The Checkout Object

The checkout object is the data payload that contains information about the customer's order. It is POSTed to the Affirm API to initialize Affirm checkout.

Attributs

Attribut

Type de données

Description

commerçant Obligatoire

objet

Merchant specific information. See merchant details.

shipping\ required*

objet

The shipping details. Note: Shipping is not required if the merchant is not shipping goods for the given transaction.

facturation

objet

The billing details.

items\ required

tableau

Un tableau d'élément.

discounts

objet

A list of discounts. Each discount must have their discount code.

métadonnées

objet

See metadata details.

order_id

string

ID de commande du commerçant. Ceci est stocké à des fins de référence ultérieure.

currency\ required

string

Three-letter ISO currency code in uppercase.

Possible values:

  • USD
  • CAD
  • GBP

financing_program

string

Un programme de financement appliqué à ce paiement.

montant_expédition

integer

The total shipping amount in cents. A positive integer representing how much, in USD or CAD cents (e.g., 100 cents to charge $1.00).

tax_amount

integer

The total tax amount in cents. A positive integer representing how much, in USD or CAD cents (e.g., 100 cents to charge $1.00).

total\ required

integer

The total amount of the checkout in USD or CAD cents (e.g., 100 cents to charge $1.00).

checkout_expiration

Horodatage

A date-timestamp of when the checkout_id will expire. - ISO timestamp format - No milliseconds

expiration_time

Horodatage

If set, this defines a time-to-live (TTL) deadline for the checkout. The checkout must be confirmed before this timestamp. Any confirmation attempt after the TTL expires will be rejected.

{
   "merchant":{
      "user_confirmation_url":"https://merchantsite.com/confirm",
      "user_cancel_url":"https://merchantsite.com/cancel",
      "user_confirmation_url_action":"POST",
      "use_vcn": false,
      "name":"Your Customer-Facing Merchant Name"
   },
   "shipping":{
      "name":{
         "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":"4155555555",
      "email":"[email protected]"
   },
   "billing":{
      "name":{
         "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":"4155555555",
      "email":"[email protected]"
   },
   "items":[
      {
         "display_name":"Awesome Pants",
         "sku":"ABC-123",
         "unit_price":1999,
         "qty":3,
         "item_image_url":"http://merchantsite.com/images/awesome-pants.jpg",
         "item_url":"http://merchantsite.com/products/awesome-pants.html"
      }
   ],
   "discounts":{
      "RETURN5":{
         "discount_amount":500,
         "discount_display_name":"Returning customer 5% discount"
      },
      "PRESDAY10":{
         "discount_amount":1000,
         "discount_display_name":"President's Day 10% off"
      }
   },
   "metadata":{
      "shipping_type":"UPS Ground",
      "mode":"modal"
   },
   "order_id":"JKLMO4321",
   "currency":"CAD",  
   "financing_program":"flyus_3z6r12r",
   "shipping_amount":1000,
   "tax_amount":500,
   "total":5997
}