API reference
Retrieve an authorization
How to fetch a specific authorization via API
To fetch a single authorization, send a GET request to the /api/authorizations/:id endpoint, where id is the ID of the resource that you want to retrieve.

Request

GET https://yourdomain.commercelayer.io/api/authorizations/:id

Example

Request
Response
The following request fetches the authorization identified by the id "xYZkjABcde":
1
curl -g -X GET \
2
'https://yourdomain.commercelayer.io/api/authorizations/xYZkjABcde' \
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 single resource object:
1
{
2
"data": {
3
"id": "xYZkjABcde",
4
"type": "authorizations",
5
"links": {
6
"self": "https://yourdomain.commercelayer.io/api/authorizations/xYZkjABcde"
7
},
8
"attributes": {
9
"number": "42/T/001",
10
"currency_code": "EUR",
11
"amount_cents": 1500,
12
"amount_float": 15.0,
13
"formatted_amount": "€15,00",
14
"succeeded": false,
15
"message": "Accepted",
16
"error_code": "00001",
17
"error_detail": "Already settled",
18
"token": "xxxx-yyyy-zzzz",
19
"gateway_transaction_id": "xxxx-yyyy-zzzz",
20
"created_at": "2018-01-01T12:00:00.000Z",
21
"updated_at": "2018-01-01T12:00:00.000Z",
22
"reference": "ANY-EXTERNAL-REFEFERNCE",
23
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
24
"metadata": {
25
"foo": "bar"
26
},
27
"cvv_code": "000",
28
"cvv_message": "validated",
29
"avs_code": "000",
30
"avs_message": "validated",
31
"fraud_review": "passed",
32
"capture_amount_cents": 500,
33
"capture_amount_float": 5.0,
34
"formatted_capture_amount": "€5,00",
35
"capture_balance_cents": 1000,
36
"capture_balance_float": 10.0,
37
"formatted_capture_balance": "€10,00",
38
"void_balance_cents": 1500,
39
"void_balance_float": 15.0,
40
"formatted_void_balance": "€15,00"
41
},
42
"relationships": {
43
"order": {
44
"links": {
45
"self": "https://yourdomain.commercelayer.io/api/authorizations/xYZkjABcde/relationships/order",
46
"related": "https://yourdomain.commercelayer.io/api/authorizations/xYZkjABcde/order"
47
}
48
},
49
"captures": {
50
"links": {
51
"self": "https://yourdomain.commercelayer.io/api/authorizations/xYZkjABcde/relationships/captures",
52
"related": "https://yourdomain.commercelayer.io/api/authorizations/xYZkjABcde/captures"
53
}
54
},
55
"voids": {
56
"links": {
57
"self": "https://yourdomain.commercelayer.io/api/authorizations/xYZkjABcde/relationships/voids",
58
"related": "https://yourdomain.commercelayer.io/api/authorizations/xYZkjABcde/voids"
59
}
60
}
61
},
62
"meta": {
63
"mode": "test"
64
}
65
}
66
}
Copied!
Copy link