> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sezzle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Checkout

> Initiate a Sezzle session with shopper order details, redirect links, and capture settings

<Danger>
  You are viewing Version 1 of the Sezzle API. Check out the [current version](/docs/api/intro)!
</Danger>


## OpenAPI

````yaml post /v1/checkouts
openapi: 3.1.0
info:
  title: Sezzle API v2
  description: >-
    This Sezzle API is for merchants who want to accept Sezzle as a payment
    option
  termsOfService: https://legal.sezzle.com
  version: 2.0.0
  x-logo:
    url: https://media.sezzle.com/branding/2.0/png/Logo_WhiteWordmark_500x126.png
    backgroundColor: '#392558'
servers:
  - url: https://sandbox.gateway.sezzle.com
    description: development server, usa, ca
  - url: https://gateway.sezzle.com
    description: production server, usa, ca
security:
  - Bearer: []
externalDocs:
  description: Sezzle API guides and tutorials
  url: https://docs.sezzle.com/sezzle-integration
paths:
  /v1/checkouts:
    post:
      tags:
        - v1
        - Session
      summary: Create a Checkout
      description: >-
        Initiate a Sezzle session with shopper order details, redirect links,
        and capture settings
      operationId: post-checkout-v1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amount_in_cents
                - currency_code
                - order_reference_id
                - order_description
                - checkout_cancel_url
                - checkout_complete_url
              properties:
                amount_in_cents:
                  type: string
                  description: >-
                    The total order amount in cents, which must be at least 100
                    which is $1.00. Please note your merchant configuration
                    might have a higher minimum.
                currency_code:
                  type: string
                  description: The 3 character currency code as defined by ISO 4217
                order_reference_id:
                  type: string
                  description: >-
                    Your reference ID for this order (must contain only
                    alphanumeric characters, dashes (-), and underscores (_))
                order_description:
                  type: string
                  description: A user-facing description for this checkout
                checkout_cancel_url:
                  type: string
                  description: >-
                    The HTTP request information used to redirect the customer
                    in the case of a cancellation
                checkout_complete_url:
                  type: string
                  description: >-
                    The HTTP request information used to redirect the customer
                    upon completion of the session
                customer_details:
                  type: object
                  description: >-
                    Customer details for this session. To optimize checkout and
                    boost conversion, it is recommended to include as much
                    customer information as possible.
                  properties:
                    first_name:
                      type: string
                      description: The customer's first name
                    last_name:
                      type: string
                      description: The customer's last name
                    email:
                      type: string
                      description: The customer's email address
                    phone:
                      type: string
                      description: The customer's phone number
                billing_address:
                  $ref: '#/components/schemas/AddressV1'
                  description: The customer's billing address
                shipping_address:
                  $ref: '#/components/schemas/AddressV1'
                  description: The customer's shipping address
                requires_shipping_info:
                  type: boolean
                  description: >-
                    Flag to indicate if you would like us to collect shipping
                    information for this checkout from the customer. If omitted,
                    defaults to false.
                items:
                  type: array
                  description: The items being purchased
                  items:
                    $ref: '#/components/schemas/LineItemBasic'
                discounts:
                  type: array
                  description: >-
                    The discounts applied to this order. Must be included in
                    total
                  items:
                    $ref: '#/components/schemas/Discount'
                tax_amount:
                  $ref: '#/components/schemas/Price'
                  description: >-
                    The taxes applied to this order. Must be included in the
                    total
                shipping_amount:
                  $ref: '#/components/schemas/Price'
                  description: >-
                    The shipping fees applied to this order. Must be included in
                    the total
                metadata:
                  type: object
                  description: >-
                    Object for any custom data you want to submit with the
                    checkout. You are not limited to the key-value pairs shown
                    in the example, and you may use any key-value pairs you like
                  properties:
                    any:
                      type: string
                      description: Custom metadata field
                merchant_completes:
                  type: boolean
                  description: >-
                    If your checkout flow requires the user to confirm their
                    checkout on your site after being approved by Sezzle, use
                    `true` to only authorize the payment. If you prefer the
                    checkout be captured immediately, use `false`. Defaults to
                    false.
                send_checkout_url:
                  $ref: '#/components/schemas/Notification'
                  description: >-
                    A Notification object for sending checkout URL to the
                    customer
                locale:
                  type: string
                  description: Localizes the checkout. Defaults to `en-US`.
                  enum:
                    - en-US
                    - en-CA
                    - fr-CA
            example:
              amount_in_cents: 12999
              currency_code: USD
              order_reference_id: ord_12345
              order_description: Some description
              checkout_cancel_url: https://sezzle.com/cart
              checkout_complete_url: https://sezzle.com/complete
              customer_details:
                first_name: John
                last_name: Doe
                email: john.doe@sezzle.com
                phone: '8885401867'
              billing_address:
                name: John Doe
                street: 123 W Lake St
                street2: Unit 104
                city: Minneapolis
                state: MN
                postal_code: '55408'
                country_code: US
                phone_number: '8885401867'
              shipping_address:
                name: John Doe
                street: 123 W Lake St
                street2: Unit 104
                city: Minneapolis
                state: MN
                postal_code: '55408'
                country_code: US
                phone_number: '8885401867'
              requires_shipping_info: false
              items:
                - name: widget
                  sku: sku123456
                  quantity: 1
                  price:
                    amount_in_cents: 1000
                    currency: USD
              discounts:
                - name: 20% off
                  amount:
                    amount_in_cents: 1000
                    currency: USD
              tax_amount:
                amount_in_cents: 1000
                currency: USD
              shipping_amount:
                amount_in_cents: 1000
                currency: USD
              metadata:
                location_id: '123'
                store_name: Downtown Minneapolis
                store_manager: Jane Doe
              merchant_completes: true
      responses:
        '201':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  checkout_uuid:
                    type: string
                    description: The unique identifier for this response
                  checkout_url:
                    type: string
                    description: >-
                      The URL to which the shopper should be directed to
                      complete their order with Sezzle
              example:
                checkout_uuid: 9dcb4d9f-ac09-4578-abf8-611128903611
                checkout_url: >-
                  https://sandbox.checkout.sezzle.com?id=9dcb4d9f-ac09-4578-abf8-611128903611
        '400':
          $ref: '#/components/responses/BadRequestV1'
          example:
            status: 400
            id: bad_request
            message: bad request
        '401':
          $ref: '#/components/responses/UnauthorizedV1'
          example:
            status: 401
            id: Unauthorized
            message: authorization not accepted
        '404':
          $ref: '#/components/responses/NotFoundV1'
          example:
            status: 404
            id: invalid
            message: not found
        '422':
          $ref: '#/components/responses/UnprocessableV1'
          example:
            status: 422
            id: invalid
            message: Unprocessable entity
