5 · Recurring billing & recovery

Instalment, subscription and metered orders have future payments. BillPro charges them on schedule. Use the API to check the schedule, handle declined payments and update cards.

Endpoints: Billing Events and Scheduled Payments · Payment Links


Steps

  1. Check the order's schedule: GET /orders/{id}/scheduled_payments.
  2. If a card was declined or has expired, update it. See Fix the card.
  3. Charge the payment again: POST /scheduled_payments/{id}/execute. To leave it to automatic retries instead, use POST /scheduled_payments/{id}/retry.
flowchart TB
  Live["Live order"] --> Due["Scheduled payment
  is charged"]
  Due -->|Approved| Next["Next payment
  runs on schedule"]
  Due -->|Declined| Card{"Card still
  valid?"}
  Card -->|Yes| Retry["Charge again
  /scheduled_payments/{id}/execute"]
  Card -->|"No"| Fix["Fix the card"] --> Retry
  Retry --> Due

Manage the schedule

ActionEndpoint
Charge a payment nowPOST /scheduled_payments/{id}/execute
Return a declined payment to automatic retriesPOST /scheduled_payments/{id}/retry
Reschedule or change a paymentPATCH /scheduled_payments/{id}
Skip upcoming paymentsPOST /orders/{order_id}/scheduled_payments/skip
Merge upcoming paymentsPOST /orders/{order_id}/scheduled_payments/merge
Add a payment to a metered orderPOST /orders/{order_id}/scheduled_payments

On a metered order, send product_id and process_date. The amount is worked out from the price on the order. A process_date of now schedules the payment for now: execute it to charge straight away.


Fix the card

SituationEndpoint
Switch to another card on filePOST /orders/{id}/replace_card

Next

Manage individual payments in Billing Events and Scheduled Payments, or go back to the Overview.