Orders

Create orders, then pause, resume, complete or cancel them.

An order links a customer to the products they buy, and sets how they pay.

Create every order with Create order. Its order_type sets how the customer pays: single_payment, instalment, subscription or metered. Each type needs different parameters. Create order lists them.

How an order moves

  1. Create the order. Its status is draft, and nothing is collected yet.
  2. Collect the first payment. See 4 · Collect payment.
  3. While payments are still due, the order is active. BillPro collects each scheduled payment on its date.
  4. When nothing more is due, the order is complete.

You can pause, resume, complete or cancel an order. The order's available_actions shows which you can do now.

Cancel or complete?

Both end an order, so no more payments are collected.

  • Cancel an order that never took a payment: draft, pending or rejected. Use cancel to end a subscription too.
  • Complete any other live order: active, failed, suspended, paused or review. Its scheduled payments are cancelled, and you can still refund the payments it took.

Order statuses

Preliminary statuses come before the first approved payment. Live statuses come after it.

IconStatusGroupMeaning
draftPreliminaryA new order with no payment taken and no payment link sent. You can take a payment, send a link, or cancel it.
pendingPreliminaryA payment link was sent, and no payment or card registration has been approved yet.
rejectedPreliminaryA payment taken with a card on file or by phone was declined. You can try again, send a link, or cancel it.
cancelledPreliminaryThe order was cancelled. Nothing more is collected.
activeLiveThe first payment or card registration was approved, and so was the latest payment. A pre-authorised single payment that isn't captured or reversed yet is also active.
pausedLiveA subscription that was paused. Nothing is collected until it resumes.
failedLiveThe latest payment was soft-declined, a temporary problem such as insufficient funds. It can be retried.
suspendedLiveThe latest payment was hard-declined, a permanent problem such as a closed account. Replace the card to collect it.
reviewLiveAn instalment order that collected more than its value. Check it, refund the extra, then complete it.
completeLiveNothing more is due: the order was paid in full, a pre-authorised amount was captured or reversed, or it was completed.

These match the statuses in the BillPro dashboard. For more on each one, see Order status in the guides.