| [ Web Proxy ] |
| Viewing: https://docs.nmi.com/docs/payment-migration-playbook | [Back] [Original] |
This document is a migration playbook for moving server-side payment submissions from the Classic API endpoint (/api/transact.php) to the modern JSON-encoded endpoints (/api/v5/payments/...).
From a single endpoint with a type parameter to explicit paths.
From flat form fields to JSON objects.
From security_key parameter in the request body to Authorization header.
From query-string style payloads to JSON payloads and HTTP status handling.
Replace type=<operation> on transact.php with the matching new endpoint, for example:
sale POST /api/v5/payments/salecapture POST /api/v5/payments/{transaction_id}/captureGET /api/v5/payments/{transaction_id}Use the transaction identifier returned within the JSON response (id) as {transaction_id} in follow-on URLs. See our API Reference for the full list of endpoints.
If a payment is initiated on a registered device (for example, cloud terminal or PIN pad workflows), use the asynchronous device endpoints:
sale POST /api/v5/devices/{device_id}/payment-requests/salevalidate POST /api/v5/devices/{device_id}/payment-requests/validateThese requests return a payment request identifier when successful. To check the status and retrieve transaction details, poll:
GET /api/v5/devices/{device_id}/payment-requests/{request_id}Once complete, the response includes summary transaction information. For additional device management and operations endpoints, see the full API Reference.
Some changes to expect:
payment_details object containing Credit Card, Check, or Token data.billing_address and shipping_address objects to more easily pass and parse customer data.response=...&responsetext=...)object field with a unique idresponse, response_text, response_codepayment_details, billing_address, etc.)Use the response's HTTP status code (ex: 409, 404, etc.) alongside the error body together:
type, error_code, and messagedetails will elaborate more on things like validation errorsPayment endpoints expect your merchant private API key as the entire Authorization header valuedo not provide Bearer, ApiKey, or any other scheme.
Validate uses the same permission inheritance as on the classic payments API for your key (including how validate relates to sale). You do not configure that separatelyif it worked with your key on transact.php, the same rules apply on /api/v5/payments/validate.
Only the server request to the gateway: pass payment_details.payment_token in your request body instead of posting payment_token to transact.php. Your Payment Component or Collect.js setup stays as-is.
No. The Classic Payment API will continue to be fully supported. However, we recommend migrating to JSON endpoints to take advantage of a cleaner and more intuitive integration experience.
Updated 5 months ago
| Web Proxy Viewer | New URL | Original Page |