Shipping & Billing Objects

Any checkout object includes a shipping object and/or the billing object. Both objects have the same format. It also includes the address and name objects.

๐Ÿ“˜

Importance of Shipping and Billing Addresses

Providing Affirm with customer shipping and billing addresses improves credit approval and fraud prevention. To learn more, read here.

Attributes

AttributeData typeDescription
nameobjectSee details.
addressobjectSee details. Validated against public address service.
phone_numberstringThe user's phone number.
emailstringThe user's email address.
{
   "name":{
      "first":"John",
      "last":"Doe",
      "full":"John Doe"
   },
   "address":{
      "line1":"325 Pacific Ave",
      "city":"San Francisco",
      "state":"CA",
      "zipcode":"94111",
      "country":"US"
   },
   "phone_number":"4151234567",
   "email":"[email protected]"
}
"billing":{
       "name":{
         "first":"John",
         "last":"Doe"
         // You can include the full name instead
         // "full" : "John Doe"
       },
       "address":{
         "line1":"325 Pacific Ave",
         "city":"San Francisco",
         "state":"CA",
         "zipcode":"94111",
         "country":"USA"
       }
       "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ย does not pre-populate 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 provides us, we'll show clear error messaging to them.

If you are concerned that doing phone number validationย will cause implementation difficulties for you or lengthen your development timeline, we would recommend you do 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 they have 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.