CyberSource

Overview

Gateway Website: http://www.cybersource.com
Developer Documentation: https://developer.cybersource.com/api-reference-assets/index.html
Default Currency: USD

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

Gateway Endpoints
This implementation of CyberSource forwards request to the below endpoints

Supported Request Parameters

* denotes a required field

Field NameTypeCyberSource MappingNotes
gatewaystringN/ACyberSource
merchantId*stringMerchantIdYour Cybersource merchant Id
publicKey*stringMerchantKeyIdAPI Key Id
privateKey*stringMerchantSecretKeyShared Secret Key associated with API Key for HTTP Signature Authentication
referenceInformationCodestringPtsv2paymentsClientReferenceInformation.CodeMerchant-generated order reference or tracking number.
amountnumericPtsv2PaymentsOrderInformationAmountDetails.TotalAmountTransaction amount in cents. Example: $10.00 should be sent as 1000
currencyCodestringPtsv2PaymentsOrderInformationAmountDetails.CurrencyCurrency of the transaction. Alpha-3 ISO currency code

Use the ISO 4217 three-letter alphabetic code for the currency.
creditCard.NumberstringPtsv2paymentsPaymentInformationCard.NumberCard number or TokenEx Token - TokenEx will replace the Token with the Detokenized number
creditCard.ExpMonthnumericPtsv2paymentsPaymentInformationCard.ExpirationMonthThe customer’s credit card expiration month. 1 or 2 digit value. Example: 11
creditCard.ExpYearnumericPtsv2paymentsPaymentInformationCard.ExpirationYearThe customer’s credit card expiration year. 4 digit value. Example: 2025
creditCard.CvvstringPtsv2paymentsPaymentInformationCard.SecurityCodeCard verification value

