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

# Setting Your Configuration

> Configure webhook URL

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

## Webhooks

### Order Webhooks

* Sezzle handles most of the consumer checkout process on its pages, using webhooks to notify your system about:
  * Checkout updates
  * Completions
  * Refunds
* Use the instructions in this page to subscribe to Webhooks
* When a webhook event occurs, Sezzle will send the below Webhook object to the URL provided in the configuration

### Order Webhook Object

<Tabs>
  <Tab title="Template">
    ```json theme={"system"}
    {
      "time": string,
      "uuid": string,
      "type": string,
      "event": string,
      "object_uuid": string,
      "refund_id": string,
      "refund_amount": {
            "amount_in_cents": number,
            "currency": string
        }
    }
    ```
  </Tab>

  <Tab title="Example">
    ```json theme={"system"}
    {
      "time": "2017-10-19T00:33:10.548372055Z",
      "uuid": "02c5a2a0-8394-4b45-80b3-52d40c494322",
      "type": "order_update",
      "event": "order_complete",
      "object_uuid": "Ref123456789",
      "refund_id": "szl-a0293Pn-3948-80b3-ao34JAia39zQ",
      "refund_amount": {
            "amount_in_cents": 500,
            "currency": "USD"
        }
    }
    ```
  </Tab>

  <Tab title="Options">
    <ParamField path="time" type="string">
      The time (UTC) at which the Webhook was generated.
    </ParamField>

    <ParamField path="uuid" type="string">
      A unique identifier for the webhook.
    </ParamField>

    <ParamField path="type" type="string">
      The high-level category.

      Available options: `order_update` (coming soon)
    </ParamField>

    <ParamField path="event" type="string">
      The ID for the Checkout/Order.

      Available options: `order_complete`, `order_refund`
    </ParamField>

    <ParamField path="object_uuid" type="string">
      The ID for the Checkout/Order. For order update webhooks, the `object_uuid` returned is the reference ID provided during checkout creation by the merchant
    </ParamField>

    <ParamField path="refund_id" type="string">
      Unique ID for a refund. Included if the webhook event is order\_refund
    </ParamField>

    <ParamField path="refund_amount" type="object">
      Price object. Included if the webhook event is order\_refund.

      <Expandable title="child attributes">
        <ParamField path="price" type="number">
          The amount in cents
        </ParamField>

        <ParamField path="price" type="number">
          The 3 character currency code as defined by ISO 4217
        </ParamField>
      </Expandable>
    </ParamField>
  </Tab>
</Tabs>


## OpenAPI

````yaml post /v1/configuration
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/configuration:
    post:
      tags:
        - v1
        - Webhooks
      summary: Setting Your Configuration
      description: Configure webhook URL
      operationId: post-configuration-v1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - webhook_url
              properties:
                webhook_url:
                  type: string
                  description: A URL for us to send our webhooks to
            example:
              webhook_url: https://yourdomain.com/webhook
      responses:
        '200':
          $ref: '#/components/responses/StatusNoContentV2'
        '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:
  responses:
    StatusNoContentV2:
      description: Status No Content
    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
  schemas:
    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.
  securitySchemes:
    Bearer:
      type: apiKey
      name: Authorization
      in: header
      description: >-
        The authentication token generated from providing API Keys to Sezzle
        Gateway

````