top of page

Take a payment and save the method

Authorize and capture a tokenized payment and retain a vault record.

Prepare the order

Use matching sandbox merchant credentials and a fresh component token. Resolve the amount on your server. Obtain consent to save the payment method and confirm Customer Vault is enabled. online

Submit from your server

This request uses the REST Payments API. Replace placeholders and the example amount with the authorized test order. POST /api/v5/payments/sale HTTP/1.1 Host: sandbox.nmi.com Authorization: <sandbox-private-merchant-key> Content-Type: application/json { "amount": 10.0, "payment_details": { "payment_token": "<fresh-sandbox-token>" }, "customer_vault": { "add_to_vault": true, "id": "CUST-EXAMPLE-001" } }

Record the outcome

Check the gateway result, not only HTTP success. Store the payment ID and returned vault ID against the correct merchant and customer.

Verify failure handling

Test approval, decline, and a lost response. Keep ambiguous attempts unresolved until investigated; do not create another charge automatically. Handle uncertain outcomes

Join the community and get the latest biz news & tips

Thanks for submitting!

© 2025 Betterpay. All Rights Reserved.

bottom of page