Payments API

Search & list payments

Changed on

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: ```bash curl --location --request GET 'https://api.primer.io/payments?status=FAILED,CANCELLED&customer\_id=john-123' \ --header 'X-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.

get/payments

Request

  • Base URL
    https://api.sandbox.primer.io
  • URL
    https://api.sandbox.primer.io/payments
  • Auth
    API key in header X-API-KEY

Query parameters

statusPaymentStatus[]

Filter payments by their status.

payment_instrument_typePaymentInstrumentTypeEnum[]

Filter payments by their payment instrument type.

processorstring[]

Filter payments by their payment processor.

currency_codestring[]

Filter payments by their payment currency.

Use the 3-letter currency code in ISO 4217 format. e.g. use USD for US dollars."

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

from_datestring date-time

Return only payments from this date (inclusive).

to_datestring date-time

Return only payments up to this date (inclusive).

order_idstring

Return payments related to this order ID.

min_amountinteger

Return payments of this amount minimum (inclusive).

max_amountinteger

Return payments of this amount max (inclusive).

customer_idstring[]

ID of the customer that has made the payment.

merchant_idstring[]

ID of the merchant involved in the payment.

customer_email_addressstring[]

Email of the customer that has made the payment.

last_4_digitsstring[]

Last 4 digits of the card used for the payment.

paypal_emailstring[]

Paypal email address associated with the payment.

klarna_emailstring[]

Klarna email address associated with the payment.

limitinteger

Maximum number of payments to return per page.

cursorstring

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

authorization_type'ESTIMATED' | 'FINAL'

Type of authorization for the payment.

Filter payments by their authorization type.

Headers

X-API-VERSIONstring required
Example:2.4

Specifies the version of the API to use. This must be set to 2.4.

Response

Successful Response

nextCursorstring
prevCursorstring

Example response

{
  "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"
      }
    }
  ]
}

Changes

    • breaking

      the response property // became optional for the status

    • warning

      deleted the query request parameter payment_method_type

    • info

      added the new optional query request parameter authorization_type

    • info

      added the new optional query request parameter payment_instrument_type