2. Authorize Transaction
Authorize a payment for a given quote. The final step for processing a transaction. Requires that you've already obtained a quote that's still active.
POST Request to {Endpoint}/pay/submit
submit can only be called once a quote has been generated and is active, meaning that the quote was generated within 10 minutes of the request to authorize a payment.
When a payment is authorized for a given quote, the user's billing information is processed for the orderTotal amount generated in getQuote.
Request Information
JSON Body Parameters:
ipAddress
string
(required) User's ip address
email
string
(required) user's email address
phone
string
(optional) user's phone
referenceID
string
(optional) External Customer reference ID to allow you to organize and keep track of customers in your system
paymentInformation
Object
See below for interface
JSON Body Interface:
{
"token": string,
"paymentInformation": {
"cardNumber": string,
"cardHolderName": string, // Must Include first and last name
"CVV": string,
"monthExpire": string, // two digit month (January = 01, December = 12)
"yearExpire": string, // four digit year
"billingAddress": string,
"billingAddress2": string, // Optional
"city": string,
"state": string,
"country": string, // two letter country code
"zip": string // post code
},
"ipAddress": string,
"email": string,
"phone": string,
"referenceID": string //optional. your external customer reference ID
}Example JSON Body:
{
"token": "{{quote_token}}",
"paymentInformation": {
"cardNumber": "4111111111111111",
"cardHolderName": "John Doe",
"CVV": "123",
"monthExpire": "01",
"yearExpire": "2028",
"billingAddress": "123 Main St",
"billingAddress2": "Unit 1A",
"city": "New York",
"state": "New York",
"country": "US",
"zip": "10001"
},
"ipAddress": "57.12.174.59",
"email": "[email protected]"
}Response Information
There are 3 possible categories of responses for this request. You can determine the category by referring to the state field. The categories are the following:
Approval
Completed transactions. Digital Asset is actively being generated.
Refused
Transactions that have been declined/refused. Responses will include refusal reasons in the
reasonfield and also potentially provide additional error codes in theadditionalErrorCodefield.
Error
A problem has occurred with the request. You can utilize information in the
errorfield response to troubleshoot the error. Additionally, refer to the Error Code Table to identify errors by their HTTP status code.
Successful Responses:
Approval Response Example
{
"success": true,
"state": "APPROVED",
"trxID": "1009779",
"time": "2024-03-21T07:20:36.424Z",
"details": {
"amount": 11.1,
"currency": "USD",
"CustomerWalletAddress": "0x4241D89139f68D126Ed40b63152Fe767F439c554",
"DigitalAssetStatus": "PROCESSING"
}
}Refused Response Example
{
"success": false,
"state": "REFUSED",
"time": "2024-03-21T16:14:41.986Z",
"reason": "REFUSED",
"error": "5 - REFUSED",
"additionalErrorCode": "5"
}Refused transactions will include a reason field in the object, which will provide information with regards why a transaction was refused.
Error Responses
Error responses will have "state": "ERROR" along with a HTTP status code that is between 400 and 600. Refer to the Authorize Transaction Error Codes page for more information.
{
"success": false,
"state": "ERROR",
"time": "2024-03-21T16:15:20.918Z",
"error": "Order with same quote already attempted. Please generate a new quote and try again."
}Last updated