Authorization
Whenever you want to charge the customer using a customer token you need to create an authorization which can be auto captured, or captured at a later stage.
Creating an authorization​
The customer token created previously can be used to charge the customer at any time. The customer is charged by creating an authorization using the customer token.
- Request
- Response
- Error
POST /purchase/authorizations HTTP/1.1
Host: api.uat.walleydev.com // (Please note! Different hostname in production)
Authorization: Bearer bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE...
Content-Type: application/json
{
"customerToken": "f590b7c4-0d2e-4d99-a3c7-5c1a39f45dce",
"order": {
"items":[
{
"id": "id-001",
"description": "Description 002",
"unitPrice": "10",
"quantity": "1",
"vat": "25"
},
{
"id": "id-002",
"description": "Description 002",
"unitPrice": "2",
"quantity": "10",
"vat": "12"
}
],
"currency": "EUR",
"reference": "01478520",
"actionReference": "reference 1234",
"captureMode": "Auto"
},
"attemptSchedule": {
"relative": ["00:00:10", "00:00:10", "00:00:10", "00:00:10", "1.00:00:10"],
"absolute": ["2023-12-24T14:00:00", "2023-12-11T18:30:00"]
}
}
HttpStatusCode: 202 Accepted
{
"id": "17635160-e66f-46b9-84fc-db939005050c",
"data": {
"authorizationId": "f874e54d-2d58-4d31-a769-857dc3972979"
}
}
/*
Example error. More errors available below.
*/
HttpStatusCode: 404 Not Found
{
"id": "fe8a21bb-6cb5-4d7d-b7f6-c0c335fc4593",
"error": {
"code": 404,
"message": "The resource requested was not found.",
"errors": []
}
}