> ## 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.

# Complete a Checkout

> Initiate order payment capture if `merchant_completes` was `true` at Create Checkout.
An example use-case is if users need to return to the merchant's site before finalizing the purchase with Sezzle.
Submit the Complete Checkout request within 30 minutes after the user is redirected to the merchant's site. Failure to do so results in Sezzle canceling the checkout.
The default expiration period for new orders can be extended up to 7 days via the Merchant Dashboard.


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


## OpenAPI

````yaml post /v1/checkouts/{order_reference_id}/complete
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/{order_reference_id}/complete:
    post:
      tags:
        - v1
        - Orders
      summary: Complete a Checkout
      description: >
        Initiate order payment capture if `merchant_completes` was `true` at
        Create Checkout.

        An example use-case is if users need to return to the merchant's site
        before finalizing the purchase with Sezzle.

        Submit the Complete Checkout request within 30 minutes after the user is
        redirected to the merchant's site. Failure to do so results in Sezzle
        canceling the checkout.

        The default expiration period for new orders can be extended up to 7
        days via the Merchant Dashboard.
      operationId: post-checkout-complete-v1
      parameters:
        - name: order_reference_id
          in: path
          description: The Order Reference ID to update
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  amount_in_cents:
                    type: number
                    description: The order total amount in cents
                  currency_code:
                    type: string
                    description: The 3 character currency code as defined by ISO 4217
                  order_description:
                    type: string
                    description: Your description for this order
                  order_reference_id:
                    type: string
                    description: >-
                      The checkout or cart ID from the merchant, currently used
                      for tracking only (must contain only alphanumeric
                      characters, dashes (-), and underscores (_))
                  display_order_reference_id:
                    type: string
                    description: ''
                  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:
                    type: object
                    description: The customer's basic contact information
                    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
                  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
                  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`.
              example:
                amount_in_cents: 12999
                currency_code: USD
                order_description: 'Order #1800'
                order_reference_id: ord_12345
                display_order_reference_id: ord_12345
                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 West Lake street
                  street2: '104'
                  city: Minneapolis
                  state: MN
                  postal_code: '55408'
                  country_code: US
                shipping_address:
                  name: John Doe
                  street: 123 West Lake street
                  street2: '104'
                  city: Minneapolis
                  state: MN
                  postal_code: '55408'
                  country_code: US
                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
                merchant_completes: true
        '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
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    description: the HTTP response code
                  id:
                    type: string
                    description: General error category
                  message:
                    type: string
                    description: A more specific error message
              example:
                status: 409
                id: checkout_expired
                message: checkout not completed within time limit
        '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
    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
    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

````