top of page

Authorize and save the method

Reserve funds now and capture later, while saving the method.

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/auth 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. An authorization is not a capture. Capture the existing payment when fulfillment is ready.

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