Cash flow
Simulate a clearing
POST
/charges/{transaction_id}/simulate/clearSimulates the clearing of a charge. Only available in the sandbox. Clearing runs asynchronously. The 204 means clearing was accepted, and the charge's cashflow_transaction appears a few seconds later, with a cashflow_transaction.created event. The simulator books a 0.30 gateway fee in the settlement currency, a 0.1% acquiring fee on approved charges, and random network and interchange fees of up to 5% of the amount each.
Headers
AuthorizationstringRequiredHTTP Basic auth: your API key as the password, with an empty username. See Authentication.
idempotency-keystringA unique key, such as a UUID, that makes a POST or DELETE request safe to retry. Pay.com keeps each key for 24 hours, separately for each workspace.
- A retry with the same key, endpoint and body gets the first request's stored status and body, without running the request again.
- If the first request is still being processed, a retry gets 409
idempotency_error(request_in_progress). - The same key on another endpoint, or with another body, gets 400
idempotency_error(invalid_parameters). - GET, PUT and PATCH requests ignore the key.
The response repeats the key in its Idempotency-Key header.
Path parameters
transaction_idstringRequiredTransaction ID that matches the "^chrg_\d{18,20}$" pattern.
Returns
Clearing accepted; it completes asynchronously.
Errors
400Invalid request parameters, or the charge has already been cleared.
401The API key or access token is missing, unknown or no longer works (
invalid_key, invalid_token, legacy_keys_ended, legacy_keys_off or permission_denied).403The endpoint is only available in the sandbox.
A 403 can also mean the key may not make this request;
code says why.404Charge not found, or the charge ended in an error.
409Another request with the same
idempotency-key is still being processed (request_in_progress). Wait, then retry with the same key.422Unprocessable content. The charge has not been processed yet.
500Internal server error.
503Service unavailable. Retry after the number of seconds in
Retry-After, or after a few seconds when there's none.Was this page helpful?