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

# Setup drawdown billing

> Set up or update drawdown billing for the authenticated developer



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/checkout-intents/openapi.documented.yml post /api/v1/billing/drawdown
openapi: 3.0.0
info:
  title: Universal Checkout API
  version: 1.0.5
  description: >-
    Turn any product URL into a completed checkout. Instantly retrieve price,
    tax, and shipping for any product, and let users buy without ever leaving
    your native AI experience.


    View the [Rye API docs](https://docs.rye.com).
  termsOfService: https://rye.com/terms-of-service
  license:
    name: UNLICENSED
  contact:
    name: Rye
    email: dev@rye.com
    url: https://docs.rye.com
servers:
  - url: https://staging.api.rye.com
security: []
paths:
  /api/v1/billing/drawdown:
    post:
      tags:
        - Billing
      summary: Setup drawdown billing
      description: Set up or update drawdown billing for the authenticated developer
      operationId: SetupDrawdown
      parameters: []
      requestBody:
        description: Drawdown settings to configure
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetupDrawdownParams'
              description: ''
      responses:
        '200':
          description: Updated billing configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingResponse'
        '401':
          description: Authentication Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateError'
      security:
        - bearerAuth:
            - billing:write
components:
  schemas:
    SetupDrawdownParams:
      properties:
        chargeAutomatically:
          type: boolean
          description: |-
            Whether to automatically charge the invoice when created.
            Defaults to true if not specified.
          example: true
        minBalanceSubunits:
          type: integer
          format: int32
          description: |-
            Minimum balance threshold in smallest currency unit (e.g. cents).
            A top-up is triggered when balance falls below this value.
          example: 200000
          minimum: 10
        targetBalanceSubunits:
          type: integer
          format: int32
          description: |-
            Target balance in smallest currency unit (e.g. cents). When balance
            drops below minBalanceSubunits, a top-up invoice is created to
            replenish to this amount.
          example: 1000000
          minimum: 100
      required:
        - minBalanceSubunits
        - targetBalanceSubunits
      type: object
    BillingResponse:
      properties:
        drawdown:
          properties:
            balance:
              allOf:
                - $ref: '#/components/schemas/Money'
              nullable: true
            config:
              properties:
                chargeAutomatically:
                  type: boolean
                currency:
                  type: string
                  example: USD
                minBalanceSubunits:
                  type: number
                  format: double
                  example: 200000
                targetBalanceSubunits:
                  type: number
                  format: double
                  example: 1000000
              required:
                - chargeAutomatically
                - currency
                - minBalanceSubunits
                - targetBalanceSubunits
              type: object
              nullable: true
            enabled:
              type: boolean
          required:
            - balance
            - config
            - enabled
          type: object
      required:
        - drawdown
      type: object
    AuthenticationError:
      properties:
        name:
          type: string
        message:
          type: string
        stack:
          type: string
      required:
        - name
        - message
      type: object
      additionalProperties: false
    ValidateError:
      properties:
        name:
          type: string
        message:
          type: string
        stack:
          type: string
        status:
          type: number
          format: double
        fields:
          $ref: '#/components/schemas/FieldErrors'
      required:
        - name
        - message
        - status
        - fields
      type: object
      additionalProperties: false
    Money:
      properties:
        currencyCode:
          type: string
          example: USD
        amountSubunits:
          type: integer
          format: int32
          example: 1500
      required:
        - currencyCode
        - amountSubunits
      type: object
    FieldErrors:
      properties: {}
      type: object
      additionalProperties:
        properties:
          value: {}
          message:
            type: string
        required:
          - message
        type: object
  securitySchemes:
    bearerAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Rye API key

````