HomeGuidesReference↗ Forage Dashboard
Log In
Reference

Cancel an OrderPayment

`OrderPayment`` Updates Must Be Server-Side

To keep your app secure, requests to cancel an OrderPayment should only be generated on the server-side.

A POST request to /orders/{order_ref}/payments/{payment_ref}/cancel/ cancels an existing OrderPayment.

An OrderPayment can only be cancelled if its status is requires_confirmation or failed. Because only payments in these unsuccessful states can be canceled, this endpoint has no financial side effects.

On success, the API responds with the original OrderPayment object.

Path Params
string
required

A unique reference hash for the Forage Order object, returned when the order’s parent Session was created.

string
required

A unique reference hash for the Forage OrderPayment object, returned when the OrderPayment was created.

Headers
string
required

An OAuth 2.0 authentication token that validates the request. Send a POST to the /o/token/ endpoint to generate an authentication token. Pass the token in this header after the word Bearer and a whitespace, for example Bearer <api_key>.

string
required

A unique merchant ID that Forage provides during onboarding, as in 123ab45c67. The Merchant ID can be found in the Forage sandbox or production dashboard.

string
required

An alphanumeric key that clients can use to identify repeated requests that are dropped in transit. Generate a distinct key for every unique request and only re-use keys for retries.

Responses

Language
Credentials
OAuth2
URL
LoadingLoading…
Response
Choose an example:
application/json