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

Request

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

Example

Request
Response
The following request fetches the void identified by the id "xYZkjABcde":
1
curl -g -X GET \
2
'https://yourdomain.commercelayer.io/api/voids/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": "voids",
5
"links": {
6
"self": "https://yourdomain.commercelayer.io/api/voids/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
},
28
"relationships": {
29
"order": {
30
"links": {
31
"self": "https://yourdomain.commercelayer.io/api/voids/xYZkjABcde/relationships/order",
32
"related": "https://yourdomain.commercelayer.io/api/voids/xYZkjABcde/order"
33
}
34
},
35
"reference_authorization": {
36
"links": {
37
"self": "https://yourdomain.commercelayer.io/api/voids/xYZkjABcde/relationships/reference_authorization",
38
"related": "https://yourdomain.commercelayer.io/api/voids/xYZkjABcde/reference_authorization"
39
}
40
}
41
},
42
"meta": {
43
"mode": "test"
44
}
45
}
46
}
Copied!
Last modified 2mo ago
Copy link