Payment flow with Credit Cards
Overview
The following payment methods are supported for the Credit/debit cards with 3DS flow: Visa, Visa Electron, Mastercard, Maestro, American Express, JCB, Discover, UnionPay, Dankort.
While 3DS related fields were not mandatory for the previous API versions, they are required starting with API 6.0 to fully support the regulations brought by PSD2 and SCA.
We always recommend using the latest version of the API in order to benefit from the latest functionalities and best performance.
Availability
Available for all 2Checkout accounts.
Requirements
In order to be able to place orders with credit/debit cards via API, merchants fall under the requirements of the Payment Card Industry' Security Standard Council and are required to provide proof of attestation for an SAQ-D questionnaire before activation of this feature.
If you want to use the 2Checkout API, please contact 2Checkout for activation.
Payment method object structure
Field name | Type | Required/Optional | Description |
---|---|---|---|
CardNumber |
String |
Required |
The number of credit/debit cards. |
CardType |
String |
Optional |
Can be: Visa, Visa electron, Mastercard, Maestro, Amex, Discover, Dankort, Carte bancaire, JCB, Hypercard, Elo card. |
ExpirationYear |
String |
Required |
Card expiration year. |
ExpirationMonth |
String |
Required |
Card expiration month. |
CCID |
String |
Required |
The CVV/card security code. |
HolderName |
String |
Required |
Cardholder name. |
Vendor3DSReturnURL |
String |
Required |
URL address to which customers are redirected after the 3DS details get validated by the bank and the order is successfully authorized. |
Vendor3DSCancelURL |
String |
Required |
URL address to which customers are redirected if the 3DS details were not validated or the order could not be authorized. |
RecurringEnabled |
Boolean |
Optional |
true or false, depending on whether the shoppers checked the subscription auto-renewal checkbox or not, during the purchase process. |
Request example
The full JSON used to place an order with credit cards would look like this:
{
"Items": [
{
"Code": "5DCB30C6B0",
"Quantity": 1
}
],
"BillingDetails": {
"Email": "example@email.com",
"FirstName": "Customer First Name",
"LastName": "Customer Last Name",
"CountryCode": "US",
"State": "California",
"City": "San Francisco",
"Address1": "Example Street",
"Zip": "90210"
},
"PaymentDetails": {
"Type": "CC",
"Currency": "USD",
"CustomerIP": "10.10.10.10",
"PaymentMethod": {
"CardNumber": "4111111111111111",
"CardType": "VISA",
"ExpirationYear": "2023",
"ExpirationMonth": "12",
"HolderName": "Red Doe",
"CCID": "123",
"Vendor3DSReturnURL": "http://yoursuccessurl.com",
"Vendor3DSCancelURL": "http://yourcancelurl.com"
}
},
"Language": "en",
"Country": "US",
"CustomerIP": "10.10.10.10",
"Source": "Website",
"ExternalCustomerReference": "externalCustomerId",
"Currency": "USD",
"MachineId": "123456789"
}
The API will respond with the full order object (for orders placed successfully) or with an error message.
3D Secure Flow
For more information on the 3DS flow please refer to this article.