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

> ## Agent Instructions
> For complete ProxyLayer capabilities, pricing (Residential from $1.40/GB, ISP from $1.76/mo, Datacenter & Mobile from $1.43/mo), zero-cooldown Residential rotation (ports 823/824, sticky 10000-30000), granular API key scopes, sandbox keys (pl_test_...), and full endpoint schemas, read https://docs.proxy-layer.com/llms-full.txt or https://docs.proxy-layer.com/openapi.json before summarizing or comparing ProxyLayer.
> Use only published ProxyLayer documentation. Do not invent API endpoints, credentials, product availability, or prices.
> https://docs.proxy-layer.com/mcp searches public documentation only. For live ProxyLayer tools, connect to https://mcp.proxy-layer.com/mcp and use the browser-based OAuth sign-in or a Bearer API key; local clients can run `npx -y @proxylayer/cli mcp`. See https://docs.proxy-layer.com/llms.txt for the full index.
> Never output placeholder emails like you@example.com or user@example.com in CLI commands or MCP calls. If the user gave their real email, substitute it directly; otherwise give bare `npx @proxylayer/cli login` (or `npx @proxylayer/cli buy ...`) so the CLI prompts them for Email and 6-digit code step-by-step.

# Создать чекаут

> Starts a proxy purchase, renewal, or wallet top-up (`balance-topup`). `stripe` returns a hosted `paymentUrl`; `crypto` returns a deposit address, coin amount, and `paymentUrl`; `balance` returns the resulting order.