Please refer to Tokenization, Detokenization and CVV Retrieval.
creditCard.BrandstringPtsv2paymentsPaymentInformationCard.TypeOptional Parameter. If not passed, will match pattern with the following cards and assign value. Currently supported: visa - 001 , mastercard - 002, americanexpress - 003, discover - 004, diners club - 005, jcb - 007
threeDSecure.AuthenticationTransactionIdstringConsumerAuthenticationInformation.AuthenticationTransactionIdPayer authentication transaction identifier passed to link the check enrollment and validate authentication messages.
threeDSecure.CAVVstringConsumerAuthenticationInformation.CavvCardholder authentication verification value (CAVV).
threeDSecure.ECIstringConsumerAuthenticationInformation.EciRawRaw electronic commerce indicator (ECI).
threeDSecure.XidstringConsumerAuthenticationInformation.XidTransaction identifier.
threeDSecure.DSTransIdstringConsumerAuthenticationInformation.DirectoryServerTransactionIdThe Directory Server Transaction ID is generated by the Mastercard Directory Server during the authentication transaction and passed back to the merchant with the authentication results.
threeDSecure.ProgramProtocolstringConsumerAuthenticationInformation.PaSpecificationVersion1 (Legacy 3DS 1.0.2) or 2 (EMVCo 3DS 2.0.0 +).
ignoreAvsResultbooleanAuthorizationOptions.IgnoreAvsResultFlag for a sale request that indicates whether to allow the capture service to run even when the authorization receives an AVS decline.
ignoreCvvResultbooleanAuthorizationOptions.IgnoreCvResultFlag for a sale request that indicates whether to allow the capture service to run even when the authorization receives a CVN decline
declineAvsFlagslistAuthorizationOptions.DeclineAvsFlagsComma-separated list of AVS flags that cause the reply flag
recurringbooleanAuthorizationOptions.Initiator.CredentialStoredOnFiletrue means merchant will use this transaction to store payment credentials for follow-up merchant-initiated transactions.
false means merchant will not use this transaction to store payment credentials for follow-up merchant-initiated transactions.
commerceIndicatorstringPtsv2paymentsProcessingInformation.CommerceIndicatorType of transaction. Only internet, moto, install, recurring, and recurring_internet are valid values.
previousTransactionIdstringMerchantInitiatedTransaction.PreviousTransactionIdNetwork transaction identifier that was returned in the payment response field processorInformation.transactionID in the reply message for either the original merchant-initiated payment in the series or the previous merchant-initiated payment in the series.
driversLicenseNumberstringPtsv2paymentsBuyerInformationPersonalIdentification.IdType will be supplied by TokenEx as driver license
driversLicenseStatestringPtsv2paymentsBuyerInformationPersonalIdentification.IssuedByThis is the State or province where the customer’s driver’s license was issued
check.AccountNumberstringPtsv2paymentsPaymentInformationBankAccount.NumberACH account number or TokenEx Token - Tokenex will replace the Token with the Detokenized number
check.RoutingNumberstringPtsv2paymentsPaymentInformationBank.RoutingNumberThe ABA routing number.
check.CheckNumberstringPtsv2paymentsPaymentInformationBank.CheckNumberThe number of the check.
check.AccountTypestringPtsv2paymentsPaymentInformationBankAccount.TypeRepresents the account type such as Checking, Savings, General Ledger, Corporate Checking
secCodestringBankTransferOptions.SecCodeSpecifies the authorization method for the transaction. Valid values are ARC, CCD, POP, PPD, TEL, WEB.
orderInfo.PurchaseOrderNumberstringPtsv2paymentsOrderInformationInvoiceDetails.PurchaseOrderNumberPurchase Order Number
orderInfo.InvoiceNumberstringPtsv2paymentsOrderInformationInvoiceDetails.InvoiceNumberAn identifier for the Invoice in Merchant's system
tax.AmountnumericPtsv2paymentsOrderInformationAmountDetails.TaxAmountTax amount in cents. Example: $10.00 should be sent as 1000
shippingAddress.FirstNamestringPtsv2paymentsOrderInformationShipTo.FirstNameFirst name associated with customer’s shipping address.
shippingAddress.LastNamestringPtsv2paymentsOrderInformationShipTo.LastNameLast name associated with customer’s shipping address.
shippingAddress.Address1stringPtsv2paymentsOrderInformationShipTo.Address1First line of the shipping address
shippingAddress.Address2stringPtsv2paymentsOrderInformationShipTo.Address2Second line of the shipping address
shippingAddress.CitystringPtsv2paymentsOrderInformationShipTo.LocalityCity of the shipping address
shippingAddress.StatestringPtsv2paymentsOrderInformationShipTo.AdministrativeAreaState or province of the shipping address
shippingAddress.ZipstringPtsv2paymentsOrderInformationShipTo.PostalCodePostal code for the shipping address
shippingAddress.CountrystringPtsv2paymentsOrderInformationShipTo.CountryCountry of the shipping address. Alpha-2 ISO country code.
shippingAddress.PhonestringPtsv2paymentsOrderInformationShipTo.PhoneNumberPhone number associated with the shipping address
billingAddress.FirstNamestringPtsv2paymentsOrderInformationBillTo.FirstNameFirst name associated with customer’s billing address.
billingAddress.LastNamestringPtsv2paymentsOrderInformationBillTo.LastNameLast name associated with customer’s billing address.
billingAddress.Address1stringPtsv2paymentsOrderInformationBillTo.Address1Payment card billing street address as it appears on the credit card issuer’s records
billingAddress.Address2stringPtsv2paymentsOrderInformationBillTo.Address2Payment card billing street address as it appears on the credit card issuer’s records
billingAddress.CitystringPtsv2paymentsOrderInformationBillTo.LocalityPayment card billing city
billingAddress.StatestringPtsv2paymentsOrderInformationBillTo.AdministrativeAreaState or province of the billing address
billingAddress.ZipstringPtsv2paymentsOrderInformationBillTo.PostalCodeThe postal code of customer’s billing address.
billingAddress.CountrystringPtsv2paymentsOrderInformationBillTo.CountryCountry of customer’s billing address. Alpha-2 ISO country code.
billingAddress.EmailstringPtsv2paymentsOrderInformationBillTo.EmailEmail associated with customer’s billing address.
billingAddress.PhonestringPtsv2paymentsOrderInformationBillTo.PhoneNumberPhone number associated with customer’s billing address.

