Checkout

Direct

Generate a redirect checkout link on the fly. Manage and share communications with your customers with your own infrastructure.

post/checkout/direct

Request

  • Base URL
    https://sandbox.affirm.com/api/v2
  • URL
    https://sandbox.affirm.com/api/v2/checkout/direct
  • 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.

Example request

{
  "billing": {
    "address": {
      "city": "San Francisco",
      "country": "USA",
      "line1": "123 Example Street",
      "line2": "Apt 123",
      "state": "CA",
      "zipcode": "94107"
    },
    "phone_number": "1234567890",
    "email": "test@example.com"
  },
  "total": 20000,
  "order_id": "A1B2C3D4",
  "tax_amount": 700,
  "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.