/void
Void all or part of a pending order before FlexFactor captures it.
Use /void to release all or part of an order before it is captured. A void never moves funds: it stops or reduces an order that is still pending, rather than reversing a settled charge. To return money after capture, use /refund instead.
You can void the same orders that /cancel accepts:
- MIT orders in
draft,onhold,processing, orcapturerequiredstatus — any status that is notcompletedorcancelled - CIT orders in
capturerequiredoronholdstatus
Prerequisites to invoke this API:
- Authenticate and send the bearer token for this call.
- Partial voids must be enabled for your account. Contact your FlexFactor Solutions engineer before you send a void below the order amount.
IdempotencySend an
idempotencyKey(a GUID, in the JSON body) on every partial void and reuse it on retries. Several partial voids against one order are legitimate, so the order ID alone cannot tell a retry apart from an intentional second void. Within the 24-hour replay window, a retry with the same key returns the original response instead of voiding a second time, and a reused key carrying a different payload is rejected as a409conflict. See the Idempotency reference (§3.4) for the full behavior.
Request
Details
| HTTP Method | POST |
| Endpoint - Sandbox | https://api-sandbox.flexfactor.io/v1/orders/{id}/void |
| Endpoint - Production | https://api.flexfactor.io/v1/orders/{id}/void |
{id} | FlexFactor unique transaction identifier.\ This is the FlexFactor orderId returned by /evaluate, GET /v1/orders/{id}, a webhook, or the SFTP batch. |
| Authentication | Bearer Token |
Body
amount | Integer | Optional | Amount to void, in cents, for example 4000 for $40.00. Send the full order amount for a full void, or a lower amount for a partial void. The behavior of a request without amount is not documented; send amount on every request. |
idempotencyKey | Guid | Optional — recommended for partial voids | Send a GUID and reuse it on retries to prevent a duplicate partial void. It replays the original response within the 24h window and detects reused-key conflicts. See Idempotency. |
mid | Guid | Optional | Your FlexFactor merchant ID (MID). |
transactionId | Guid | Optional | FlexFactor identifier of the transaction to void. |
Full and partial voids
Full and partial voids use the same request. amount is the amount to remove from the order, in cents; it is not the new order total.
- There is no
currencyfield. The void is applied in the currency of the original order. - Full void. An
amountequal to the order amount cancels the whole order. The order moves tocancelled, and theorder.cancelledwebhook fires when the status changed and you subscribe to the event. - Partial void. An
amountlower than the order amount reduces the order and keeps the remainder open. The order stays in its pre-capture state, andorder.cancelleddoes not fire.GET /v1/orders/{id}returns the reduced amount inamountandformattedAmount, in dollars. When you capture the order later, send the remaining amount to /capture. - You can issue several partial voids against one order. Each void is applied to the amount that remains after the previous one, so two 2000-cent voids take a 10000-cent order to 8000 cents and then to 6000 cents.
For example, if you void 4000 cents from a 9900-cent order, the order amount becomes $59.00 and nothing is captured. When you capture the order, send amount 5900 to /capture.
Try it right now:
- Check out the /void Reference.
Response
The void response uses the common FlexFactor envelope. Read success to decide whether the void succeeded, then confirm the order with GET /v1/orders/{id} before you update your own records. The envelope is defined in Workflows §3.5.
success | boolean | true when errors is empty, that is, when the void succeeded. Key your void logic on this field. |
status | string | Not meaningful on this endpoint; null in current responses. Read success. |
result | string | Do not use it. |
responseCode | string | Processor response code when the void failed. null on success. Optional |
responseMessage | string | Processor response message when the void failed. null on success. Optional |
statusCode | string | It is not the HTTP status code. Do not use it. |
errors | array of objects | Error details for a failed void; empty on success. Each item is serialized positionally: item1 message, item2 key, item3 error code, item4 friendly flag (boolean). |
customProperties | object | Additional custom properties for the API request Optional |
HTTP status codes
| Situation | HTTP | Body |
|---|---|---|
| The request was processed | 200 | Void envelope. success: true when the void succeeded; success: false with errors, and responseCode and responseMessage when the processor returned a failure |
| Invalid or expired bearer token | 401 | — |
No order matches {id}, or it belongs to another merchant | 404 | Problem details |
Same idempotencyKey reused with a different body, or the first request is still running | 409 | Problem details — see Idempotency §3.4 |
| The void failed, or an internal error occurred | 500 | Envelope with success: false and responseMessage |
Confirm the order after every voidCheck
successon every200; do not treat the HTTP code alone as the outcome. After a full void,GET /v1/orders/{id}returnsstatuscancelled. After a partial void, it returns the reducedamountand the order status is unchanged.
Updating the status orderAfter receiving a successful response from /void, you need to update this order in your CRM with the corresponding status and amount.
Payload examples
Request
curl --request POST \
--url https://api-sandbox.flexfactor.io/v1/orders/{id}/void \ //insert the orderId 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 '
{
"amount": 9900, //in cents — equal to the order amount
"idempotencyKey": "{generate_a_GUID_and_reuse_it_on_retries}"
}curl --request POST \
--url https://api-sandbox.flexfactor.io/v1/orders/{id}/void \ //insert the orderId 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 '
{
"amount": 4000, //in cents — lower than the order amount
"idempotencyKey": "{generate_a_GUID_and_reuse_it_on_retries}"
}Response
{
"success": true,
"status": null,
"result": null,
"responseCode": null,
"responseMessage": null,
"statusCode": null,
"errors": [],
"customProperties": {}
}{
"success": false,
"status": null,
"result": null,
"responseCode": "{processor response code}",
"responseMessage": "{processor response message}",
"statusCode": null,
"errors": [
{ "item1": "{failure reason}", "item2": "{error key}", "item3": "{error code}", "item4": true }
],
"customProperties": {}
}Void by external order ID
external-void identifies the order by your own external order ID (the orderId you sent to /evaluate) instead of the FlexFactor order ID returned in the response. It works exactly like /void: the same eligible orders, the same body, the same full and partial void behavior, and the same response. Use it when you do not store the FlexFactor order ID, or when you never received it, for example because the /evaluate response timed out.
Request
Details
| HTTP Method | POST |
| Endpoint - Sandbox | https://api-sandbox.flexfactor.io/v1/orders/{external-order-id}/external-void |
| Endpoint - Production | https://api.flexfactor.io/v1/orders/{external-order-id}/external-void |
| {external-order-id} | Your own external order ID — the orderId you sent in the original /evaluate request. |
| Authentication | Bearer Token |
Body
Same as /void — see Body above. Send an idempotencyKey on every partial void and reuse it on retries.
Response
Same as /void, including the HTTP status codes — see Response above. A 404 means no order matches the external order ID for your account.
Payload examples
Request
curl --request POST \
--url https://api-sandbox.flexfactor.io/v1/orders/{external-order-id}/external-void \ //insert the orderId you sent to /evaluate
--header 'Authorization: Bearer abc123def456' \ //replace with bearer returned by /oauth2
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"amount": 4000, //in cents — lower than the order amount
"idempotencyKey": "{generate_a_GUID_and_reuse_it_on_retries}"
}Try it right now:
- Check out the /external-void Reference.
Updated about 3 hours ago

