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

# Criar cobrança PIX



## OpenAPI

````yaml /reference/openapi.json post /v1/deposits
openapi: 3.1.0
info:
  title: SwytchPay API
  version: 0.1.0
  description: 'Gateway de pagamentos multi-provedor (PIX). Auth: x-api-key + x-api-secret.'
servers:
  - url: https://api.swytchpay.app
security: []
paths:
  /v1/deposits:
    post:
      tags:
        - Deposits
      summary: Criar cobrança PIX
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DepositCreate'
      responses:
        '200':
          description: external_id repetido — retorna o existente (idempotente)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deposit'
        '201':
          description: Deposit criado (PENDING)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deposit'
components:
  schemas:
    DepositCreate:
      type: object
      properties:
        amount_cents:
          type: integer
          minimum: 0
          exclusiveMinimum: true
        external_id:
          type: string
          minLength: 1
          maxLength: 120
        payer:
          type: object
          properties:
            name:
              type: string
              minLength: 2
              maxLength: 120
            email:
              type: string
              format: email
            phone:
              type: string
              maxLength: 20
            document:
              type: string
              minLength: 11
              maxLength: 18
          required:
            - name
            - email
            - document
        expires_in_sec:
          type: integer
          minimum: 1800
          maximum: 86400
        callback_url:
          type: string
          format: uri
        metadata:
          type: object
          additionalProperties:
            nullable: true
      required:
        - amount_cents
    Deposit:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          enum:
            - deposit
        external_id:
          type: string
        status:
          type: string
          enum:
            - PENDING
            - PAID
            - EXPIRED
            - REFUNDED
            - FAILED
        amount_cents:
          type: integer
        fee_cents:
          type: integer
        net_cents:
          type: integer
        pix:
          type: object
          properties:
            emv:
              type: string
              nullable: true
            qr_url:
              type: string
              nullable: true
          required:
            - emv
            - qr_url
        environment:
          type: string
          enum:
            - live
            - test
      required:
        - id
        - object
        - external_id
        - status
        - amount_cents
        - fee_cents
        - net_cents
        - pix
        - environment
      additionalProperties:
        nullable: true

````