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
- Check the order's schedule:
GET /orders/{id}/scheduled_payments. - If a card was declined or has expired, update it. See Fix the card.
- Charge the payment again:
POST /scheduled_payments/{id}/execute. To leave it to automatic retries instead, usePOST /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
| Action | Endpoint |
|---|---|
| Charge a payment now | POST /scheduled_payments/{id}/execute |
| Return a declined payment to automatic retries | POST /scheduled_payments/{id}/retry |
| Reschedule or change a payment | PATCH /scheduled_payments/{id} |
| Skip upcoming payments | POST /orders/{order_id}/scheduled_payments/skip |
| Merge upcoming payments | POST /orders/{order_id}/scheduled_payments/merge |
| Add a payment to a metered order | POST /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
| Situation | Endpoint |
|---|---|
| Switch to another card on file | POST /orders/{id}/replace_card |
Next
Manage individual payments in Billing Events and Scheduled Payments, or go back to the Overview.