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

# Criar cliente

> Crie um perfil reutilizável de comprador.



## OpenAPI

````yaml api-reference/openapi-v2.json POST /v2/customers
openapi: 3.1.0
info:
  title: API PIX - v2
  description: API for Pagou.ai Gateway
  version: 2.0.0
  contact:
    name: Support
    url: https://pagou.ai
    email: support@pagou.ai
servers:
  - url: https://api.pagou.ai
    description: Production server
  - url: https://api.sandbox.pagou.ai
    description: Sandbox server for testing
security:
  - BearerAuth: []
  - ApiKeyAuth: []
  - BasicAuth: []
paths:
  /v2/customers:
    post:
      tags:
        - API - Customers
      summary: Create a Customer
      description: Create a customer
      operationId: postCustomers
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  description: Full name of the customer.
                email:
                  type: string
                  format: email
                  pattern: >-
                    ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                  description: Primary email address of the customer.
                document:
                  description: >-
                    Optional government-issued document information for the
                    customer.
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - EIN
                        - CUIT
                        - DNI
                        - CPF
                        - CNPJ
                        - RUT
                        - RUN
                        - CE
                        - PASS
                        - CC
                        - PEP
                        - CEDULA
                        - RUC
                        - PAS
                        - RFC
                        - CURP
                        - CI
                        - NIN
                        - NIT
                        - CDI
                        - DPI
                        - CUI
                        - PP
                    number:
                      type: string
                  required:
                    - type
                    - number
                phone:
                  description: >-
                    Optional customer phone number in E.164-like numeric format
                    with 11 digits.
                  type: string
                  pattern: ^\d{11}$
                externalRef:
                  description: >-
                    Optional external reference from your system used to
                    correlate this customer.
                  type: string
                address:
                  description: Optional billing or residential address of the customer.
                  type: object
                  properties:
                    street:
                      type: string
                      minLength: 1
                    number:
                      type: string
                    complement:
                      nullable: true
                      type: string
                    neighborhood:
                      type: string
                    city:
                      type: string
                      minLength: 1
                    state:
                      type: string
                      minLength: 2
                      maxLength: 3
                      pattern: ^[\p{L}\p{N}]{2,3}$
                    zipCode:
                      type: string
                    country:
                      default: BR
                      type: string
                      enum:
                        - BR
                        - MX
                        - PH
                        - RU
                        - IN
                        - SA
                        - AE
                        - KW
                        - QA
                        - OM
                        - KH
                        - CL
                        - CO
                        - EC
                        - PE
                        - CR
                        - SV
                        - PA
                        - GT
                        - NI
                        - SG
                        - ID
                        - KR
                        - TH
                        - MY
                        - HK
                        - CN
                        - EG
                        - EU
                        - GL
                        - GB
                        - BH
                        - MA
                        - AR
                        - UY
                        - US
                        - PY
                        - BO
                        - AU
                        - CA
                        - CH
                        - NZ
                        - PL
                        - KZ
                        - UZ
                        - JP
                        - AT
                        - BE
                        - BG
                        - HR
                        - CY
                        - CZ
                        - DK
                        - EE
                        - FI
                        - FR
                        - DE
                        - GR
                        - HU
                        - IE
                        - IT
                        - LV
                        - LT
                        - LU
                        - MT
                        - NL
                        - PT
                        - RO
                        - SK
                        - SI
                        - ES
                        - SE
                  required:
                    - street
                    - city
                ip_address:
                  description: >-
                    Optional IP address associated with the customer creation
                    request.
                  type: string
              required:
                - name
                - email
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
        '422':
          description: Validation error (RFC 7807)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        default:
          description: RFC 7807 Problem Details error response
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
        - BasicAuth: []
components:
  schemas:
    GenericSuccessResponse:
      type: object
      additionalProperties: true
      description: Generic success response payload.
    ValidationProblemDetails:
      allOf:
        - $ref: '#/components/schemas/ProblemDetails'
        - type: object
          properties:
            errors:
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
                  code:
                    type: string
                additionalProperties: true
          additionalProperties: true
    ProblemDetails:
      type: object
      description: RFC 7807 Problem Details object.
      properties:
        type:
          type: string
          format: uri-reference
        title:
          type: string
        status:
          type: number
        detail:
          type: string
        instance:
          type: string
          format: uri-reference
      required:
        - type
        - title
        - status
        - detail
      additionalProperties: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apiKey
    BasicAuth:
      type: http
      scheme: basic
      description: Use Basic auth with username `token` and password `x`.

````