Example Requests

{
    "merchantId": "<Your Merchant Id>",
    "publicKey": "<Your API Key>",
    "privateKey": "<Your shared secret key>",
    "referenceInformationCode": "<Your reference information code>",
    "creditCard": {
        "brand": "Visa",
        "number": "4242424242424242",
        "expMonth": 10,
        "expYear": 2021,
        "firstName": "John",
        "lastName": "Doe",
        "cvv": "123"
    },
    "billingAddress": {
        "phone": "555-555-5555",
        "fax": "555-555-6666",
        "email": "[email protected]",
        "firstName": "John",
        "lastName": "Doe",
        "name": "John Doe",
        "company": "Test Co.",
        "address1": "123 Someplace Lane",
        "address2": "Some Place",
        "city": "Tulsa",
        "state": "OK",
        "zip": "74111",
        "country": "USA"
    },
    "amount": 123,
    "gateway": "CyberSource"
}
{
    "merchantId": "<Your Merchant Id>",
    "publicKey": "<Your API Key>",
    "privateKey": "<Your shared secret key>",
    "referenceInformationCode": "<Your reference information code>",
    "tokenExTransactionCode": "<TokenExTransactionCode provided by Authorize call>",
    "amount": 123,
    "gateway": "CyberSource"
}
{
    "merchantId": "<Your Merchant Id>",
    "publicKey": "<Your API Key>",
    "privateKey": "<Your shared secret key>",
    "referenceInformationCode": "<Your reference information code>",
    "tokenExTransactionCode": "<TokenExTransactionCode provided by Purchase/Capture call>",
    "amount": 123,
    "gateway": "CyberSource"
}
{
    "merchantId": "<Your Merchant Id>",
    "publicKey": "<Your API Key>",
    "privateKey": "<Your shared secret key>",
    "referenceInformationCode": "<Your reference information code>",
    "tokenExTransactionCode": "<TokenExTransactionCode of transaction to void>",
    "amount": 123, 
    "gateway": "CyberSource",
}
{
    "merchantId": "<Your Merchant Id>",
    "publicKey": "<Your API Key>",
    "privateKey": "<Your shared secret key>",
    "referenceInformationCode": "<Your reference information code>",
    "check": {
        "accountNumber": "4101",
        "routingNumber": "071923284",
        "checkNumber": "123456789",          
        "firstName": "Maureen",
        "lastName": "Heller",
        "accountType": "Savings"
    },
    "billingAddress": {
        "phone": "555-555-5555",
        "fax": "555-555-6666",
        "email": "[email protected]",
        "firstName": "John",
        "lastName": "Doe",
        "name": "John Doe",
        "company": "Test Co.",
        "address1": "123 Someplace Lane",
        "address2": "Some Place",
        "city": "Tulsa",
        "state": "OK",
        "zip": "74111",
        "country": "USA"
    },
    "amount": 12025,
    "gateway": "CyberSource"
}
{
    "merchantId": "<Your Merchant Id>",
    "publicKey": "<Your API Key>",
    "privateKey": "<Your shared secret key>",
    "referenceInformationCode": "<Your reference information code>",
    "tokenExTransactionCode": "<TokenExTransactionCode provided by ACH Purchase call>",
    "amount": 123,
    "gateway": "CyberSource"
}
{
    "merchantId": "<Your Merchant Id>",
    "publicKey": "<Your API Key>",
    "privateKey": "<Your shared secret key>",
    "referenceInformationCode": "<Your reference information code>",
    "tokenExTransactionCode": "<TokenExTransactionCode provided by ACH Purchase call>",
    "gateway": "CyberSource"
}

Gateway Response Parameters

Field NameTypeTokenEx MappingNotes
approvalCodestringProcessorInformation.ApprovalCodeCyberSource approval code
providerTransactionCodestringPtsV2PaymentsPost201Response.IdCyberSource generated Id for the request

Example Responses

