List Payments

This endpoint retrieves a collection of payments along with their order details.

Successful Response (200)

Returns the matching Payment objects, enclosed in a Pagination object.

Connection Timeouts

TimeoutTime (Seconds)
Open10
Read20

Errors

In addition to the GET Errors applicable to all GET endpoints, the following errors are specific to List Payments:

HTTP Status CodeerrorCodeDescription
422 <br />Unprocessable EntityerrorAn invalid query param was provided.<br /><br />For example, a value for limit was provided, but was less than 1 or more than 250.
500 <br />Internal Server ErrorerrorThis is usually caused by sending a fromCreatedDate or toCreatedDate in an invalid format. Please ensure the dash and colon characters are included, and any plus characters are URL-encoded. See Example Request 1.<br /><br />Also, for the array parameters (ids, tokens, merchantReferences and statuses), do not use comma-separated values or square brackets. Instead, include each parameter multiple times, as needed. See Example Request 2.

Example Request 1

The following example searches for all Clearpay Orders placed within two timestamps, using a local timezone. Note that the plus character must be URL-encoded.

<Warning title="Warning">

The request that is automatically generated by Readme appears as though it URL-encodes the Query Params. However, the request that is actually delivered to Clearpay when clicking the "Try It" button does not include any URL-encoding.

Please specifically replace "+" characters with "%2b" when testing a fromCreatedDate or toCreatedDate with a timezone ahead of UTC. </Warning>

curl https://global-api.afterpay.com/v2/payments?fromCreatedDate=2019-01-01T09:00:00.000%2b01:00&toCreatedDate=2019-01-01T17:00:00.000%2b01:00 \
  -H 'Authorization: Basic <Base64EncodedCredentials>' \
  -H 'User-Agent: <MyUserAgent>' \
  -H 'Accept: application/json'

Example Request 2

The following example searches for all Clearpay Orders matching a list of tokens. Note that the tokens parameter is included several times, once for each token.

curl https://api.eu-sandbox.afterpay.com/v2/payments?tokens=abcdefgh&tokens=ijklmnop \
  -H 'Authorization: Basic <Base64EncodedCredentials>' \
  -H 'User-Agent: <MyUserAgent>' \
  -H 'Accept: application/json'
get/v2/payments

Request

  • Base URL: https://global-api-sandbox.afterpay.com
  • URL: https://global-api-sandbox.afterpay.com/v2/payments
  • Auth: HTTP basic

Query parameters

toCreatedDatestring

An inclusive end date and time to search, in ISO 8601 format.

fromCreatedDatestring

An inclusive start date and time to search, in ISO 8601 format.

limitinteger

The number of results to retrieve from a query. Must be between 1 and 250 (inclusive).

offsetinteger

The position on the page to start the results. The first result has a position of 0.

includeNextLinkboolean

Will return a modified pagination object which includes a url to return the next page. The default value is false

tokensstring[]

One or more order tokens to search for.

idsstring[]

One or more Clearpay Order IDs to search for.

merchantReferencesstring[]

One or more Merchant Reference IDs to search for.

statusesstring[]

One or more Clearpay Order Statuses to search for. Possible values include "APPROVED" and "DECLINED".

orderBystring

A field to order results by. If provided, must be one of "createdAt", "id", "totalAmount", "merchantReference" or "email".

ascendingboolean

true to order results in ascending order, or false for descending order.

Headers

User-Agentstring required
Acceptstring

Response

Successful response

Changes

No recorded changes to this operation across all 1 revision of this API.