/api/v1/mystery/billing/repayments packs:readReports an on-chain USDC repayment of your receivable. Send the owed amount as USDC to repayment.address (from GET /billing), then POST the transaction hash. The transfer is verified ON-CHAIN — the credited amount is the sum decoded from the USDC Transfer logs to the repayment address, never your claim — so this endpoint can’t move money and shares the packs:read scope with the billing reads. Owed usage rows are then marked repaid strictly oldest-first (invoice_ref repay:<tx_hash>) while the credit covers them; any excess stays as unapplied credit consumed automatically by future accruals. Idempotent by tx_hash: a tx is only ever credited once, to one partner — replaying returns the original row with already_recorded: true.
POST /api/v1/mystery/billing/repayments write These inputs are shared across all docs pages — an id entered here carries over.
{
"tx_hash": ""
}Not run yet — press Run to make a live call against https://service.rip.fun (through this demo's server-side proxy; the API key never reaches the browser).
curl -X POST 'https://service.rip.fun/api/v1/mystery/billing/repayments' \
-H 'X-API-Key: rip_…' \
-H 'Content-Type: application/json' \
-d '{"tx_hash":""}' | Field | Type | Required | Description |
|---|---|---|---|
tx_hash | string | yes | 0x-prefixed 32-byte hash of the mined USDC transfer (`txHash` accepted as an alias) |
data)| Field | Description |
|---|---|
repayment | The recorded row: tx_hash, verified amount_usdc, applied_usdc, from/to/token address, block_number |
already_recorded | true when this tx was reported before (idempotent replay — nothing new settled) |
settled_items / settled_usdc | Usage rows stamped repaid by this call and their total |
remaining_credit_usdc | Verified credit left over after settlement (drained by the next accrual/repayment) |
| Status | Code | When |
|---|---|---|
| 400 | invalid_tx_hash | tx_hash is not a 0x-prefixed 32-byte transaction hash |
| 400 | tx_not_confirmed | the tx is not mined yet, or contains no USDC transfer to the repayment address — wait for confirmation and retry |
| 400 | tx_reverted | the transaction reverted on-chain — nothing was transferred |
| 409 | tx_already_credited | this tx was already credited to a different partner |
| 409 | tx_wrong_partner | the USDC left a wallet registered to a different partner |
| 503 | repayment_address_unconfigured | no repayment address configured yet — contact rip.fun |
See Errors for the response envelope and the full code list.