Record a payment

POST/api/v1/credit/payments

Records a debit the partner executed and returns the allocation and corrected balances in one response. Allocation is not selectable: oldest loan first, and within a loan accrued interest, then the disbursement fee, then principal (D-10, D-11). paid_on is the date the money landed. Send pending: true to record an initiated debit without allocating, then confirm settlement. Pass loan_id for the per-row Pay action, subject to the per-loan minimum (D-09). Idempotent on external_payment_id.

Operation ID: record_payment·View as markdown·OpenAPI slice

Authentication

Bearer token authentication. Pass your DayZero API token in the Authorization header and the target business UUID in x-business-id.

Request body

credit_line_idstring
external_line_idstring
external_payment_idstringrequired

Partner payment ID. The idempotency key.

amount_centsintegerrequired
paid_onstring · daterequired

The date the payment counts from: when the money landed, not when the merchant pressed Pay (§10.6). A partner reporting at initiation sends pending=true and confirms settlement later.

methodstring
loan_idstring

Per-row Pay (§7.2): allocate to this loan only. Subject to the per-loan minimum (D-09).

pendingboolean

Record the debit as initiated but not settled. Nothing is allocated until settlement is confirmed (O-10).

Responses

201Successful Response

successboolean
messagestring
codestring
dataapp__api__v1__schemas__credit_line__PaymentResponse

400Bad Request - Invalid input

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

401Unauthorized - Missing/invalid token or no access to this business

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

403Forbidden - Insufficient permissions

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

404Not Found - Resource does not exist

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

422Validation Error

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.