v1
latestOpenAPI 3.0.02026-07-244352379.2 KBUpdate an OrderPayment
⚠️ Update OrderPayment Server-Side Only
To keep your app secure, requests to update an OrderPayment should only be generated on the server-side.
A PATCH request to /orders/{order_ref}/payments/{payment_ref}/ updates an existing Forage OrderPayment.
On success, the API responds with the updated OrderPayment object.
The status property of the OrderPayment determines what data can be updated. If the status is processing, canceled, or succeeded, then only the following Payment fields can be modified:
- metadata
- external_order_id
During these statuses, Forage ignores attempts to update other OrderPayment fields.
Headers
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>.
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.
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.
Request body
Example request
{
"tpp_lookup_id": "pi_1DpdZq2eZvKYlo2CAYyzTr8j_secret_lxr4crBJP4txbrg7sqit0XQQO",
"external_location_id": "6e3b2ff7-51c8-4c64-befa-2eac90f7c3e9"
}Response
OK - Success
Example response
{
"merchant_fixed_settlement": 5.11,
"platform_fixed_settlement": 5.11,
"external_location_id": "6e3b2ff7-51c8-4c64-befa-2eac90f7c3e9",
"ref": "cc3175bfea",
"status": "requires_confirmation",
"created": "2021-06-16T00:11:50.000000Z",
"updated": "2021-06-16T00:11:50.000000Z",
"success_date": "2021-06-16T00:11:50.000000Z",
"refunds": [
"ac47392bb1"
],
"tpp_lookup_id": "pi_1DpdZq2eZvKYlo2CAYyzTr8j_secret_lxr4crBJP4txbrg7sqit0XQQO",
"order": "340129aff3"
}