Skip to main content

Authorize.Net

Overview

Gateway Website: https://www.authorize.net/
Developer Documentation: https://developer.authorize.net/api/reference/index.html
Default Currency: USD

Request Objects: BillingAddress, ShippingAddress, CreditCard, Check, OrderInfo, Wallet

Gateway Endpoints
This implementation of Authorize.Net forwards requests to the below endpoints.
Production: https://api.authorize.net/xml/v1/request.api
Sandbox: https://apitest.authorize.net/xml/v1/request.api

Supported Request Parameters

* denotes a required field
Field NameTypeAuthorize.Net MappingNotes
gatewaystringN/AAuthorizeNetDirect
username*stringmerchantAuthentication.​nameMerchant's unique API Login ID.
password*stringmerchantAuthentication.​transactionKeyMerchant's unique Transaction Key.
referenceIdstringcreateTransactionRequest.​refIdMerchant-assigned reference ID for the request.
amountinttransactionRequest.​amountTransaction amount in whole units. Example: $10.​00 USD should be sent as 1000.
currencyCodestringtransactionRequest.​CurrencyCodeISO 4217 three-letter alphabetic code for the currency.
trackData1stringtransactionRequest.​payment.​trackData.​track1Card's Track 1 data.
trackData2stringtransactionRequest.​payment.​trackData.​track2Card's Track 2 data.
creditCard.​numberstringtransactionRequest.​payment.​creditCard.​cardNumberCard's PAN.

If using NetworkTokenization, the value of this field is replaced with the network token itself.
creditCard.​expYearinttransactionRequest.​payment.​creditCard.​expirationDateFour digit year. TokenEx will combine expYear with expMonth to match the "YYYY-MM" format.

If using NetworkTokenization, this will be the year of the network token expiration.
creditCard.​expMonthinttransactionRequest.​payment.​creditCard.​expirationDate1 or 2 digit month. TokenEx will combine expYear with expMonth to match the "YYYY-MM" format.

