Every card object includes the billing object. It also includes the address and name objects.

Attributs

AttributType de donnéesDescription
nameobjetVoir les détails.
addressobjetSee details. Validated against public address service.
phone_numberstringThe user's phone number.
CourrielstringThe user's email address.
{
   "name":{
      "first":"John",
      "last":"Doe",
      "full":"John Doe"
   },
   "address":{
      "street1": "4519 Rue Levy",
      	 "street2": "Apt 1",
      	 "city": "Saint-Laurent",
      	 "region1_code": "QC",
      	 "postal_code": "H4R2P9",
     		 "country_code": "CAN"
   },
   "phone_number":"4151234567",
   "email":"[email protected]"
}
"billing":{
       "name":{
         "first":"John",
         "last":"Doe"
         // You can include the full name instead
         // "full" : "John Doe"
       },
       "address":{
         	"street1": "4519 Rue Levy",
      	 		 "street2": "Apt 1",
      	 		 "city": "Saint-Laurent",
      	 		 "region1_code": "QC",
      	 		 "postal_code": "H4R2P9",
     		 		 "country": "CAN"
       }
       "phone_number": "4151234567",
       "email": "[email protected]"
     }

Phone Number Validation

The phone_number field is an optional field nested inside the contact object within the checkout object you submit to Affirm in order to initiate an Affirm-hosted checkout session. To reduce errors and confusion, Affirm doesn't prepopulate the phone number from the checkout request in our customer-facing checkout application. This way, the customer enters their phone number directly on the Affirm application, and, if there are any issues with the number the customer provide us, we'll show clear error messaging to him/her.

If you're concerned that doing phone number validation will cause implementation headaches for you or lengthen your development timeline, we'd recommend you simply not send Affirm this field in your checkout requests.

Validation Process

If you wish to provide the phone_number field to Affirm in your checkout requests, before allowing the customer to initiate the checkout request to Affirm, you should ensure that he/she has provided you with a valid US mobile phone number. Affirm has built in-house technology to validate phone numbers, taking the phonenumbers Python library as one of our starting points. Therefore, we recommend using the built-in functionality of this or another implementation of Google's libphonenumber library and providing customers with clear steps to rectify the issue if they submit invalid phone numbers to you.