Payments API

Search & list payments

GET

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.

Query parameters

statusenumOptional
Filter payments by their status.
payment_method_typeenumOptional
Filter payments by their payment method type.
processorstringOptional
Filter payments by their payment processor.
currency_codestringOptional

Filter payments by their payment currency. e.g. use USD for US dollars.

from_datedatetimeOptional
Return only payments from this date (inclusive).
to_datedatetimeOptional
Return only payments up to this date (inclusive).
order_idstringOptional
Return payments related to this order ID.
min_amountintegerOptional
Return payments of this amount minimum (inclusive).
max_amountintegerOptional
Return payments of this amount max (inclusive).
customer_idstringOptional
ID of the customer that has made the payment.
merchant_idstringOptional
ID of the merchant involved in the payment.
customer_email_addressstringOptional
Email of the customer that has made the payment.
last_4_digitsstringOptional
Last 4 digits of the card used for the payment.
paypal_emailstringOptional
Paypal email address associated with the payment.
klarna_emailstringOptional
Klarna email address associated with the payment.
limitintegerOptional
Maximum number of payments to return per page.
cursorstringOptional

If results are paginated, pass the nextCursor to access next page.

Response

This endpoint returns an object
data
list of objectsOptional
nextCursor
stringOptional
prevCursor
stringOptional

Errors

GET
$curl -G https://api.sandbox.primer.io/payments \
> -H "X-API-KEY: <apiKey>" \
> -d status=PENDING \
> -d payment_method_type=PAYMENT_CARD
Response
1{
2 "data": [
3 {
4 "id": "string",
5 "date": "2024-01-15T09:30:00Z",
6 "dateUpdated": "2024-01-15T09:30:00Z",
7 "status": "PENDING",
8 "orderId": "string",
9 "currencyCode": "string",
10 "amount": 1,
11 "processor": {
12 "name": "string"
13 }
14 }
15 ]
16}