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

# Add a customer



## OpenAPI

````yaml post /v2/customer
openapi: 3.0.1
info:
  title: SwipeAPI
  description: Partner API
  version: '2.0'
servers:
  - url: https://app.getswipe.in/api/partner
security:
  - bearerAuth: []
tags:
  - name: Document
    description: Document related operations
  - name: Customer
    description: Customer related operations
  - name: Payment
    description: Payment related operations
  - name: Product
    description: Product related operations
  - name: Utility
    description: Generic operations
  - name: Subscriptions
    description: Subscriptions related operations
  - name: Document V2
    description: Document related operations
  - name: Customer V2
    description: Customer related operations
  - name: Payment V2
    description: Payment related operations
  - name: Product V2
    description: Product related operations
  - name: Subscriptions V2
    description: Subscriptions related operations
  - name: Utility V2
    description: Generic operations
  - name: Vendor V2
    description: Vendor related operations
  - name: EwayBill
    description: EwayBill related operations
  - name: Inventory V2
    description: Inventory related operations
paths:
  /v2/customer:
    post:
      tags:
        - Customer V2
      summary: Add a customer
      operationId: v2_post_customer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BaseCustomerV2'
        required: true
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerResponseV2'
        '400':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerResponseV2'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerResponseV2'
components:
  schemas:
    BaseCustomerV2:
      required:
        - name
        - customer_id
      type: object
      properties:
        customer_id:
          type: string
          description: Your Customer ID
          example: '123'
        name:
          type: string
          description: Customer name
          example: TATA RATAN
        phone:
          type: string
          description: Phone number
          example: '1234567890'
        email:
          pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+(\.[a-zA-Z]{2,5})+$
          type: string
          description: Email address
          example: reddi@reddi.reddi
        discount:
          type: integer
          description: Discount
          example: 10
        gstin:
          pattern: ^(|[0-9A-Z]{15})$
          type: string
          description: GSTIN
          example: 27AARCS7202C1ZD
        company_name:
          type: string
          description: Company name
          example: GSTN
        opening_balance:
          type: string
          description: Opening balance
          example: '1245'
        credit_limit:
          type: integer
          description: Credit limit
          example: 200
        billing_address:
          type: array
          description: List of billing addresses
          items:
            $ref: '#/components/schemas/AddressV2'
        shipping_address:
          type: array
          description: List of shipping addresses
          items:
            $ref: '#/components/schemas/AddressV2'
        opening_balance_type:
          type: integer
          description: Credit[0] / Debit[1]
          example: 1
        dial_code:
          type: string
          description: Dial code
          example: '91'
        profile_image:
          type: string
          description: Profile image URL
          example: ''
        pan:
          type: string
          description: PAN
          example: ABCD1234F
        notes:
          type: string
          description: Notes
          example: Testing api
        cc_emails:
          type: string
          description: CC email addresses
          example: reddi@reddi.reddi,acb.a@bcd.con
        tags:
          type: array
          description: List of tags
          items:
            type: string
        custom_fields:
          type: array
          description: >-
            Customer Custom Fields. Custom fields should already be added in
            Swipe Portal.
          example:
            - label: Custom Field 1
              value: Value 1
          items:
            $ref: '#/components/schemas/CustomerCustomFields'
        visibility:
          type: integer
          description: >-
            If set to 1, the customer will be visible to all branches. If set to
            0, the customer will be visible only to the branch it was created
            in.
          example: 1
    CustomerResponseV2:
      type: object
      properties:
        success:
          type: boolean
          description: Success flag
          example: true
        message:
          type: string
          description: Response message
          example: ''
        error_code:
          type: string
          description: Error Code
          example: ''
        errors:
          type: object
          properties: {}
          description: Errors
        data:
          $ref: '#/components/schemas/EmptyData'
    AddressV2:
      required:
        - country
        - state
      type: object
      properties:
        addr_id:
          type: integer
          description: >-
            Address ID.  It will automatically update the existing address if
            the address ID already exists.
          example: -1
        addr_id_v2:
          type: string
          description: >-
            Address ID. It must be alphanumeric, not empty, and up to 16
            characters long.
          example: addr1
        address_line1:
          type: string
          description: Address line 1
          example: ''
        address_line2:
          type: string
          description: Address line 2
          example: ''
        pincode:
          type: string
          description: Pincode
          example: '500075'
        city:
          type: string
          description: City
          example: ''
        state:
          type: string
          description: >-
            State. You can copy the state details from
            https://developers.getswipe.in/api-reference/references#state-details
          example: State Name
          enum:
            - JAMMU AND KASHMIR
            - HIMACHAL PRADESH
            - PUNJAB
            - CHANDIGARH
            - UTTARAKHAND
            - HARYANA
            - DELHI
            - RAJASTHAN
            - UTTAR PRADESH
            - BIHAR
            - SIKKIM
            - ARUNACHAL PRADESH
            - NAGALAND
            - MANIPUR
            - MIZORAM
            - TRIPURA
            - MEGHALAYA
            - ASSAM
            - WEST BENGAL
            - JHARKHAND
            - ODISHA
            - CHHATTISGARH
            - MADHYA PRADESH
            - GUJARAT
            - DADRA & NAGAR HAVELI & DAMAN & DIU
            - MAHARASHTRA
            - ANDHRAPRADESH(BEFOREADDED)
            - KARNATAKA
            - GOA
            - LAKSHWADEEP
            - KERALA
            - TAMIL NADU
            - PUDUCHERRY
            - ANDAMAN & NICOBAR
            - TELANGANA
            - ANDHRA PRADESH
            - LADAKH(NEWLYADDED)
            - OTHER TERRITORY
        country:
          type: string
          description: >-
            Country. You can copy the country details from
            https://developers.getswipe.in/api-reference/references#country-array
          example: India
          enum:
            - Afghanistan
            - Albania
            - Algeria
            - Andorra
            - Angola
            - Antigua and Barbuda
            - Argentina
            - Armenia
            - Australia
            - Austria
            - Azerbaijan
            - Bahamas
            - Bahrain
            - Bangladesh
            - Barbados
            - Belarus
            - Belgium
            - Belize
            - Benin
            - Bhutan
            - Bolivia
            - Bosnia and Herzegovina
            - Botswana
            - Brazil
            - Brunei
            - Bulgaria
            - Burkina Faso
            - Burundi
            - Cabo Verde
            - Cambodia
            - Cameroon
            - Canada
            - Central African Republic
            - Chad
            - Chile
            - China
            - Colombia
            - Comoros
            - Congo, Democratic Republic of the
            - Congo, Republic of the
            - Costa Rica
            - Croatia
            - Cuba
            - Cyprus
            - Czechia
            - Denmark
            - Djibouti
            - Dominica
            - Dominican Republic
            - Ecuador
            - Egypt
            - El Salvador
            - Equatorial Guinea
            - Eritrea
            - Estonia
            - Eswatini
            - Ethiopia
            - Fiji
            - Finland
            - France
            - Gabon
            - Gambia
            - Georgia
            - Germany
            - Ghana
            - Greece
            - Grenada
            - Guatemala
            - Guinea
            - Guinea-Bissau
            - Guyana
            - Haiti
            - Honduras
            - Hungary
            - Iceland
            - India
            - Indonesia
            - Iran
            - Iraq
            - Ireland
            - Israel
            - Italy
            - Jamaica
            - Japan
            - Jordan
            - Kazakhstan
            - Kenya
            - Kiribati
            - Korea, North
            - Korea, South
            - Kosovo
            - Kuwait
            - Kyrgyzstan
            - Laos
            - Latvia
            - Lebanon
            - Lesotho
            - Liberia
            - Libya
            - Liechtenstein
            - Lithuania
            - Luxembourg
            - Madagascar
            - Malawi
            - Malaysia
            - Maldives
            - Mali
            - Malta
            - Marshall Islands
            - Mauritania
            - Mauritius
            - Mexico
            - Micronesia
            - Moldova
            - Monaco
            - Mongolia
            - Montenegro
            - Morocco
            - Mozambique
            - Myanmar
            - Namibia
            - Nauru
            - Nepal
            - Netherlands
            - New Zealand
            - Nicaragua
            - Niger
            - Nigeria
            - North Macedonia
            - Norway
            - Oman
            - Pakistan
            - Palau
            - Palestine
            - Panama
            - Papua New Guinea
            - Paraguay
            - Peru
            - Philippines
            - Poland
            - Portugal
            - Qatar
            - Romania
            - Russia
            - Rwanda
            - Saint Kitts and Nevis
            - Saint Lucia
            - Saint Vincent and the Grenadines
            - Samoa
            - San Marino
            - Sao Tome and Principe
            - Saudi Arabia
            - Senegal
            - Serbia
            - Seychelles
            - Sierra Leone
            - Singapore
            - Slovakia
            - Slovenia
            - Solomon Islands
            - Somalia
            - South Africa
            - South Sudan
            - Spain
            - Sri Lanka
            - Sudan
            - Suriname
            - Sweden
            - Switzerland
            - Syria
            - Taiwan
            - Tajikistan
            - Tanzania
            - Thailand
            - Timor-Leste
            - Togo
            - Tonga
            - Trinidad and Tobago
            - Tunisia
            - Turkey
            - Turkmenistan
            - Tuvalu
            - Uganda
            - Ukraine
            - United Arab Emirates
            - United Kingdom
            - United States
            - Uruguay
            - Uzbekistan
            - Vanuatu
            - Vatican City
            - Venezuela
            - Vietnam
            - Yemen
            - Zambia
            - Zimbabwe
    CustomerCustomFields:
      required:
        - label
        - value
      properties:
        label:
          type: string
        value:
          type: string
      type: object
    EmptyData:
      type: object
      properties:
        message:
          type: string
          description: Response message
          example: No data found!
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication header of the form Bearer <token>, where <token>
        is your auth token.

````