Update a firm's registration details
curl --request PATCH \
--url https://api.scripxhq.com/v1/firms/{iec} \
--header 'Content-Type: application/json' \
--header 'X-ScripX-Key: <api-key>' \
--data '
{
"name": "<string>",
"email": "<string>"
}
'import requests
url = "https://api.scripxhq.com/v1/firms/{iec}"
payload = {
"name": "<string>",
"email": "<string>"
}
headers = {
"X-ScripX-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-ScripX-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', email: '<string>'})
};
fetch('https://api.scripxhq.com/v1/firms/{iec}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scripxhq.com/v1/firms/{iec}",
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([
'name' => '<string>',
'email' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-ScripX-Key: <api-key>"
],
]);
$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.scripxhq.com/v1/firms/{iec}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"email\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-ScripX-Key", "<api-key>")
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.scripxhq.com/v1/firms/{iec}")
.header("X-ScripX-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"email\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scripxhq.com/v1/firms/{iec}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-ScripX-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"email\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"firm": {
"iec": "<string>",
"name": "<string>",
"email": "<string>",
"created_at": "<string>"
}
}{
"error": "<string>",
"message": "<string>",
"detail": {}
}{
"error": "<string>",
"message": "<string>",
"detail": {}
}{
"error": "<string>",
"message": "<string>",
"detail": {}
}Firms
Update a firm
Update a ScripX client firm’s registration details, name and contact email, without touching its connection state.
PATCH
/
v1
/
firms
/
{iec}
Update a firm's registration details
curl --request PATCH \
--url https://api.scripxhq.com/v1/firms/{iec} \
--header 'Content-Type: application/json' \
--header 'X-ScripX-Key: <api-key>' \
--data '
{
"name": "<string>",
"email": "<string>"
}
'import requests
url = "https://api.scripxhq.com/v1/firms/{iec}"
payload = {
"name": "<string>",
"email": "<string>"
}
headers = {
"X-ScripX-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-ScripX-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', email: '<string>'})
};
fetch('https://api.scripxhq.com/v1/firms/{iec}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scripxhq.com/v1/firms/{iec}",
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([
'name' => '<string>',
'email' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-ScripX-Key: <api-key>"
],
]);
$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.scripxhq.com/v1/firms/{iec}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"email\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-ScripX-Key", "<api-key>")
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.scripxhq.com/v1/firms/{iec}")
.header("X-ScripX-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"email\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scripxhq.com/v1/firms/{iec}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-ScripX-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"email\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"firm": {
"iec": "<string>",
"name": "<string>",
"email": "<string>",
"created_at": "<string>"
}
}{
"error": "<string>",
"message": "<string>",
"detail": {}
}{
"error": "<string>",
"message": "<string>",
"detail": {}
}{
"error": "<string>",
"message": "<string>",
"detail": {}
}Updates the firm’s registration details:
name and email. The IEC and the connection state are not editable here; to change the connected customs account, run verify again.
Request example
curl -X PATCH "https://api.scripxhq.com/v1/firms/0512345678" \
-H "X-ScripX-Key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"name": "Acme Exports Private Limited", "email": "ops@acmeexports.example"}'
Response example
{
"firm": {
"iec": "0512345678",
"name": "Acme Exports Private Limited",
"email": "ops@acmeexports.example",
"state": "connected"
}
}
Errors
404 not_found, no such firm on your desk.422 unprocessable, emptyname.
Next steps
- Get the firm to confirm.
⌘I