---
updatedAt: 2026-03-04T18:56:44.000Z
agentTools:
  siteIndex: https://docs.affirm.com/llms.txt
  projectIndex: https://docs.affirm.com/developers/llms.txt
---

# Direct

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

For the global Direct endpoint, see the <Anchor label="Direct Checkout (Global) page" target="_blank" href="https://docs.affirm.com/developers/v1.0-Global-Integration/reference/direct-1">Direct Checkout (Global) page</Anchor>.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Checkout API",
    "version": "2.0"
  },
  "security": [
    {
      "basicAuth": []
    }
  ],
  "paths": {
    "/checkout/direct": {
      "post": {
        "tags": [
          "Checkout"
        ],
        "operationId": "Direct",
        "summary": "Direct",
        "description": "Generate a redirect checkout link on the fly.  Manage and share communications with your customers with your own infrastructure.",
        "requestBody": {
          "description": "Returns the `checkout` object.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DirectRequest",
                "description": "Returns the `checkout` object."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "HTTP 200 OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Store"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400 Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401 Unauthorized",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorUnauthorized"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404 Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorNotFound"
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://sandbox.affirm.com/api/v2"
    },
    {
      "url": "https://api.affirm.com/api/v2"
    }
  ],
  "components": {
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    },
    "schemas": {
      "ErrorBadRequest": {
        "properties": {
          "message": {
            "description": "The error message.",
            "example": "Bad Request",
            "type": "string"
          },
          "status_code": {
            "description": "The HTTP status code.",
            "example": 400,
            "type": "integer"
          },
          "type": {
            "description": "The error type.",
            "example": "BAD_REQUEST",
            "type": "string"
          },
          "code": {
            "description": "The error type.",
            "example": "BAD_REQUEST",
            "type": "string"
          }
        }
      },
      "ErrorNotFound": {
        "properties": {
          "message": {
            "description": "The error message.",
            "example": "Not Found",
            "type": "string"
          },
          "status_code": {
            "description": "The HTTP status code.",
            "example": 404,
            "type": "integer"
          },
          "type": {
            "description": "The error type.",
            "example": "NOT_FOUND",
            "type": "string"
          },
          "code": {
            "description": "The error type.",
            "example": "NOT_FOUND",
            "type": "string"
          },
          "token": {
            "description": "The error response embedded in a JWT token",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ErrorUnauthorized": {
        "properties": {
          "message": {
            "description": "The error message.",
            "example": "Unauthorized",
            "type": "string"
          },
          "status_code": {
            "description": "The HTTP status code.",
            "example": 401,
            "type": "integer"
          },
          "type": {
            "description": "The error type.",
            "example": "UNAUTHORIZED",
            "type": "string"
          },
          "code": {
            "description": "The error type.",
            "example": "UNAUTHORIZED",
            "type": "string"
          },
          "token": {
            "description": "The error response embedded in a JWT token",
            "type": "string"
          }
        },
        "type": "object"
      },
      "DirectRequest": {
        "type": "object",
        "required": [
          "merchant"
        ],
        "properties": {
          "merchant": {
            "type": "object",
            "description": "A list of items specific to the merchant.",
            "required": [
              "public_api_key",
              "user_cancel_url",
              "user_confirmation_url"
            ],
            "properties": {
              "public_api_key": {
                "type": "string",
                "description": "The merchant's public api key."
              },
              "user_cancel_url": {
                "type": "string",
                "description": "On customer cancellation redirect them to this merchant URL."
              },
              "user_confirmation_url": {
                "type": "string",
                "description": "On customer confirmation redirect them to this merchant URL."
              },
              "user_confirmation_url_action": {
                "description": "Supported values -'GET' -'POST'",
                "type": "string"
              },
              "name": {
                "type": "string",
                "description": "If you have multiple sites operating under a single Affirm account, you can override the external company/brand name that the customer sees. This affects all references to your company name in the Affirm UI."
              },
              "use_vcn": {
                "type": "boolean",
                "description": "A flag to enable virtual card integration (default is 'false')."
              }
            }
          },
          "billing": {
            "type": "object",
            "required": [
              "billing"
            ],
            "description": "The customer billing information.",
            "properties": {
              "name": {
                "type": "object",
                "properties": {
                  "first": {
                    "description": "The first name of the customer.",
                    "type": "string"
                  },
                  "full": {
                    "description": "The full name of the customer, which must contain at least two words.",
                    "type": "string"
                  },
                  "last": {
                    "description": "The last name of the customer.",
                    "type": "string"
                  }
                },
                "nullable": true
              },
              "address": {
                "type": "object",
                "properties": {
                  "city": {
                    "description": "The name of the city.",
                    "example": "San Francisco",
                    "type": "string"
                  },
                  "country": {
                    "description": "The abbreviated name of the country.",
                    "example": "USA",
                    "type": "string"
                  },
                  "line1": {
                    "description": "A U.S. street address.",
                    "example": "123 Example Street",
                    "type": "string"
                  },
                  "line2": {
                    "description": "The apartment number, floor or suite that complements the street address.",
                    "example": "Apt 123",
                    "type": "string"
                  },
                  "state": {
                    "description": "The 2-letter postal abbreviation or full name of the U.S. state.",
                    "example": "CA",
                    "type": "string"
                  },
                  "zipcode": {
                    "description": "The 5-digit postal code of the address.",
                    "example": "94107",
                    "type": "string"
                  }
                }
              },
              "phone_number": {
                "description": "The phone number of the customer. It must be a valid U.S. phone number represented as a 10-digit string without any delimiters.",
                "example": "1234567890",
                "type": "string",
                "nullable": true
              },
              "email": {
                "description": "The email address of the customer.",
                "example": "test@example.com",
                "type": "string",
                "nullable": true
              }
            }
          },
          "total": {
            "required": [
              "total"
            ],
            "description": "The total amount in cents of the purchase.",
            "example": 20000,
            "type": "integer"
          },
          "order_id": {
            "description": "The merchant id for this order.",
            "example": "A1B2C3D4",
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          },
          "tax_amount": {
            "description": "The shipping tax amount.",
            "example": 700,
            "type": "integer"
          },
          "shipping": {
            "description": "The shipping information. Required for scenarios where goods are shipped.",
            "required": [
              "shipping"
            ],
            "type": "object",
            "properties": {
              "name": {
                "type": "object",
                "properties": {
                  "full": {
                    "required": [
                      "full"
                    ],
                    "description": "The customer's name.",
                    "example": "John Doe",
                    "type": "string"
                  },
                  "first": {
                    "description": "The customer's first name.",
                    "example": "John",
                    "type": "string"
                  },
                  "last": {
                    "description": "The customer's last name.",
                    "example": "Doe",
                    "type": "string"
                  }
                }
              },
              "address": {
                "type": "object",
                "properties": {
                  "city": {
                    "description": "The name of the city.",
                    "example": "San Francisco",
                    "type": "string"
                  },
                  "country": {
                    "description": "The abbreviated name of the country.",
                    "example": "USA",
                    "type": "string"
                  },
                  "line1": {
                    "description": "A U.S. street address.",
                    "example": "123 Example Street",
                    "type": "string"
                  },
                  "line2": {
                    "description": "The apartment number, floor or suite that complements the street address.",
                    "example": "Apt 123",
                    "type": "string"
                  },
                  "state": {
                    "description": "The 2-letter postal abbreviation or full name of the U.S. state.",
                    "example": "CA",
                    "type": "string"
                  },
                  "zipcode": {
                    "description": "The 5-digit postal code of the address.",
                    "example": "94107",
                    "type": "string"
                  }
                }
              },
              "email": {
                "description": "The email address of the customer.",
                "example": "test@example.com",
                "type": "string",
                "nullable": true
              },
              "phone_number": {
                "description": "The phone number of the customer.  It must be a valid U.S. phone number represented as a 10-digit string without any delimiters.",
                "example": "1234567890",
                "type": "string",
                "nullable": true
              }
            }
          }
        }
      },
      "Store": {
        "type": "object",
        "properties": {
          "redirect_url": {
            "description": "URL the consumer should be directed to in order to complete their loan.",
            "example": "https://affirm.com/checkout/ARQBLCL7NAMBTZ7F/new/HTSZAGURU7PZ8ZAG/",
            "type": "string"
          },
          "checkout_id": {
            "description": "Specific Checkout ID for the related request. This ID is embedded in the redirect_url.",
            "example": "HTSZAGURU7PZ8ZAG",
            "type": "string"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```

# Sibling pages

* [Read Checkout](https://docs.affirm.com/developers/reference/read_checkout-1.md)
* [Store](https://docs.affirm.com/developers/reference/store-1.md)
* [Update Checkout](https://docs.affirm.com/developers/reference/update_checkout-1.md)
* [Resend Checkout](https://docs.affirm.com/developers/reference/resend_checkout-1.md)