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

# Customers - Create

> Creates a customer object and stores the customer details to be reused for future payments.
Incase the customer already exists in the system, this API will respond with the customer details.



## OpenAPI

````yaml openapi_spec post /customers
openapi: 3.0.3
info:
  title: Vaultera Switch - API Documentation
  description: >

    ## Get started


    Vaultera Switch provides a collection of APIs that enable you to process and
    manage payments.

    Our APIs accept and return JSON in the HTTP body, and return standard HTTP
    response codes.


    You can consume the APIs directly using your favorite HTTP/REST library.


    We have a testing environment referred to "sandbox", which you can setup to
    test API calls without

    affecting production data.

    Currently, our sandbox environment is live while our production environment
    is under development

    and will be available soon.

    You can sign up on our Dashboard to get API keys to access Vaultera Switch
    API.


    ### Environment


    Use the following base URLs when making requests to the APIs:


    | Environment   |  Base URL                          |

    |---------------|------------------------------------|

    | Sandbox       | <https://sandbox.test.switch.vaultera.co>   |

    | Production    | <https://api.test.switch.vaultera.co>       |


    ## Authentication


    When you sign up on our [dashboard](https://app.test.switch.vaultera.co) and
    create a merchant

    account, you are given a secret key (also referred as api-key) and a
    publishable key.

    You may authenticate all API requests with Vaultera Switch server by
    providing the appropriate key in

    the request Authorization header.


    | Key             | 
    Description                                                                                 
    |

    |-----------------|-----------------------------------------------------------------------------------------------|

    | api-key         | Private key. Used to authenticate all API requests from
    your merchant server                  |

    | publishable key | Unique identifier for your account. Used to authenticate
    API requests from your app's client  |


    Never share your secret api keys. Keep them guarded and secure.
  contact:
    name: Vaultera Switch Support
    url: https://vaultera.co
    email: support@vaultera.co
  license:
    name: Apache-2.0
  version: 0.1.0
servers:
  - url: https://api.test.switch.vaultera.co
    description: Sandbox Environment
  - url: https://api.switch.vaultera.co
    description: Sandbox Environment
security: []
tags:
  - name: Merchant Account
    description: Create and manage merchant accounts
  - name: Profile
    description: Create and manage profiles
  - name: Merchant Connector Account
    description: Create and manage merchant connector accounts
  - name: Payments
    description: Create and manage one-time payments, recurring payments and mandates
  - name: Refunds
    description: Create and manage refunds for successful payments
  - name: Mandates
    description: Manage mandates
  - name: Customers
    description: Create and manage customers
  - name: Payment Methods
    description: Create and manage payment methods of customers
  - name: Disputes
    description: Manage disputes
  - name: API Key
    description: Create and manage API Keys
  - name: Payouts
    description: Create and manage payouts
  - name: payment link
    description: Create payment link
  - name: Routing
    description: Create and manage routing configurations
  - name: Event
    description: Manage events
paths:
  /customers:
    post:
      tags:
        - Customers
      summary: Customers - Create
      description: >-
        Creates a customer object and stores the customer details to be reused
        for future payments.

        Incase the customer already exists in the system, this API will respond
        with the customer details.
      operationId: Create a Customer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerRequest'
            examples:
              Update name and email of a customer:
                value:
                  email: guest@example.com
                  name: John Doe
        required: true
      responses:
        '200':
          description: Customer Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerResponse'
        '400':
          description: Invalid data
      security:
        - api_key: []
components:
  schemas:
    CustomerRequest:
      type: object
      description: The customer details
      properties:
        customer_id:
          type: string
          description: >-
            The identifier for the customer object. If not provided the customer
            ID will be autogenerated.
          example: cus_y3oqhf46pyzuxjbcn2giaqnb44
          nullable: true
          maxLength: 64
          minLength: 1
        name:
          type: string
          description: The customer's name
          example: Jon Test
          nullable: true
          maxLength: 255
        email:
          type: string
          description: The customer's email address
          example: JonTest@test.com
          nullable: true
          maxLength: 255
        phone:
          type: string
          description: The customer's phone number
          example: '9123456789'
          nullable: true
          maxLength: 255
        description:
          type: string
          description: An arbitrary string that you can attach to a customer object.
          example: First Customer
          nullable: true
          maxLength: 255
        phone_country_code:
          type: string
          description: The country code for the customer phone number
          example: '+65'
          nullable: true
          maxLength: 255
        address:
          allOf:
            - $ref: '#/components/schemas/AddressDetails'
          nullable: true
        metadata:
          type: object
          description: >-
            You can specify up to 50 keys, with key names up to 40 characters
            long and values up to 500

            characters long. Metadata is useful for storing additional,
            structured information on an

            object.
          nullable: true
    CustomerResponse:
      type: object
      required:
        - customer_id
        - created_at
      properties:
        customer_id:
          type: string
          description: The identifier for the customer object
          example: cus_y3oqhf46pyzuxjbcn2giaqnb44
          maxLength: 64
          minLength: 1
        name:
          type: string
          description: The customer's name
          example: Jon Test
          nullable: true
          maxLength: 255
        email:
          type: string
          description: The customer's email address
          example: JonTest@test.com
          nullable: true
          maxLength: 255
        phone:
          type: string
          description: The customer's phone number
          example: '9123456789'
          nullable: true
          maxLength: 255
        phone_country_code:
          type: string
          description: The country code for the customer phone number
          example: '+65'
          nullable: true
          maxLength: 255
        description:
          type: string
          description: An arbitrary string that you can attach to a customer object.
          example: First Customer
          nullable: true
          maxLength: 255
        address:
          allOf:
            - $ref: '#/components/schemas/AddressDetails'
          nullable: true
        created_at:
          type: string
          format: date-time
          description: >-
            A timestamp (ISO 8601 code) that determines when the customer was
            created
          example: '2023-01-18T11:04:09.922Z'
        metadata:
          type: object
          description: >-
            You can specify up to 50 keys, with key names up to 40 characters
            long and values up to 500

            characters long. Metadata is useful for storing additional,
            structured information on an

            object.
          nullable: true
        default_payment_method_id:
          type: string
          description: The identifier for the default payment method.
          example: pm_djh2837dwduh890123
          nullable: true
          maxLength: 64
    AddressDetails:
      type: object
      description: Address details
      properties:
        city:
          type: string
          description: The address city
          example: New York
          nullable: true
          maxLength: 50
        country:
          allOf:
            - $ref: '#/components/schemas/CountryAlpha2'
          nullable: true
        line1:
          type: string
          description: The first line of the address
          example: 123, King Street
          nullable: true
          maxLength: 200
        line2:
          type: string
          description: The second line of the address
          example: Powelson Avenue
          nullable: true
          maxLength: 50
        line3:
          type: string
          description: The third line of the address
          example: Bridgewater
          nullable: true
          maxLength: 50
        zip:
          type: string
          description: The zip/postal code for the address
          example: '08807'
          nullable: true
          maxLength: 50
        state:
          type: string
          description: The address state
          example: New York
          nullable: true
        first_name:
          type: string
          description: The first name for the address
          example: John
          nullable: true
          maxLength: 255
        last_name:
          type: string
          description: The last name for the address
          example: Doe
          nullable: true
          maxLength: 255
      additionalProperties: false
    CountryAlpha2:
      type: string
      enum:
        - AF
        - AX
        - AL
        - DZ
        - AS
        - AD
        - AO
        - AI
        - AQ
        - AG
        - AR
        - AM
        - AW
        - AU
        - AT
        - AZ
        - BS
        - BH
        - BD
        - BB
        - BY
        - BE
        - BZ
        - BJ
        - BM
        - BT
        - BO
        - BQ
        - BA
        - BW
        - BV
        - BR
        - IO
        - BN
        - BG
        - BF
        - BI
        - KH
        - CM
        - CA
        - CV
        - KY
        - CF
        - TD
        - CL
        - CN
        - CX
        - CC
        - CO
        - KM
        - CG
        - CD
        - CK
        - CR
        - CI
        - HR
        - CU
        - CW
        - CY
        - CZ
        - DK
        - DJ
        - DM
        - DO
        - EC
        - EG
        - SV
        - GQ
        - ER
        - EE
        - ET
        - FK
        - FO
        - FJ
        - FI
        - FR
        - GF
        - PF
        - TF
        - GA
        - GM
        - GE
        - DE
        - GH
        - GI
        - GR
        - GL
        - GD
        - GP
        - GU
        - GT
        - GG
        - GN
        - GW
        - GY
        - HT
        - HM
        - VA
        - HN
        - HK
        - HU
        - IS
        - IN
        - ID
        - IR
        - IQ
        - IE
        - IM
        - IL
        - IT
        - JM
        - JP
        - JE
        - JO
        - KZ
        - KE
        - KI
        - KP
        - KR
        - KW
        - KG
        - LA
        - LV
        - LB
        - LS
        - LR
        - LY
        - LI
        - LT
        - LU
        - MO
        - MK
        - MG
        - MW
        - MY
        - MV
        - ML
        - MT
        - MH
        - MQ
        - MR
        - MU
        - YT
        - MX
        - FM
        - MD
        - MC
        - MN
        - ME
        - MS
        - MA
        - MZ
        - MM
        - NA
        - NR
        - NP
        - NL
        - NC
        - NZ
        - NI
        - NE
        - NG
        - NU
        - NF
        - MP
        - 'NO'
        - OM
        - PK
        - PW
        - PS
        - PA
        - PG
        - PY
        - PE
        - PH
        - PN
        - PL
        - PT
        - PR
        - QA
        - RE
        - RO
        - RU
        - RW
        - BL
        - SH
        - KN
        - LC
        - MF
        - PM
        - VC
        - WS
        - SM
        - ST
        - SA
        - SN
        - RS
        - SC
        - SL
        - SG
        - SX
        - SK
        - SI
        - SB
        - SO
        - ZA
        - GS
        - SS
        - ES
        - LK
        - SD
        - SR
        - SJ
        - SZ
        - SE
        - CH
        - SY
        - TW
        - TJ
        - TZ
        - TH
        - TL
        - TG
        - TK
        - TO
        - TT
        - TN
        - TR
        - TM
        - TC
        - TV
        - UG
        - UA
        - AE
        - GB
        - UM
        - UY
        - UZ
        - VU
        - VE
        - VN
        - VG
        - VI
        - WF
        - EH
        - YE
        - ZM
        - ZW
        - US
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: api-key
      description: >-
        Use the API key created under your merchant account from the Vaultera
        Switch dashboard. API key is used to authenticate API requests from your
        merchant server only. Don't expose this key on a website or embed it in
        a mobile application.

````