top of page

Create a sale

Authorize and capture a tokenized payment in one server request.

When to use sale

A sale combines authorization and capture. Choose it when your business workflow is ready to collect the payment immediately. Use separate authorization and capture when fulfillment requires a later capture decision. lifecycle

Minimal token request

The server must calculate the amount from its order record. The browser supplies a fresh payment token, not an authoritative price. POST /api/v5/payments/sale HTTP/1.1 Host: sandbox.nmi.com Authorization: <sandbox-private-key> Content-Type: application/json { "amount": 10.0, "payment_details": { "payment_token": "<fresh-sandbox-token>" } } Sandbox verified 2026-10-16: browser Payment Component token sale and synthetic-card sale approved; test payments voided. This does not establish live settlement.

Request fields

This is a focused token-payment reference, not the complete set of processor-specific options. Field Use amount Required numeric amount in currency units, formatted to two decimal places. payment_details.payment_token Token from the browser collection flow; use only one payment-details variant. currency Optional three-letter currency code; confirm merchant currency configuration. processor_id Optional routing identifier when selecting among configured processors.

Complete the order safely

Recommended application handling: validate the returned payment result, store its gateway ID with your order, and distinguish checkout approval from settlement. A browser redirect or a successful HTTP exchange alone is not your complete financial record. Validate customer access to the order before submitting. Create one application payment attempt and guard repeated clicks. Record the outcome and gateway ID before returning the customer-facing result. If the transport result is uncertain, investigate the existing attempt before initiating another charge.

Amount representation

The endpoint reference describes amount as numeric; some provider HTTP examples show a decimal string. This example follows the numeric schema. Verify acceptance and rounding behavior in your sandbox integration; do not assume a string and number are interchangeable.

Join the community and get the latest biz news & tips

Thanks for submitting!

© 2025 Betterpay. All Rights Reserved.

bottom of page