{
    "gatewayResponse": {
        "rawResponse": "{\"_links\":{\"self\":{\"href\":\"/pts/v2/payments/7017283144516797204951\",\"method\":\"GET\"},\"capture\":{\"href\":\"/pts/v2/payments/7017283144516797204951/captures\",\"method\":\"POST\"}},\"id\":\"7017283144516797204951\",\"submitTimeUtc\":\"2023-12-04T22:18:34Z\",\"status\":\"AUTHORIZED\",\"reconciliationId\":\"75028628KPNHBTL3\",\"clientReferenceInformation\":{\"code\":\"1701728314507\"},\"processorInformation\":{\"approvalCode\":\"888888\",\"transactionId\":\"123456789619999\",\"networkTransactionId\":\"123456789619999\",\"responseCode\":\"100\",\"avs\":{\"code\":\"X\",\"codeRaw\":\"I1\"}},\"paymentInformation\":{\"card\":{},\"tokenizedCard\":{\"type\":\"001\"}},\"orderInformation\":{\"amountDetails\":{\"authorizedAmount\":\"1.23\",\"currency\":\"USD\"}},\"pointOfSaleInformation\":{\"terminalId\":\"111111\"}}",
        "gatewayErrors": [],
        "tokenExTransactionCode": "NzAxNzI4MzE0NDUxNjc5NzIwNDk1MTswMQ==",
        "approvalCode": "888888",
        "providerTransactionCode": "7017283144516797204951",
        "approved": true
    },
    "referenceNumber": "23120416183229527759",
    "success": true,
    "error": "",
    "message": "",
    "thirdPartyStatusCode": "201"
}
{
    "gatewayResponse": {
        "rawResponse": "{\"_links\":{\"self\":{\"href\":\"/pts/v2/payments/7017283584606339104953\",\"method\":\"GET\"}},\"id\":\"7017283584606339104953\",\"submitTimeUtc\":\"2023-12-04T22:19:18Z\",\"status\":\"AUTHORIZED\",\"reconciliationId\":\"75028667KPNHBTMH\",\"clientReferenceInformation\":{\"code\":\"1701728358513\"},\"processorInformation\":{\"approvalCode\":\"888888\",\"transactionId\":\"123456789619999\",\"networkTransactionId\":\"123456789619999\",\"responseCode\":\"100\",\"avs\":{\"code\":\"X\",\"codeRaw\":\"I1\"}},\"paymentInformation\":{\"card\":{},\"tokenizedCard\":{\"type\":\"001\"}},\"orderInformation\":{\"amountDetails\":{\"totalAmount\":\"1.23\",\"authorizedAmount\":\"1.23\",\"currency\":\"USD\"}},\"pointOfSaleInformation\":{\"terminalId\":\"111111\"}}",
        "gatewayErrors": [],
        "tokenExTransactionCode": "NzAxNzI4MzU4NDYwNjMzOTEwNDk1MzswMg==",
        "approvalCode": "888888",
        "providerTransactionCode": "7017283584606339104953",
        "approved": true
    },
    "referenceNumber": "23120416191760977190",
    "success": true,
    "error": "",
    "message": "",
    "thirdPartyStatusCode": "201"
}
{
    "gatewayResponse": {
        "rawResponse": "{\"_links\":{\"self\":{\"href\":\"/pts/v2/captures/7017284431566362204953\",\"method\":\"GET\"},\"void\":{\"href\":\"/pts/v2/captures/7017284431566362204953/voids\",\"method\":\"POST\"}},\"id\":\"7017284431566362204953\",\"submitTimeUtc\":\"2023-12-04T22:20:43Z\",\"status\":\"PENDING\",\"reconciliationId\":\"75028628KPNHBTL3\",\"clientReferenceInformation\":{\"code\":\"1701728443212\"},\"orderInformation\":{\"amountDetails\":{\"totalAmount\":\"1.23\",\"currency\":\"USD\"}}}",
        "gatewayErrors": [],
        "tokenExTransactionCode": "NzAxNzI4NDQzMTU2NjM2MjIwNDk1MzswMw==",
        "approvalCode": "",
        "providerTransactionCode": "7017284431566362204953",
        "approved": true
    },
    "referenceNumber": "23120416204226007564",
    "success": true,
    "error": "",
    "message": "",
    "thirdPartyStatusCode": "201"
}
{
    "gatewayResponse": {
        "rawResponse": "{\"_links\":{\"self\":{\"href\":\"/pts/v2/refunds/7017287050566881304951\",\"method\":\"GET\"},\"void\":{\"href\":\"/pts/v2/refunds/7017287050566881304951/voids\",\"method\":\"POST\"}},\"id\":\"7017287050566881304951\",\"submitTimeUtc\":\"2023-12-04T22:25:05Z\",\"status\":\"PENDING\",\"reconciliationId\":\"749709831PNLPFNS\",\"clientReferenceInformation\":{\"code\":\"1701728705108\"},\"refundAmountDetails\":{\"refundAmount\":\"1.23\",\"currency\":\"USD\"},\"processorInformation\":{\"responseCode\":\"100\"},\"orderInformation\":{}}",
        "gatewayErrors": [],
        "tokenExTransactionCode": "NzAxNzI4NzA1MDU2Njg4MTMwNDk1MTswNQ==",
        "approvalCode": "",
        "providerTransactionCode": "7017287050566881304951",
        "approved": true
    },
    "referenceNumber": "23120416250494925549",
    "success": true,
    "error": "",
    "message": "",
    "thirdPartyStatusCode": "201"
}
{
    "gatewayResponse": {
        "rawResponse": "{\"_links\":{\"self\":{\"href\":\"/pts/v2/voids/7017308036806043903955\",\"method\":\"GET\"}},\"id\":\"7017308036806043903955\",\"submitTimeUtc\":\"2023-12-04T23:00:04Z\",\"status\":\"VOIDED\",\"clientReferenceInformation\":{\"code\":\"1701730803868\"},\"voidAmountDetails\":{\"voidAmount\":\"1.23\",\"currency\":\"usd\"}}",
        "gatewayErrors": [],
        "tokenExTransactionCode": "NzAxNzMwODAzNjgwNjA0MzkwMzk1NTswNA==",
        "approvalCode": "",
        "providerTransactionCode": "7017308036806043903955",
        "approved": true
    },
    "referenceNumber": "023120416595269285584",
    "success": true,
    "error": "",
    "message": "",
    "thirdPartyStatusCode": "201"
}
{
    "gatewayResponse": {
        "gatewayErrors": [
            "401:{\"response\":{\"rmsg\":\"Authentication Failed\"}}"
        ],
        "tokenExTransactionCode": "",
        "approvalCode": "",
        "providerTransactionCode": "",
        "approved": false
    },
    "referenceNumber": "23120815533310510482",
    "success": true,
    "error": "",
    "message": "",
    "thirdPartyStatusCode": "401"
}
{
    "gatewayResponse": {
        "rawResponse": "{\"_links\":{\"self\":{\"href\":\"/pts/v2/payments/7020728313446251704951\",\"method\":\"GET\"}},\"id\":\"7020728313446251704951\",\"status\":\"DECLINED\",\"errorInformation\":{\"reason\":\"PROCESSOR_DECLINED\",\"message\":\"Decline - General decline of the card. No other information provided by the issuing bank.\"},\"clientReferenceInformation\":{\"code\":\"1702072831400\"},\"processorInformation\":{\"transactionId\":\"123456789619999\",\"networkTransactionId\":\"123456789619999\",\"responseCode\":\"303\",\"avs\":{\"code\":\"X\",\"codeRaw\":\"I1\"}},\"pointOfSaleInformation\":{\"terminalId\":\"111111\"}}",
        "gatewayErrors": [
            "PROCESSOR_DECLINED",
            "Decline - General decline of the card. No other information provided by the issuing bank."
        ],
        "tokenExTransactionCode": "",
        "approvalCode": "",
        "providerTransactionCode": "7020728313446251704951",
        "approved": false
    },
    "referenceNumber": "23120816003074893324",
    "success": true,
    "error": "",
    "message": "",
    "thirdPartyStatusCode": "201"
}