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. An approved first payment makes the order live.

  3. Optional: capture, reverse or refund the payment. See After payment.

flowchart TB
  Order["Order (draft)"] --> 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["Live 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

ActionEndpointWhen you can use it
CapturePOST /payments/{id}/captureOn a successful pre-authorisation, for a pre-auth-only order.
ReversePOST /payments/{id}/reverseOn a pre-authorisation, to release the funds.
RefundPOST /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.