4 · Collect payment

Take the first payment on an order. Choose how the customer pays, then capture, reverse or refund payments as needed.

Endpoints: Custom Checkout · Payment Links · Order card · Payments


Steps

  1. Choose how the customer pays:

    OptionUse it whenEndpoints
    Checkout on your websiteThe customer pays on your site.POST /orders with create_checkout: true; POST /orders/{id}/custom_checkout to renew
    Payment linkYou send a link by email or SMS, or show a QR code.POST /orders/{id}/send_email_link, send_sms_link or payment_link
    Stored cardThe customer already has a card on file.POST /orders/{id}/pay_with_card
  2. Wait for the payment result. What an approved first payment does depends on the order type:

    • Single payment: the order becomes complete. With pa_only: true, the amount is only held on the card, and the order is active until you capture or reverse it.
    • Instalment, subscription or metered: the order becomes active, and BillPro collects the later payments.
  3. Optional: capture, reverse or refund the payment. See After payment.

flowchart TB
  Order["New order"] --> Choose{"How does the
  customer pay?"}
  Choose -->|"On your website"| Checkout["Custom checkout
  create_checkout: true"]
  Choose -->|"From a link"| Link["Payment link
  email · SMS · QR"]
  Choose -->|"Card on file"| Stored["Stored card
  /pay_with_card"]
  Checkout --> Live["Active or complete order"]
  Link --> Live
  Stored --> Live

Checkout on your website

Use this to show the payment form inside your own website. For the full walkthrough, see Custom Checkout.

sequenceDiagram
  autonumber
  participant B as Your server
  participant API as BillPro API
  participant F as Your website
  participant Cu as Customer

  B->>API: POST /orders with create_checkout: true
  API-->>B: Order and checkout for the payment form
  B->>F: Show the payment form
  Cu->>F: Enter card details
  F-->>F: BillPro records the payment
  F->>B: Customer returns to your URL with the status
  B->>API: GET /orders/{id} to confirm

Sending a payment link, or showing its QR code, moves a draft order to pending.


After payment

ActionOrder typesEndpointWhen you can use it
CaptureSingle payment with pa_only: true onlyPOST /payments/{id}/captureOnce, on a successful pre-authorisation. Capture within 7 days.
ReverseSingle payment with pa_only: true onlyPOST /payments/{id}/reverseOn a pre-authorisation with nothing captured, to release the whole amount.
RefundAll order typesPOST /payments/{id}/refundOn a successful payment or capture.

Capture and refund accept an amount for part of the payment.


Next

Instalment, subscription and metered orders have future payments. Continue to 5 · Recurring billing & recovery.