# Create a customer

Creates a customer (vendor) with optional billing address, shipping address, primary contact and account note,
without an order. Idempotent on supplier + `newVendor.email`: a retry after a lost response returns the existing
customer's references instead of creating a duplicate.
Accepts user session headers only. Contact support to request API key access for this endpoint.

Endpoint: POST /vendors
Version: 1.19
Security: UserGuid, UserToken, SupplierGuid

## Security:

  - `UserGuid` (unknown)
    apiKey in header userGuid

  - `UserToken` (unknown)
    apiKey in header userToken

  - `SupplierGuid` (unknown)
    apiKey in header supplierGuid

## Request fields (application/json):

  - `newVendor` (object, required)
    Customer fields accepted on create.

  - `newVendor.name` (string, required)
    Example: Acme, Inc.

  - `newVendor.email` (string)
    Example: orders@acme.example

  - `newVendor.customer_internal_id` (string)
    Your own identifier for this customer. Used for idempotent matching by some integrations.

  - `newVendor.phone` (string)

  - `newVendor.cell` (string)

  - `newVendor.fax` (string)

  - `newVendor.shipping_email` (string)

  - `newVendor.address_line_one` (string)

  - `newVendor.address_line_two` (string)

  - `newVendor.city` (string)

  - `newVendor.state` (string)

  - `newVendor.postal_code` (string)

  - `newVendor.country` (string)

  - `newVendor.active` (boolean)

  - `newVendor.tax_exempt` (boolean)

  - `newVendor.resale_tax_id` (string)

  - `newVendor.price_group_id` (integer)

  - `newVendor.lock_catalog_id` (integer)

  - `newVendor.payment_type_id` (integer)

  - `newVendor.payment_term_id` (integer)

  - `newVendor.require_payment` (boolean)

  - `newVendor.require_po` (boolean)

  - `newVendor.standing_po` (string)

  - `newVendor.hide_pricing` (boolean)

  - `newVendor.is_ecomm_user` (boolean)

  - `newVendor.notes` (string)

  - `newVendor.default_order_category_id` (integer)

  - `newVendor.route_id` (integer)

  - `newVendor.route_stop_order` (integer)
    Standing stop order of the customer on its route; null or omitted = unordered (sorts last, by name).

  - `newVendorBillTo` (object)
    Address fields accepted when creating or updating an address.

  - `newVendorBillTo.name` (string)
    Contact name at this address.
    Example: Jane Doe

  - `newVendorBillTo.company_name` (string)
    Example: Acme, Inc.

  - `newVendorBillTo.address_line_one` (string)
    Example: 123 Any Street

  - `newVendorBillTo.address_line_two` (string)
    Example: Unit A

  - `newVendorBillTo.address_line_three` (string)

  - `newVendorBillTo.city` (string)
    Example: Anytown

  - `newVendorBillTo.state` (string)
    Example: CA

  - `newVendorBillTo.postal_code` (string)
    Example: 12345

  - `newVendorBillTo.country` (string)
    Example: US

  - `newVendorBillTo.phone` (string)

  - `newVendorBillTo.fax` (string)

  - `newVendorBillTo.email` (string)

  - `newVendorBillTo.note` (string)

  - `newVendorBillTo.address_internal_id` (string)
    Your own identifier for this address.

  - `newVendorContact` (object)

  - `newVendorContact.name` (string, required)
    Example: Jane Doe

  - `newVendorContact.email` (string)

  - `newVendorContact.phone` (string)

  - `newVendorContact.mobile` (string)

  - `newVendorNote` (string)
    Free-text account note stored against the new customer.

  - `source` (string)
    Origin of the record (for example `APP`). Stored for reporting only.

## Response 200:

  - `200` (unknown)
    The created (or matched) customer.

