Search…
API Reference
Resources
List all external payments
How to fetch a collection of external payments via API
To fetch a collection of external payments, send a GET request to the /api/external_payments endpoint.

Request

GET https://yourdomain.commercelayer.io/api/external_payments

Example

Request
Response
The following request fetches a collection of external payments:
1
curl -g -X GET \
2
'https://yourdomain.commercelayer.io/api/external_payments/' \
3
-H 'Accept: application/vnd.api+json' \
4
-H 'Authorization: Bearer your-access-token'
Copied!
On success, the API responds with a 200 OK status code, returning a paginated collection of resource objects:
1
{
2
"data": [
3
{
4
"id": "xYZkjABcde",
5
"type": "external_payments",
6
"links": {
7
"self": "https://yourdomain.commercelayer.io/api/external_payments/xYZkjABcde"
8
},
9
"attributes": {
10
"payment_source_token": "xxxx.yyyy.zzzz",
11
"options": {
12
"foo": "bar"
13
},
14
"created_at": "2018-01-01T12:00:00.000Z",
15
"updated_at": "2018-01-01T12:00:00.000Z",
16
"reference": "ANY-EXTERNAL-REFEFERNCE",
17
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
18
"metadata": {
19
"foo": "bar"
20
}
21
},
22
"relationships": {
23
"order": {
24
"links": {
25
"self": "https://yourdomain.commercelayer.io/api/external_payments/xYZkjABcde/relationships/order",
26
"related": "https://yourdomain.commercelayer.io/api/external_payments/xYZkjABcde/order"
27
}
28
},
29
"payment_gateway": {
30
"links": {
31
"self": "https://yourdomain.commercelayer.io/api/external_payments/xYZkjABcde/relationships/payment_gateway",
32
"related": "https://yourdomain.commercelayer.io/api/external_payments/xYZkjABcde/payment_gateway"
33
}
34
}
35
},
36
"meta": {
37
"mode": "test"
38
}
39
},
40
{
41
"other": "... 9 external_payments (first page)"
42
}
43
],
44
"meta": {
45
"record_count": 140,
46
"page_count": 14
47
},
48
"links": {
49
"first": "https://yourdomain.commercelayer.io/api/external_payments?page[number]=1&page[size]=10",
50
"next": "https://yourdomain.commercelayer.io/api/external_payments?page[number]=2&page[size]=10",
51
"last": "https://yourdomain.commercelayer.io/api/external_payments?page[number]=14&page[size]=10"
52
}
53
}
Copied!

Sortable attributes

The list of external payments can be sorted by the following attributes:
  • id
  • created_at
  • updated_at
  • reference
  • reference_origin
Last modified 2mo ago