curl --request GET \
--url https://api.sandbox.primer.io/payments \
--header 'X-API-KEY: <api-key>' \
--header 'X-API-VERSION: <x-api-version>'import requests
url = "https://api.sandbox.primer.io/payments"
headers = {
"X-API-VERSION": "<x-api-version>",
"X-API-KEY": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-API-VERSION': '<x-api-version>', 'X-API-KEY': '<api-key>'}
};
fetch('https://api.sandbox.primer.io/payments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.primer.io/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>",
"X-API-VERSION: <x-api-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.primer.io/payments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-VERSION", "<x-api-version>")
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.primer.io/payments")
.header("X-API-VERSION", "<x-api-version>")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.primer.io/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-VERSION"] = '<x-api-version>'
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "IHQlakKC",
"date": "2021-03-24T14:56:56.869248",
"status": "SETTLED",
"orderId": "my-order-123",
"currencyCode": "EUR",
"amount": 700,
"processor": {
"name": "STRIPE",
"processorMerchantId": "acct_stripe_1234"
},
"metadata": {
"productId": 123,
"merchantId": "a13bsd62s"
}
}
],
"nextCursor": "<string>",
"prevCursor": "<string>"
}{
"error": {
"errorId": "RequestValidationError",
"description": "Invalid type for `currencyCode`",
"recoverySuggestion": "The currency code must be a valid value",
"diagnosticsId": "1234567898"
}
}Search & list payments
Retrieve a list of your payments.
Results are paginated, they will only return up to 100 payments maximum.
To access the next page of result, set the cursor query parameter to the value of nextCursor in
your current result payload. Use prevCursor to go back to the previous page.
Note: this endpoint returns a list of
summarized payments. Not all payments attributes are present. You can use
the query parameters to filter payments. You can separate multiple query parameters with the & symbol.
Query parameters with types of the form “Array of strings” (such as the status parameter) can be specified as a comma-separated list.
For example, if you wanted to get both FAILED and CANCELLED payments, for customer john-123, you would use:
curl --location --request GET 'https://api.primer.io/payments?status=FAILED,CANCELLED&customer_id=john-123' \
--header 'X-Api-Key: <YOUR_API_KEY>'
You can alternatively specify a list by repeating the parameter multiple times.
Query parameters are also accepted in camelCase (for example customerId, fromDate). If both spellings are supplied, the camelCase value is used.
Note: payments will be available within a minute from being created.
curl --request GET \
--url https://api.sandbox.primer.io/payments \
--header 'X-API-KEY: <api-key>' \
--header 'X-API-VERSION: <x-api-version>'import requests
url = "https://api.sandbox.primer.io/payments"
headers = {
"X-API-VERSION": "<x-api-version>",
"X-API-KEY": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-API-VERSION': '<x-api-version>', 'X-API-KEY': '<api-key>'}
};
fetch('https://api.sandbox.primer.io/payments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.primer.io/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>",
"X-API-VERSION: <x-api-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.primer.io/payments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-VERSION", "<x-api-version>")
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.primer.io/payments")
.header("X-API-VERSION", "<x-api-version>")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.primer.io/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-VERSION"] = '<x-api-version>'
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "IHQlakKC",
"date": "2021-03-24T14:56:56.869248",
"status": "SETTLED",
"orderId": "my-order-123",
"currencyCode": "EUR",
"amount": 700,
"processor": {
"name": "STRIPE",
"processorMerchantId": "acct_stripe_1234"
},
"metadata": {
"productId": 123,
"merchantId": "a13bsd62s"
}
}
],
"nextCursor": "<string>",
"prevCursor": "<string>"
}{
"error": {
"errorId": "RequestValidationError",
"description": "Invalid type for `currencyCode`",
"recoverySuggestion": "The currency code must be a valid value",
"diagnosticsId": "1234567898"
}
}Authorizations
Headers
Specifies the version of the API to use. This must be set to 2.4.
"2.4"
Query Parameters
Filter payments by their status.
An enumeration.
PENDING, FAILED, AUTHORIZED, SETTLING, PARTIALLY_SETTLED, SETTLED, DECLINED, CANCELLED Filter payments by their payment instrument type.
The type of payment instrument used to make a payment.
PAYMENT_CARD, PAYPAL_ORDER, PAYPAL_BILLING_AGREEMENT, APPLE_PAY, APPLE_PAY_ENCRYPTED_TOKEN, GOOGLE_PAY, KLARNA_AUTHORIZATION_TOKEN, KLARNA_CUSTOMER_TOKEN, PAY_NL_IDEAL, APAYA, OFF_SESSION_PAYMENT, CARD_OFF_SESSION_PAYMENT, AUTOMATED_CLEARING_HOUSE Filter payments by their payment processor.
Filter payments by their payment currency.
e.g. use USD for US dollars.
Filter payments by their payment currency.
Use the 3-letter currency code in ISO 4217 format.
e.g. use USD for US dollars."
Return only payments from this date (inclusive).
Return only payments up to this date (inclusive).
Return payments related to this order ID.
Return payments of this amount minimum (inclusive).
Return payments of this amount max (inclusive).
ID of the customer that has made the payment.
ID of the merchant involved in the payment.
Email of the customer that has made the payment.
Last 4 digits of the card used for the payment.
Paypal email address associated with the payment.
Klarna email address associated with the payment.
Maximum number of payments to return per page.
1 <= x <= 100If results are paginated, pass the nextCursor to access next page.
Filter payments by their authorization type. Type of authorization for the payment.
ESTIMATED, FINAL