Introduction

Integrate payment recovery into your billing stack

Declined.io Developer Documentation

Integrate payment recovery automation into your billing stack. Send events when payments fail, mark recoveries when customers pay, and receive outbound webhooks as sequences progress.

Quick start

Send your first event to the Events API. Each request must include a unique event_id — replays with the same ID return 200 with status: "duplicate" and do not create side effects.

curl
curl -X POST https://app.declined.io/api/v1/events \
  -H "Authorization: Bearer decl_sandbox_sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "event_id": "evt_001",
    "type": "payment_failed",
    "customer_id": "cus_123",
    "invoice_id": "inv_456",
    "amount": 24900,
    "currency": "usd",
    "provider": "stripe"
  }'

Official SDKs

Client libraries wrap authentication, idempotency, and typed payloads. Each language is maintained in the declined-sdk monorepo:

  • Node.jsnpm install declined
  • Pythonpip install declined
  • Rubygem install declined
  • PHPcomposer require declined/sdk
  • Gogo get github.com/Enoros/declined-sdk/declined-go
  • JavaMaven: io.declined:declined

Core concepts

  • Authentication — Bearer secret keys, live vs sandbox environments, publishable vs secret key types
  • Events — Ingest billing signals that enqueue recovery sequences
  • Recoveries — Stop sequences when payment succeeds outside hosted recovery
  • Webhooks — Receive signed outbound notifications
  • REST API — Full endpoint reference and HTTP semantics