components:
  schemas:
    AddressV1:
      allOf:
        - $ref: '#/components/schemas/Address'
        - type: object
          properties:
            phone_number:
              type: string
              description: The phone number at the delivery location
    LineItemBasic:
      type: object
      description: >-
        Merchants who are in the Sports & Hobbies or Hunting & Fishing
        categories must define a category_path for each item in the order.
        Please talk with your account manager for further details.
      properties:
        name:
          type: string
          description: The name of the item
        sku:
          type: string
          description: The sku identifier
        quantity:
          type: integer
          description: The quantity purchased
        price:
          $ref: '#/components/schemas/Price'
          description: The price of the product before tax and discounts
        category_path:
          type: string
          description: >-
            The category path where the product is located. Use `>` only as the
            category delimiter, not as part of a product or category name.
            Example: Camping Gear & Supplies > Tents & Shelters.
    Discount:
      type: object
      properties:
        name:
          type: string
          description: The description of the discount
        amount:
          $ref: '#/components/schemas/Price'
          description: A price object
    Price:
      allOf:
        - $ref: '#/components/schemas/PriceBase'
        - type: object
          required:
            - amount_in_cents
            - currency
    Notification:
      type: object
      properties:
        to_sms_phone:
          type: string
          description: The SMS phone number of the notification
        to_email:
          type: string
          description: The email address of the notification
        language:
          $ref: '#/components/schemas/Language'
    Address:
      type: object
      properties:
        name:
          type: string
          description: The name on the address
        street:
          type: string
          description: The street and number of the address
        street2:
          type: string
          description: The apt or unit
        city:
          type: string
          description: The city
        state:
          type: string
          description: The 2 character state code
        postal_code:
          type: string
          description: The postal delivery code
        country_code:
          type: string
          description: The 2 character country code
    PriceBase:
      type: object
      properties:
        amount_in_cents:
          type: integer
          description: The amount in cents
        currency:
          type: string
          description: The 3 character currency code as defined by ISO 4217
    Language:
      type: string
      description: >-
        The 2-character ISO 639 langauge code of the notification. Acceptable
        values are en and fr-CA. Will default to English if not provided.
      enum:
        - en
        - fr-CA
    ErrorV1:
      type: object
      properties:
        status:
          type: number
          description: Matches the HTTP Status code of the response
        id:
          type: string
          description: >-
            A programmatic identifier for the error. These rarely (if at all)
            change.
        message:
          type: string
          description: >-
            A human-friendly string. These may change, and are intended to
            assist in debugging rather than program logic.
  responses:
    BadRequestV1:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorV1'
          example:
            status: 400
            id: bad_request
            message: bad request
    UnauthorizedV1:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorV1'
          example:
            status: 401
            id: unauthorized
            message: authorization not accepted
    NotFoundV1:
      description: The specified resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorV1'
          example:
            status: 404
            id: record_not_found
            message: not found
    UnprocessableV1:
      description: Unable to process the request entity
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorV1'
          example:
            status: 422
            id: invalid
            message: Unprocessable entity
  securitySchemes:
    Bearer:
      type: apiKey
      name: Authorization
      in: header
      description: >-
        The authentication token generated from providing API Keys to Sezzle
        Gateway

````