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.update('acct_01jpqjvfg9enpt7pyxd60pcmxj');
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.update(
id="acct_01jpqjvfg9enpt7pyxd60pcmxj",
)
print(account.id)require "surge_api"
surge = SurgeAPI::Client.new(api_key: "My API Key")
account = surge.accounts.update("acct_01jpqjvfg9enpt7pyxd60pcmxj")
puts(account)curl --request PATCH \
--url https://api.surge.app/accounts/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"brand_name": "DT Precision Auto",
"name": "D·T Precision Auto Shop",
"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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'brand_name' => 'DT Precision Auto',
'name' => 'D·T Precision Auto Shop',
'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/{id}"
payload := strings.NewReader("{\n \"brand_name\": \"DT Precision Auto\",\n \"name\": \"D·T Precision Auto Shop\",\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("PATCH", 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.patch("https://api.surge.app/accounts/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"brand_name\": \"DT Precision Auto\",\n \"name\": \"D·T Precision Auto Shop\",\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"
}
}Update account
Update organization details on an existing account to fill gaps identified by the status check.
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.update('acct_01jpqjvfg9enpt7pyxd60pcmxj');
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.update(
id="acct_01jpqjvfg9enpt7pyxd60pcmxj",
)
print(account.id)require "surge_api"
surge = SurgeAPI::Client.new(api_key: "My API Key")
account = surge.accounts.update("acct_01jpqjvfg9enpt7pyxd60pcmxj")
puts(account)curl --request PATCH \
--url https://api.surge.app/accounts/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"brand_name": "DT Precision Auto",
"name": "D·T Precision Auto Shop",
"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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'brand_name' => 'DT Precision Auto',
'name' => 'D·T Precision Auto Shop',
'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/{id}"
payload := strings.NewReader("{\n \"brand_name\": \"DT Precision Auto\",\n \"name\": \"D·T Precision Auto Shop\",\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("PATCH", 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.patch("https://api.surge.app/accounts/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"brand_name\": \"DT Precision Auto\",\n \"name\": \"D·T Precision Auto Shop\",\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
Path Parameters
Body
Parameters for updating an existing 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
Updated 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.