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

# Generate checkout link (Stripe)

> Creates a hosted Stripe checkout page and returns the url for the user to open in a browser — nothing is charged until they complete it there. purpose:"wallet_topup" (requires amount > 0, in the account currency) mints a one-time payment that credits the pre-paid wallet; purpose:"add_card" mints a page to save a card on file. Account-level action: requires a TENANT-scoped key (403 NUMBER_SCOPE_NOT_ALLOWED for a number key). Stripe only.

**Requires a tenant-scoped key.**



## OpenAPI

````yaml openapi.json POST /v1/billing/checkout
openapi: 3.1.0
info:
  title: Pilot Status API
  version: 1.0.0
  license:
    name: Pilot Status Terms of Service
    url: https://pilotstatus.com.br/terms
  description: >-
    Public REST API for Pilot Status. Authenticate with the `x-api-key: ps_...`
    header (or `x-api-key-id`). Base URL: https://pilotstatus.com.br
servers:
  - url: https://pilotstatus.com.br
security:
  - apiKey: []
  - apiKeyId: []
paths:
  /v1/billing/checkout:
    post:
      tags:
        - Billing
      summary: Generate checkout link (Stripe)
      description: >-
        Creates a hosted Stripe checkout page and returns the url for the user
        to open in a browser — nothing is charged until they complete it there.
        purpose:"wallet_topup" (requires amount > 0, in the account currency)
        mints a one-time payment that credits the pre-paid wallet;
        purpose:"add_card" mints a page to save a card on file. Account-level
        action: requires a TENANT-scoped key (403 NUMBER_SCOPE_NOT_ALLOWED for a
        number key). Stripe only.


        **Requires a tenant-scoped key.**
      operationId: post_billing_checkout
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                purpose:
                  type: string
                  description: What the checkout page is for.
                  example: wallet_topup
                amount:
                  type: string
                  description: >-
                    Amount to credit to the wallet, in the account currency
                    (required for wallet_topup).
                  example: '50'
                successUrl:
                  type: string
                  description: Redirect URL after success.
                  example: https://app.acme.com/billing/ok
                cancelUrl:
                  type: string
                  description: Redirect URL if cancelled.
                  example: https://app.acme.com/billing
              required:
                - purpose
            example:
              purpose: wallet_topup
              amount: 50
      responses:
        '200':
          description: Top up wallet
          content:
            application/json:
              example:
                url: https://checkout.stripe.com/c/pay/cs_test_...
                purpose: wallet_topup
                orderId: cto_01HZX...
                amount: 50
                currency: BRL
        '400':
          description: Invalid payload or parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Validation error
        '401':
          description: Missing or invalid `x-api-key` / `x-api-key-id` header
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Unauthorized
        '403':
          description: Number-scoped key used on a tenant-only endpoint
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Number-scoped keys cannot call tenant endpoints
                code: NUMBER_SCOPE_NOT_ALLOWED
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Too many requests
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your ps_ API key
    apiKeyId:
      type: apiKey
      in: header
      name: x-api-key-id
      description: API key id (alternative to x-api-key)

````