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

# Customer Create Api

> Creates a new customer in the system.



## OpenAPI

````yaml post /api/v1/customer/create
openapi: 3.1.0
info:
  title: NinjaAPI
  version: 1.0.0
  description: ''
servers:
  - url: https://api.justpaid.io
security: []
paths:
  /api/v1/customer/create:
    post:
      summary: Customer Create Api
      description: Creates a new customer in the system.
      operationId: loopfour_backend_customer_api_external_customer_create_api
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerIn'
        required: true
      responses:
        '200':
          description: Customer created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerOut'
              example:
                uuid: 123e4567-e89b-12d3-a456-426614174000
                name: John Doe
                email: john.doe@example.com
                external_id: CUST-001
                billing_address:
                  street: 123 Main St
                  city: Anytown
                  state: CA
                  postal_code: '12345'
                  country: US
                shipping_address:
                  street: 456 Elm St
                  city: Othertown
                  state: NY
                  postal_code: '67890'
                  country: US
        '400':
          description: Bad Request - Invalid input data
          content:
            application/json:
              example:
                detail: 'Invalid input: field X is required'
      security:
        - HttpBearerAuth: []
components:
  schemas:
    CustomerIn:
      description: |-
        Schema for creating or updating a customer.

        Attributes:
            name (str): The name of the customer.
            contact_name (Optional[str]): The name of the contact person for the customer.
            email (Optional[str]): The primary email address of the customer.
            additional_emails (Optional[List[str]]): A list of additional email addresses for the customer.
            billing_emails (Optional[List[str]]): A list of email addresses used for billing purposes.
            phone_number (Optional[str]): The customer's phone number, including country code.
            currency (Optional[str]): The currency used by the customer, defaulting to USD.
            tax_id (Optional[str]): The customer's tax identification number.
            billing_address (Optional[AddressSchema]): The customer's billing address.
            shipping_address (Optional[AddressSchema]): The customer's shipping address.
            external_id (Optional[str]): An external identifier for the customer.
      properties:
        name:
          description: The name of the customer.
          example: John Doe
          title: Name
          type: string
        external_id:
          description: >-
            An optional external identifier for the customer. This can be used
            to link the customer to an external system.
          example: CUST-001
          title: External Id
          type: string
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/AddressSchema'
            - type: 'null'
          description: The customer's billing address.
        shipping_address:
          anyOf:
            - $ref: '#/components/schemas/AddressSchema'
            - type: 'null'
          description: The customer's shipping address.
        currency:
          anyOf:
            - type: string
            - type: 'null'
          default: USD
          description: The currency used by the customer.
          example: USD
          title: Currency
        contact_name:
          anyOf:
            - maxLength: 100
              type: string
            - type: 'null'
          description: The name of the contact person
          title: Contact Name
        email:
          anyOf:
            - maxLength: 100
              type: string
            - type: 'null'
          title: Email
        additional_emails:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          description: A list of additional customer email addresses
          title: Additional Emails
        billing_emails:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          description: Billing email addresses
          title: Billing Emails
        phone_number:
          anyOf:
            - maxLength: 20
              type: string
            - type: 'null'
          description: Customer phone number with country code
          title: Phone Number
        tax_id:
          anyOf:
            - maxLength: 25
              type: string
            - type: 'null'
          description: Customer tax id
          title: Tax Id
      required:
        - name
      title: CustomerIn
      type: object
    CustomerOut:
      description: |-
        Schema for retrieving customer information.

        Attributes:
            uuid (UUID): The unique identifier for the customer.
            name (str): The name of the customer.
            contact_name (Optional[str]): The name of the contact person for the customer.
            email (Optional[str]): The primary email address of the customer.
            additional_emails (Optional[List[str]]): A list of additional email addresses for the customer.
            billing_emails (Optional[List[str]]): A list of email addresses used for billing purposes.
            phone_number (Optional[str]): The customer's phone number, including country code.
            currency (Optional[str]): The currency used by the customer.
            tax_id (Optional[str]): The customer's tax identification number.
            billing_address (Optional[AddressSchema]): The customer's billing address.
            shipping_address (Optional[AddressSchema]): The customer's shipping address.
            external_id (Optional[str]): An external identifier for the customer, aliased as 'external_customer_id'.
      properties:
        uuid:
          description: The unique identifier for the customer.
          example: 123e4567-e89b-12d3-a456-426614174000
          format: uuid
          title: Uuid
          type: string
        name:
          description: The name of the customer.
          example: John Doe
          title: Name
          type: string
        contact_name:
          anyOf:
            - type: string
            - type: 'null'
          description: The name of the contact person for the customer.
          example: John Doe
          title: Contact Name
        email:
          anyOf:
            - type: string
            - type: 'null'
          description: The primary email address of the customer.
          example: john.doe@example.com
          title: Email
        additional_emails:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: A list of additional email addresses for the customer.
          example:
            - john.doe@example.com
            - jane.doe@example.com
          title: Additional Emails
        billing_emails:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: A list of email addresses used for billing purposes.
          example:
            - john.doe@example.com
            - jane.doe@example.com
          title: Billing Emails
        phone_number:
          anyOf:
            - type: string
            - type: 'null'
          description: The customer's phone number, including country code.
          example: '+1234567890'
          title: Phone Number
        currency:
          anyOf:
            - type: string
            - type: 'null'
          description: The currency used by the customer.
          example: USD
          title: Currency
        tax_id:
          anyOf:
            - type: string
            - type: 'null'
          description: The customer's tax identification number.
          example: '1234567890'
          title: Tax Id
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/AddressSchema'
            - type: 'null'
          description: The customer's billing address.
        shipping_address:
          anyOf:
            - $ref: '#/components/schemas/AddressSchema'
            - type: 'null'
          description: The customer's shipping address.
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            An optional external identifier for the customer. This can be used
            to link the customer to an external system.
          example: CUST-001
          title: External Id
        external_customer_id:
          anyOf:
            - maxLength: 100
              type: string
            - type: 'null'
          description: External customer Id
          title: External Customer Id
      title: CustomerOut
      type: object
    AddressSchema:
      description: |-
        Schema for an address object.

        Attributes:
            address_line1 (Optional[str]): The first line of the address.
            address_line2 (Optional[str]): The second line of the address.
            city (Optional[str]): The city of the address.
            state (Optional[str]): The state of the address.
            zip (Optional[str]): The ZIP code of the address.
            country (Optional[str]): The country of the address.
      properties:
        address_line1:
          anyOf:
            - maxLength: 100
              type: string
            - type: 'null'
          description: Customer address line 1
          title: Address Line1
        address_line2:
          anyOf:
            - maxLength: 100
              type: string
            - type: 'null'
          description: Customer address line 2
          title: Address Line2
        city:
          anyOf:
            - maxLength: 60
              type: string
            - type: 'null'
          description: Customer city
          title: City
        state:
          anyOf:
            - maxLength: 60
              type: string
            - type: 'null'
          description: Customer state
          title: State
        zip:
          anyOf:
            - maxLength: 10
              type: string
            - type: 'null'
          description: Customer zip code
          title: Zip
        country:
          anyOf:
            - maxLength: 60
              type: string
            - type: 'null'
          description: Customer country
          title: Country
      title: AddressSchema
      type: object
  securitySchemes:
    HttpBearerAuth:
      type: http
      scheme: bearer

````