Skip to main content

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

ActionProductionSandbox
Card Authorize, Card Purchase, Check Purchasehttps://api.cybersource.com/pts/v2/paymentshttps://apitest.cybersource.com/pts/v2/payments
Card Capturehttps://api.cybersource.com/pts/v2/payments/{id}/captureshttps://apitest.cybersource.com/pts/v2/payments/{id}/captures
Card Refund, Check Refundhttps://api.cybersource.com/pts/v2/payments/{id}/refundshttps://apitest.cybersource.com/pts/v2/payments/{id}/refunds
Card Void, Check Voidhttps://api.cybersource.com/pts/v2/captures/{id}/voidshttps://apitest.cybersource.com/pts/v2/captures/{id}/voids

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
declineAvsFlagslist<string>AuthorizationOptions.​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"
}

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"
}