Core API
...
Core API Docs
Customers
Create a Customer
code examples curl location 'https //app sparklayer io/api/v1/customers' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "addresses" \[ { "address line1" "", "city" "", "country code" "" } ] }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "addresses" \[ { "address line1" "", "city" "", "country code" "" } ] }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //app sparklayer io/api/v1/customers", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //app sparklayer io/api/v1/customers") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "addresses" \[ { "address line1" "", "city" "", "country code" "" } ] }) response = https request(request) puts response read body import requests import json url = "https //app sparklayer io/api/v1/customers" payload = json dumps({ "addresses" \[ { "address line1" "", "city" "", "country code" "" } ] }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // successful response { "id" "cu 123", "created at" "", "updated at" "", "addresses" \[ { "id" "ca 123", "title" "mr", "first name" "bob", "last name" "jones", "company" "tom jones climbing ltd", "address line1" "example industrial estate", "address line2" "north country", "city" "cityland", "region name" "california", "region code" "ca", "postal code" "12345", "country code" "usa", "phone" "+44 (0) 123456789", "mobile" "+44 (0) 723456789", "external id" "add1234567", "nickname" "warehouse cityland" } ], "title" "mr", "first name" "tom", "last name" "jones", "email" "tom jones\@climbing com", "company name" "tom jones climbing ltd", "external id" "xxxx00123", "accounting id" "xxxx00123", "status" "", "group" "base", "role" "limited customer", "default billing address id" "ca 1234", "default shipping address id" "ca 1234", "available shipping addresses" \[ "ca 12345" ], "currency code" "gbp", "sales agent groups" \[ "south west uk" ], "price lists" \[ "b2b gb gbp 123" ], "vatin numbers" \[ "gb999999973" ], "discount percentage" "", "tax exempt" false, "payment by invoice" false, "payment on account" { "credit limit" "", "balance" "", "net terms" "" }, "metadata" {}, "parent customer" { "id" "cu 123", "external id" "xxxx00123" } }// error response