After completing integration you should test that you correctly handle our refund recommendation responses.
To help with this we support special email addresses which will return a specific refund recommendation response.
These special email addresses only work when using the API key for your sandbox account.
The special email addresses which will force specific refund recommendation responses are shown below:
Customer Email | Action Response |
---|---|
qa-force-refund-allow@ravelin.com |
ALLOW |
qa-force-refund-prevent@ravelin.com |
PREVENT |
qa-force-refund-manualreview@ravelin.com |
MANUAL_REVIEW |
qa-force-refund-review@ravelin.com |
REVIEW |
These email addresses should be used in the customer.email
field.
An example request which will force an ALLOW
action to be returned is shown below:
POST https://api.ravelin.com/v2/refund?score=refundRequest HTTP/1.1
Authorization: token ...
Content-Type: application/json
{
"timestamp": 1512828988826,
"customer": {
"customerId": "abc-123-ZYZ",
"email": "qa-force-refund-allow@ravelin.com"
},
"order": {
"orderId": "abcde12345-ZXY"
},
"refund": {
"refundId": "abc-123-GDFS",
"refundRequestTime": 1636629706000,
"status": "OPEN",
"initiatedBy": "CUSTOMER",
"type": "REFUND",
"claim": "FULL",
"policy": "TERMS_AND_CONDITIONS",
"amount": 1000,
"currency": "GBP",
"nonRefundableAmount": 250,
"refundIssuedTo": [
"ORIGINAL_PAYMENT_METHOD",
"GIFT_CARD"
],
"items": [
{
"name": "Midi Dress",
"quantity": 1,
"price": 1000,
"currency": "GBP",
"sku": "1234AAB",
"category": "Clothing",
"subcategory": "Dresses",
"brand": "Trendy Threads",
"refundReason": "ITEM_NOT_RECEIVED"
}
]
},
"device": {
"deviceId": "df020f51-5ebb-4901-82cf-96299225754b"
}
}
An example testing response containing ALLOW
in the data.action
field is shown below:
{
"status": 200,
"timestamp": 1637933719,
"data": {
"customerId": "abc-123-ZYZ",
"action": "ALLOW",
"source": "RULE"
}
}
Was this page helpful?