curl --request POST \
--url https://api.upwell.com/api/rest/customers \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"input": {
"addresses": {
"data": [
{
"canonicalAddressId": "<string>",
"city": "<string>",
"companyId": "<string>",
"companyName": "<string>",
"customerId": "<string>",
"locationCodeId": "<string>",
"name": "<string>",
"phoneNumber": "<string>",
"stateOrProvince": "<string>",
"streetLine1": "<string>",
"streetLine2": "<string>",
"streetLine3": "<string>",
"zipOrPostalCode": "<string>"
}
]
},
"billToCustomerId": "<string>",
"ccEmailAddresses": [
"<string>"
],
"contacts": {
"data": [
{
"customerId": "<string>",
"email": {
"email": "billing@example.com",
"type": "default"
},
"phoneNumber": {
"number": "+1-555-0100",
"type": "default"
}
}
]
},
"emailAddress": "<string>",
"isActive": true,
"metadata": {
"externalBatchId": "BATCH-123"
},
"name": "<string>",
"payorAliases": [
"ACME INC",
"ACME ACCOUNTS PAYABLE"
],
"sourceSystem": "<string>",
"sourceSystemId": "<string>",
"tmsCustomerType": "<string>",
"customer_invoice_emails": [
"<string>"
],
"customer_statement_emails": [
"<string>"
],
"customer_reminder_emails": [
"<string>"
],
"statementScheduleId": "<string>",
"forceClearRecipients": true
}
}
'import requests
url = "https://api.upwell.com/api/rest/customers"
payload = { "input": {
"addresses": { "data": [
{
"canonicalAddressId": "<string>",
"city": "<string>",
"companyId": "<string>",
"companyName": "<string>",
"customerId": "<string>",
"locationCodeId": "<string>",
"name": "<string>",
"phoneNumber": "<string>",
"stateOrProvince": "<string>",
"streetLine1": "<string>",
"streetLine2": "<string>",
"streetLine3": "<string>",
"zipOrPostalCode": "<string>"
}
] },
"billToCustomerId": "<string>",
"ccEmailAddresses": ["<string>"],
"contacts": { "data": [
{
"customerId": "<string>",
"email": {
"email": "billing@example.com",
"type": "default"
},
"phoneNumber": {
"number": "+1-555-0100",
"type": "default"
}
}
] },
"emailAddress": "<string>",
"isActive": True,
"metadata": { "externalBatchId": "BATCH-123" },
"name": "<string>",
"payorAliases": ["ACME INC", "ACME ACCOUNTS PAYABLE"],
"sourceSystem": "<string>",
"sourceSystemId": "<string>",
"tmsCustomerType": "<string>",
"customer_invoice_emails": ["<string>"],
"customer_statement_emails": ["<string>"],
"customer_reminder_emails": ["<string>"],
"statementScheduleId": "<string>",
"forceClearRecipients": True
} }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: {
addresses: {
data: [
{
canonicalAddressId: '<string>',
city: '<string>',
companyId: '<string>',
companyName: '<string>',
customerId: '<string>',
locationCodeId: '<string>',
name: '<string>',
phoneNumber: '<string>',
stateOrProvince: '<string>',
streetLine1: '<string>',
streetLine2: '<string>',
streetLine3: '<string>',
zipOrPostalCode: '<string>'
}
]
},
billToCustomerId: '<string>',
ccEmailAddresses: ['<string>'],
contacts: {
data: [
{
customerId: '<string>',
email: {email: 'billing@example.com', type: 'default'},
phoneNumber: {number: '+1-555-0100', type: 'default'}
}
]
},
emailAddress: '<string>',
isActive: true,
metadata: {externalBatchId: 'BATCH-123'},
name: '<string>',
payorAliases: ['ACME INC', 'ACME ACCOUNTS PAYABLE'],
sourceSystem: '<string>',
sourceSystemId: '<string>',
tmsCustomerType: '<string>',
customer_invoice_emails: ['<string>'],
customer_statement_emails: ['<string>'],
customer_reminder_emails: ['<string>'],
statementScheduleId: '<string>',
forceClearRecipients: true
}
})
};
fetch('https://api.upwell.com/api/rest/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.upwell.com/api/rest/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => [
'addresses' => [
'data' => [
[
'canonicalAddressId' => '<string>',
'city' => '<string>',
'companyId' => '<string>',
'companyName' => '<string>',
'customerId' => '<string>',
'locationCodeId' => '<string>',
'name' => '<string>',
'phoneNumber' => '<string>',
'stateOrProvince' => '<string>',
'streetLine1' => '<string>',
'streetLine2' => '<string>',
'streetLine3' => '<string>',
'zipOrPostalCode' => '<string>'
]
]
],
'billToCustomerId' => '<string>',
'ccEmailAddresses' => [
'<string>'
],
'contacts' => [
'data' => [
[
'customerId' => '<string>',
'email' => [
'email' => 'billing@example.com',
'type' => 'default'
],
'phoneNumber' => [
'number' => '+1-555-0100',
'type' => 'default'
]
]
]
],
'emailAddress' => '<string>',
'isActive' => true,
'metadata' => [
'externalBatchId' => 'BATCH-123'
],
'name' => '<string>',
'payorAliases' => [
'ACME INC',
'ACME ACCOUNTS PAYABLE'
],
'sourceSystem' => '<string>',
'sourceSystemId' => '<string>',
'tmsCustomerType' => '<string>',
'customer_invoice_emails' => [
'<string>'
],
'customer_statement_emails' => [
'<string>'
],
'customer_reminder_emails' => [
'<string>'
],
'statementScheduleId' => '<string>',
'forceClearRecipients' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.upwell.com/api/rest/customers"
payload := strings.NewReader("{\n \"input\": {\n \"addresses\": {\n \"data\": [\n {\n \"canonicalAddressId\": \"<string>\",\n \"city\": \"<string>\",\n \"companyId\": \"<string>\",\n \"companyName\": \"<string>\",\n \"customerId\": \"<string>\",\n \"locationCodeId\": \"<string>\",\n \"name\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"stateOrProvince\": \"<string>\",\n \"streetLine1\": \"<string>\",\n \"streetLine2\": \"<string>\",\n \"streetLine3\": \"<string>\",\n \"zipOrPostalCode\": \"<string>\"\n }\n ]\n },\n \"billToCustomerId\": \"<string>\",\n \"ccEmailAddresses\": [\n \"<string>\"\n ],\n \"contacts\": {\n \"data\": [\n {\n \"customerId\": \"<string>\",\n \"email\": {\n \"email\": \"billing@example.com\",\n \"type\": \"default\"\n },\n \"phoneNumber\": {\n \"number\": \"+1-555-0100\",\n \"type\": \"default\"\n }\n }\n ]\n },\n \"emailAddress\": \"<string>\",\n \"isActive\": true,\n \"metadata\": {\n \"externalBatchId\": \"BATCH-123\"\n },\n \"name\": \"<string>\",\n \"payorAliases\": [\n \"ACME INC\",\n \"ACME ACCOUNTS PAYABLE\"\n ],\n \"sourceSystem\": \"<string>\",\n \"sourceSystemId\": \"<string>\",\n \"tmsCustomerType\": \"<string>\",\n \"customer_invoice_emails\": [\n \"<string>\"\n ],\n \"customer_statement_emails\": [\n \"<string>\"\n ],\n \"customer_reminder_emails\": [\n \"<string>\"\n ],\n \"statementScheduleId\": \"<string>\",\n \"forceClearRecipients\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.upwell.com/api/rest/customers")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"addresses\": {\n \"data\": [\n {\n \"canonicalAddressId\": \"<string>\",\n \"city\": \"<string>\",\n \"companyId\": \"<string>\",\n \"companyName\": \"<string>\",\n \"customerId\": \"<string>\",\n \"locationCodeId\": \"<string>\",\n \"name\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"stateOrProvince\": \"<string>\",\n \"streetLine1\": \"<string>\",\n \"streetLine2\": \"<string>\",\n \"streetLine3\": \"<string>\",\n \"zipOrPostalCode\": \"<string>\"\n }\n ]\n },\n \"billToCustomerId\": \"<string>\",\n \"ccEmailAddresses\": [\n \"<string>\"\n ],\n \"contacts\": {\n \"data\": [\n {\n \"customerId\": \"<string>\",\n \"email\": {\n \"email\": \"billing@example.com\",\n \"type\": \"default\"\n },\n \"phoneNumber\": {\n \"number\": \"+1-555-0100\",\n \"type\": \"default\"\n }\n }\n ]\n },\n \"emailAddress\": \"<string>\",\n \"isActive\": true,\n \"metadata\": {\n \"externalBatchId\": \"BATCH-123\"\n },\n \"name\": \"<string>\",\n \"payorAliases\": [\n \"ACME INC\",\n \"ACME ACCOUNTS PAYABLE\"\n ],\n \"sourceSystem\": \"<string>\",\n \"sourceSystemId\": \"<string>\",\n \"tmsCustomerType\": \"<string>\",\n \"customer_invoice_emails\": [\n \"<string>\"\n ],\n \"customer_statement_emails\": [\n \"<string>\"\n ],\n \"customer_reminder_emails\": [\n \"<string>\"\n ],\n \"statementScheduleId\": \"<string>\",\n \"forceClearRecipients\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upwell.com/api/rest/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": {\n \"addresses\": {\n \"data\": [\n {\n \"canonicalAddressId\": \"<string>\",\n \"city\": \"<string>\",\n \"companyId\": \"<string>\",\n \"companyName\": \"<string>\",\n \"customerId\": \"<string>\",\n \"locationCodeId\": \"<string>\",\n \"name\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"stateOrProvince\": \"<string>\",\n \"streetLine1\": \"<string>\",\n \"streetLine2\": \"<string>\",\n \"streetLine3\": \"<string>\",\n \"zipOrPostalCode\": \"<string>\"\n }\n ]\n },\n \"billToCustomerId\": \"<string>\",\n \"ccEmailAddresses\": [\n \"<string>\"\n ],\n \"contacts\": {\n \"data\": [\n {\n \"customerId\": \"<string>\",\n \"email\": {\n \"email\": \"billing@example.com\",\n \"type\": \"default\"\n },\n \"phoneNumber\": {\n \"number\": \"+1-555-0100\",\n \"type\": \"default\"\n }\n }\n ]\n },\n \"emailAddress\": \"<string>\",\n \"isActive\": true,\n \"metadata\": {\n \"externalBatchId\": \"BATCH-123\"\n },\n \"name\": \"<string>\",\n \"payorAliases\": [\n \"ACME INC\",\n \"ACME ACCOUNTS PAYABLE\"\n ],\n \"sourceSystem\": \"<string>\",\n \"sourceSystemId\": \"<string>\",\n \"tmsCustomerType\": \"<string>\",\n \"customer_invoice_emails\": [\n \"<string>\"\n ],\n \"customer_statement_emails\": [\n \"<string>\"\n ],\n \"customer_reminder_emails\": [\n \"<string>\"\n ],\n \"statementScheduleId\": \"<string>\",\n \"forceClearRecipients\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"createCustomer": {
"addresses": [
{
"city": "<string>",
"country": "AD",
"id": "<string>",
"stateOrProvince": "<string>",
"streetLine1": "<string>",
"streetLine2": "<string>",
"type": "ADDRESS_BOOK",
"zipOrPostalCode": "<string>"
}
],
"balance": 450000,
"billToCustomerId": "<string>",
"ccEmailAddresses": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"customerRule": {
"dueOption": 123,
"id": "<string>"
},
"emailAddress": "<string>",
"id": "<string>",
"metadata": {
"externalBatchId": "BATCH-123"
},
"name": "<string>",
"overdueBalance": 450000,
"overdueInvoiceCount": 123,
"sourceSystem": "<string>",
"sourceSystemId": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"customer_invoice_emails": [
"<string>"
],
"customer_statement_emails": [
"<string>"
],
"customer_reminder_emails": [
"<string>"
]
}
}{
"error": "Not-NULL violation. null value in column \"shipment_id\" of relation \"shipments\" violates not-null constraint",
"code": "constraint-violation"
}{
"error": "Authentication hook unauthorized this request",
"path": "$",
"code": "access-denied"
}Create One Customer
Create One Customer. To set payment terms on create, send input.customerRule.data.dueOption. Use 0 for due on receipt or a positive integer for Net terms. Existing native customer fields, nested create inputs, filters and role permissions remain validated by Hasura. Recipient arrays use the existing delivery settings; entries are normalized, deduplicated and validated. Do not combine a convenience array with its native deliveryMethods, statementSchedules or reminderSettings representation. Unsupported, malformed, absent/ambiguous/foreign statement targets reject before customer or customer-rule writes. Runtime transport/database failures across mutation stages may follow committed changes: GET the customer, then retry the remaining changes with PUT. A post-insert invoice-recipient error identifies the stored customer ID; do not retry POST blindly. POST is for first sync; an existing source identity returns HTTP 400. Read the stored customer and use PUT for updates. Validation failures return HTTP 400.
curl --request POST \
--url https://api.upwell.com/api/rest/customers \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"input": {
"addresses": {
"data": [
{
"canonicalAddressId": "<string>",
"city": "<string>",
"companyId": "<string>",
"companyName": "<string>",
"customerId": "<string>",
"locationCodeId": "<string>",
"name": "<string>",
"phoneNumber": "<string>",
"stateOrProvince": "<string>",
"streetLine1": "<string>",
"streetLine2": "<string>",
"streetLine3": "<string>",
"zipOrPostalCode": "<string>"
}
]
},
"billToCustomerId": "<string>",
"ccEmailAddresses": [
"<string>"
],
"contacts": {
"data": [
{
"customerId": "<string>",
"email": {
"email": "billing@example.com",
"type": "default"
},
"phoneNumber": {
"number": "+1-555-0100",
"type": "default"
}
}
]
},
"emailAddress": "<string>",
"isActive": true,
"metadata": {
"externalBatchId": "BATCH-123"
},
"name": "<string>",
"payorAliases": [
"ACME INC",
"ACME ACCOUNTS PAYABLE"
],
"sourceSystem": "<string>",
"sourceSystemId": "<string>",
"tmsCustomerType": "<string>",
"customer_invoice_emails": [
"<string>"
],
"customer_statement_emails": [
"<string>"
],
"customer_reminder_emails": [
"<string>"
],
"statementScheduleId": "<string>",
"forceClearRecipients": true
}
}
'import requests
url = "https://api.upwell.com/api/rest/customers"
payload = { "input": {
"addresses": { "data": [
{
"canonicalAddressId": "<string>",
"city": "<string>",
"companyId": "<string>",
"companyName": "<string>",
"customerId": "<string>",
"locationCodeId": "<string>",
"name": "<string>",
"phoneNumber": "<string>",
"stateOrProvince": "<string>",
"streetLine1": "<string>",
"streetLine2": "<string>",
"streetLine3": "<string>",
"zipOrPostalCode": "<string>"
}
] },
"billToCustomerId": "<string>",
"ccEmailAddresses": ["<string>"],
"contacts": { "data": [
{
"customerId": "<string>",
"email": {
"email": "billing@example.com",
"type": "default"
},
"phoneNumber": {
"number": "+1-555-0100",
"type": "default"
}
}
] },
"emailAddress": "<string>",
"isActive": True,
"metadata": { "externalBatchId": "BATCH-123" },
"name": "<string>",
"payorAliases": ["ACME INC", "ACME ACCOUNTS PAYABLE"],
"sourceSystem": "<string>",
"sourceSystemId": "<string>",
"tmsCustomerType": "<string>",
"customer_invoice_emails": ["<string>"],
"customer_statement_emails": ["<string>"],
"customer_reminder_emails": ["<string>"],
"statementScheduleId": "<string>",
"forceClearRecipients": True
} }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: {
addresses: {
data: [
{
canonicalAddressId: '<string>',
city: '<string>',
companyId: '<string>',
companyName: '<string>',
customerId: '<string>',
locationCodeId: '<string>',
name: '<string>',
phoneNumber: '<string>',
stateOrProvince: '<string>',
streetLine1: '<string>',
streetLine2: '<string>',
streetLine3: '<string>',
zipOrPostalCode: '<string>'
}
]
},
billToCustomerId: '<string>',
ccEmailAddresses: ['<string>'],
contacts: {
data: [
{
customerId: '<string>',
email: {email: 'billing@example.com', type: 'default'},
phoneNumber: {number: '+1-555-0100', type: 'default'}
}
]
},
emailAddress: '<string>',
isActive: true,
metadata: {externalBatchId: 'BATCH-123'},
name: '<string>',
payorAliases: ['ACME INC', 'ACME ACCOUNTS PAYABLE'],
sourceSystem: '<string>',
sourceSystemId: '<string>',
tmsCustomerType: '<string>',
customer_invoice_emails: ['<string>'],
customer_statement_emails: ['<string>'],
customer_reminder_emails: ['<string>'],
statementScheduleId: '<string>',
forceClearRecipients: true
}
})
};
fetch('https://api.upwell.com/api/rest/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.upwell.com/api/rest/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => [
'addresses' => [
'data' => [
[
'canonicalAddressId' => '<string>',
'city' => '<string>',
'companyId' => '<string>',
'companyName' => '<string>',
'customerId' => '<string>',
'locationCodeId' => '<string>',
'name' => '<string>',
'phoneNumber' => '<string>',
'stateOrProvince' => '<string>',
'streetLine1' => '<string>',
'streetLine2' => '<string>',
'streetLine3' => '<string>',
'zipOrPostalCode' => '<string>'
]
]
],
'billToCustomerId' => '<string>',
'ccEmailAddresses' => [
'<string>'
],
'contacts' => [
'data' => [
[
'customerId' => '<string>',
'email' => [
'email' => 'billing@example.com',
'type' => 'default'
],
'phoneNumber' => [
'number' => '+1-555-0100',
'type' => 'default'
]
]
]
],
'emailAddress' => '<string>',
'isActive' => true,
'metadata' => [
'externalBatchId' => 'BATCH-123'
],
'name' => '<string>',
'payorAliases' => [
'ACME INC',
'ACME ACCOUNTS PAYABLE'
],
'sourceSystem' => '<string>',
'sourceSystemId' => '<string>',
'tmsCustomerType' => '<string>',
'customer_invoice_emails' => [
'<string>'
],
'customer_statement_emails' => [
'<string>'
],
'customer_reminder_emails' => [
'<string>'
],
'statementScheduleId' => '<string>',
'forceClearRecipients' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.upwell.com/api/rest/customers"
payload := strings.NewReader("{\n \"input\": {\n \"addresses\": {\n \"data\": [\n {\n \"canonicalAddressId\": \"<string>\",\n \"city\": \"<string>\",\n \"companyId\": \"<string>\",\n \"companyName\": \"<string>\",\n \"customerId\": \"<string>\",\n \"locationCodeId\": \"<string>\",\n \"name\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"stateOrProvince\": \"<string>\",\n \"streetLine1\": \"<string>\",\n \"streetLine2\": \"<string>\",\n \"streetLine3\": \"<string>\",\n \"zipOrPostalCode\": \"<string>\"\n }\n ]\n },\n \"billToCustomerId\": \"<string>\",\n \"ccEmailAddresses\": [\n \"<string>\"\n ],\n \"contacts\": {\n \"data\": [\n {\n \"customerId\": \"<string>\",\n \"email\": {\n \"email\": \"billing@example.com\",\n \"type\": \"default\"\n },\n \"phoneNumber\": {\n \"number\": \"+1-555-0100\",\n \"type\": \"default\"\n }\n }\n ]\n },\n \"emailAddress\": \"<string>\",\n \"isActive\": true,\n \"metadata\": {\n \"externalBatchId\": \"BATCH-123\"\n },\n \"name\": \"<string>\",\n \"payorAliases\": [\n \"ACME INC\",\n \"ACME ACCOUNTS PAYABLE\"\n ],\n \"sourceSystem\": \"<string>\",\n \"sourceSystemId\": \"<string>\",\n \"tmsCustomerType\": \"<string>\",\n \"customer_invoice_emails\": [\n \"<string>\"\n ],\n \"customer_statement_emails\": [\n \"<string>\"\n ],\n \"customer_reminder_emails\": [\n \"<string>\"\n ],\n \"statementScheduleId\": \"<string>\",\n \"forceClearRecipients\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.upwell.com/api/rest/customers")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"addresses\": {\n \"data\": [\n {\n \"canonicalAddressId\": \"<string>\",\n \"city\": \"<string>\",\n \"companyId\": \"<string>\",\n \"companyName\": \"<string>\",\n \"customerId\": \"<string>\",\n \"locationCodeId\": \"<string>\",\n \"name\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"stateOrProvince\": \"<string>\",\n \"streetLine1\": \"<string>\",\n \"streetLine2\": \"<string>\",\n \"streetLine3\": \"<string>\",\n \"zipOrPostalCode\": \"<string>\"\n }\n ]\n },\n \"billToCustomerId\": \"<string>\",\n \"ccEmailAddresses\": [\n \"<string>\"\n ],\n \"contacts\": {\n \"data\": [\n {\n \"customerId\": \"<string>\",\n \"email\": {\n \"email\": \"billing@example.com\",\n \"type\": \"default\"\n },\n \"phoneNumber\": {\n \"number\": \"+1-555-0100\",\n \"type\": \"default\"\n }\n }\n ]\n },\n \"emailAddress\": \"<string>\",\n \"isActive\": true,\n \"metadata\": {\n \"externalBatchId\": \"BATCH-123\"\n },\n \"name\": \"<string>\",\n \"payorAliases\": [\n \"ACME INC\",\n \"ACME ACCOUNTS PAYABLE\"\n ],\n \"sourceSystem\": \"<string>\",\n \"sourceSystemId\": \"<string>\",\n \"tmsCustomerType\": \"<string>\",\n \"customer_invoice_emails\": [\n \"<string>\"\n ],\n \"customer_statement_emails\": [\n \"<string>\"\n ],\n \"customer_reminder_emails\": [\n \"<string>\"\n ],\n \"statementScheduleId\": \"<string>\",\n \"forceClearRecipients\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upwell.com/api/rest/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": {\n \"addresses\": {\n \"data\": [\n {\n \"canonicalAddressId\": \"<string>\",\n \"city\": \"<string>\",\n \"companyId\": \"<string>\",\n \"companyName\": \"<string>\",\n \"customerId\": \"<string>\",\n \"locationCodeId\": \"<string>\",\n \"name\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"stateOrProvince\": \"<string>\",\n \"streetLine1\": \"<string>\",\n \"streetLine2\": \"<string>\",\n \"streetLine3\": \"<string>\",\n \"zipOrPostalCode\": \"<string>\"\n }\n ]\n },\n \"billToCustomerId\": \"<string>\",\n \"ccEmailAddresses\": [\n \"<string>\"\n ],\n \"contacts\": {\n \"data\": [\n {\n \"customerId\": \"<string>\",\n \"email\": {\n \"email\": \"billing@example.com\",\n \"type\": \"default\"\n },\n \"phoneNumber\": {\n \"number\": \"+1-555-0100\",\n \"type\": \"default\"\n }\n }\n ]\n },\n \"emailAddress\": \"<string>\",\n \"isActive\": true,\n \"metadata\": {\n \"externalBatchId\": \"BATCH-123\"\n },\n \"name\": \"<string>\",\n \"payorAliases\": [\n \"ACME INC\",\n \"ACME ACCOUNTS PAYABLE\"\n ],\n \"sourceSystem\": \"<string>\",\n \"sourceSystemId\": \"<string>\",\n \"tmsCustomerType\": \"<string>\",\n \"customer_invoice_emails\": [\n \"<string>\"\n ],\n \"customer_statement_emails\": [\n \"<string>\"\n ],\n \"customer_reminder_emails\": [\n \"<string>\"\n ],\n \"statementScheduleId\": \"<string>\",\n \"forceClearRecipients\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"createCustomer": {
"addresses": [
{
"city": "<string>",
"country": "AD",
"id": "<string>",
"stateOrProvince": "<string>",
"streetLine1": "<string>",
"streetLine2": "<string>",
"type": "ADDRESS_BOOK",
"zipOrPostalCode": "<string>"
}
],
"balance": 450000,
"billToCustomerId": "<string>",
"ccEmailAddresses": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"customerRule": {
"dueOption": 123,
"id": "<string>"
},
"emailAddress": "<string>",
"id": "<string>",
"metadata": {
"externalBatchId": "BATCH-123"
},
"name": "<string>",
"overdueBalance": 450000,
"overdueInvoiceCount": 123,
"sourceSystem": "<string>",
"sourceSystemId": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"customer_invoice_emails": [
"<string>"
],
"customer_statement_emails": [
"<string>"
],
"customer_reminder_emails": [
"<string>"
]
}
}{
"error": "Not-NULL violation. null value in column \"shipment_id\" of relation \"shipments\" violates not-null constraint",
"code": "constraint-violation"
}{
"error": "Authentication hook unauthorized this request",
"path": "$",
"code": "access-denied"
}POSTing an existing (sourceSystem, sourceSystemId) pair returns 400 Uniqueness violation — create once, then update with PUT. See Idempotency & retries.Authorizations
Body
Query parameters can also be provided in the request body as a JSON object

