Call Sale API With Token
The token has been provided in 2 ways:
- In the body of the form submitted.
- As an argument to the onSubmitPayment callback, if supplied in the JavaScript SDK configuration.
This token can now be used to call the Sale API.
API Details
Mode: Stateless REST API
API URL: paymentApiUrl /sale
HTTP Method: POST
Request Body: JSON
Authentication: uses netvalve client ID, apiKey and basic auth. See here.
Request
Example Request Body
{
"amount": 12.00,
"cardHolderName": "John Doe",
"clientOrderId": "{{clientOrderId}}",
"currency": "USD",
"customerAddress": "123 Main St",
"customerCity": "New York",
"customerCountryCode": "US",
"customerEmail": "docs@netvalve.com",
"customerIp": "203.0.113.1",
"customerName": "John",
"customerLastName": "Doe",
"customerPhone": "+12025551234",
"customerState": "NY",
"customerZipCode": "10001",
"midId": {{midId}}, // Use either midId or siteId
"siteId": {{siteId}},
"paymentToken": "e9d74bfb-12d6-422c-a230-fdcc351afc52"
}
Response
Example Response Body
{
"traceID": "267d8adf-8077-49b1-af95-321252545981",
"responseTimestamp": "2024-11-26T04:09:49.657+00:00",
"transactionID": 1,
"responseCode": "GTW_1000",
"responseMessage": "Transaction Approved/ Request Successful.",
"responseCodeType": "APPROVED",
"paymentMethod": "CARD",
"cardNumber": "401200******5439",
"cardType": "VISA",
"bankTransactionId": "432604500812",
"authCode": "TAS639",
"midId": 2,
"netvalveMidId": "289e253d-f955-4e29-a2c7-bb1805883ee0"
}