Endpoints Reference
Customer Sub-Accounts
Create a new Customer sub-account
code examples curl location globoff '/v1/{siteenv}/{siteid}/sub accounts' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data raw '{ "email" "bob\@sparklayer io", "first name" "bob", "last name" "jones", "parent customer external id" "cu1234" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "email" "bob\@sparklayer io", "first name" "bob", "last name" "jones", "parent customer external id" "cu1234" }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("/v1/{siteenv}/{siteid}/sub accounts", 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("/v1/{siteenv}/{siteid}/sub accounts") http = net http new(url host, url port); request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "email" "bob\@sparklayer io", "first name" "bob", "last name" "jones", "parent customer external id" "cu1234" }) response = http request(request) puts response read body import requests import json url = "/v1/{siteenv}/{siteid}/sub accounts" payload = json dumps({ "email" "bob\@sparklayer io", "first name" "bob", "last name" "jones", "parent customer external id" "cu1234" }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // successful operation { "customer external id" "cu1234" }// error handling request such as email already taken { "error code" "email already taken" }// auth failure // system exception