Skip to main content
POST
/
counterparties
Create a Counterparty
curl --request POST \
  --url https://sandbox-api.polygon.technology/v0.10/counterparties \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --data '
{
  "customerId": "<string>",
  "name": "<string>",
  "dateOfBirth": "2023-12-25",
  "email": "<string>",
  "metadata": {},
  "nationality": "<string>",
  "phone": "<string>",
  "taxId": "<string>"
}
'
import requests

url = "https://sandbox-api.polygon.technology/v0.10/counterparties"

payload = {
    "customerId": "<string>",
    "name": "<string>",
    "dateOfBirth": "2023-12-25",
    "email": "<string>",
    "metadata": {},
    "nationality": "<string>",
    "phone": "<string>",
    "taxId": "<string>"
}
headers = {
    "Idempotency-Key": "<idempotency-key>",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {
    'Idempotency-Key': '<idempotency-key>',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    customerId: '<string>',
    name: '<string>',
    dateOfBirth: '2023-12-25',
    email: '<string>',
    metadata: {},
    nationality: '<string>',
    phone: '<string>',
    taxId: '<string>'
  })
};

fetch('https://sandbox-api.polygon.technology/v0.10/counterparties', 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://sandbox-api.polygon.technology/v0.10/counterparties",
  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([
    'customerId' => '<string>',
    'name' => '<string>',
    'dateOfBirth' => '2023-12-25',
    'email' => '<string>',
    'metadata' => [
        
    ],
    'nationality' => '<string>',
    'phone' => '<string>',
    'taxId' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json",
    "Idempotency-Key: <idempotency-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://sandbox-api.polygon.technology/v0.10/counterparties"

	payload := strings.NewReader("{\n  \"customerId\": \"<string>\",\n  \"name\": \"<string>\",\n  \"dateOfBirth\": \"2023-12-25\",\n  \"email\": \"<string>\",\n  \"metadata\": {},\n  \"nationality\": \"<string>\",\n  \"phone\": \"<string>\",\n  \"taxId\": \"<string>\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Idempotency-Key", "<idempotency-key>")
	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.polygon.technology/v0.10/counterparties")
  .header("Idempotency-Key", "<idempotency-key>")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"customerId\": \"<string>\",\n  \"name\": \"<string>\",\n  \"dateOfBirth\": \"2023-12-25\",\n  \"email\": \"<string>\",\n  \"metadata\": {},\n  \"nationality\": \"<string>\",\n  \"phone\": \"<string>\",\n  \"taxId\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://sandbox-api.polygon.technology/v0.10/counterparties")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"customerId\": \"<string>\",\n  \"name\": \"<string>\",\n  \"dateOfBirth\": \"2023-12-25\",\n  \"email\": \"<string>\",\n  \"metadata\": {},\n  \"nationality\": \"<string>\",\n  \"phone\": \"<string>\",\n  \"taxId\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "address": {
    "city": "<string>",
    "country": "<string>",
    "postalCode": "<string>",
    "streetAddress": "<string>",
    "countryArea": "<string>"
  },
  "createdAt": "2023-11-07T05:31:56Z",
  "customerId": "<string>",
  "dateOfBirth": "2023-12-25",
  "email": "<string>",
  "id": "<string>",
  "metadata": {},
  "name": "<string>",
  "nationality": "<string>",
  "object": "counterparty",
  "phone": "<string>",
  "rejectionReason": "<string>",
  "taxId": "<string>",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Token from POST /auth/token

Headers

Idempotency-Key
string
required

Required on POST and PUT requests. Use a unique value per logical mutation attempt, for example a UUID.

Body

application/json
customerId
string
required

Owning customer (cst_… TypeID or legacy public id).

name
string
required

Full legal name or registered business name. 1..140 chars.

Required string length: 1 - 140
address
object
dateOfBirth
string<date>
email
string
entityType
enum<string>
Available options:
individual,
business
metadata
object
nationality
string

ISO 3166-1 alpha-2.

phone
string
taxId
string

Response

201 - application/json

The request has succeeded and a new resource has been created as a result.

A third party a customer transacts with: an entry in the customer's address book. Counterparties will own External Accounts (registered payment destinations) in a later slice.

address
object
createdAt
string<date-time>
customerId
string
dateOfBirth
string<date>
email
string
entityType
enum<string>
Available options:
individual,
business
id
string
metadata
object
name
string

Full legal name or registered business name.

nationality
string

ISO 3166-1 alpha-2.

object
enum<string>
Available options:
counterparty
phone
string
rejectionReason
string

Set when status = rejected.

status
enum<string>

Lifecycle of a counterparty. rejected is reserved for create-time compliance screening (not yet active); deleted marks a soft-deleted record that remains readable by id.

Available options:
active,
rejected,
deleted
taxId
string
updatedAt
string<date-time>