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

# Create a customer



## OpenAPI

````yaml /openapi/v1.yaml post /customers
openapi: 3.1.0
info:
  title: Payoes API
  version: 1.0.0
  description: >
    REST API for creating and managing Stellar payments, customers, checkout
    sessions,

    payment links, and invoices.


    ## Authentication


    Send your API key as a Bearer token. Sandbox keys use the `pk_test_` prefix
    and

    only access sandbox data. Live keys use `pk_live_` and only access
    production data.


    ## Environments


    Sandbox and production are fully isolated. Resources created in one
    environment

    are not visible from API keys scoped to the other.
servers:
  - url: https://payoes.com/api/v1
    description: Production host (replace with your deployment URL)
  - url: http://localhost:3000/api/v1
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Payments
    description: Direct payment intents with hosted Stellar checkout
  - name: Customers
    description: Payer profiles scoped to your organization and environment
  - name: Checkout sessions
    description: Hosted checkout flows with optional redirect URLs
  - name: Payment links
    description: Reusable shareable links that start checkout on each visit
  - name: Invoices
    description: Customer invoices with draft, finalize, and checkout lifecycle
paths:
  /customers:
    post:
      tags:
        - Customers
      summary: Create a customer
      operationId: createCustomer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCustomerRequest'
      responses:
        '201':
          description: Customer created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    CreateCustomerRequest:
      type: object
      properties:
        email:
          type: string
          format: email
          nullable: true
        name:
          type: string
          maxLength: 200
          nullable: true
        primary_stellar_address:
          type: string
          nullable: true
          description: Stellar public key (G...)
        notes:
          type: string
          maxLength: 2000
          nullable: true
        metadata:
          $ref: '#/components/schemas/StringMetadata'
    Customer:
      type: object
      required:
        - id
        - environment
        - created_at
        - updated_at
      properties:
        id:
          type: string
          example: cus_abc123xyz
        email:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        primary_stellar_address:
          type: string
          nullable: true
        notes:
          type: string
          nullable: true
        metadata:
          $ref: '#/components/schemas/StringMetadata'
        environment:
          $ref: '#/components/schemas/Environment'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    StringMetadata:
      type: object
      additionalProperties:
        type: string
      nullable: true
    Environment:
      type: string
      enum:
        - sandbox
        - production
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
  responses:
    BadRequest:
      description: Invalid request body or business rule violation
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Settlement wallet is not configured
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Unauthorized
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key from the Payoes dashboard (`pk_test_...` or `pk_live_...`)

````