Error based Reversals
In the event that an error or communications failure has occurred and you have not received a receipt for your order, Wpay provides an option of invoking an API that will allow you to reverse an order. This API applies to both digital card orders and physical card activation requests.
However, a reversal must be requested within 24 hours of the original order. A reversal will fail if this time limit has been exceeded or if one or more gift cards in the original order/activation request have already been accessed and used in a transaction.
Note
Talk to your Account Manager if you are interested in implementing this feature
Step 1 : Order results in error
When ordering digital gift cards or activating physical cards, the API response typically provides acknowledgement that your gift cards have been provisioned and activated. This however will not be the case if an error has occurred while processing your order or activation request.
In the above sequence, an order has been placed but a communications failure prevented the receipt of the order confirmation. For a real-time digital order, the order response contains gift card details and the lack of a proper order response prevents this information from reaching you.
If your order has been processed successfully, you may use the Get Order Status API to retrieve the order status and the Get Activated Cards to retrieve the card details
However, in some situations, you may instead wish to simply reverse the order and submit a new order.
Step 2 : Perform a reversal
The reversal API can help in the recovery of error scenarios when submitting digital orders or activating physical gift cards
To perform a reversal, submit the order's reference number to the Order Reversal API.
curl --location --request POST 'https://pt-api.wpay.com.au/v1/partner/giftcards/orders/reverse' \
--header 'X-Api-Key: ******' \
--header 'Content-Type: application/json' \
--data-raw '{
"refno": "aaaa-bbbb-0000-0006"
}'
Where:
refno
is the unique order reference number you generated and submitted in the original order request.
A successful response will have the HTTP status code of 202
and confirmation that the reversal has been accepted.
{
"code": 0,
"message": "Successfully accepted the order for reversal",
"messages": [],
"order": {
"status": "PROCESSING",
"orderId": "AAN9200073512",
"refno": "aaaa-bbbb-0000-0006"
}
}
Where:
code
will show 0 for successmessage
provides information about the reversal statusorder.status
contains the current order status
Refer to the Reverse an Order API specification for descriptions of all fields in the request and response.
Reversal errors
The system may also return an HTTP status code of 400
if one of the following error conditions are encountered:
- The order or activation request was not received by our infrastructure
- The order or activation request resulted in an error due to business rule violation or other error condition
- The reversal time limit has been exceeded
- Any activity has occurred on the gift cards activated by the original order
- A reversal has already been requested for this order
For example:
{
"httpStatusCode": 400,
"code": 10467,
"message": "Reverse allowed within 24 Hours",
"messages": []
}
Where:
code
is the error codemessage
will include information about the error
Refer to the Reverse an Order API specification for descriptions of all fields in the request and response.
Updated 9 months ago