Record a payment outcome

Record a payment's real-world outcome when the payment provider never reported one, for example a debit order whose result only reached you on a bank statement.

This is a narrowed alternative to update payment: only successful and failed can be recorded, the payment is identified by the path so payment_id is not accepted in the body, and a manually recorded outcome carries no provider code so failure_code is not accepted at all. Sending either field returns a 400.

Not every transition is reachable. A payment already in a final status cannot be changed, with the single exception of reversing a successful payment:

FromTo successfulTo failed
pending, submitted, processing200200
successful200, no change200, reverses the payment's ledger entry and creates a reversal payment
failed400400
cancelled400400

Correcting a failed payment to successful is therefore not possible over the API.

Path Params
string
required

The unique identifier of the payment to record the outcome on.

Query Params
string

To perform an idempotent request, provide the idempotency_key query parameter with the request. An idempotency key is a unique value generated by the client which the platform uses to recognize subsequent retries of the same request. How you create unique keys is up to you, but we suggest using a V4 UUID, or another random string with enough entropy to avoid collisions. Idempotency keys can be up to 255 characters long.

Body Params
string
enum
required

The real-world outcome to record on the payment. Only successful and failed can be recorded here. The remaining statuses stay on the update payment endpoint.

Allowed:
string
length ≤ 1000

A description of the reason the payment failed. Surrounding whitespace is trimmed, so a reason consisting only of whitespace is rejected. This field will be required if status is failed, forbidden otherwise.

string
enum

The additional action to perform when processing a failed payment. block_payment_method: Set the payment method's verification status to blocked, and do not generate a retry. block_retry: Do not generate a retry payment (even if enabled in the product module settings). allow_retry: Generate a retry payment (if enabled in the product module settings). Note: The payment method will be blocked after 4 consecutive failed payments regardless. See the billing settings guide for more details on the number of consecutive payments allowed. This field will be required if status is failed, forbidden otherwise.

Allowed:
boolean

Set to true to suppress the failure notification that would otherwise be sent to the policyholder. Has no effect when status is successful.

Responses

400

The request body is invalid, or the payment's current status cannot be changed.

403

Recording a payment outcome is not enabled for the organization, or the caller is missing the payments:external:update permission.

404

No such payment, or the caller's user group does not grant access to its policy.

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json