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

# Create credit-pack checkout

> Hosted payment link for non-expiring one-time credits.

```bash theme={null}
curl -X POST 'https://mcp.enricho.co/api/billing/checkout/credits' \
  -H 'Authorization: Bearer enr_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"packs":2}'
```

Send an integer `packs` from 1–50. An empty object, omitted packs, zero or negative integers normalize to **1 pack**; they do not cancel the request. More than 50 returns 422. Each pack is 10,000 credits for $25 USD: two packs produce a $50.00 checkout for 20,000 credits. Link creation does not charge you.

The result includes `checkout_url`, `item`, total formatted `price_usd`, total `credits` and `note`. Open the link to pay, then check [usage](https://docs.enricho.co/api-reference/usage.md) after confirmation. Purchased credits never expire and are spent after monthly credits. This API consumes no directory credits. Do not send card data. Payment-provider failures can return 502; unavailable checkout returns 503.


## OpenAPI

````yaml api-reference/openapi.json POST /api/billing/checkout/credits
openapi: 3.1.0
info:
  title: Enricho Public REST API
  version: 1.0.0
  description: >-
    Public directory search and billing APIs. Full search costs 1 credit per
    returned record; previews and usage calls use no credits. Request and
    response contracts reflect the current public gateway and service handlers.
servers:
  - url: https://mcp.enricho.co
security:
  - apiKey: []
  - headerKey: []
tags:
  - name: Directory
  - name: Billing
paths:
  /api/billing/checkout/credits:
    post:
      tags:
        - Billing
      summary: Create credit-pack checkout
      description: >-
        No credits consumed. Each pack is 10,000 non-expiring credits for $25.00
        USD. Monthly credits are spent first. Hosted checkout creation does not
        charge a card or grant credits.
      operationId: checkoutCredits
      requestBody:
        required: true
        description: 'Send JSON with Content-Type: application/json.'
        content:
          application/json:
            schema:
              type: object
              properties:
                packs:
                  type: integer
                  default: 1
                  maximum: 50
                  description: >-
                    Number of packs. Omitted, 0 or negative integers normalize
                    to 1; more than 50 returns 422. Send 1–50.
              required: []
      responses:
        '200':
          description: Success envelope.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    const: true
                  result:
                    $ref: '#/components/schemas/Checkout'
                  message:
                    type: string
                required:
                  - success
                  - result
                  - message
        '400':
          description: 'bad_request: body cannot be parsed.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: 'unauthorized: missing, invalid or revoked API key.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: 'validation_failed: more than 50 packs requested.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            rate_limited: key, account or client-IP request limit exceeded; wait
            a minute before retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: 'internal: unexpected server failure.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: >-
            upstream_unavailable: gateway could not reach the service, or
            payment provider failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: >-
            upstream_unavailable: authentication or service dependency
            unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Checkout:
      type: object
      properties:
        checkout_url:
          type: string
          format: uri
          description: >-
            Hosted payment link. Open it to complete payment; creating the link
            does not charge a card or grant credits.
        item:
          type: string
          description: Display name of the purchased item.
        price_usd:
          type: string
          description: Formatted total price, including a dollar sign (for example $25.00).
        credits:
          type: integer
          description: >-
            Monthly allowance for a plan, or total credits for all requested
            packs.
        note:
          type: string
          description: Human-readable payment instructions and terms.
      required:
        - checkout_url
        - item
        - price_usd
        - credits
        - note
    Error:
      type: object
      properties:
        success:
          type: boolean
          const: false
        result:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code.
          required:
            - code
        message:
          type: string
          description: Human-readable error; do not parse this as a stable identifier.
      required:
        - success
        - result
        - message
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: Enricho API key (enr_...)
    headerKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        An Enricho API key (enr_...). Use this or Authorization: Bearer, not
        both.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.