> For the complete documentation index, see [llms.txt](https://docs.xorosoft.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xorosoft.com/developers-api/customer-management/create-or-update-customer.md).

# Create Or Update Customer

Creates a customer record or updates an existing customer profile and related address information. Use this endpoint when syncing customer master data from ecommerce, CRM, marketplace, or external ERP systems into Xorosoft ERP.

```json
{"openapi":"3.0.3","info":{"title":"Xorosoft ERP Public API","version":"2026.07"},"tags":[{"name":"Customer Management","description":"Use Customer Management APIs to retrieve, create, update, and maintain customer records and addresses. Customer data can be filtered by identifiers, names, email, phone, account number, tags, contact email, customer group, and date ranges. These APIs are intended for CRM, ecommerce, customer-service, and order-entry integrations that need customer information synchronized with Xorosoft ERP."}],"servers":[{"url":"https://res.xorosoft.io","description":"Xorosoft ERP API server"}],"security":[{"basic":[]}],"components":{"securitySchemes":{"basic":{"scheme":"basic","type":"http"}},"schemas":{"XoroApiResponse":{"type":"object","description":"Standard Xorosoft ERP API response envelope used by most endpoints.","properties":{"Result":{"type":"boolean","description":"True when the operation completed successfully."},"Message":{"type":"string","description":"Human-readable success or error message."},"Data":{"description":"Endpoint-specific payload.","type":"object","additionalProperties":true,"nullable":true},"Page":{"type":"integer","description":"Current page number when paging is enabled.","nullable":true},"TotalPages":{"type":"integer","description":"Total page count when paging is enabled.","nullable":true}}},"CustomerRequest":{"type":"object","description":"Customer create/update payload.","properties":{"CustomerName":{"type":"string","description":"Customer display name."},"CustomerNumber":{"type":"string","description":"Customer number assigned by the external system or Xorosoft ERP."},"Email":{"type":"string","description":"Customer email address.","format":"email","nullable":true},"Phone":{"type":"string","description":"Customer phone number.","nullable":true},"CurrencyCode":{"type":"string","description":"Customer currency code.","nullable":true},"BillToAddrList":{"type":"array","description":"Billing addresses associated with the customer.","items":{"$ref":"#/components/schemas/CustomerAddressRequest"}},"ShipToAddrList":{"type":"array","description":"Shipping addresses associated with the customer.","items":{"$ref":"#/components/schemas/CustomerAddressRequest"}}},"additionalProperties":true},"CustomerAddressRequest":{"type":"object","description":"Customer billing or shipping address payload.","required":["CustomerId","AddressName","AddressType","Addr","City","State","Country","PostalZipCode"],"properties":{"CustomerId":{"type":"integer","description":"Customer identifier in Xorosoft ERP."},"CustomerNumber":{"type":"string","description":"Customer number assigned in Xorosoft ERP."},"AddressId":{"type":"integer","description":"Existing address identifier when updating an address.","nullable":true},"AddressName":{"type":"string","description":"Saved address name."},"AddressType":{"type":"string","description":"Address type such as Bill To or Ship To."},"DefaultFlag":{"type":"boolean","description":"Marks this as the default address for the address type."},"Addr":{"type":"string","description":"Primary street address line."},"Addr2":{"type":"string","description":"Secondary street address line.","nullable":true},"City":{"type":"string","description":"City for the address."},"State":{"type":"string","description":"State, province, or region for the address."},"Country":{"type":"string","description":"Country for the address."},"PostalZipCode":{"type":"string","description":"Postal or ZIP code."},"FirstName":{"type":"string","description":"Contact first name for this address.","nullable":true},"LastName":{"type":"string","description":"Contact last name for this address.","nullable":true},"CompanyName":{"type":"string","description":"Company name associated with this address.","nullable":true},"PhoneNumber":{"type":"string","description":"Contact phone number for this address.","nullable":true},"Email":{"type":"string","description":"Contact email address for this address.","format":"email","nullable":true}}}}},"paths":{"/api/xerp/customers/export":{"post":{"tags":["Customer Management"],"summary":"Create Or Update Customer","description":"Creates a customer record or updates an existing customer profile and related address information. Use this endpoint when syncing customer master data from ecommerce, CRM, marketplace, or external ERP systems into Xorosoft ERP.","operationId":"post_customers_export","responses":{"200":{"description":"Request processed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XoroApiResponse"}}}},"400":{"description":"Invalid request, failed validation, or business rule error.","content":{"text/plain":{"schema":{"type":"string"}}}},"401":{"description":"Missing or invalid private app credentials."},"403":{"description":"Private app does not have permission for this request."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerRequest"}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.xorosoft.com/developers-api/customer-management/create-or-update-customer.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
