Waylo Commerce
Commerce

Payments

Payment collections, sessions, authorization, capture, and refunds.

Payments go through a payment provider. Which providers a buyer can use is set per region. Provider IDs look like pp_<identifier>_<id>.

Concepts

ConceptMeaning
Payment collectionThe amount to collect for a cart or an order.
Payment sessionOne attempt to pay with one provider, inside a collection. Holds the provider's data, such as a client secret.
PaymentCreated when a session is authorized. Captured and refunded from here.

At checkout

  1. Create a payment collection with cart_id.
  2. Create a payment session with a provider_id enabled in the cart's region. Use the session's data to run the provider's own UI.
  3. Complete the cart. This authorizes the session. See Carts and checkout.
  • List payment providers with region_id to show the choices.
  • Create the session again if the cart total changes after step 2.
  • A provider can report pending_authorization for flows confirmed later by webhook. The order is placed, and the payment follows.

After the order is placed

ActionAdmin call
Capture an authorized payment, fully or partlyPOST /admin/payments/{id}/capture
Refund a captured payment, with an optional reasonPOST /admin/payments/{id}/refund
Ask for an outstanding amount on an orderCreate payment collection with order_id and amount
Record a payment made outside the systemMark as paid
  • Authorization and capture are separate. A common B2B setup authorizes at checkout and captures when the order ships. Waylo Commerce doesn't add payment timing rules yet, so capture is a separate merchant action.
  • Authorizations can expire before capture, depending on the provider. There is no reauthorize route: capture before it expires, or create a new payment collection for the amount.
  • Returns, exchanges, and claims can leave money owed either way. Refund or collect it with the calls above. See Orders.
  • Canceling an order cancels uncaptured payments and refunds captured ones.

Never send card data to the API. The provider's own UI collects it; the backend only stores the provider's references.

On this page