import Surge from '@surgeapi/node';
const client = new Surge({
apiKey: process.env['SURGE_API_KEY'], // This is the default and can be omitted
});
const account = await client.accounts.create({ name: 'Account #2840 - DT Precision Auto' });
console.log(account.id);import os
from surge import Surge
client = Surge(
api_key=os.environ.get("SURGE_API_KEY"), # This is the default and can be omitted
)
account = client.accounts.create(
name="Account #2840 - DT Precision Auto",
)
print(account.id)require "surge_api"
surge = SurgeAPI::Client.new(api_key: "My API Key")
account = surge.accounts.create(name: "Account #2840 - DT Precision Auto")
puts(account)curl --request POST \
--url https://api.surge.app/accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"brand_name": "DT Precision Auto",
"name": "Account #2840 - DT Precision Auto",
"organization": {
"address": {
"country": "US",
"line1": "2640 Huron St",
"line2": null,
"locality": "Los Angeles",
"name": "DT Precision Auto",
"postal_code": "90065",
"region": "CA"
},
"contact": {
"title": "other",
"email": "dom@dtprecisionauto.com",
"first_name": "Dominic",
"last_name": "Toretto",
"phone_number": "+13235556439",
"title_other": "Owner"
},
"country": "US",
"email": "dom@dtprecisionauto.com",
"identifier": "123456789",
"identifier_type": "ein",
"industry": "automotive",
"mobile_number": "+13235556439",
"regions_of_operation": [
"usa_and_canada"
],
"registered_name": "DT Precision Auto LLC",
"stock_exchange": null,
"stock_symbol": null,
"type": "llc",
"website": "https://dtprecisionauto.com"
},
"time_zone": "America/Los_Angeles"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.surge.app/accounts",
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([
'brand_name' => 'DT Precision Auto',
'name' => 'Account #2840 - DT Precision Auto',
'organization' => [
'address' => [
'country' => 'US',
'line1' => '2640 Huron St',
'line2' => null,
'locality' => 'Los Angeles',
'name' => 'DT Precision Auto',
'postal_code' => '90065',
'region' => 'CA'
],
'contact' => [
'title' => 'other',
'email' => 'dom@dtprecisionauto.com',
'first_name' => 'Dominic',
'last_name' => 'Toretto',
'phone_number' => '+13235556439',
'title_other' => 'Owner'
],
'country' => 'US',
'email' => 'dom@dtprecisionauto.com',
'identifier' => '123456789',
'identifier_type' => 'ein',
'industry' => 'automotive',
'mobile_number' => '+13235556439',
'regions_of_operation' => [
'usa_and_canada'
],
'registered_name' => 'DT Precision Auto LLC',
'stock_exchange' => null,
'stock_symbol' => null,
'type' => 'llc',
'website' => 'https://dtprecisionauto.com'
],
'time_zone' => 'America/Los_Angeles'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.surge.app/accounts"
payload := strings.NewReader("{\n \"brand_name\": \"DT Precision Auto\",\n \"name\": \"Account #2840 - DT Precision Auto\",\n \"organization\": {\n \"address\": {\n \"country\": \"US\",\n \"line1\": \"2640 Huron St\",\n \"line2\": null,\n \"locality\": \"Los Angeles\",\n \"name\": \"DT Precision Auto\",\n \"postal_code\": \"90065\",\n \"region\": \"CA\"\n },\n \"contact\": {\n \"title\": \"other\",\n \"email\": \"dom@dtprecisionauto.com\",\n \"first_name\": \"Dominic\",\n \"last_name\": \"Toretto\",\n \"phone_number\": \"+13235556439\",\n \"title_other\": \"Owner\"\n },\n \"country\": \"US\",\n \"email\": \"dom@dtprecisionauto.com\",\n \"identifier\": \"123456789\",\n \"identifier_type\": \"ein\",\n \"industry\": \"automotive\",\n \"mobile_number\": \"+13235556439\",\n \"regions_of_operation\": [\n \"usa_and_canada\"\n ],\n \"registered_name\": \"DT Precision Auto LLC\",\n \"stock_exchange\": null,\n \"stock_symbol\": null,\n \"type\": \"llc\",\n \"website\": \"https://dtprecisionauto.com\"\n },\n \"time_zone\": \"America/Los_Angeles\"\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))
}HttpResponse<String> response = Unirest.post("https://api.surge.app/accounts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"brand_name\": \"DT Precision Auto\",\n \"name\": \"Account #2840 - DT Precision Auto\",\n \"organization\": {\n \"address\": {\n \"country\": \"US\",\n \"line1\": \"2640 Huron St\",\n \"line2\": null,\n \"locality\": \"Los Angeles\",\n \"name\": \"DT Precision Auto\",\n \"postal_code\": \"90065\",\n \"region\": \"CA\"\n },\n \"contact\": {\n \"title\": \"other\",\n \"email\": \"dom@dtprecisionauto.com\",\n \"first_name\": \"Dominic\",\n \"last_name\": \"Toretto\",\n \"phone_number\": \"+13235556439\",\n \"title_other\": \"Owner\"\n },\n \"country\": \"US\",\n \"email\": \"dom@dtprecisionauto.com\",\n \"identifier\": \"123456789\",\n \"identifier_type\": \"ein\",\n \"industry\": \"automotive\",\n \"mobile_number\": \"+13235556439\",\n \"regions_of_operation\": [\n \"usa_and_canada\"\n ],\n \"registered_name\": \"DT Precision Auto LLC\",\n \"stock_exchange\": null,\n \"stock_symbol\": null,\n \"type\": \"llc\",\n \"website\": \"https://dtprecisionauto.com\"\n },\n \"time_zone\": \"America/Los_Angeles\"\n}")
.asString();{
"brand_name": "DT Precision Auto",
"id": "acct_01jpqjvfg9enpt7pyxd60pcmxj",
"name": "Account #2840 - DT Precision Auto",
"organization": {
"address": {
"country": "US",
"line1": "2640 Huron St",
"line2": null,
"locality": "Los Angeles",
"name": "DT Precision Auto",
"postal_code": "90065",
"region": "CA"
},
"contact": {
"title": "other",
"email": "dom@dtprecisionauto.com",
"first_name": "Dominic",
"last_name": "Toretto",
"phone_number": "+13235556439",
"title_other": "Owner"
},
"country": "US",
"email": "dom@dtprecisionauto.com",
"identifier": "123456789",
"identifier_type": "ein",
"industry": "automotive",
"mobile_number": "+13235556439",
"regions_of_operation": [
"usa_and_canada"
],
"registered_name": "DT Precision Auto LLC",
"stock_exchange": null,
"stock_symbol": null,
"type": "llc",
"website": "https://dtprecisionauto.com"
},
"time_zone": "America/Los_Angeles"
}{
"error": {
"message": "The requested resource could not be found.",
"type": "not_found"
}
}Create account
Create a new account under your project. Submit organization details to begin the carrier registration process.
import Surge from '@surgeapi/node';
const client = new Surge({
apiKey: process.env['SURGE_API_KEY'], // This is the default and can be omitted
});
const account = await client.accounts.create({ name: 'Account #2840 - DT Precision Auto' });
console.log(account.id);import os
from surge import Surge
client = Surge(
api_key=os.environ.get("SURGE_API_KEY"), # This is the default and can be omitted
)
account = client.accounts.create(
name="Account #2840 - DT Precision Auto",
)
print(account.id)require "surge_api"
surge = SurgeAPI::Client.new(api_key: "My API Key")
account = surge.accounts.create(name: "Account #2840 - DT Precision Auto")
puts(account)curl --request POST \
--url https://api.surge.app/accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"brand_name": "DT Precision Auto",
"name": "Account #2840 - DT Precision Auto",
"organization": {
"address": {
"country": "US",
"line1": "2640 Huron St",
"line2": null,
"locality": "Los Angeles",
"name": "DT Precision Auto",
"postal_code": "90065",
"region": "CA"
},
"contact": {
"title": "other",
"email": "dom@dtprecisionauto.com",
"first_name": "Dominic",
"last_name": "Toretto",
"phone_number": "+13235556439",
"title_other": "Owner"
},
"country": "US",
"email": "dom@dtprecisionauto.com",
"identifier": "123456789",
"identifier_type": "ein",
"industry": "automotive",
"mobile_number": "+13235556439",
"regions_of_operation": [
"usa_and_canada"
],
"registered_name": "DT Precision Auto LLC",
"stock_exchange": null,
"stock_symbol": null,
"type": "llc",
"website": "https://dtprecisionauto.com"
},
"time_zone": "America/Los_Angeles"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.surge.app/accounts",
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([
'brand_name' => 'DT Precision Auto',
'name' => 'Account #2840 - DT Precision Auto',
'organization' => [
'address' => [
'country' => 'US',
'line1' => '2640 Huron St',
'line2' => null,
'locality' => 'Los Angeles',
'name' => 'DT Precision Auto',
'postal_code' => '90065',
'region' => 'CA'
],
'contact' => [
'title' => 'other',
'email' => 'dom@dtprecisionauto.com',
'first_name' => 'Dominic',
'last_name' => 'Toretto',
'phone_number' => '+13235556439',
'title_other' => 'Owner'
],
'country' => 'US',
'email' => 'dom@dtprecisionauto.com',
'identifier' => '123456789',
'identifier_type' => 'ein',
'industry' => 'automotive',
'mobile_number' => '+13235556439',
'regions_of_operation' => [
'usa_and_canada'
],
'registered_name' => 'DT Precision Auto LLC',
'stock_exchange' => null,
'stock_symbol' => null,
'type' => 'llc',
'website' => 'https://dtprecisionauto.com'
],
'time_zone' => 'America/Los_Angeles'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.surge.app/accounts"
payload := strings.NewReader("{\n \"brand_name\": \"DT Precision Auto\",\n \"name\": \"Account #2840 - DT Precision Auto\",\n \"organization\": {\n \"address\": {\n \"country\": \"US\",\n \"line1\": \"2640 Huron St\",\n \"line2\": null,\n \"locality\": \"Los Angeles\",\n \"name\": \"DT Precision Auto\",\n \"postal_code\": \"90065\",\n \"region\": \"CA\"\n },\n \"contact\": {\n \"title\": \"other\",\n \"email\": \"dom@dtprecisionauto.com\",\n \"first_name\": \"Dominic\",\n \"last_name\": \"Toretto\",\n \"phone_number\": \"+13235556439\",\n \"title_other\": \"Owner\"\n },\n \"country\": \"US\",\n \"email\": \"dom@dtprecisionauto.com\",\n \"identifier\": \"123456789\",\n \"identifier_type\": \"ein\",\n \"industry\": \"automotive\",\n \"mobile_number\": \"+13235556439\",\n \"regions_of_operation\": [\n \"usa_and_canada\"\n ],\n \"registered_name\": \"DT Precision Auto LLC\",\n \"stock_exchange\": null,\n \"stock_symbol\": null,\n \"type\": \"llc\",\n \"website\": \"https://dtprecisionauto.com\"\n },\n \"time_zone\": \"America/Los_Angeles\"\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))
}HttpResponse<String> response = Unirest.post("https://api.surge.app/accounts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"brand_name\": \"DT Precision Auto\",\n \"name\": \"Account #2840 - DT Precision Auto\",\n \"organization\": {\n \"address\": {\n \"country\": \"US\",\n \"line1\": \"2640 Huron St\",\n \"line2\": null,\n \"locality\": \"Los Angeles\",\n \"name\": \"DT Precision Auto\",\n \"postal_code\": \"90065\",\n \"region\": \"CA\"\n },\n \"contact\": {\n \"title\": \"other\",\n \"email\": \"dom@dtprecisionauto.com\",\n \"first_name\": \"Dominic\",\n \"last_name\": \"Toretto\",\n \"phone_number\": \"+13235556439\",\n \"title_other\": \"Owner\"\n },\n \"country\": \"US\",\n \"email\": \"dom@dtprecisionauto.com\",\n \"identifier\": \"123456789\",\n \"identifier_type\": \"ein\",\n \"industry\": \"automotive\",\n \"mobile_number\": \"+13235556439\",\n \"regions_of_operation\": [\n \"usa_and_canada\"\n ],\n \"registered_name\": \"DT Precision Auto LLC\",\n \"stock_exchange\": null,\n \"stock_symbol\": null,\n \"type\": \"llc\",\n \"website\": \"https://dtprecisionauto.com\"\n },\n \"time_zone\": \"America/Los_Angeles\"\n}")
.asString();{
"brand_name": "DT Precision Auto",
"id": "acct_01jpqjvfg9enpt7pyxd60pcmxj",
"name": "Account #2840 - DT Precision Auto",
"organization": {
"address": {
"country": "US",
"line1": "2640 Huron St",
"line2": null,
"locality": "Los Angeles",
"name": "DT Precision Auto",
"postal_code": "90065",
"region": "CA"
},
"contact": {
"title": "other",
"email": "dom@dtprecisionauto.com",
"first_name": "Dominic",
"last_name": "Toretto",
"phone_number": "+13235556439",
"title_other": "Owner"
},
"country": "US",
"email": "dom@dtprecisionauto.com",
"identifier": "123456789",
"identifier_type": "ein",
"industry": "automotive",
"mobile_number": "+13235556439",
"regions_of_operation": [
"usa_and_canada"
],
"registered_name": "DT Precision Auto LLC",
"stock_exchange": null,
"stock_symbol": null,
"type": "llc",
"website": "https://dtprecisionauto.com"
},
"time_zone": "America/Los_Angeles"
}{
"error": {
"message": "The requested resource could not be found.",
"type": "not_found"
}
}Authorizations
Body
Parameters for creating a new account.
The name of the account that will be visible for your internal organizational purposes. This will also be the default public-facing brand name unless you also set a brand_name, but otherwise the account name will never be displayed anywhere outside of Surge HQ, and may include your ID for the account or anything else that may help you.
Response
Created account
Response containing account information.
The name of the account that will be visible for your internal organizational purposes. This will also be the default public-facing brand name unless you also set a brand_name, but otherwise the account name will never be displayed anywhere outside of Surge HQ, and may include your ID for the account or anything else that may help you.