If using NetworkTokenization, this will be the month of the network token expiration.
n/abooltransactionRequest.​payment.​creditCard.​isPaymentTokentrue if using NetworkTokenization. If not, the field is null.
creditCard.​CVVstringtransactionRequest.​payment.​creditCard.​cardCode3 or 4 digit Card Verification Code.
createProfilebooleantransactionRequest.​profile.​createProfileIf set to true, a customer profile and payment profile will be generated from the customer and payment data.
solutionIdstringtransactionRequest.​solution.​idThe unique Solution ID which you generate and associate with your solution through the Authorize.​Net Partner Interface.
solutionNamestringtransactionRequest.​solution.​nameThe name is generated by the solution provider and provided to Authorize.​net.
terminalIdstringtransactionRequest.​terminalNumberThe merchant's in-store terminal number. Can identify the cashiers or kiosks used.
orderInfo.​invoiceNumberstringtransactionRequest.​Order.​invoiceNumberMerchant-defined invoice number associated with the order.
descriptionstringtransactionRequest.​Order.​descriptionDescription of the item purchased.
tax.​amountinttransactionRequest.​tax.​amountAmount in whole units. Example: $10.​00 USD should be sent as 1000.
tax.​namestringtransactionRequest.​tax.​nameName of tax.
tax.​descriptionstringtransactionRequest.​tax.​descriptionDescription of tax.
orderInfo.​dutyAmountinttransactionRequest.​duty.​amountAmount in whole units. Example: $10.​00 USD should be sent as 1000.
orderInfo.​dutyNamestringtransactionRequest.​duty.​nameName of duty.
orderInfo.​dutyDescriptionstringtransactionRequest.​duty.​descriptionDescription of duty.
orderInfo.​shippingAmountinttransactionRequest.​shipping.​amountShipping amount in whole units. Example: $10.​00 USD should be sent as 1000.
orderInfo.​shippingNamestringtransactionRequest.​shipping.​nameName of the shipping charges.
orderInfo.​shippingDescriptionstringtransactionRequest.​shipping.​descriptionDescription of the shipping charges.
tax.​exemptbooleantransactionRequest.​taxExemptIndicates whether or not the order is exempt from tax.
orderInfo.​purchaseOrderNumberstringtransactionRequest.​poNumberThe merchant-assigned purchase order number.
orderInfo.​CustomerTypestringtransactionRequest.​Customer.​typeValid values:
- Individual
- Business
orderInfo.​CustomerEmailstringtransactionRequest.​Customer.​emailThe customer's valid email address.
orderInfo.​CustomerIdstringtransactionRequest.​customer.​idThe unique customer ID used to represent the customer associated with the transaction.
billingAddress.​firstNamestringtransactionRequest.​billTo.​firstNameFirst name associated with customer’s billing address.
billingAddress.​lastNamestringtransactionRequest.​billTo.​lastNameLast name associated with customer’s billing address.
billingAddress.​companystringtransactionRequest.​billTo.​companyCompany associated with customer’s billing address.
billingAddress.​address1stringtransactionRequest.​billTo.​addressCustomer’s billing street address.
billingAddress.​citystringtransactionRequest.​billTo.​cityCity of customer’s billing address.
billingAddress.​statestringtransactionRequest.​billTo.​stateState of customer’s billing address.
billingAddress.​zipstringtransactionRequest.​billTo.​zipThe postal code of customer’s billing address.
billingAddress.​countrystringtransactionRequest.​billTo.​countryCountry of customer’s billing address.
billingAddress.​phonestringtransactionRequest.​billTo.​phoneNumberPhone number associated with customer’s billing address.
billingAddress.​faxstringtransactionRequest.​billTo.​faxNumberFax number associated with customer’s billing address.
shippingAddress.​firstNamestringtransactionRequest.​shipTo.​firstNameFirst name associated with customer’s shipping address.
shippingAddress.​lastNamestringtransactionRequest.​shipTo.​lastNameLast name associated with customer’s shipping address.
shippingAddress.​companystringtransactionRequest.​shipTo.​companyCompany associated with customer’s shipping address.
shippingAddress.​address1stringtransactionRequest.​shipTo.​addressCustomer’s shipping street address.
shippingAddress.​citystringtransactionRequest.​shipTo.​cityCity of customer’s shipping address.
shippingAddress.​statestringtransactionRequest.​shipTo.​stateState of customer’s shipping address.
shippingAddress.​zipstringtransactionRequest.​shipTo.​zipPostal code of customer’s shipping address.
shippingAddress.​countrystringtransactionRequest.​shipTo.​countryCountry of customer’s shipping address.
customerIpAddressstringtransactionRequest.​customerIpThe IPv4 address of the customer initiating the transaction. Defaults to 255.​255.​255.​255 if omitted
marketTypestringtransactionRequest.​retail.​marketTypeThe market type of the transaction.
Defaults to 0 if omitted
This designates the transaction as being e-commerce and Card Not Present.
deviceTypestringtransactionRequest.​retail.​deviceTypeThe type of device submitting the retail transaction
employeeIdstringtransactionRequest.​employeeIdMerchant-assigned employee ID.
transactionSettings[ ]transactionRequest.​transactionSettingsThis element contains one or more setting elements.
- settingNamestringtransactionRequest.​transactionSettings.​setting.​settingNameName of a specific setting to be modified for this transaction.
- settingValuestringtransactionRequest.​transactionSettings.​setting.​settingValueIndicates whether the specified setting is enabled or disabled.
userFields[ ]transactionRequest.​userFieldsThese elements may be used to pass through information, such as session IDs and order details. The merchant will receive these elements in the response, exactly as it was submitted in the request. Authorize.​net will not store these values.
- namestringtransactionRequest.​userFields.​userfield.​nameName of the user-defined field.
- valuestringtransactionRequest.​userFields.​userfield.​valueValue of the user-defined field.
surchargeAmountinttransactionRequest.​surcharge.​amountAmount in whole units. Example: $10.​00 USD should be sent as 1000
surchargeDescriptionstringtransactionRequest.​surcharge.​descriptionDescribes the reason or details for the surcharge.
tipinttransactionRequest.​tipThe amount of the tip authorized by the cardholder.
isFirstRecurringPaymentbooleantransactionRequest.​processingOptions.​isFirstRecurringPaymentIndicates the initial zero-dollar authorization or the first recurring payment in a series of charges.
isFirstSubsequentAuthbooleantransactionRequest.​processingOptions.​isFirstSubsequentAuthIndicates the initial zero-dollar authorization or the first payment in a series of charges.
isSubsequentAuthbooleantransactionRequest.​processingOptions.​isSubsequentAuthIndicates that the transaction is a follow-on transaction for an established customer.
isStoredCredentialsbooleantransactionRequest.​processingOptions.​isStoredCredentialsIndicates that the transaction was initiated by the customer using card-on-file payment information.
originalNetworkTransIdstringtransactionRequest.​subsequentAuthInformation.​originalNetworkTransIdThe network transaction ID returned in response to the original card-on-file transaction.
subsequentReasonstringtransactionRequest.​subsequentAuthInformation.​reasonDescribes the reason for the subsequent card-on-file transaction.
originalAuthAmountinttransactionRequest.​subsequentAuthInformation.​originalAuthAmountThe original authorization amount.
authorizationIndicatorstringtransactionRequest.​AuthorizationIndicatorIndicates whether the authorization was a pre-authorization or final authorization.
tokenExTransactionCodestringtransactionRequest.​refTransIdBase64 encoded transId. Required for capture, refund, and void transactions.
recurringbooleantransactionRequest.​transactionSettingsRecurring payment indicator. Does not create a subscription.
check.​AccountNumberstringtransactionRequest.​payment.​bankAccount.​accountNumberThe customer's account number.
check.​RoutingNumberstringtransactionRequest.​payment.​bankAccount.​routingNumberThe bank's routing number.
check.​CheckNumberstringtransactionRequest.​payment.​bankAccount.​checkNumberThe check number printed on the physical check. Required for ARC and BOC echeck transactions.
check.​FirstNamestringtransactionRequest.​payment.​bankAccount.​nameOnAccountThe first name of the person who holds the bank account.
First and last names will be concatenated with a space between.
check.​LastNamestringtransactionRequest.​payment.​bankAccount.​nameOnAccountThe last name of the person who holds the bank account.
First and last names will be concatenated with a space between.
check.​AccountTypeenumtransactionRequest.​payment.​bankAccount.​accountTypeThe type of bank account. Certain bank account types require you to use certain ACH transaction types.
Valid values:
1- Checking
2- Savings
4- CorporateChecking (maps to businessChecking)
check.​BankNamestringtransactionRequest.​payment.​bankAccount.​bankNameThe name of the bank.
check.​CheckTypestringtransactionRequest.​payment.​bankAccount.​echeckTypeThe type of ACH transaction.
Valid Values: ARC, BOC, CCD, PPD, TEL, WEB. Defaults to PPD.
customerProfileIdstringtransactionRequest.​profile.​customerProfileIdThe customer profile ID.
shippingProfileIdstringtransactionRequest.​profile.​shippingProfileIdThe customer shipping profile ID.
paymentProfileIdstringtransactionRequest.​profile.​customerPaymentProfile.​paymentProfileIdThe customer payment profile ID.
wallet.​providerstringtransactionRequest.​payment.​opaqueData.​dataDescriptorValues accepted:
- GooglePay
wallet.​providerTokenstringtransactionRequest.​payment.​opaqueData.​providerTokenThe payment instrument token provided by the wallet provider.
For Google Pay, this value will be the paymentMethodData.tokenizationData.token as returned by the Google Pay JavaScript SDK, base 64 encoded.

