Skip to content

Cancels a payment session

Request

POST {{baseURL}}/v2/payment-sessions/{{paymentSessionId}}/cancel

This endpoint cancels a payment session.

A payment session can only be canceled successfully if:

  • The payment session must belong to the requesting merchant. The merchantId from the API token must match the session's merchant. It returns 403 Forbidden if it does not.
  • The session is in Created status. Any other status, such as Completed, Failed, or Cancelled, fails with the validation error: "Payment Session can be canceled only in Created status".

See Also:
To create a new payment session, see POST /v2/payment-sessions.
To retrieve a payment session by Id, see GET /v2/payment-sessions/{{paymentSessionId}}.

Security
Bearer
Path
paymentSessionIdstring, (uuid)required

Specifies the payment session identifier.

Example:edf7b36a-1b2c-4d3e-4f5a-6b7c8d9e0f36
curl -i -X POST \
  https://sandbox.api.flute.com/v2/payment-sessions/edf7b36a-1b2c-4d3e-4f5a-6b7c8d9e0f36/cancel \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

OK. The payment session was successfully canceled.

Response
No content