Customers
Create Customer
Create a new customer.
POST
/
v1
/
customers
Create Customer
curl --request POST \
--url https://api.monk.com/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme Corp",
"legalName": "Acme Corporation Inc.",
"tags": [
"enterprise"
],
"contacts": [
{
"name": "John Doe",
"email": "john@acme.com",
"roles": [
"accounts_payable"
],
"emailRecipientType": "to"
}
],
"billingAddress": {
"address1": "123 Main St",
"city": "San Francisco",
"region": "CA",
"postalCode": "94105",
"country": "US"
}
}
'import requests
url = "https://api.monk.com/v1/customers"
payload = {
"name": "Acme Corp",
"legalName": "Acme Corporation Inc.",
"tags": ["enterprise"],
"contacts": [
{
"name": "John Doe",
"email": "john@acme.com",
"roles": ["accounts_payable"],
"emailRecipientType": "to"
}
],
"billingAddress": {
"address1": "123 Main St",
"city": "San Francisco",
"region": "CA",
"postalCode": "94105",
"country": "US"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Acme Corp',
legalName: 'Acme Corporation Inc.',
tags: ['enterprise'],
contacts: [
{
name: 'John Doe',
email: 'john@acme.com',
roles: ['accounts_payable'],
emailRecipientType: 'to'
}
],
billingAddress: {
address1: '123 Main St',
city: 'San Francisco',
region: 'CA',
postalCode: '94105',
country: 'US'
}
})
};
fetch('https://api.monk.com/v1/customers', 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.monk.com/v1/customers",
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([
'name' => 'Acme Corp',
'legalName' => 'Acme Corporation Inc.',
'tags' => [
'enterprise'
],
'contacts' => [
[
'name' => 'John Doe',
'email' => 'john@acme.com',
'roles' => [
'accounts_payable'
],
'emailRecipientType' => 'to'
]
],
'billingAddress' => [
'address1' => '123 Main St',
'city' => 'San Francisco',
'region' => 'CA',
'postalCode' => '94105',
'country' => 'US'
]
]),
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.monk.com/v1/customers"
payload := strings.NewReader("{\n \"name\": \"Acme Corp\",\n \"legalName\": \"Acme Corporation Inc.\",\n \"tags\": [\n \"enterprise\"\n ],\n \"contacts\": [\n {\n \"name\": \"John Doe\",\n \"email\": \"john@acme.com\",\n \"roles\": [\n \"accounts_payable\"\n ],\n \"emailRecipientType\": \"to\"\n }\n ],\n \"billingAddress\": {\n \"address1\": \"123 Main St\",\n \"city\": \"San Francisco\",\n \"region\": \"CA\",\n \"postalCode\": \"94105\",\n \"country\": \"US\"\n }\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://api.monk.com/v1/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Corp\",\n \"legalName\": \"Acme Corporation Inc.\",\n \"tags\": [\n \"enterprise\"\n ],\n \"contacts\": [\n {\n \"name\": \"John Doe\",\n \"email\": \"john@acme.com\",\n \"roles\": [\n \"accounts_payable\"\n ],\n \"emailRecipientType\": \"to\"\n }\n ],\n \"billingAddress\": {\n \"address1\": \"123 Main St\",\n \"city\": \"San Francisco\",\n \"region\": \"CA\",\n \"postalCode\": \"94105\",\n \"country\": \"US\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monk.com/v1/customers")
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 \"name\": \"Acme Corp\",\n \"legalName\": \"Acme Corporation Inc.\",\n \"tags\": [\n \"enterprise\"\n ],\n \"contacts\": [\n {\n \"name\": \"John Doe\",\n \"email\": \"john@acme.com\",\n \"roles\": [\n \"accounts_payable\"\n ],\n \"emailRecipientType\": \"to\"\n }\n ],\n \"billingAddress\": {\n \"address1\": \"123 Main St\",\n \"city\": \"San Francisco\",\n \"region\": \"CA\",\n \"postalCode\": \"94105\",\n \"country\": \"US\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Acme Corp",
"legalName": "Acme Corporation Inc.",
"tags": [
"enterprise"
],
"isPaused": false,
"pausedAt": null,
"pausedUntil": null,
"metadata": {
"externalCustomerId": "my-crm-id-123",
"externalCompanyIds": []
},
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}Scope:
customers:writeAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Display name
At least one contact is required. Each contact must have an email and at least one role.
Minimum array length:
1Show child attributes
Show child attributes
Legal/registered business name
Your own external customer ID
Payment provider customer ID (e.g. Stripe cus_xxx). Requires provider.
Payment provider. Requires paymentProviderId.
Available options:
stripe Billing address for tax calculation. Required when your organization has sales tax (Anrok) enabled.
Show child attributes
Show child attributes
Stripe Payment Method ID (pm_xxx). Sets the customer's default payment method. Requires paymentMethodType.
Type of payment method. Required when paymentMethodId is provided.
Available options:
card, us_bank_account Response
Customer created
Show child attributes
Show child attributes
⌘I
Create Customer
curl --request POST \
--url https://api.monk.com/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme Corp",
"legalName": "Acme Corporation Inc.",
"tags": [
"enterprise"
],
"contacts": [
{
"name": "John Doe",
"email": "john@acme.com",
"roles": [
"accounts_payable"
],
"emailRecipientType": "to"
}
],
"billingAddress": {
"address1": "123 Main St",
"city": "San Francisco",
"region": "CA",
"postalCode": "94105",
"country": "US"
}
}
'import requests
url = "https://api.monk.com/v1/customers"
payload = {
"name": "Acme Corp",
"legalName": "Acme Corporation Inc.",
"tags": ["enterprise"],
"contacts": [
{
"name": "John Doe",
"email": "john@acme.com",
"roles": ["accounts_payable"],
"emailRecipientType": "to"
}
],
"billingAddress": {
"address1": "123 Main St",
"city": "San Francisco",
"region": "CA",
"postalCode": "94105",
"country": "US"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Acme Corp',
legalName: 'Acme Corporation Inc.',
tags: ['enterprise'],
contacts: [
{
name: 'John Doe',
email: 'john@acme.com',
roles: ['accounts_payable'],
emailRecipientType: 'to'
}
],
billingAddress: {
address1: '123 Main St',
city: 'San Francisco',
region: 'CA',
postalCode: '94105',
country: 'US'
}
})
};
fetch('https://api.monk.com/v1/customers', 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.monk.com/v1/customers",
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([
'name' => 'Acme Corp',
'legalName' => 'Acme Corporation Inc.',
'tags' => [
'enterprise'
],
'contacts' => [
[
'name' => 'John Doe',
'email' => 'john@acme.com',
'roles' => [
'accounts_payable'
],
'emailRecipientType' => 'to'
]
],
'billingAddress' => [
'address1' => '123 Main St',
'city' => 'San Francisco',
'region' => 'CA',
'postalCode' => '94105',
'country' => 'US'
]
]),
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.monk.com/v1/customers"
payload := strings.NewReader("{\n \"name\": \"Acme Corp\",\n \"legalName\": \"Acme Corporation Inc.\",\n \"tags\": [\n \"enterprise\"\n ],\n \"contacts\": [\n {\n \"name\": \"John Doe\",\n \"email\": \"john@acme.com\",\n \"roles\": [\n \"accounts_payable\"\n ],\n \"emailRecipientType\": \"to\"\n }\n ],\n \"billingAddress\": {\n \"address1\": \"123 Main St\",\n \"city\": \"San Francisco\",\n \"region\": \"CA\",\n \"postalCode\": \"94105\",\n \"country\": \"US\"\n }\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://api.monk.com/v1/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Corp\",\n \"legalName\": \"Acme Corporation Inc.\",\n \"tags\": [\n \"enterprise\"\n ],\n \"contacts\": [\n {\n \"name\": \"John Doe\",\n \"email\": \"john@acme.com\",\n \"roles\": [\n \"accounts_payable\"\n ],\n \"emailRecipientType\": \"to\"\n }\n ],\n \"billingAddress\": {\n \"address1\": \"123 Main St\",\n \"city\": \"San Francisco\",\n \"region\": \"CA\",\n \"postalCode\": \"94105\",\n \"country\": \"US\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monk.com/v1/customers")
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 \"name\": \"Acme Corp\",\n \"legalName\": \"Acme Corporation Inc.\",\n \"tags\": [\n \"enterprise\"\n ],\n \"contacts\": [\n {\n \"name\": \"John Doe\",\n \"email\": \"john@acme.com\",\n \"roles\": [\n \"accounts_payable\"\n ],\n \"emailRecipientType\": \"to\"\n }\n ],\n \"billingAddress\": {\n \"address1\": \"123 Main St\",\n \"city\": \"San Francisco\",\n \"region\": \"CA\",\n \"postalCode\": \"94105\",\n \"country\": \"US\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Acme Corp",
"legalName": "Acme Corporation Inc.",
"tags": [
"enterprise"
],
"isPaused": false,
"pausedAt": null,
"pausedUntil": null,
"metadata": {
"externalCustomerId": "my-crm-id-123",
"externalCompanyIds": []
},
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}