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

# Create New Customer

> The API creates a new customer within Wingback or updates an existing one.

export const IntRedir = () => {
  if (typeof document === "undefined") {
    return null;
  } else {
    setTimeout(() => {
      const currentUrl = new URL(window.location.href);
      if (currentUrl.hostname === 'docs-int.wingback.com') {
        currentUrl.hostname = 'docs.wingback.com';
        window.location.replace(currentUrl.toString());
      }
    }, 1);
    return <></>;
  }
};

<IntRedir />


## OpenAPI

````yaml POST /v1/c/customer
openapi: 3.0.3
info:
  title: wingback-api
  description: ''
  contact:
    name: ''
  license:
    name: commercial
  version: 0.1.0
servers:
  - url: http://127.0.0.1:8080
    description: Local server
  - url: https://api.app.test.wingback.com
    description: Testing server
security: []
paths:
  /v1/c/customer:
    post:
      tags:
        - customer
      operationId: upsert_customer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/models.customer.Upsert'
        required: true
      responses:
        '200':
          description: Updated
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: string
              example: Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670
      security:
        - api-key: []
        - wb_user_cookie: []
components:
  schemas:
    models.customer.Upsert:
      type: object
      description: |-
        Used to either create a new Customer, or modify an existing Customer
        When `id` is empty, will create a new customer, while
        setting `id` will modify an existing customer
      properties:
        address:
          allOf:
            - $ref: '#/components/schemas/core.address.Address'
          nullable: true
        customer_reference:
          type: string
          description: Customer Reference. May contain a reference to an external system
          nullable: true
        emails:
          type: object
          description: Emails associated with this customer
          additionalProperties:
            type: string
          nullable: true
        id:
          allOf:
            - $ref: '#/components/schemas/Id'
          nullable: true
        metadata:
          allOf:
            - $ref: '#/components/schemas/CustomerMetadata'
          nullable: true
        name:
          type: string
          description: Name of the Customer
          nullable: true
        notes:
          type: string
          description: Additional notes for the customer
          nullable: true
        tax_details:
          allOf:
            - $ref: '#/components/schemas/CustomerTaxDetails'
          nullable: true
      example:
        addresses:
          main:
            address: 221B Baker St
            city: London
            country: UK
            zip: NW1 6XE
        emails:
          main: sherlock@wingback.com
        name: Sherlock Holmes
    core.address.Address:
      type: object
      description: Physical address. Used by both Customer and WbCustomer entities.
      required:
        - line_1
        - zip
        - city
        - country
      properties:
        city:
          type: string
          description: City name
        country:
          $ref: '#/components/schemas/Country'
        line_1:
          type: string
          description: First line of address
        line_2:
          type: string
          description: Second line of the address. Optional
          nullable: true
        state:
          type: string
          description: |-
            State, or another appropriate administrative region
            Empty string value will be treated as NULL
          nullable: true
        zip:
          type: string
          description: Zip or Postal code
    Id:
      type: string
      description: >-
        Unique identifier of an object. Consists of object class prefix and a
        UUID
      example: Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670
    CustomerMetadata:
      type: object
      description: Key-value customer metadata with string values.
      additionalProperties:
        type: string
    CustomerTaxDetails:
      type: object
      description: Extra information that impacts customer's taxation
      properties:
        vat_id:
          type: string
          description: Customer's VAT ID
          nullable: true
    Country:
      type: string
      description: ISO 3166 2-letter Country code
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: wb-key
    wb_user_cookie:
      type: apiKey
      in: cookie
      name: app-session

````