/refund
Prerequisites to invoke this API:
- Authenticate and send the bearer token for this call.
Idempotency
/refunddoes not require anidempotencyKey. Server-side idempotency is enforced via the order ID — repeated refund calls for the same order will not double-refund.
Request
Details
| HTTP Method | POST |
| Endpoint - Sandbox | https://api-sandbox.flexfactor.io/v1/orders/{id}/refund |
| Endpoint - Production | https://api.flexfactor.io/v1/orders/{id}/refund |
{id} | FlexFactor unique transaction identifier.\ This is the orderSessionKey returned by /evaluate and/or /outcome and/or webhook and/or batch response file. |
Body
amountToRefund | Decimal | Required | In dollars E.g.: '19.99' |
refundMessage | String | Optional | Additional message you want to send with the request. E.g.: "Customer request" |
Try it right now:
- Check out the /refund Reference.
- Check out our Postman Collection
Response
status | string | success / fail |
success | boolean | Indicates if the API request was successful |
result | string | The result of the API request Optional |
statusCode | string | The status code of the API request Optional |
errors | array of string | Any errors encountered during the API request Optional |
customProperties | object | Additional custom properties for the API request Optional |
Updating the status orderAfter receiving a successful response from /refund, you need to update this order in your CRM with the corresponding status.
Payload examples
Request
curl --request POST \
--url https://api-sandbox.flexfactor.io/v1/orders/{id}/refund //insert orderSessionKey returned by the response to /evaluate
--header 'Authorization: Bearer abc123def456' \ //replace with bearer returned by /oauth2
--header 'accept: application/json' \
--header 'content-type: application/*+json' \
--data '
{
"amountToRefund": 12.00, //in dollars
}Response
{
"status": "SUCCESS | FAILED",
"success": true,
"result": null,
"statusCode": null,
"errors": [],
"customProperties": {}
}