Cancel a payout order if is possible
Cancels a payout order that is still created, waiting_validation, waiting_approval or scheduled. On success the payout order transitions to cancelled and the resulting state is returned.
Those four are the only states the transition is allowed from. An order that is already approved, pending_funds, enqueued or executing cannot be cancelled even though it has not finished, and neither can one in a terminal state. In every one of those cases the request fails with 422 and the payout order is left untouched.
Path Parameters
- Type: stringpayout
_order _id requiredThe id of the shinkansen payout order id of the payout order (returned when this was created).
Responses
- application/json
- application/json
- application/json
Request Example for patch/payout_orders/{payout_order_id} /state/cancel
curl 'https://api.treasury.shinkansen.finance/v1/payout_orders/{payout_order_id}/state/cancel' \
--request PATCH \
--header 'Shinkansen-Treasury-Api-Key: YOUR_SECRET_TOKEN'
{
"shinkansen_payout_order_state": "cancelled"
}