## Response 200 fields (application/json):

  - `vendor` (object, required)
    A customer of the supplier. The full model includes many integration-specific fields (QuickBooks, Stripe, FastBound, routing); only the commonly used ones are listed here.

  - `vendor.id` (integer)

  - `vendor.guid` (string)

  - `vendor.supplier_id` (integer)

  - `vendor.parent_vendor_id` (integer)

  - `vendor.customer_internal_id` (string)
    Your own identifier for this customer.

  - `vendor.name` (string)

  - `vendor.email` (string)

  - `vendor.shipping_email` (string)

  - `vendor.phone` (string)

  - `vendor.cell` (string)

  - `vendor.fax` (string)

  - `vendor.address_line_one` (string)

  - `vendor.address_line_two` (string)

  - `vendor.city` (string)

  - `vendor.state` (string)

  - `vendor.postal_code` (string)

  - `vendor.country` (string)

  - `vendor.active` (boolean)

  - `vendor.tax_exempt` (boolean)

  - `vendor.resale_tax_id` (string)

  - `vendor.lock_catalog_id` (integer)
    When set, the customer can only order from this catalog.

  - `vendor.price_group_id` (integer)
    Price group used for this customer's pricing.

  - `vendor.payment_type_id` (integer)

  - `vendor.payment_term_id` (integer)

  - `vendor.require_payment` (boolean)

  - `vendor.credit_limit` (number)

  - `vendor.open_balance` (number)

  - `vendor.is_ecomm_user` (boolean)
    True for Orderwerks Online (e-commerce) customers.

  - `vendor.net_term_ecomm_user` (boolean)

  - `vendor.require_po` (boolean)

  - `vendor.standing_po` (string)

  - `vendor.hide_pricing` (boolean)

  - `vendor.currency_id` (integer)

  - `vendor.notes` (string)

  - `vendor.default_order_category_id` (integer)

  - `vendor.route_id` (integer)

  - `vendor.route_stop_order` (integer)
    Standing stop order of the customer on its route; null = unordered (sorts last, by name).

  - `vendor.timezone` (string)

  - `vendor.bill_to_id` (integer)

  - `vendor.ship_to_id` (integer)

  - `vendor.Bill_To` (object)
    A billing or shipping address. Additional internal fields may be present.

  - `vendor.Bill_To.id` (integer)

  - `vendor.Bill_To.guid` (string)

  - `vendor.Bill_To.vendor_id` (integer)

  - `vendor.Bill_To.order_id` (integer)

  - `vendor.Bill_To.name` (string)
    Contact name at this address.

  - `vendor.Bill_To.company_name` (string)

  - `vendor.Bill_To.address_line_one` (string)

  - `vendor.Bill_To.address_line_two` (string)

  - `vendor.Bill_To.address_line_three` (string)

  - `vendor.Bill_To.city` (string)

  - `vendor.Bill_To.state` (string)

  - `vendor.Bill_To.postal_code` (string)

  - `vendor.Bill_To.country` (string)

  - `vendor.Bill_To.phone` (string)

  - `vendor.Bill_To.fax` (string)

  - `vendor.Bill_To.email` (string)

  - `vendor.Bill_To.note` (string)

  - `vendor.Bill_To.address_internal_id` (string)
    Your own identifier for this address, if one was supplied.

  - `vendor.Bill_To.is_vendor_main_ship_to` (boolean)

  - `vendor.Bill_To.verified` (boolean)
    True when the address was verified against a postal database.

  - `vendor.Bill_To.lat` (number)

  - `vendor.Bill_To.lng` (number)

  - `vendor.Bill_To.created_at` (string)

  - `vendor.Bill_To.updated_at` (string)

  - `vendor.created_at` (string)

  - `vendor.updated_at` (string)

  - `vendor.deleted_at` (string)
    Present only in delta-sync responses for soft-deleted customers.

  - `billTo` (object)
    Minimal reference to a created record, so a client can back-fill its local rows.

  - `billTo.id` (integer, required)
    Example: 4821

  - `billTo.guid` (string, required)

## Response 400:

  - `400` (unknown)
    Validation failure (`newVendor` or `newVendor.name` missing).

## Response 400 fields (application/json):

  - `isValid` (boolean, required)
    Example: false

  - `inactiveAccount` (boolean)
    The customer account is inactive.

  - `noAccountAccess` (boolean)
    The caller may not order for this customer.

  - `message` (string)

  - `errors` (array, required)
    One entry per line that failed validation.

  - `errors.sku` (string)

  - `errors.name` (string)

  - `errors.active` (boolean)

  - `errors.inventoryAvailable` (number)

## Response 401:

  - `401` (unknown)
    Missing or invalid credentials.

## Response 401 fields (application/json):

  - `message` (string, required)
    Human-readable error message.
    Example: Invalid Catalog GUID

  - `error` (string)
    Underlying error detail, when available.

  - `code` (string)
    Machine-readable code for specific failures (for example `INVALID_DELTA_CURSOR`).

## Response 500:

  - `500` (unknown)
    Unexpected server error. Some legacy endpoints return the message as `text/plain` instead of JSON.

## Response 500 fields (application/json):

  - `message` (string, required)
    Human-readable error message.
    Example: Invalid Catalog GUID

  - `error` (string)
    Underlying error detail, when available.

  - `code` (string)
    Machine-readable code for specific failures (for example `INVALID_DELTA_CURSOR`).

