# Upsert Customer Create a new customer or update the details of an existing customer. For consumer customers, the email address and merchant identifier constitute the business key. For organisation customers, the customer reference id and the merchant identifier constitute the business key. If a record with the same business key already exists, then it is updated with the provided details, otherwise a new customer is added. Endpoint: POST /customers Version: 3.0 Security: Marketplace API Key | Merchant Secret Token ## Header parameters: - `Merchant-Id` (string) Perform operation in the context of the given merchant. Usually not required — specify only if acting on behalf of a merchant not implied by the credentials specified in the Authorization header. ## Response 200 fields (application/json): - `customerId` (string, required) - `merchantId` (string, required) ## Response 400 fields (application/json): - `statusCode` (integer, required) HTTP status code for this error - `errorCode` (string, required) An April code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type. - `message` (string, required) Human readable description of the error - `tracer` (string) An unique identifier for the request. Provide this to the support team if you wish to query a particular error. - `detail` (string) Optional additional details for the error. - `errorTypeDescription` (string) A description of the category of errors for the given statusCode. - `metadata` (any) Optional key value list of metadata ## Response 401 fields (application/json): - `statusCode` (integer, required) HTTP status code for this error - `errorCode` (string, required) An April code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type. - `message` (string, required) Human readable description of the error - `tracer` (string) An unique identifier for the request. Provide this to the support team if you wish to query a particular error. - `detail` (string) Optional additional details for the error. - `errorTypeDescription` (string) A description of the category of errors for the given statusCode. - `metadata` (any) Optional key value list of metadata ## Response 403 fields (application/json): - `statusCode` (integer, required) HTTP status code for this error - `errorCode` (string, required) An April code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type. - `message` (string, required) Human readable description of the error - `tracer` (string) An unique identifier for the request. Provide this to the support team if you wish to query a particular error. - `detail` (string) Optional additional details for the error. - `errorTypeDescription` (string) A description of the category of errors for the given statusCode. - `metadata` (any) Optional key value list of metadata ## Response 404 fields (application/json): - `statusCode` (integer, required) HTTP status code for this error - `errorCode` (string, required) An April code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type. - `message` (string, required) Human readable description of the error - `tracer` (string) An unique identifier for the request. Provide this to the support team if you wish to query a particular error. - `detail` (string) Optional additional details for the error. - `errorTypeDescription` (string) A description of the category of errors for the given statusCode. - `metadata` (any) Optional key value list of metadata ## Response 405 fields (application/json): - `statusCode` (integer, required) HTTP status code for this error - `errorCode` (string, required) An April code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type. - `message` (string, required) Human readable description of the error - `tracer` (string) An unique identifier for the request. Provide this to the support team if you wish to query a particular error. - `detail` (string) Optional additional details for the error. - `errorTypeDescription` (string) A description of the category of errors for the given statusCode. - `metadata` (any) Optional key value list of metadata ## Response 406 fields (application/json): - `statusCode` (integer, required) HTTP status code for this error - `errorCode` (string, required) An April code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type. - `message` (string, required) Human readable description of the error - `tracer` (string) An unique identifier for the request. Provide this to the support team if you wish to query a particular error. - `detail` (string) Optional additional details for the error. - `errorTypeDescription` (string) A description of the category of errors for the given statusCode. - `metadata` (any) Optional key value list of metadata ## Response 409 fields (application/json): - `statusCode` (integer, required) HTTP status code for this error - `errorCode` (string, required) An April code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type. - `message` (string, required) Human readable description of the error - `tracer` (string) An unique identifier for the request. Provide this to the support team if you wish to query a particular error. - `detail` (string) Optional additional details for the error. - `errorTypeDescription` (string) A description of the category of errors for the given statusCode. - `metadata` (any) Optional key value list of metadata ## Response 422 fields (application/json): - `statusCode` (integer, required) HTTP status code for this error - `errorCode` (string, required) An April code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type. - `message` (string, required) Human readable description of the error - `tracer` (string) An unique identifier for the request. Provide this to the support team if you wish to query a particular error. - `detail` (string) Optional additional details for the error. - `errorTypeDescription` (string) A description of the category of errors for the given statusCode. - `metadata` (any) Optional key value list of metadata ## Response 429 fields (application/json): - `statusCode` (integer, required) HTTP status code for this error - `errorCode` (string, required) An April code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type. - `message` (string, required) Human readable description of the error - `tracer` (string) An unique identifier for the request. Provide this to the support team if you wish to query a particular error. - `detail` (string) Optional additional details for the error. - `errorTypeDescription` (string) A description of the category of errors for the given statusCode. - `metadata` (any) Optional key value list of metadata ## Response 500 fields (application/json): - `statusCode` (integer, required) HTTP status code for this error - `errorCode` (string, required) An April code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type. - `message` (string, required) Human readable description of the error - `tracer` (string) An unique identifier for the request. Provide this to the support team if you wish to query a particular error. - `detail` (string) Optional additional details for the error. - `errorTypeDescription` (string) A description of the category of errors for the given statusCode. - `metadata` (any) Optional key value list of metadata ## Response 503 fields (application/json): - `statusCode` (integer, required) HTTP status code for this error - `errorCode` (string, required) An April code providing a brief explanation of the underlying error. Use this if you wish to provide custom behaviour based on the error type. - `message` (string, required) Human readable description of the error - `tracer` (string) An unique identifier for the request. Provide this to the support team if you wish to query a particular error. - `detail` (string) Optional additional details for the error. - `errorTypeDescription` (string) A description of the category of errors for the given statusCode. - `metadata` (any) Optional key value list of metadata