Request service credit

POST /api/v1/service-credits/:id/request write:service_credit

Claims a PENDING credit within the 30-day request window from report_available_at. Only requested credits are applied to your invoice — an unclaimed credit expires unused, so poll GET /service-credits and claim promptly. Requested credits appear as a negative line item (line_type "service_credit") on the next invoice covering a period after the credit’s period_end. Checks run in order — status first, then amount: a credit that is already REQUESTED, APPLIED or EXPIRED returns 409 regardless of its amount; the 400 for a zero credit only occurs on a credit that is still PENDING.

Try it POST /api/v1/service-credits/0/request write

These inputs are shared across all docs pages, so an id entered here carries over.

response

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 (tracks the inputs above)
curl -X POST 'https://service.rip.fun/api/v1/service-credits/0/request' \
  -H 'X-API-Key: rip_…'

Response fields (data)

FieldDescription
service_creditSame row shape as List service credits, now with status "REQUESTED" and client_requested_at stamped

Errors

StatusCodeWhen
400invalid requestid not a positive integer, or credit_cents ≤ 0 (nothing due)
404not foundcredit not part of your account
409not requestablecredit is not PENDING, or the request window has elapsed (the latter flips the status to EXPIRED as a side effect)

See Errors for the response envelope and the full code list.