Authorize.​Net's documentation

Example Requests

{
"testMode": true,
"gateway": "AuthorizeNetDirect",
"username": "<Your Authorize.Net API Login ID>",
"password": "<Your Authorize.Net Transaction Key>",
"amount": 900,
"marketType": "0",
"deviceType": "1",
"creditCard": {
"number": "4111111111111111",
"expMonth": 6,
"expYear": 2024,
"firstName": "John",
"lastName": "Doe",
"cvv": "123"
},
"billingAddress": {
"phone": "555-555-5555",
"email": "[email protected]",
"name": "John Doe",
"company": "Test Co.",
"address1": "123 Someplace Lane, Suite #40A",
"city": "Edmond",
"state": "OK",
"zip": "74100",
"country": "USA"
},
"transactionSettings": [
{
"settingName": "duplicateWindow",
"settingValue": "0"
}
]
}

Gateway Response Parameters

Field NameTypeAuthorize.Net MappingNotes
approvalCodestringtransactionResponse.authCodeThe authorization code granted by the card issuing bank for this transaction.
approvedbooleantransactionResponse.responseCodeThe overall status of the transaction.
The field is true if responseCode == "1"
providerTransactionCodestringtransactionResponse.transIdThe Authorize.net assigned identification number for a transaction.

Example Responses

{
"gatewayResponse": {
"rawResponse": "{\"transactionResponse\":{\"responseCode\":\"1\",\"authCode\":\"QX9A1K\",\"avsResultCode\":\"Y\",\"cvvResultCode\":\"P\",\"cavvResultCode\":\"2\",\"transId\":\"80009867871\",\"refTransID\":\"\",\"transHash\":\"\",\"testRequest\":\"0\",\"accountNumber\":\"XXXX1111\",\"accountType\":\"Visa\",\"messages\":[{\"code\":\"1\",\"description\":\"This transaction has been approved.\"}],\"transHashSha2\":\"BC054C19D08E0E9BD38BCBD8A60C18A250E6938DE7D82B9A68AB87BFA0895A0BE47FE52DD95339B88634C829D35D95AD0D655E14E83736E04D02AD8BE78FF9DB\",\"networkTransId\":\"KBE1HA6SQBNA4ZO1R12SKL9\"},\"messages\":{\"resultCode\":0,\"message\":[{\"code\":\"I00001\",\"text\":\"Successful.\"}]}}",
"gatewayErrors": [],
"tokenExTransactionCode": "ODAwMDk4Njc4NzE=",
"approvalCode": "QX9A1K",
"providerTransactionCode": "80009867871",
"approved": true
},
"referenceNumber": "23113010133720550538",
"success": true,
"error": "",
"message": "",
"thirdPartyStatusCode": "200"
}