Skip to main content
POST
Record a return

Authorizations

X-API-KEY
string
header
required

Headers

Idempotency-Key
string

Optional. Send the same key when retrying a write you are not sure landed: the first response is returned again (with Idempotent-Replayed: true) instead of writing twice. A key used for a different request is refused with 422; one whose first request is still running gets 409. A refused or failed request does not use up its key. Keys are per environment and kept for 7 days.

Maximum string length: 255

Path Parameters

reconciliation_id
string
required

The reconciliation to reconcile the return in

Body

application/json
payment_record_id
string
required

The payment that was returned (for example the system transaction).

bank_record_id
string
required

The bank transaction that moved the money back. Its amount is the amount returned.

reason
string

Optional. The return reason, for example an ACH return code such as R01. Stored in the return record's metadata.return_reason and its description.

Response

Return recorded and reconciled

return_record
object
reconciliation_match
object

A reconciliation match represents a group of records that have been matched together. Endclose supports many-to-one matching, so a single match can contain a large number of records — to retrieve them, use GET /v1/records?reconciliation_match_id={id}.

residual_record
object | null

The open residual for the part of the payment that is not returned yet. null when the payment is now fully returned.