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

Request

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

Example

Request
Response
The following request fetches a collection of external gateways:
1
curl -g -X GET \
2
'https://yourdomain.commercelayer.io/api/external_gateways/' \
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_gateways",
6
"links": {
7
"self": "https://yourdomain.commercelayer.io/api/external_gateways/xYZkjABcde"
8
},
9
"attributes": {
10
"name": "US payment gateway",
11
"created_at": "2018-01-01T12:00:00.000Z",
12
"updated_at": "2018-01-01T12:00:00.000Z",
13
"reference": "ANY-EXTERNAL-REFEFERNCE",
14
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
15
"metadata": {
16
"foo": "bar"
17
},
18
"shared_secret": "xxxx-yyyy-zzzz",
19
"authorize_url": "https://external_gateway.com/authorize",
20
"capture_url": "https://external_gateway.com/capture",
21
"void_url": "https://external_gateway.com/void",
22
"refund_url": "https://external_gateway.com/refund"
23
},
24
"relationships": {
25
"payment_methods": {
26
"links": {
27
"self": "https://yourdomain.commercelayer.io/api/external_gateways/xYZkjABcde/relationships/payment_methods",
28
"related": "https://yourdomain.commercelayer.io/api/external_gateways/xYZkjABcde/payment_methods"
29
}
30
},
31
"external_payments": {
32
"links": {
33
"self": "https://yourdomain.commercelayer.io/api/external_gateways/xYZkjABcde/relationships/external_payments",
34
"related": "https://yourdomain.commercelayer.io/api/external_gateways/xYZkjABcde/external_payments"
35
}
36
}
37
},
38
"meta": {
39
"mode": "test"
40
}
41
},
42
{
43
"other": "... 9 external_gateways (first page)"
44
}
45
],
46
"meta": {
47
"record_count": 140,
48
"page_count": 14
49
},
50
"links": {
51
"first": "https://yourdomain.commercelayer.io/api/external_gateways?page[number]=1&page[size]=10",
52
"next": "https://yourdomain.commercelayer.io/api/external_gateways?page[number]=2&page[size]=10",
53
"last": "https://yourdomain.commercelayer.io/api/external_gateways?page[number]=14&page[size]=10"
54
}
55
}
Copied!

Sortable attributes

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