Create an incorporation service for a company
curl --request POST \
--url https://api.prod.commenda.io/api/v1/public/services \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"companyId": 77
}
'import requests
url = "https://api.prod.commenda.io/api/v1/public/services"
payload = { "companyId": 77 }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({companyId: 77})
};
fetch('https://api.prod.commenda.io/api/v1/public/services', 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.prod.commenda.io/api/v1/public/services",
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([
'companyId' => 77
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-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.prod.commenda.io/api/v1/public/services"
payload := strings.NewReader("{\n \"companyId\": 77\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-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.post("https://api.prod.commenda.io/api/v1/public/services")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"companyId\": 77\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prod.commenda.io/api/v1/public/services")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"companyId\": 77\n}"
response = http.request(request)
puts response.read_body{
"paymentIntentId": "pi_123"
}{
"statusCode": 403,
"message": "Company does not belong to this affiliate firm",
"error": "Forbidden"
}{
"statusCode": 403,
"message": "Company does not belong to this affiliate firm",
"error": "Forbidden"
}{
"statusCode": 403,
"message": "Company does not belong to this affiliate firm",
"error": "Forbidden"
}Services
Create an incorporation service
Start a supported incorporation service for an affiliate-owned company and return the linked payment intent id.
POST
/
public
/
services
Create an incorporation service for a company
curl --request POST \
--url https://api.prod.commenda.io/api/v1/public/services \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"companyId": 77
}
'import requests
url = "https://api.prod.commenda.io/api/v1/public/services"
payload = { "companyId": 77 }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({companyId: 77})
};
fetch('https://api.prod.commenda.io/api/v1/public/services', 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.prod.commenda.io/api/v1/public/services",
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([
'companyId' => 77
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-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.prod.commenda.io/api/v1/public/services"
payload := strings.NewReader("{\n \"companyId\": 77\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-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.post("https://api.prod.commenda.io/api/v1/public/services")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"companyId\": 77\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prod.commenda.io/api/v1/public/services")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"companyId\": 77\n}"
response = http.request(request)
puts response.read_body{
"paymentIntentId": "pi_123"
}{
"statusCode": 403,
"message": "Company does not belong to this affiliate firm",
"error": "Forbidden"
}{
"statusCode": 403,
"message": "Company does not belong to this affiliate firm",
"error": "Forbidden"
}{
"statusCode": 403,
"message": "Company does not belong to this affiliate firm",
"error": "Forbidden"
}Creates a supported incorporation service for an affiliate-owned company and returns the
Requests with an unsupported
paymentIntentId used by the current public handoff flow.
Supported service types
Only the followingserviceType values are accepted:
| Service type | Description |
|---|---|
US_CCORP_INCORPORATION | United States C-Corporation |
US_LLC_INCORPORATION | United States LLC |
CA_CORP_INCORPORATION | Canada Corporation |
INDIA_PVT_LTD_INCORPORATION | India Private Limited |
INDIA_LLP_INCORPORATION | India LLP |
UAE_INCORPORATION | United Arab Emirates |
UK_INCORPORATION | United Kingdom |
IE_INCORPORATION | Ireland |
SG_INCORPORATION | Singapore |
serviceType return 400 Bad Request with a message listing the valid options.
Example error response
{
"statusCode": 400,
"message": [
"serviceType must be one of the supported legacy affiliate API services: US_CCORP_INCORPORATION, US_LLC_INCORPORATION, CA_CORP_INCORPORATION, INDIA_PVT_LTD_INCORPORATION, INDIA_LLP_INCORPORATION, UAE_INCORPORATION, UK_INCORPORATION, IE_INCORPORATION, SG_INCORPORATION"
],
"error": "Bad Request"
}
Authorizations
Body
application/json
Company that the new incorporation service should be attached to.
Example:
77
Incorporation service types currently supported by the legacy affiliate API.
Available options:
US_CCORP_INCORPORATION, US_LLC_INCORPORATION, CA_CORP_INCORPORATION, INDIA_PVT_LTD_INCORPORATION, INDIA_LLP_INCORPORATION, UAE_INCORPORATION, UK_INCORPORATION, IE_INCORPORATION, SG_INCORPORATION Response
Service and payment intent created successfully
Identifier for the newly created payment intent that anchors the current public flow.
Example:
"pi_123"
Was this page helpful?