curl --request GET \
--url https://api.sandbox.primer.io/payments \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.sandbox.primer.io/payments"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'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>"
],
]);
$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-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-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-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.
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>'import requests
url = "https://api.sandbox.primer.io/payments"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'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>"
],
]);
$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-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-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-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"
}
}Query Parameters
Filter payments by their payment method type.
Payment method type, where OFF_SESSION_PAYMENT is used for APM (Alternative Payment Method) payments and PAYMENT_CARD for traditional debit or credit cards. Please note that this list is different from one indicated on available payment methods page and values of this field will be changed in the future versions of the API.
PAYMENT_CARD, PAYPAL_ORDER, PAYPAL_BILLING_AGREEMENT, KLARNA_AUTHORIZATION_TOKEN, KLARNA_CUSTOMER_TOKEN, PAY_NL_IDEAL, APAYA, OFF_SESSION_PAYMENT, CARD_OFF_SESSION_PAYMENT, APPLE_PAY, APPLE_PAY_ENCRYPTED_TOKEN, GOOGLE_PAY, AUTOMATED_CLEARING_HOUSE Filter payments by their payment currency.
Use the three-letter currency code in ISO 4217 format.
e.g. use USD for US dollars.
Filter payments by their payment currency.
Use the three-letter currency code in ISO 4217 format.
e.g. use USD for US dollars."