Skip to main content

Merchant Help

 

Affirm Merchant Help

Retrieve Card Details

Card details request format

POST /api/v2/card/

This returns the virtual card details associated with the card_token that was passed in the request body. Once the card details are returned, the card can be authorized through your usual card gateway.

Card details request

 

curl https://sandbox.affirm.com/api/v2/card/
     -X POST
     -u "(public_api_key):(private_api_key)"
     -H "Content-Type: application/json"
     -d '{"card_token": "ARZBLCL7NAMBTZ2D"}'
Data
card_token
required string. The card token that was returned from the checkout success callback event data.

 

Card details response object

{
   billing_address: Object,
   callback_id:"0cd3bcb1-8592-4ebf-a8cd-08816fbe266a",
   cardholder_name:"John James Doe",
   card_token:"1L7Y0UV4IR8LIA9G",
   created:"2016-04-04T14:24:06.386576Z",
   cvv:"123",
   expiration:"0719",
   id:"1L7Y0UV4IR8LIA9G",
   number:"41111111111111111"
}
billing address
object. This object can be ignored, as you will always be using the customer's billing (if provided) or shipping address.
callback_id
string. Can be ignored, for Affirm internal use.
cardholder_name
string. Can be ignored, since you will always be using the customer's name.
card_token
string.  The card token that these card details correspond to.
created
string. Timestamp of when the card was generated.
cvv
string. The CVV verification code for the card.
expiration
string. A four-digit expiration date in MMYY format.
id
string. Can be ignored, the transaction ID for this API event.
number
string. The debit card number. This can be set to your payment gateway's test card number when using Affirm's sandbox environment.

Example card details request

VCN Server Card request details

Example card details response

{
   billing_address: Object,
   callback_id:"0cd3bcb1-8592-4ebf-a8cd-08816fbe266a",
   cardholder_name:"John James Doe",
   card_token:"1L7Y0UV4IR8LIA9G",
   created:"2016-04-04T14:24:06.386576Z",
   cvv:"123",
   expiration:"0719",
   id:"1L7Y0UV4IR8LIA9G",
   number:"41111111111111111"
}