Register a counterparty
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
legalName: '<string>',
displayName: '<string>',
jurisdiction: '<string>',
defaultCurrency: '<string>',
taxId: '<string>',
taxWithholdingRate: '<string>',
ledgerAccountCode: '<string>',
tags: ['<string>'],
active: true
})
};
fetch('https://sandbox.api.enfinitos.com/v1/counterparties', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox.api.enfinitos.com/v1/counterparties"
payload = {
"legalName": "<string>",
"displayName": "<string>",
"jurisdiction": "<string>",
"defaultCurrency": "<string>",
"taxId": "<string>",
"taxWithholdingRate": "<string>",
"ledgerAccountCode": "<string>",
"tags": ["<string>"],
"active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.api.enfinitos.com/v1/counterparties"
payload := strings.NewReader("{\n \"legalName\": \"<string>\",\n \"displayName\": \"<string>\",\n \"jurisdiction\": \"<string>\",\n \"defaultCurrency\": \"<string>\",\n \"taxId\": \"<string>\",\n \"taxWithholdingRate\": \"<string>\",\n \"ledgerAccountCode\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"active\": true\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://sandbox.api.enfinitos.com/v1/counterparties")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"legalName\": \"<string>\",\n \"displayName\": \"<string>\",\n \"jurisdiction\": \"<string>\",\n \"defaultCurrency\": \"<string>\",\n \"taxId\": \"<string>\",\n \"taxWithholdingRate\": \"<string>\",\n \"ledgerAccountCode\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.enfinitos.com/v1/counterparties")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"legalName\": \"<string>\",\n \"displayName\": \"<string>\",\n \"jurisdiction\": \"<string>\",\n \"defaultCurrency\": \"<string>\",\n \"taxId\": \"<string>\",\n \"taxWithholdingRate\": \"<string>\",\n \"ledgerAccountCode\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"active\": true\n}"
response = http.request(request)
puts response.read_bodyfalsecurl --request POST \
--url https://sandbox.api.enfinitos.com/v1/counterparties \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"legalName": "<string>",
"displayName": "<string>",
"jurisdiction": "<string>",
"defaultCurrency": "<string>",
"taxId": "<string>",
"taxWithholdingRate": "<string>",
"ledgerAccountCode": "<string>",
"tags": [
"<string>"
],
"active": true
}
'{
"ok": true,
"data": {
"counterparty": {
"id": "<string>",
"orgId": "<string>",
"legalName": "<string>",
"displayName": "<string>",
"jurisdiction": "<string>",
"taxId": "<string>",
"defaultCurrency": "<string>",
"taxWithholdingRate": "<string>",
"ledgerAccountCode": "<string>",
"tags": [
"<string>"
],
"active": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
},
"contractVersion": "<string>"
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}Settlement config
Register a counterparty
Register a new counterparty. Settlement-rule splits address counterparties by id, so these must exist before a rule can target them. jurisdiction and defaultCurrency are upper-cased before validation. Requires scope settlement:write.
POST
/
v1
/
counterparties
Register a counterparty
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
legalName: '<string>',
displayName: '<string>',
jurisdiction: '<string>',
defaultCurrency: '<string>',
taxId: '<string>',
taxWithholdingRate: '<string>',
ledgerAccountCode: '<string>',
tags: ['<string>'],
active: true
})
};
fetch('https://sandbox.api.enfinitos.com/v1/counterparties', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox.api.enfinitos.com/v1/counterparties"
payload = {
"legalName": "<string>",
"displayName": "<string>",
"jurisdiction": "<string>",
"defaultCurrency": "<string>",
"taxId": "<string>",
"taxWithholdingRate": "<string>",
"ledgerAccountCode": "<string>",
"tags": ["<string>"],
"active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.api.enfinitos.com/v1/counterparties"
payload := strings.NewReader("{\n \"legalName\": \"<string>\",\n \"displayName\": \"<string>\",\n \"jurisdiction\": \"<string>\",\n \"defaultCurrency\": \"<string>\",\n \"taxId\": \"<string>\",\n \"taxWithholdingRate\": \"<string>\",\n \"ledgerAccountCode\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"active\": true\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://sandbox.api.enfinitos.com/v1/counterparties")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"legalName\": \"<string>\",\n \"displayName\": \"<string>\",\n \"jurisdiction\": \"<string>\",\n \"defaultCurrency\": \"<string>\",\n \"taxId\": \"<string>\",\n \"taxWithholdingRate\": \"<string>\",\n \"ledgerAccountCode\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.enfinitos.com/v1/counterparties")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"legalName\": \"<string>\",\n \"displayName\": \"<string>\",\n \"jurisdiction\": \"<string>\",\n \"defaultCurrency\": \"<string>\",\n \"taxId\": \"<string>\",\n \"taxWithholdingRate\": \"<string>\",\n \"ledgerAccountCode\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"active\": true\n}"
response = http.request(request)
puts response.read_bodyfalsecurl --request POST \
--url https://sandbox.api.enfinitos.com/v1/counterparties \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"legalName": "<string>",
"displayName": "<string>",
"jurisdiction": "<string>",
"defaultCurrency": "<string>",
"taxId": "<string>",
"taxWithholdingRate": "<string>",
"ledgerAccountCode": "<string>",
"tags": [
"<string>"
],
"active": true
}
'{
"ok": true,
"data": {
"counterparty": {
"id": "<string>",
"orgId": "<string>",
"legalName": "<string>",
"displayName": "<string>",
"jurisdiction": "<string>",
"taxId": "<string>",
"defaultCurrency": "<string>",
"taxWithholdingRate": "<string>",
"ledgerAccountCode": "<string>",
"tags": [
"<string>"
],
"active": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
},
"contractVersion": "<string>"
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}Authorizations
API key sent as Authorization: Bearer <api-key>.
Body
application/json
Available options:
VENUE, CUSTOMER, AGENCY, AFFILIATE, RESELLER, TAX_AUTHORITY Available options:
STANDARD_VAT, ZERO_RATED, EXEMPT, REVERSE_CHARGE, NON_VAT_JURISDICTION ISO 3166-1 alpha-2 country code (upper-cased).
ISO 4217 currency code (upper-cased).
Decimal string, e.g. "0.15".
⌘I