Checkout

Store

Initiate an Affirm checkout directly with your customers.

post/checkout/store

Request

  • Base URL
    https://sandbox.affirm.com/api/v2
  • URL
    https://sandbox.affirm.com/api/v2/checkout/store
  • Auth
    HTTP basic

Request body

totalinteger

The total amount in cents of the purchase.

order_idstring

The merchant id for this order.

tax_amountinteger

The shipping tax amount.

shipping_amountinteger

The amount to ship the item.

itemsobject

An array of items based on the cart contents.

discountsobject

An array of discount codes based on the merchant.

financing_programstring

The applicable Affirm financing program.

checkout_expirationstring

A date-timestamp of when the checkout_id will expire.

Example request

{
  "billing": {
    "phone_number": "1234567890",
    "email": "test@example.com",
    "address": {
      "city": "San Francisco",
      "country": "USA",
      "line1": "123 Example Street",
      "line2": "Apt 123",
      "state": "CA",
      "zipcode": "94107"
    }
  },
  "total": 20000,
  "order_id": "A1B2C3D4",
  "tax_amount": 700,
  "shipping_amount": 400,
  "shipping": {
    "name": {
      "full": "John Doe",
      "first": "John",
      "last": "Doe"
    },
    "address": {
      "city": "San Francisco",
      "country": "USA",
      "line1": "123 Example Street",
      "line2": "Apt 123",
      "state": "CA",
      "zipcode": "94107"
    },
    "email": "test@example.com",
    "phone_number": "1234567890"
  }
}

Response

HTTP 200 OK

redirect_urlstring

URL the consumer should be directed to in order to complete their loan.

checkout_idstring

Specific Checkout ID for the related request. This ID is embedded in the redirect_url.

Example response

{
  "redirect_url": "https://affirm.com/checkout/ARQBLCL7NAMBTZ7F/new/HTSZAGURU7PZ8ZAG/",
  "checkout_id": "HTSZAGURU7PZ8ZAG"
}

Changes

No recorded changes to this operation across all 1 revision of this API.