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

# Cria receiver

> Cria um receiver (usuário final do merchant). O receiver começa com `kycStatus: PENDING` e só pode transacionar após aprovação. Forneça `walletAddress` (endereço Solana existente) **ou** `createPrivyWallet: true` (a plataforma cria uma wallet gerenciada pra ele), nunca os dois.



## OpenAPI

````yaml POST /receivers
openapi: 3.1.0
info:
  title: Astron Pay API
  version: 1.0.0
  description: >-
    API B2B para integração de câmbio crypto ↔ BRL via PIX. Autentique com
    `x-api-key` + `x-api-secret`.
  contact:
    name: Astron Pay
    url: https://astronpay.co
    email: dev@astronpay.co
servers:
  - url: https://api.astronpay.co/api/v1
    description: Production
security:
  - apiKey: []
    apiSecret: []
  - bearerAuth: []
tags:
  - name: Fee Tiers
    description: Consulta e atualização das taxas do merchant.
  - name: Receivers
    description: CRUD, KYC, limites e wallet signing dos receivers.
  - name: Quote
    description: Cotações de payin e payout.
  - name: Payin
    description: Ordens de entrada (BRL → crypto).
  - name: Payout
    description: Ordens de saída (crypto → BRL).
  - name: Orders
    description: Consulta genérica de ordens.
  - name: Merchant Wallet
    description: Assinatura de transações com a wallet gerenciada do merchant.
  - name: Ledger
    description: Saldos, entries e liquidações.
  - name: Webhook Config
    description: Configuração de webhook e listagem de eventos.
paths:
  /receivers:
    post:
      tags:
        - Receivers
      summary: Cria um novo receiver
      description: >-
        Cria um receiver (usuário final do merchant). O receiver começa com
        `kycStatus: PENDING` e só pode transacionar após aprovação. Forneça
        `walletAddress` (endereço Solana existente) **ou** `createPrivyWallet:
        true` (a plataforma cria uma wallet gerenciada pra ele), nunca os dois.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                type:
                  type: string
                  enum:
                    - PF
                    - PJ
                  default: PF
                  description: PF = Pessoa Física, PJ = Pessoa Jurídica.
                name:
                  type: string
                  minLength: 2
                  maxLength: 255
                document:
                  type: string
                  description: CPF (11 dígitos) ou CNPJ (14 dígitos), apenas números.
                email:
                  type: string
                  format: email
                phone:
                  type: string
                  maxLength: 20
                addressStreet:
                  type: string
                addressNumber:
                  type: string
                addressComplement:
                  type: string
                addressNeighborhood:
                  type: string
                addressCity:
                  type: string
                addressState:
                  type: string
                  maxLength: 2
                addressZipCode:
                  type: string
                  maxLength: 10
                walletAddress:
                  type: string
                  description: >-
                    Endereço Solana base58 (32–44 chars). Mutuamente exclusivo
                    com `createPrivyWallet`.
                createPrivyWallet:
                  type: boolean
                  description: >-
                    Se `true`, a plataforma cria e custodia uma wallet
                    gerenciada pelo receiver. O envio das transações é feito via
                    `POST /receivers/{id}/wallet/sign-and-send-transaction`, com
                    gas patrocinado pela plataforma — não é necessário manter
                    SOL na wallet pra pagar fee. Mutuamente exclusivo com
                    `walletAddress`.
            example:
              type: PF
              name: João Silva
              email: joao@example.com
              phone: '+5511999999999'
              document: '12345678901'
              createPrivyWallet: true
      responses:
        '201':
          description: Criado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Receiver'
        '400':
          description: Dados inválidos ou campos mutuamente exclusivos violados
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Receiver com esse documento já existe para o merchant
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Receiver:
      type: object
      required:
        - id
        - merchantId
        - type
        - name
        - document
        - documentType
        - status
        - kycStatus
        - createdAt
      properties:
        id:
          type: string
          format: uuid
        merchantId:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - PF
            - PJ
        name:
          type: string
          example: João Silva
        email:
          type: string
          format: email
          nullable: true
        phone:
          type: string
          nullable: true
          example: '+5511999999999'
        document:
          type: string
          example: '12345678901'
        documentType:
          type: string
          enum:
            - CPF
            - CNPJ
        status:
          type: string
          enum:
            - PENDING
            - ACTIVE
            - SUSPENDED
            - BLOCKED
        kycStatus:
          type: string
          enum:
            - PENDING
            - SUBMITTED
            - UNDER_REVIEW
            - APPROVED
            - REJECTED
        limits:
          $ref: '#/components/schemas/ReceiverLimits'
        walletAddress:
          type: string
          nullable: true
          example: 4k5d...Solana
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
          example: VALIDATION_ERROR
        message:
          type: string
          example: Campo 'amountBrl' é obrigatório
        details:
          type: object
          additionalProperties: true
        requestId:
          type: string
          example: req_abc123
    ReceiverLimits:
      type: object
      properties:
        dailyLimitBrl:
          type: number
          example: 50000
        dailyTransactionLimit:
          type: integer
          example: 20
        nightTransactionsEnabled:
          type: boolean
          example: false
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
    apiSecret:
      type: apiKey
      in: header
      name: x-api-secret
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````