Create a customer
curl --request POST \
--url https://core.nozle.app/api/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer": {
"external_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"billing_entity_code": "acme_corp",
"address_line1": "5230 Penfield Ave",
"address_line2": "",
"city": "Woodland Hills",
"country": "US",
"currency": "USD",
"email": "dinesh@piedpiper.test",
"legal_name": "Coleman-Blair",
"legal_number": "49-008-2965",
"logo_url": "http://hooli.com/logo.png",
"name": "Gavin Belson",
"firstname": "Gavin",
"lastname": "Belson",
"account_type": "customer",
"phone": "1-171-883-3711 x245",
"state": "CA",
"tax_codes": [
"french_standard_vat"
],
"tax_identification_number": "EU123456789",
"timezone": "America/Los_Angeles",
"url": "http://hooli.com",
"zipcode": "91364",
"net_payment_term": 30,
"finalize_zero_amount_invoice": "inherit",
"billing_configuration": {
"invoice_grace_period": 3,
"subscription_invoice_issuing_date_anchor": "next_period_start",
"subscription_invoice_issuing_date_adjustment": "keep_anchor",
"payment_provider": "stripe",
"payment_provider_code": "stripe-eu-1",
"provider_customer_id": "cus_12345",
"sync": true,
"sync_with_provider": true,
"document_locale": "fr",
"provider_payment_methods": [
"card",
"sepa_debit",
"us_bank_account",
"bacs_debit",
"link",
"boleto",
"crypto",
"customer_balance"
]
},
"shipping_address": {
"address_line1": "5230 Penfield Ave",
"address_line2": null,
"city": "Woodland Hills",
"country": "US",
"state": "CA",
"zipcode": "91364"
},
"integration_customers": [
{
"id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"integration_type": "netsuite",
"integration_code": "netsuite-eu-1",
"external_customer_id": "cus_12345",
"sync_with_provider": true,
"subsidiary_id": "2"
}
],
"metadata": [
{
"key": "Purchase Order",
"value": "123456789",
"display_in_invoice": true,
"id": "1a901a90-1a90-1a90-1a90-1a901a901a90"
}
],
"skip_invoice_custom_sections": false,
"invoice_custom_section_codes": [
"eu_bank_details"
]
}
}
'import requests
url = "https://core.nozle.app/api/v1/customers"
payload = { "customer": {
"external_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"billing_entity_code": "acme_corp",
"address_line1": "5230 Penfield Ave",
"address_line2": "",
"city": "Woodland Hills",
"country": "US",
"currency": "USD",
"email": "dinesh@piedpiper.test",
"legal_name": "Coleman-Blair",
"legal_number": "49-008-2965",
"logo_url": "http://hooli.com/logo.png",
"name": "Gavin Belson",
"firstname": "Gavin",
"lastname": "Belson",
"account_type": "customer",
"phone": "1-171-883-3711 x245",
"state": "CA",
"tax_codes": ["french_standard_vat"],
"tax_identification_number": "EU123456789",
"timezone": "America/Los_Angeles",
"url": "http://hooli.com",
"zipcode": "91364",
"net_payment_term": 30,
"finalize_zero_amount_invoice": "inherit",
"billing_configuration": {
"invoice_grace_period": 3,
"subscription_invoice_issuing_date_anchor": "next_period_start",
"subscription_invoice_issuing_date_adjustment": "keep_anchor",
"payment_provider": "stripe",
"payment_provider_code": "stripe-eu-1",
"provider_customer_id": "cus_12345",
"sync": True,
"sync_with_provider": True,
"document_locale": "fr",
"provider_payment_methods": ["card", "sepa_debit", "us_bank_account", "bacs_debit", "link", "boleto", "crypto", "customer_balance"]
},
"shipping_address": {
"address_line1": "5230 Penfield Ave",
"address_line2": None,
"city": "Woodland Hills",
"country": "US",
"state": "CA",
"zipcode": "91364"
},
"integration_customers": [
{
"id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"integration_type": "netsuite",
"integration_code": "netsuite-eu-1",
"external_customer_id": "cus_12345",
"sync_with_provider": True,
"subsidiary_id": "2"
}
],
"metadata": [
{
"key": "Purchase Order",
"value": "123456789",
"display_in_invoice": True,
"id": "1a901a90-1a90-1a90-1a90-1a901a901a90"
}
],
"skip_invoice_custom_sections": False,
"invoice_custom_section_codes": ["eu_bank_details"]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer: {
external_id: '5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba',
billing_entity_code: 'acme_corp',
address_line1: '5230 Penfield Ave',
address_line2: '',
city: 'Woodland Hills',
country: 'US',
currency: 'USD',
email: 'dinesh@piedpiper.test',
legal_name: 'Coleman-Blair',
legal_number: '49-008-2965',
logo_url: 'http://hooli.com/logo.png',
name: 'Gavin Belson',
firstname: 'Gavin',
lastname: 'Belson',
account_type: 'customer',
phone: '1-171-883-3711 x245',
state: 'CA',
tax_codes: ['french_standard_vat'],
tax_identification_number: 'EU123456789',
timezone: 'America/Los_Angeles',
url: 'http://hooli.com',
zipcode: '91364',
net_payment_term: 30,
finalize_zero_amount_invoice: 'inherit',
billing_configuration: {
invoice_grace_period: 3,
subscription_invoice_issuing_date_anchor: 'next_period_start',
subscription_invoice_issuing_date_adjustment: 'keep_anchor',
payment_provider: 'stripe',
payment_provider_code: 'stripe-eu-1',
provider_customer_id: 'cus_12345',
sync: true,
sync_with_provider: true,
document_locale: 'fr',
provider_payment_methods: [
'card',
'sepa_debit',
'us_bank_account',
'bacs_debit',
'link',
'boleto',
'crypto',
'customer_balance'
]
},
shipping_address: {
address_line1: '5230 Penfield Ave',
address_line2: null,
city: 'Woodland Hills',
country: 'US',
state: 'CA',
zipcode: '91364'
},
integration_customers: [
{
id: '1a901a90-1a90-1a90-1a90-1a901a901a90',
integration_type: 'netsuite',
integration_code: 'netsuite-eu-1',
external_customer_id: 'cus_12345',
sync_with_provider: true,
subsidiary_id: '2'
}
],
metadata: [
{
key: 'Purchase Order',
value: '123456789',
display_in_invoice: true,
id: '1a901a90-1a90-1a90-1a90-1a901a901a90'
}
],
skip_invoice_custom_sections: false,
invoice_custom_section_codes: ['eu_bank_details']
}
})
};
fetch('https://core.nozle.app/api/v1/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://core.nozle.app/api/v1/customers"
payload := strings.NewReader("{\n \"customer\": {\n \"external_id\": \"5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba\",\n \"billing_entity_code\": \"acme_corp\",\n \"address_line1\": \"5230 Penfield Ave\",\n \"address_line2\": \"\",\n \"city\": \"Woodland Hills\",\n \"country\": \"US\",\n \"currency\": \"USD\",\n \"email\": \"dinesh@piedpiper.test\",\n \"legal_name\": \"Coleman-Blair\",\n \"legal_number\": \"49-008-2965\",\n \"logo_url\": \"http://hooli.com/logo.png\",\n \"name\": \"Gavin Belson\",\n \"firstname\": \"Gavin\",\n \"lastname\": \"Belson\",\n \"account_type\": \"customer\",\n \"phone\": \"1-171-883-3711 x245\",\n \"state\": \"CA\",\n \"tax_codes\": [\n \"french_standard_vat\"\n ],\n \"tax_identification_number\": \"EU123456789\",\n \"timezone\": \"America/Los_Angeles\",\n \"url\": \"http://hooli.com\",\n \"zipcode\": \"91364\",\n \"net_payment_term\": 30,\n \"finalize_zero_amount_invoice\": \"inherit\",\n \"billing_configuration\": {\n \"invoice_grace_period\": 3,\n \"subscription_invoice_issuing_date_anchor\": \"next_period_start\",\n \"subscription_invoice_issuing_date_adjustment\": \"keep_anchor\",\n \"payment_provider\": \"stripe\",\n \"payment_provider_code\": \"stripe-eu-1\",\n \"provider_customer_id\": \"cus_12345\",\n \"sync\": true,\n \"sync_with_provider\": true,\n \"document_locale\": \"fr\",\n \"provider_payment_methods\": [\n \"card\",\n \"sepa_debit\",\n \"us_bank_account\",\n \"bacs_debit\",\n \"link\",\n \"boleto\",\n \"crypto\",\n \"customer_balance\"\n ]\n },\n \"shipping_address\": {\n \"address_line1\": \"5230 Penfield Ave\",\n \"address_line2\": null,\n \"city\": \"Woodland Hills\",\n \"country\": \"US\",\n \"state\": \"CA\",\n \"zipcode\": \"91364\"\n },\n \"integration_customers\": [\n {\n \"id\": \"1a901a90-1a90-1a90-1a90-1a901a901a90\",\n \"integration_type\": \"netsuite\",\n \"integration_code\": \"netsuite-eu-1\",\n \"external_customer_id\": \"cus_12345\",\n \"sync_with_provider\": true,\n \"subsidiary_id\": \"2\"\n }\n ],\n \"metadata\": [\n {\n \"key\": \"Purchase Order\",\n \"value\": \"123456789\",\n \"display_in_invoice\": true,\n \"id\": \"1a901a90-1a90-1a90-1a90-1a901a901a90\"\n }\n ],\n \"skip_invoice_custom_sections\": false,\n \"invoice_custom_section_codes\": [\n \"eu_bank_details\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}require 'uri'
require 'net/http'
url = URI("https://core.nozle.app/api/v1/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer\": {\n \"external_id\": \"5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba\",\n \"billing_entity_code\": \"acme_corp\",\n \"address_line1\": \"5230 Penfield Ave\",\n \"address_line2\": \"\",\n \"city\": \"Woodland Hills\",\n \"country\": \"US\",\n \"currency\": \"USD\",\n \"email\": \"dinesh@piedpiper.test\",\n \"legal_name\": \"Coleman-Blair\",\n \"legal_number\": \"49-008-2965\",\n \"logo_url\": \"http://hooli.com/logo.png\",\n \"name\": \"Gavin Belson\",\n \"firstname\": \"Gavin\",\n \"lastname\": \"Belson\",\n \"account_type\": \"customer\",\n \"phone\": \"1-171-883-3711 x245\",\n \"state\": \"CA\",\n \"tax_codes\": [\n \"french_standard_vat\"\n ],\n \"tax_identification_number\": \"EU123456789\",\n \"timezone\": \"America/Los_Angeles\",\n \"url\": \"http://hooli.com\",\n \"zipcode\": \"91364\",\n \"net_payment_term\": 30,\n \"finalize_zero_amount_invoice\": \"inherit\",\n \"billing_configuration\": {\n \"invoice_grace_period\": 3,\n \"subscription_invoice_issuing_date_anchor\": \"next_period_start\",\n \"subscription_invoice_issuing_date_adjustment\": \"keep_anchor\",\n \"payment_provider\": \"stripe\",\n \"payment_provider_code\": \"stripe-eu-1\",\n \"provider_customer_id\": \"cus_12345\",\n \"sync\": true,\n \"sync_with_provider\": true,\n \"document_locale\": \"fr\",\n \"provider_payment_methods\": [\n \"card\",\n \"sepa_debit\",\n \"us_bank_account\",\n \"bacs_debit\",\n \"link\",\n \"boleto\",\n \"crypto\",\n \"customer_balance\"\n ]\n },\n \"shipping_address\": {\n \"address_line1\": \"5230 Penfield Ave\",\n \"address_line2\": null,\n \"city\": \"Woodland Hills\",\n \"country\": \"US\",\n \"state\": \"CA\",\n \"zipcode\": \"91364\"\n },\n \"integration_customers\": [\n {\n \"id\": \"1a901a90-1a90-1a90-1a90-1a901a901a90\",\n \"integration_type\": \"netsuite\",\n \"integration_code\": \"netsuite-eu-1\",\n \"external_customer_id\": \"cus_12345\",\n \"sync_with_provider\": true,\n \"subsidiary_id\": \"2\"\n }\n ],\n \"metadata\": [\n {\n \"key\": \"Purchase Order\",\n \"value\": \"123456789\",\n \"display_in_invoice\": true,\n \"id\": \"1a901a90-1a90-1a90-1a90-1a901a901a90\"\n }\n ],\n \"skip_invoice_custom_sections\": false,\n \"invoice_custom_section_codes\": [\n \"eu_bank_details\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://core.nozle.app/api/v1/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([
'customer' => [
'external_id' => '5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba',
'billing_entity_code' => 'acme_corp',
'address_line1' => '5230 Penfield Ave',
'address_line2' => '',
'city' => 'Woodland Hills',
'country' => 'US',
'currency' => 'USD',
'email' => 'dinesh@piedpiper.test',
'legal_name' => 'Coleman-Blair',
'legal_number' => '49-008-2965',
'logo_url' => 'http://hooli.com/logo.png',
'name' => 'Gavin Belson',
'firstname' => 'Gavin',
'lastname' => 'Belson',
'account_type' => 'customer',
'phone' => '1-171-883-3711 x245',
'state' => 'CA',
'tax_codes' => [
'french_standard_vat'
],
'tax_identification_number' => 'EU123456789',
'timezone' => 'America/Los_Angeles',
'url' => 'http://hooli.com',
'zipcode' => '91364',
'net_payment_term' => 30,
'finalize_zero_amount_invoice' => 'inherit',
'billing_configuration' => [
'invoice_grace_period' => 3,
'subscription_invoice_issuing_date_anchor' => 'next_period_start',
'subscription_invoice_issuing_date_adjustment' => 'keep_anchor',
'payment_provider' => 'stripe',
'payment_provider_code' => 'stripe-eu-1',
'provider_customer_id' => 'cus_12345',
'sync' => true,
'sync_with_provider' => true,
'document_locale' => 'fr',
'provider_payment_methods' => [
'card',
'sepa_debit',
'us_bank_account',
'bacs_debit',
'link',
'boleto',
'crypto',
'customer_balance'
]
],
'shipping_address' => [
'address_line1' => '5230 Penfield Ave',
'address_line2' => null,
'city' => 'Woodland Hills',
'country' => 'US',
'state' => 'CA',
'zipcode' => '91364'
],
'integration_customers' => [
[
'id' => '1a901a90-1a90-1a90-1a90-1a901a901a90',
'integration_type' => 'netsuite',
'integration_code' => 'netsuite-eu-1',
'external_customer_id' => 'cus_12345',
'sync_with_provider' => true,
'subsidiary_id' => '2'
]
],
'metadata' => [
[
'key' => 'Purchase Order',
'value' => '123456789',
'display_in_invoice' => true,
'id' => '1a901a90-1a90-1a90-1a90-1a901a901a90'
]
],
'skip_invoice_custom_sections' => false,
'invoice_custom_section_codes' => [
'eu_bank_details'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://core.nozle.app/api/v1/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer\": {\n \"external_id\": \"5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba\",\n \"billing_entity_code\": \"acme_corp\",\n \"address_line1\": \"5230 Penfield Ave\",\n \"address_line2\": \"\",\n \"city\": \"Woodland Hills\",\n \"country\": \"US\",\n \"currency\": \"USD\",\n \"email\": \"dinesh@piedpiper.test\",\n \"legal_name\": \"Coleman-Blair\",\n \"legal_number\": \"49-008-2965\",\n \"logo_url\": \"http://hooli.com/logo.png\",\n \"name\": \"Gavin Belson\",\n \"firstname\": \"Gavin\",\n \"lastname\": \"Belson\",\n \"account_type\": \"customer\",\n \"phone\": \"1-171-883-3711 x245\",\n \"state\": \"CA\",\n \"tax_codes\": [\n \"french_standard_vat\"\n ],\n \"tax_identification_number\": \"EU123456789\",\n \"timezone\": \"America/Los_Angeles\",\n \"url\": \"http://hooli.com\",\n \"zipcode\": \"91364\",\n \"net_payment_term\": 30,\n \"finalize_zero_amount_invoice\": \"inherit\",\n \"billing_configuration\": {\n \"invoice_grace_period\": 3,\n \"subscription_invoice_issuing_date_anchor\": \"next_period_start\",\n \"subscription_invoice_issuing_date_adjustment\": \"keep_anchor\",\n \"payment_provider\": \"stripe\",\n \"payment_provider_code\": \"stripe-eu-1\",\n \"provider_customer_id\": \"cus_12345\",\n \"sync\": true,\n \"sync_with_provider\": true,\n \"document_locale\": \"fr\",\n \"provider_payment_methods\": [\n \"card\",\n \"sepa_debit\",\n \"us_bank_account\",\n \"bacs_debit\",\n \"link\",\n \"boleto\",\n \"crypto\",\n \"customer_balance\"\n ]\n },\n \"shipping_address\": {\n \"address_line1\": \"5230 Penfield Ave\",\n \"address_line2\": null,\n \"city\": \"Woodland Hills\",\n \"country\": \"US\",\n \"state\": \"CA\",\n \"zipcode\": \"91364\"\n },\n \"integration_customers\": [\n {\n \"id\": \"1a901a90-1a90-1a90-1a90-1a901a901a90\",\n \"integration_type\": \"netsuite\",\n \"integration_code\": \"netsuite-eu-1\",\n \"external_customer_id\": \"cus_12345\",\n \"sync_with_provider\": true,\n \"subsidiary_id\": \"2\"\n }\n ],\n \"metadata\": [\n {\n \"key\": \"Purchase Order\",\n \"value\": \"123456789\",\n \"display_in_invoice\": true,\n \"id\": \"1a901a90-1a90-1a90-1a90-1a901a901a90\"\n }\n ],\n \"skip_invoice_custom_sections\": false,\n \"invoice_custom_section_codes\": [\n \"eu_bank_details\"\n ]\n }\n}")
.asString();{
"customer": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"sequential_id": 1,
"slug": "LAG-1234-001",
"external_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"applicable_timezone": "America/Los_Angeles",
"created_at": "2022-04-29T08:59:51Z",
"billing_entity_code": "acme_corp",
"address_line1": "5230 Penfield Ave",
"address_line2": null,
"city": "Woodland Hills",
"country": "US",
"currency": "USD",
"email": "dinesh@piedpiper.test",
"legal_name": "Coleman-Blair",
"legal_number": "49-008-2965",
"logo_url": "http://hooli.com/logo.png",
"name": "Gavin Belson",
"firstname": "Gavin",
"lastname": "Belson",
"account_type": "customer",
"customer_type": "company",
"phone": "1-171-883-3711 x245",
"state": "CA",
"tax_identification_number": "EU123456789",
"timezone": "America/Los_Angeles",
"url": "http://hooli.com",
"zipcode": "91364",
"net_payment_term": 30,
"updated_at": "2022-04-29T08:59:51Z",
"finalize_zero_amount_invoice": "inherit",
"skip_invoice_custom_sections": false,
"billing_configuration": {
"invoice_grace_period": 3,
"subscription_invoice_issuing_date_anchor": "next_period_start",
"subscription_invoice_issuing_date_adjustment": "keep_anchor",
"payment_provider": "stripe",
"payment_provider_code": "stripe-eu-1",
"provider_customer_id": "cus_12345",
"sync": true,
"sync_with_provider": true,
"document_locale": "fr",
"provider_payment_methods": [
"card",
"sepa_debit",
"us_bank_account",
"bacs_debit",
"link",
"boleto",
"crypto",
"customer_balance"
]
},
"shipping_address": {
"address_line1": "5230 Penfield Ave",
"address_line2": null,
"city": "Woodland Hills",
"country": "US",
"state": "CA",
"zipcode": "91364"
},
"metadata": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"key": "Purchase Order",
"value": "123456789",
"display_in_invoice": true,
"created_at": "2022-04-29T08:59:51Z"
}
],
"integration_customers": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"type": "netsuite",
"integration_code": "netsuite-eu-1",
"external_customer_id": "cus_12345",
"sync_with_provider": true,
"subsidiary_id": "2",
"targeted_object": "contacts",
"email": "dinesh@piedpiper.test"
}
],
"taxes": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "TVA",
"code": "french_standard_vat",
"rate": 20,
"applied_to_organization": true,
"created_at": "2023-07-06T14:35:58Z",
"description": "French standard VAT"
}
],
"applicable_invoice_custom_sections": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "EU Bank Details",
"code": "eu_bank_details",
"description": "This section contains the bank details for EU customers.",
"details": "Bank Name: Nozle Bank, IBAN: FR7630004000031234567890143",
"display_name": "Bank Details:",
"applied_to_organization": true,
"organization_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"created_at": "2023-07-06T14:35:58Z"
}
],
"error_details": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"error_code": "tax_error",
"details": {
"tax_error": "taxDateTooFarInFuture"
}
}
]
}
}{
"status": 400,
"error": "Bad request"
}{
"status": 401,
"error": "Unauthorized"
}{
"status": 422,
"error": "Unprocessable entity",
"code": "validation_errors",
"error_details": {}
}Customers
Create a customer
This endpoint creates a new customer.
POST
/
customers
Create a customer
curl --request POST \
--url https://core.nozle.app/api/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer": {
"external_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"billing_entity_code": "acme_corp",
"address_line1": "5230 Penfield Ave",
"address_line2": "",
"city": "Woodland Hills",
"country": "US",
"currency": "USD",
"email": "dinesh@piedpiper.test",
"legal_name": "Coleman-Blair",
"legal_number": "49-008-2965",
"logo_url": "http://hooli.com/logo.png",
"name": "Gavin Belson",
"firstname": "Gavin",
"lastname": "Belson",
"account_type": "customer",
"phone": "1-171-883-3711 x245",
"state": "CA",
"tax_codes": [
"french_standard_vat"
],
"tax_identification_number": "EU123456789",
"timezone": "America/Los_Angeles",
"url": "http://hooli.com",
"zipcode": "91364",
"net_payment_term": 30,
"finalize_zero_amount_invoice": "inherit",
"billing_configuration": {
"invoice_grace_period": 3,
"subscription_invoice_issuing_date_anchor": "next_period_start",
"subscription_invoice_issuing_date_adjustment": "keep_anchor",
"payment_provider": "stripe",
"payment_provider_code": "stripe-eu-1",
"provider_customer_id": "cus_12345",
"sync": true,
"sync_with_provider": true,
"document_locale": "fr",
"provider_payment_methods": [
"card",
"sepa_debit",
"us_bank_account",
"bacs_debit",
"link",
"boleto",
"crypto",
"customer_balance"
]
},
"shipping_address": {
"address_line1": "5230 Penfield Ave",
"address_line2": null,
"city": "Woodland Hills",
"country": "US",
"state": "CA",
"zipcode": "91364"
},
"integration_customers": [
{
"id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"integration_type": "netsuite",
"integration_code": "netsuite-eu-1",
"external_customer_id": "cus_12345",
"sync_with_provider": true,
"subsidiary_id": "2"
}
],
"metadata": [
{
"key": "Purchase Order",
"value": "123456789",
"display_in_invoice": true,
"id": "1a901a90-1a90-1a90-1a90-1a901a901a90"
}
],
"skip_invoice_custom_sections": false,
"invoice_custom_section_codes": [
"eu_bank_details"
]
}
}
'import requests
url = "https://core.nozle.app/api/v1/customers"
payload = { "customer": {
"external_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"billing_entity_code": "acme_corp",
"address_line1": "5230 Penfield Ave",
"address_line2": "",
"city": "Woodland Hills",
"country": "US",
"currency": "USD",
"email": "dinesh@piedpiper.test",
"legal_name": "Coleman-Blair",
"legal_number": "49-008-2965",
"logo_url": "http://hooli.com/logo.png",
"name": "Gavin Belson",
"firstname": "Gavin",
"lastname": "Belson",
"account_type": "customer",
"phone": "1-171-883-3711 x245",
"state": "CA",
"tax_codes": ["french_standard_vat"],
"tax_identification_number": "EU123456789",
"timezone": "America/Los_Angeles",
"url": "http://hooli.com",
"zipcode": "91364",
"net_payment_term": 30,
"finalize_zero_amount_invoice": "inherit",
"billing_configuration": {
"invoice_grace_period": 3,
"subscription_invoice_issuing_date_anchor": "next_period_start",
"subscription_invoice_issuing_date_adjustment": "keep_anchor",
"payment_provider": "stripe",
"payment_provider_code": "stripe-eu-1",
"provider_customer_id": "cus_12345",
"sync": True,
"sync_with_provider": True,
"document_locale": "fr",
"provider_payment_methods": ["card", "sepa_debit", "us_bank_account", "bacs_debit", "link", "boleto", "crypto", "customer_balance"]
},
"shipping_address": {
"address_line1": "5230 Penfield Ave",
"address_line2": None,
"city": "Woodland Hills",
"country": "US",
"state": "CA",
"zipcode": "91364"
},
"integration_customers": [
{
"id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"integration_type": "netsuite",
"integration_code": "netsuite-eu-1",
"external_customer_id": "cus_12345",
"sync_with_provider": True,
"subsidiary_id": "2"
}
],
"metadata": [
{
"key": "Purchase Order",
"value": "123456789",
"display_in_invoice": True,
"id": "1a901a90-1a90-1a90-1a90-1a901a901a90"
}
],
"skip_invoice_custom_sections": False,
"invoice_custom_section_codes": ["eu_bank_details"]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer: {
external_id: '5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba',
billing_entity_code: 'acme_corp',
address_line1: '5230 Penfield Ave',
address_line2: '',
city: 'Woodland Hills',
country: 'US',
currency: 'USD',
email: 'dinesh@piedpiper.test',
legal_name: 'Coleman-Blair',
legal_number: '49-008-2965',
logo_url: 'http://hooli.com/logo.png',
name: 'Gavin Belson',
firstname: 'Gavin',
lastname: 'Belson',
account_type: 'customer',
phone: '1-171-883-3711 x245',
state: 'CA',
tax_codes: ['french_standard_vat'],
tax_identification_number: 'EU123456789',
timezone: 'America/Los_Angeles',
url: 'http://hooli.com',
zipcode: '91364',
net_payment_term: 30,
finalize_zero_amount_invoice: 'inherit',
billing_configuration: {
invoice_grace_period: 3,
subscription_invoice_issuing_date_anchor: 'next_period_start',
subscription_invoice_issuing_date_adjustment: 'keep_anchor',
payment_provider: 'stripe',
payment_provider_code: 'stripe-eu-1',
provider_customer_id: 'cus_12345',
sync: true,
sync_with_provider: true,
document_locale: 'fr',
provider_payment_methods: [
'card',
'sepa_debit',
'us_bank_account',
'bacs_debit',
'link',
'boleto',
'crypto',
'customer_balance'
]
},
shipping_address: {
address_line1: '5230 Penfield Ave',
address_line2: null,
city: 'Woodland Hills',
country: 'US',
state: 'CA',
zipcode: '91364'
},
integration_customers: [
{
id: '1a901a90-1a90-1a90-1a90-1a901a901a90',
integration_type: 'netsuite',
integration_code: 'netsuite-eu-1',
external_customer_id: 'cus_12345',
sync_with_provider: true,
subsidiary_id: '2'
}
],
metadata: [
{
key: 'Purchase Order',
value: '123456789',
display_in_invoice: true,
id: '1a901a90-1a90-1a90-1a90-1a901a901a90'
}
],
skip_invoice_custom_sections: false,
invoice_custom_section_codes: ['eu_bank_details']
}
})
};
fetch('https://core.nozle.app/api/v1/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://core.nozle.app/api/v1/customers"
payload := strings.NewReader("{\n \"customer\": {\n \"external_id\": \"5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba\",\n \"billing_entity_code\": \"acme_corp\",\n \"address_line1\": \"5230 Penfield Ave\",\n \"address_line2\": \"\",\n \"city\": \"Woodland Hills\",\n \"country\": \"US\",\n \"currency\": \"USD\",\n \"email\": \"dinesh@piedpiper.test\",\n \"legal_name\": \"Coleman-Blair\",\n \"legal_number\": \"49-008-2965\",\n \"logo_url\": \"http://hooli.com/logo.png\",\n \"name\": \"Gavin Belson\",\n \"firstname\": \"Gavin\",\n \"lastname\": \"Belson\",\n \"account_type\": \"customer\",\n \"phone\": \"1-171-883-3711 x245\",\n \"state\": \"CA\",\n \"tax_codes\": [\n \"french_standard_vat\"\n ],\n \"tax_identification_number\": \"EU123456789\",\n \"timezone\": \"America/Los_Angeles\",\n \"url\": \"http://hooli.com\",\n \"zipcode\": \"91364\",\n \"net_payment_term\": 30,\n \"finalize_zero_amount_invoice\": \"inherit\",\n \"billing_configuration\": {\n \"invoice_grace_period\": 3,\n \"subscription_invoice_issuing_date_anchor\": \"next_period_start\",\n \"subscription_invoice_issuing_date_adjustment\": \"keep_anchor\",\n \"payment_provider\": \"stripe\",\n \"payment_provider_code\": \"stripe-eu-1\",\n \"provider_customer_id\": \"cus_12345\",\n \"sync\": true,\n \"sync_with_provider\": true,\n \"document_locale\": \"fr\",\n \"provider_payment_methods\": [\n \"card\",\n \"sepa_debit\",\n \"us_bank_account\",\n \"bacs_debit\",\n \"link\",\n \"boleto\",\n \"crypto\",\n \"customer_balance\"\n ]\n },\n \"shipping_address\": {\n \"address_line1\": \"5230 Penfield Ave\",\n \"address_line2\": null,\n \"city\": \"Woodland Hills\",\n \"country\": \"US\",\n \"state\": \"CA\",\n \"zipcode\": \"91364\"\n },\n \"integration_customers\": [\n {\n \"id\": \"1a901a90-1a90-1a90-1a90-1a901a901a90\",\n \"integration_type\": \"netsuite\",\n \"integration_code\": \"netsuite-eu-1\",\n \"external_customer_id\": \"cus_12345\",\n \"sync_with_provider\": true,\n \"subsidiary_id\": \"2\"\n }\n ],\n \"metadata\": [\n {\n \"key\": \"Purchase Order\",\n \"value\": \"123456789\",\n \"display_in_invoice\": true,\n \"id\": \"1a901a90-1a90-1a90-1a90-1a901a901a90\"\n }\n ],\n \"skip_invoice_custom_sections\": false,\n \"invoice_custom_section_codes\": [\n \"eu_bank_details\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}require 'uri'
require 'net/http'
url = URI("https://core.nozle.app/api/v1/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer\": {\n \"external_id\": \"5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba\",\n \"billing_entity_code\": \"acme_corp\",\n \"address_line1\": \"5230 Penfield Ave\",\n \"address_line2\": \"\",\n \"city\": \"Woodland Hills\",\n \"country\": \"US\",\n \"currency\": \"USD\",\n \"email\": \"dinesh@piedpiper.test\",\n \"legal_name\": \"Coleman-Blair\",\n \"legal_number\": \"49-008-2965\",\n \"logo_url\": \"http://hooli.com/logo.png\",\n \"name\": \"Gavin Belson\",\n \"firstname\": \"Gavin\",\n \"lastname\": \"Belson\",\n \"account_type\": \"customer\",\n \"phone\": \"1-171-883-3711 x245\",\n \"state\": \"CA\",\n \"tax_codes\": [\n \"french_standard_vat\"\n ],\n \"tax_identification_number\": \"EU123456789\",\n \"timezone\": \"America/Los_Angeles\",\n \"url\": \"http://hooli.com\",\n \"zipcode\": \"91364\",\n \"net_payment_term\": 30,\n \"finalize_zero_amount_invoice\": \"inherit\",\n \"billing_configuration\": {\n \"invoice_grace_period\": 3,\n \"subscription_invoice_issuing_date_anchor\": \"next_period_start\",\n \"subscription_invoice_issuing_date_adjustment\": \"keep_anchor\",\n \"payment_provider\": \"stripe\",\n \"payment_provider_code\": \"stripe-eu-1\",\n \"provider_customer_id\": \"cus_12345\",\n \"sync\": true,\n \"sync_with_provider\": true,\n \"document_locale\": \"fr\",\n \"provider_payment_methods\": [\n \"card\",\n \"sepa_debit\",\n \"us_bank_account\",\n \"bacs_debit\",\n \"link\",\n \"boleto\",\n \"crypto\",\n \"customer_balance\"\n ]\n },\n \"shipping_address\": {\n \"address_line1\": \"5230 Penfield Ave\",\n \"address_line2\": null,\n \"city\": \"Woodland Hills\",\n \"country\": \"US\",\n \"state\": \"CA\",\n \"zipcode\": \"91364\"\n },\n \"integration_customers\": [\n {\n \"id\": \"1a901a90-1a90-1a90-1a90-1a901a901a90\",\n \"integration_type\": \"netsuite\",\n \"integration_code\": \"netsuite-eu-1\",\n \"external_customer_id\": \"cus_12345\",\n \"sync_with_provider\": true,\n \"subsidiary_id\": \"2\"\n }\n ],\n \"metadata\": [\n {\n \"key\": \"Purchase Order\",\n \"value\": \"123456789\",\n \"display_in_invoice\": true,\n \"id\": \"1a901a90-1a90-1a90-1a90-1a901a901a90\"\n }\n ],\n \"skip_invoice_custom_sections\": false,\n \"invoice_custom_section_codes\": [\n \"eu_bank_details\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://core.nozle.app/api/v1/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([
'customer' => [
'external_id' => '5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba',
'billing_entity_code' => 'acme_corp',
'address_line1' => '5230 Penfield Ave',
'address_line2' => '',
'city' => 'Woodland Hills',
'country' => 'US',
'currency' => 'USD',
'email' => 'dinesh@piedpiper.test',
'legal_name' => 'Coleman-Blair',
'legal_number' => '49-008-2965',
'logo_url' => 'http://hooli.com/logo.png',
'name' => 'Gavin Belson',
'firstname' => 'Gavin',
'lastname' => 'Belson',
'account_type' => 'customer',
'phone' => '1-171-883-3711 x245',
'state' => 'CA',
'tax_codes' => [
'french_standard_vat'
],
'tax_identification_number' => 'EU123456789',
'timezone' => 'America/Los_Angeles',
'url' => 'http://hooli.com',
'zipcode' => '91364',
'net_payment_term' => 30,
'finalize_zero_amount_invoice' => 'inherit',
'billing_configuration' => [
'invoice_grace_period' => 3,
'subscription_invoice_issuing_date_anchor' => 'next_period_start',
'subscription_invoice_issuing_date_adjustment' => 'keep_anchor',
'payment_provider' => 'stripe',
'payment_provider_code' => 'stripe-eu-1',
'provider_customer_id' => 'cus_12345',
'sync' => true,
'sync_with_provider' => true,
'document_locale' => 'fr',
'provider_payment_methods' => [
'card',
'sepa_debit',
'us_bank_account',
'bacs_debit',
'link',
'boleto',
'crypto',
'customer_balance'
]
],
'shipping_address' => [
'address_line1' => '5230 Penfield Ave',
'address_line2' => null,
'city' => 'Woodland Hills',
'country' => 'US',
'state' => 'CA',
'zipcode' => '91364'
],
'integration_customers' => [
[
'id' => '1a901a90-1a90-1a90-1a90-1a901a901a90',
'integration_type' => 'netsuite',
'integration_code' => 'netsuite-eu-1',
'external_customer_id' => 'cus_12345',
'sync_with_provider' => true,
'subsidiary_id' => '2'
]
],
'metadata' => [
[
'key' => 'Purchase Order',
'value' => '123456789',
'display_in_invoice' => true,
'id' => '1a901a90-1a90-1a90-1a90-1a901a901a90'
]
],
'skip_invoice_custom_sections' => false,
'invoice_custom_section_codes' => [
'eu_bank_details'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://core.nozle.app/api/v1/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer\": {\n \"external_id\": \"5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba\",\n \"billing_entity_code\": \"acme_corp\",\n \"address_line1\": \"5230 Penfield Ave\",\n \"address_line2\": \"\",\n \"city\": \"Woodland Hills\",\n \"country\": \"US\",\n \"currency\": \"USD\",\n \"email\": \"dinesh@piedpiper.test\",\n \"legal_name\": \"Coleman-Blair\",\n \"legal_number\": \"49-008-2965\",\n \"logo_url\": \"http://hooli.com/logo.png\",\n \"name\": \"Gavin Belson\",\n \"firstname\": \"Gavin\",\n \"lastname\": \"Belson\",\n \"account_type\": \"customer\",\n \"phone\": \"1-171-883-3711 x245\",\n \"state\": \"CA\",\n \"tax_codes\": [\n \"french_standard_vat\"\n ],\n \"tax_identification_number\": \"EU123456789\",\n \"timezone\": \"America/Los_Angeles\",\n \"url\": \"http://hooli.com\",\n \"zipcode\": \"91364\",\n \"net_payment_term\": 30,\n \"finalize_zero_amount_invoice\": \"inherit\",\n \"billing_configuration\": {\n \"invoice_grace_period\": 3,\n \"subscription_invoice_issuing_date_anchor\": \"next_period_start\",\n \"subscription_invoice_issuing_date_adjustment\": \"keep_anchor\",\n \"payment_provider\": \"stripe\",\n \"payment_provider_code\": \"stripe-eu-1\",\n \"provider_customer_id\": \"cus_12345\",\n \"sync\": true,\n \"sync_with_provider\": true,\n \"document_locale\": \"fr\",\n \"provider_payment_methods\": [\n \"card\",\n \"sepa_debit\",\n \"us_bank_account\",\n \"bacs_debit\",\n \"link\",\n \"boleto\",\n \"crypto\",\n \"customer_balance\"\n ]\n },\n \"shipping_address\": {\n \"address_line1\": \"5230 Penfield Ave\",\n \"address_line2\": null,\n \"city\": \"Woodland Hills\",\n \"country\": \"US\",\n \"state\": \"CA\",\n \"zipcode\": \"91364\"\n },\n \"integration_customers\": [\n {\n \"id\": \"1a901a90-1a90-1a90-1a90-1a901a901a90\",\n \"integration_type\": \"netsuite\",\n \"integration_code\": \"netsuite-eu-1\",\n \"external_customer_id\": \"cus_12345\",\n \"sync_with_provider\": true,\n \"subsidiary_id\": \"2\"\n }\n ],\n \"metadata\": [\n {\n \"key\": \"Purchase Order\",\n \"value\": \"123456789\",\n \"display_in_invoice\": true,\n \"id\": \"1a901a90-1a90-1a90-1a90-1a901a901a90\"\n }\n ],\n \"skip_invoice_custom_sections\": false,\n \"invoice_custom_section_codes\": [\n \"eu_bank_details\"\n ]\n }\n}")
.asString();{
"customer": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"sequential_id": 1,
"slug": "LAG-1234-001",
"external_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"applicable_timezone": "America/Los_Angeles",
"created_at": "2022-04-29T08:59:51Z",
"billing_entity_code": "acme_corp",
"address_line1": "5230 Penfield Ave",
"address_line2": null,
"city": "Woodland Hills",
"country": "US",
"currency": "USD",
"email": "dinesh@piedpiper.test",
"legal_name": "Coleman-Blair",
"legal_number": "49-008-2965",
"logo_url": "http://hooli.com/logo.png",
"name": "Gavin Belson",
"firstname": "Gavin",
"lastname": "Belson",
"account_type": "customer",
"customer_type": "company",
"phone": "1-171-883-3711 x245",
"state": "CA",
"tax_identification_number": "EU123456789",
"timezone": "America/Los_Angeles",
"url": "http://hooli.com",
"zipcode": "91364",
"net_payment_term": 30,
"updated_at": "2022-04-29T08:59:51Z",
"finalize_zero_amount_invoice": "inherit",
"skip_invoice_custom_sections": false,
"billing_configuration": {
"invoice_grace_period": 3,
"subscription_invoice_issuing_date_anchor": "next_period_start",
"subscription_invoice_issuing_date_adjustment": "keep_anchor",
"payment_provider": "stripe",
"payment_provider_code": "stripe-eu-1",
"provider_customer_id": "cus_12345",
"sync": true,
"sync_with_provider": true,
"document_locale": "fr",
"provider_payment_methods": [
"card",
"sepa_debit",
"us_bank_account",
"bacs_debit",
"link",
"boleto",
"crypto",
"customer_balance"
]
},
"shipping_address": {
"address_line1": "5230 Penfield Ave",
"address_line2": null,
"city": "Woodland Hills",
"country": "US",
"state": "CA",
"zipcode": "91364"
},
"metadata": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"key": "Purchase Order",
"value": "123456789",
"display_in_invoice": true,
"created_at": "2022-04-29T08:59:51Z"
}
],
"integration_customers": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"type": "netsuite",
"integration_code": "netsuite-eu-1",
"external_customer_id": "cus_12345",
"sync_with_provider": true,
"subsidiary_id": "2",
"targeted_object": "contacts",
"email": "dinesh@piedpiper.test"
}
],
"taxes": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "TVA",
"code": "french_standard_vat",
"rate": 20,
"applied_to_organization": true,
"created_at": "2023-07-06T14:35:58Z",
"description": "French standard VAT"
}
],
"applicable_invoice_custom_sections": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "EU Bank Details",
"code": "eu_bank_details",
"description": "This section contains the bank details for EU customers.",
"details": "Bank Name: Nozle Bank, IBAN: FR7630004000031234567890143",
"display_name": "Bank Details:",
"applied_to_organization": true,
"organization_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"created_at": "2023-07-06T14:35:58Z"
}
],
"error_details": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"error_code": "tax_error",
"details": {
"tax_error": "taxDateTooFarInFuture"
}
}
]
}
}{
"status": 400,
"error": "Bad request"
}{
"status": 401,
"error": "Unauthorized"
}{
"status": 422,
"error": "Unprocessable entity",
"code": "validation_errors",
"error_details": {}
}