Skip to main content

Reauthorize order

Order items that not yet been captured can be changed with the reauthorize endpoint. Already captured items won't be affected by the reauthorize call.

Please note

Only credit options and orders with status NotActivated or PartActivated allow for an increase in the total order amount. Currently, prepaid options do not support an increase in the order amount after the original purchase.

Reauthorize order with items​

POST /manage/orders/{{orderId}}/reauthorize HTTP/1.1
Host: api.uat.walleydev.com // (Please note! Different hostname in production)
Authorization: Bearer bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE...

{
"amount": 285.0,
"actionReference": "test-captureref-123",
"items": [
{
"id": "10001",
"description": "Shoes",
"unitPrice": 95,
"quantity": 1,
"vat": 25
},
{
"id": "10002",
"description": "T-Shirt",
"unitPrice": 95,
"quantity": 2,
"vat": 25
}
]
}

Reauthorize order with amount​

POST /manage/orders/{{orderId}}/reauthorize HTTP/1.1
Host: api.uat.walleydev.com // (Please note! Different hostname in production)
Authorization: Bearer bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE...

{
"amount": 380.0,
"actionReference": "test-captureref-123"
}

Reauthorize order with increased amount​

With the reauthorize endpoint only orders in state NotActivated can be increased.

If a credit check is needed, the endpoint will return 201 with a location header to check for the status of the reauthorize call. This can potentially involve authorization from the customer.

POST /manage/orders/{{orderId}}/reauthorize HTTP/1.1
Host: api.uat.walleydev.com // (Please note! Different hostname in production)
Authorization: Bearer bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE...

{
"amount": 380.0,
"actionReference": "test-captureref-123",
"items": [
{
"id": "10001",
"description": "Shoes",
"unitPrice": 95,
"quantity": 2,
"vat": 25
},
{
"id": "10002",
"description": "T-Shirt",
"unitPrice": 95,
"quantity": 2,
"vat": 25
}
]
}

These https status codes are valid for the POST reauthorize request.

Http status codeDescription
201Order reauthorization initialized. Requires additional status call to URL of location header. Get reauthorized status
202Order reauthorized successfully
401Unauthorized, token verification needed. See: Authentication for more information
403Permissions needed e.g. trying to handle content for a store you don't have permission to
404Order not found
422See error codes

Get reauthorized status​

Use this endpoint for polling for the status of a reauthorized call that responded with 201.

GET /manage/orders/{{orderId}}/reauthorize/{{reauthorizeId}} HTTP/1.1
Http status codeDescription
200Reauthorize found
404Order or reauthorize not found

Data Model​

Request​

Request headers​
HeaderRequiredExplanation
AuthorizationYesInstructions on how to generate the Bearer token value can be found here
Request body​
PropertyRequiredExplanationTypeNotes
amountYesThe new amount to authorize. Must match provided total summary of order items, if order items are provided.numberMaximum 2 decimals
descriptionNoA description for the reuthorization. This will be used as description if no order items is provided.stringVisible on invoices if applicable. Maximum 50 characters
actionReferenceNoA reference to this specific reauthroize.stringThis will appear as a data property on the settlement report
itemsNoThe article items and quantity to authorize.arrayReauthorize Item

If you are doing a reauthorize with items, you will have to provide items in the request.


Response​

The response will be 202 Accepted for a successful reauthorization, and 201 Created if additional status check is needed.

Please note

Due to the asynchronous nature of the 202 Accepted status answer, it can take a few seconds before the update can be shown in various systems and responses to API requests. You should design your system to accomodate this.

Response body​
PropertyExplanationType
idThe id of the reauthorizationstring
orderIdThe orderId affected by the reauthorizationstring
statusCompleted for a successfully completed reauthorize. Failed for example when a credit check was denied or additional household income data was needed.string
createdAtThe timestamp of the reauthorizationdate

Error codes​

Change order​

CodeMessage
REAUTHORIZE_ORDER_ALREADY_CAPTUREDYou cannot reauthorize an already fully captured order
REAUTHORIZE_MATCHING_ARTICLES_WITH_DIFFERENT_VATRequest inclueds identical articles with mismatched VAT
REAUTHORIZE_ARTICLE_EXISTS_BUT_OTHER_INFORMATIONRequest inclueds identical articles with mismatched unit price
REAUTHORIZE_ORDER_INCREASE_ABOVE_CURRENT_TOTAL_AMOUNT_IS_NOT_ALLOWEDTotal amount must be less than or equal to original amount
REAUTHORIZE_AMOUNT_MUST_BE_GREATER_THAN_ZEROTotal amount must be positive
REAUTHORIZE_AMOUNT_MUST_MATCH_SUM_OF_ARTICLESTotal amount must match article amount
REAUTHORIZE_AMOUNT_HAS_TOO_MANY_DECIMALSTotal amount have too many decimals
REAUTHORIZE_DESCRIPTION_TOO_LONGDescription have a max limit of 50 characters
REAUTHORIZE_ID_TOO_LONGItem Id have a max limit of 50 characters
REAUTHORIZE_UNIT_PRICE_HAS_TOO_MANY_DECIMALSItem Unit Price has too many decimals
REAUTHORIZE_QUANTITY_MUST_BE_GREATER_THAN_ZEROItem Quantity must be greater than zero
REAUTHORIZE_VAT_MUST_BE_GREATER_THAN_ZEROItem Vat must be greater than zero
REAUTHORIZE_INVALID_INVOICE_STATUSYou cannot reauthorize an order in state closed or expired
REAUTHORIZE_INCREASED_AMOUNT_NOT_AVAILABLE_FOR_PREPAID_PAYMENT_METHODIt is not possible to increase order amount on prepaid orders
Idempotency

To prevent multiple requests by mistake, the idempotency header can be used to single out requests. The API supports idempotency for safely retrying requests that only should be performed once. This could be useful if responses are not received due to network connectivity problems. For example, if a response for a request to add an invoice is not received, you can retry the request with the same idempotency key again and be guaranteed that no more than one invoice is added.

You will need to generate a guid/uuid v4 and send it in with the header x-idempotency for every unique operation:

X-Idempotency: 03304b06-cb33-4f78-bcea-86cb4b202ba0