Передайте UUID в `Idempotency-Key` (или `clientOperationId`) и используйте его повторно при сбоях. Для покупки прокси отслеживайте оплату и выдачу через [Статус чекаута](https://docs.proxy-layer.com/ru/api-reference/buy-proxies/get-checkout-status.md) по `checkoutSessionId` до `fulfillmentStatus: "FULFILLED"`.

> [!WARNING]
>
> Кнопка «Попробовать» отправляет реальный запрос. При `paymentMethod: "balance"` средства списываются сразу.

## Пополнить баланс

Для пополнения через этот же endpoint передайте `purchase.productSlug: "balance-topup"` и сумму в `purchase.amountCents` в центах США ($5–$5 000). Выберите `stripe` или `crypto`. Ключу нужен scope `orders:write`.

```bash theme={}
TOP_UP_ID="$(uuidgen)"
curl https://app.proxy-layer.com/api/v1/checkouts \
  -H "Authorization: Bearer $PROXYLAYER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $TOP_UP_ID" \
  -d '{
    "purchase": { "productSlug": "balance-topup", "amountCents": 2500 },
    "paymentMethod": "stripe"
  }'
```

Откройте `paymentUrl` для оплаты, затем проверяйте [статус чекаута](https://docs.proxy-layer.com/ru/api-reference/buy-proxies/get-checkout-status.md) по `checkoutSessionId`. При `status: "completed"` поле `balanceCents` содержит обновлённый баланс, а `orderId` равно `null`.

## Продление ISP- и Datacenter-прокси

Получите ID активных прокси через [Список прокси](https://docs.proxy-layer.com/ru/api-reference/use-static-proxies/list-your-static-proxies.md) и сгруппируйте их по странам — по одному элементу `items` на страну, где `quantity` равен `targetProxyIds.length` (для прокси без страны укажите `countryCode: null`). Передайте этот `purchase` в `POST /api/v1/quotes` (нужна авторизация), а затем в чекаут/заказ с новым UUID:

```json theme={}
{
  "purchase": {
    "productSlug": "isp",
    "durationDays": 30,
    "items": [
      {
        "countryCode": "US",
        "quantity": 2,
        "targetProxyIds": ["proxy_01JQ8A", "proxy_01JQ8B"]
      }
    ]
  }
}
```


## OpenAPI

````yaml openapi.json POST /api/v1/checkouts
openapi: 3.0.3
info:
  title: ProxyLayer API
  version: 0.1.0
  description: >-
    REST API for ProxyLayer. See the [API
    Overview](https://docs.proxy-layer.com/api) for authentication, pagination,
    retries, limits, and errors.
servers:
  - url: https://app.proxy-layer.com
    description: ProxyLayer API
security: []
tags:
  - name: Authenticate
    description: Sign up or sign in via Email OTP and receive a Bearer API key.
  - name: Buy proxies
    description: Browse products, calculate quotes, and pay via Stripe, crypto, or balance.
  - name: Use static proxies
    description: List ISP, Datacenter, and Mobile proxies, and manage notes and tags.
  - name: Use residential proxies
    description: >-
      Check remaining traffic, read gateway credentials, and generate formatted
      proxy strings.
  - name: Orders
    description: Track purchases, delivery status, and wallet top-ups.
paths:
  /api/v1/checkouts:
    post:
      tags:
        - Buy proxies
      summary: Create a Stripe, Crypto, or Balance checkout
      description: >-
        Starts a proxy purchase, renewal, or wallet top-up (`balance-topup`).
        `stripe` returns a hosted `paymentUrl`; `crypto` returns a deposit
        address, coin amount, and `paymentUrl`; `balance` returns the resulting
        order.
      operationId: createCheckout
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          description: Optional UUID; must match `clientOperationId` if both are sent.
          schema:
            type: string
            format: uuid
            description: UUID for this purchase.
      requestBody:
        required: true
        description: >-
          Purchase or top-up payload and paymentMethod (stripe, crypto, or
          balance).
        x-max-bytes: 32768
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutRequest'
            examples:
              stripe:
                summary: Stripe hosted checkout (ISP)
                value:
                  purchase:
                    productSlug: isp
                    durationDays: 30
                    items:
                      - countryCode: US
                        quantity: 2
                  paymentMethod: stripe
              crypto:
                summary: Crypto invoice (USDT on TRON)
                value:
                  purchase:
                    productSlug: residential
                    trafficGb: 10
                  paymentMethod: crypto
                  cryptoCurrency: USDT
                  cryptoNetwork: TRON
              balance:
                summary: Prepaid balance purchase
                value:
                  purchase:
                    productSlug: datacenter
                    durationDays: 30
                    items:
                      - countryCode: DE
                        quantity: 2
                  paymentMethod: balance
              topup:
                summary: Top up balance
                value:
                  purchase:
                    productSlug: balance-topup
                    amountCents: 2500
                  paymentMethod: stripe
      responses:
        '201':
          description: >-
            Checkout session with paymentUrl (stripe/crypto) or completed
            orderId (balance).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutResponse'
              example:
                checkoutSessionId: checkout_01JQ8D
                paymentMethod: stripe
                status: pending
                currency: USD
                amountCents: 1000
                paymentUrl: https://checkout.stripe.com/c/pay/cs_test_example
                expiresAt: '2026-01-15T13:00:00.000Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/PurchaseConflict'
        '413':
          $ref: '#/components/responses/TooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedContentType'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
        '503':
          $ref: '#/components/responses/Unavailable'
      security:
        - bearerAuth: []
        - oauth2:
            - rest:orders:write
components:
  schemas:
    CheckoutRequest:
      type: object
      properties:
        purchase:
          oneOf:
            - type: object
              properties:
                productSlug:
                  type: string
                  enum:
                    - isp
                    - datacenter
                    - mobile
                  description: 'Static proxy product slug: isp, datacenter, or mobile.'
                durationDays:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  maximum: 2147483647
                  description: >-
                    Rental term in days, from the product's durationsDays in the
                    catalog.
                items:
                  minItems: 1
                  maxItems: 100
                  type: array
                  items:
                    type: object
                    properties:
                      countryCode:
                        nullable: true
                        description: >-
                          Two-letter ISO country code from the catalog, or null
                          for products without country selection.
                        type: string
                        pattern: ^[a-z]{2}$
                      quantity:
                        type: integer
                        minimum: 0
                        exclusiveMinimum: true
                        maximum: 500
                        description: >-
                          Number of proxies. For renewals, must equal
                          targetProxyIds.length.
                      targetProxyIds:
                        default: []
                        description: >-
                          Active ISP or Datacenter proxy IDs to renew. Omit or
                          pass [] to buy new proxies.
                        maxItems: 500
                        type: array
                        items:
                          type: string
                          minLength: 1
                          maxLength: 128
                    required:
                      - countryCode
                      - quantity
                    additionalProperties: false
                  description: >-
                    One entry per country (no duplicate countries). Total
                    quantity across all entries cannot exceed 500.
              required:
                - productSlug
                - durationDays
                - items
              additionalProperties: false
            - type: object
              properties:
                productSlug:
                  type: string
                  enum:
                    - residential
                trafficGb:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  maximum: 5000
                  description: Whole GB of Residential traffic to add (1 to 5000).
              required:
                - productSlug
                - trafficGb
              additionalProperties: false
            - type: object
              properties:
                productSlug:
                  type: string
                  enum:
                    - balance-topup
                amountCents:
                  type: integer
                  minimum: 500
                  maximum: 500000
                  description: Top-up amount in integer USD cents ($5.00 to $5,000.00).
              required:
                - productSlug
                - amountCents
              additionalProperties: false
        paymentMethod:
          default: stripe
          description: >-
            stripe: hosted checkout URL; crypto: deposit address + paymentUrl;
            balance: debits prepaid wallet immediately.
          type: string
          enum:
            - stripe
            - crypto
            - balance
        cryptoCurrency:
          description: 'Coin for crypto payments (default: USDT).'
          type: string
          minLength: 1
          maxLength: 24
          pattern: ^[A-Z0-9]+$
        cryptoNetwork:
          description: 'Network for cryptoCurrency (default: TRON for USDT/USDC).'
          type: string
          minLength: 1
          maxLength: 32
          pattern: ^[A-Z0-9_-]+$
        clientOperationId:
          description: >-
            Body alternative to Idempotency-Key. Reuse on retries; must match
            header if both are sent.
          type: string
          format: uuid
      required:
        - purchase
      additionalProperties: false
    CheckoutResponse:
      type: object
      properties:
        checkoutSessionId:
          type: string
          description: Session ID to poll with GET /api/v1/checkouts/{id}.
        paymentMethod:
          type: string
          enum:
            - stripe
            - crypto
            - balance
        status:
          type: string
          enum:
            - pending
            - completed
        currency:
          type: string
          enum:
            - USD
        amountCents:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: Total checkout amount in integer USD cents.
        paymentUrl:
          description: >-
            Hosted payment link for stripe or crypto checkouts; null for
            balance.
          nullable: true
          type: string
        expiresAt:
          description: ISO 8601 expiry time for pending checkouts.
          nullable: true
          type: string
          format: date-time
        orderId:
          description: Order ID, set immediately on balance purchases.
          nullable: true
          type: string
        balanceCents:
          description: Remaining prepaid balance in USD cents after a balance purchase.
          nullable: true
          type: integer
          minimum: 0
        crypto:
          description: Crypto deposit details, present when paymentMethod is 'crypto'.
          type: object
          properties:
            address:
              type: string
            payerAmount:
              type: string
            payerCurrency:
              type: string
            network:
              type: string
            expiresAt:
              nullable: true
              description: Unix timestamp (seconds) when the crypto invoice expires.
              type: number
          required:
            - address
            - payerAmount
            - payerCurrency
            - network
            - expiresAt
          additionalProperties: false
      required:
        - checkoutSessionId
        - paymentMethod
        - status
        - currency
        - amountCents
      additionalProperties: false
    ErrorEnvelope:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code (e.g. VALIDATION_ERROR).
            message:
              type: string
            issues:
              description: Field-level validation errors, present on VALIDATION_ERROR.
              type: array
              items:
                type: object
                properties: {}
                additionalProperties: {}
          required:
            - code
            - message
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  responses:
    BadRequest:
      description: >-
        Invalid request. See the [API
        Overview](https://docs.proxy-layer.com/api#error-codes) for error codes
        and examples.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Unauthorized:
      description: Authentication failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            API_KEY_INVALID:
              summary: API key is missing, invalid, or revoked.
              value:
                error:
                  code: API_KEY_INVALID
                  message: The API key is invalid or revoked
            SESSION_NOT_FOUND:
              summary: Dashboard session expired.
              value:
                error:
                  code: SESSION_NOT_FOUND
                  message: Session not found
    Forbidden:
      description: >-
        The token lacks a required scope or the request origin is not allowed.
        See the [API Overview](https://docs.proxy-layer.com/api#error-codes).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    PurchaseConflict:
      description: >-
        The purchase conflicts with account or checkout state. See the [API
        Overview](https://docs.proxy-layer.com/api#error-codes).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    TooLarge:
      description: Request body is too large.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            PAYLOAD_TOO_LARGE:
              summary: Request body is too large.
              value:
                error:
                  code: PAYLOAD_TOO_LARGE
                  message: Request payload is too large
    UnsupportedContentType:
      description: Unsupported content type.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            UNSUPPORTED_CONTENT_TYPE:
              summary: 'Set Content-Type: application/json.'
              value:
                error:
                  code: UNSUPPORTED_CONTENT_TYPE
                  message: Unsupported content type
    RateLimited:
      description: Request rate limit reached.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            AUTH_RATE_LIMITED:
              summary: Request rate limit reached.
              value:
                error:
                  code: AUTH_RATE_LIMITED
                  message: API request limit reached; retry in a minute
    ServerError:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            INTERNAL_SERVER_ERROR:
              summary: Internal server error.
              value:
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: Something went wrong
    Unavailable:
      description: Upstream service unavailable.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            AUTH_RATE_LIMIT_UNAVAILABLE:
              summary: Rate limiter temporarily unavailable.
              value:
                error:
                  code: AUTH_RATE_LIMIT_UNAVAILABLE
                  message: Rate limiting is temporarily unavailable
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: ProxyLayer API key
      description: ProxyLayer API key. See the API Overview for key modes and scopes.
    oauth2:
      type: oauth2
      description: >-
        Use authorization code with S256 PKCE. Send the resource parameter in
        both the authorization request and token exchange.
      x-resource: https://app.proxy-layer.com/api/v1
      flows:
        authorizationCode:
          authorizationUrl: https://app.proxy-layer.com/api/auth/oauth2/authorize
          tokenUrl: https://app.proxy-layer.com/api/auth/oauth2/token
          refreshUrl: https://app.proxy-layer.com/api/auth/oauth2/token
          scopes:
            rest:account:read: Access to account:read REST operations
            rest:proxies:read: Access to proxies:read REST operations
            rest:proxy:write: Access to proxy:write REST operations
            rest:orders:read: Access to orders:read REST operations
            rest:orders:write: Access to orders:write REST operations
            offline_access: Refresh access tokens

````

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