Credit lifecycle
Once a user has a credit limit, you authorize draws against it and report repayments. All endpoints require Authorization: Bearer <accessToken>.
1. Authorize a draw
POST /card/authorize-credit
{ "userId": "949", "requestedAmount": 100 }
| Field | Notes |
|---|---|
userId | Either your externalUserId or Yumi's internal card-user userId from the CREDIT_LIMIT webhook — both resolve to the same user, so send whichever you have. The same identifier is accepted on every user-scoped call. |
requestedAmount | USD. Must be ≤ the user's approved limit. |
Response
{ "success": true, "data": { "creditApproved": true, "authId": "…", "creditId": "…" } }
creditApproved: falsemeans the request exceeded the available limit (noauthId/creditIdreturned).- Keep the
creditId— you need it to report repayment. - A user can hold only one active credit at a time; repay the current one before authorizing another.
:::note On-chain (wallet-based) cards
Wallet-based cards add steps (submit-authorization, submit-issuance) and deadline / spender / recipient fields on the authorize call. If your card is on-chain, Yumi will provide the addendum. The flow here is the standard off-chain path.
:::
2. Report repayment
POST /card/submit-repayment
{
"userId": "949",
"creditId": "123e4567-e89b-12d3-a456-426614174000",
"amount": 100,
"paymentReference": "acme-payment-abc123"
}
| Field | Notes |
|---|---|
amount | USD (min 0.01). |
paymentReference | Your payment id. Used for traceability and safe retries — send the same reference if you retry. |
Once fully repaid, the credit closes and the user can draw again.
Next: API Reference →