Update a payment request
This API call is used to request the cancellation of a payment request by setting its status to CANCELLING.
This call is a request to cancel, not a confirmation that the payment was cancelled. A successful (200) response means the cancellation request has been accepted and the payment request has moved to CANCELLING — it does not mean the payment has been cancelled.
Whether the payment is actually cancelled depends on how far the terminal has progressed:
- If the terminal has not yet started processing the payment, the terminal cancels the payment request and its status becomes CANCELLED with a status reason of CANCELLED_BY_EPOS.
- If the terminal has already started processing the payment, the cancellation cannot be applied and the payment continues to its final status (SUCCESSFUL or FAILED), which overrides CANCELLING.
To confirm the outcome, keep following the payment request’s status updates until it reaches a final state. The payment is only cancelled when the status is CANCELLED; a final state of SUCCESSFUL or FAILED means the cancellation did not take effect.
Required Scopes (one of the following):
- payment_requests (returned via the register API: POST /poslink/v1/epos/register)
- default_access (deprecated, will be removed in the future; included for backward compatibility with existing integrations)
Request
- Base URLhttps://api.teya.com
- AuthOAuth 2Authorization codehttps://id.teya.com/oauth/v2/oauth-authorizeToken URLhttps://id.teya.com/oauth/v2/oauth-token
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
The ID assigned to the payment request
Request body
Example request
{
"status": "CANCELLING"
}Response
Cancellation request accepted. The payment request has moved to CANCELLING; this does not confirm the payment was cancelled. Follow the status updates until a final state (CANCELLED, SUCCESSFUL, or FAILED) to determine the outcome.
Example response
{
"payment_request_id": "dfc4fc52-8293-45b6-9f3e-b3b0f8f88188",
"status": "CANCELLING",
"updated_at": "2023-08-14T11:28:45.610Z"
}Changes
No recorded changes to this operation across all 1 revision of this API.