Customers
Update Customer
Update a customer. At least one field required.
PATCH
/
v1
/
customers
/
{customerId}
Update Customer
curl --request PATCH \
--url https://api.monk.com/v1/customers/{customerId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"legalName": "<string>",
"tags": [
"<string>"
],
"externalCustomerId": "<string>",
"paymentProviderId": "<string>",
"provider": "stripe",
"paymentMethodId": "<string>"
}
'import requests
url = "https://api.monk.com/v1/customers/{customerId}"
payload = {
"name": "<string>",
"legalName": "<string>",
"tags": ["<string>"],
"externalCustomerId": "<string>",
"paymentProviderId": "<string>",
"provider": "stripe",
"paymentMethodId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
legalName: '<string>',
tags: ['<string>'],
externalCustomerId: '<string>',
paymentProviderId: '<string>',
provider: 'stripe',
paymentMethodId: '<string>'
})
};
fetch('https://api.monk.com/v1/customers/{customerId}', 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/{customerId}",
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>',
'legalName' => '<string>',
'tags' => [
'<string>'
],
'externalCustomerId' => '<string>',
'paymentProviderId' => '<string>',
'provider' => 'stripe',
'paymentMethodId' => '<string>'
]),
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/{customerId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"legalName\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"externalCustomerId\": \"<string>\",\n \"paymentProviderId\": \"<string>\",\n \"provider\": \"stripe\",\n \"paymentMethodId\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.monk.com/v1/customers/{customerId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"legalName\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"externalCustomerId\": \"<string>\",\n \"paymentProviderId\": \"<string>\",\n \"provider\": \"stripe\",\n \"paymentMethodId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monk.com/v1/customers/{customerId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"legalName\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"externalCustomerId\": \"<string>\",\n \"paymentProviderId\": \"<string>\",\n \"provider\": \"stripe\",\n \"paymentMethodId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"legalName": "<string>",
"tags": [
"<string>"
],
"isPaused": true,
"pausedAt": "<string>",
"pausedUntil": "2023-12-25",
"metadata": {
"externalCustomerId": "<string>",
"externalCompanyIds": [
"<string>"
]
},
"externalIds": [
{
"entityType": "customer",
"id": "<string>"
}
],
"billingContacts": [
{
"name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"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.
Path Parameters
Body
application/json
Pass null to clear
Replaces existing tags
Stripe customer ID (cus_xxx). Requires provider.
Payment provider. Requires paymentProviderId.
Available options:
stripe Stripe Payment Method ID (pm_xxx). Sets the customer's default payment method on file.
Monk retrieves payment method details (last4, brand, type) from Stripe automatically.
Requires paymentMethodType. Requires the org to have a Stripe integration configured.
Type of payment method. Required when paymentMethodId is provided.
Available options:
card, us_bank_account Response
Customer updated
Show child attributes
Show child attributes
Previous
Assign Customer CSMsAssign Customer Success Manager contacts to customers by Stripe customer ID.
Monk resolves each Stripe customer ID within the authenticated organization.
For each matched customer, existing imported CSM contacts are demoted to
`Unreachable` except the incoming CSM email, then the incoming CSM is
created or updated. Manually-created CSM contacts are preserved.
Next
⌘I
Update Customer
curl --request PATCH \
--url https://api.monk.com/v1/customers/{customerId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"legalName": "<string>",
"tags": [
"<string>"
],
"externalCustomerId": "<string>",
"paymentProviderId": "<string>",
"provider": "stripe",
"paymentMethodId": "<string>"
}
'import requests
url = "https://api.monk.com/v1/customers/{customerId}"
payload = {
"name": "<string>",
"legalName": "<string>",
"tags": ["<string>"],
"externalCustomerId": "<string>",
"paymentProviderId": "<string>",
"provider": "stripe",
"paymentMethodId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
legalName: '<string>',
tags: ['<string>'],
externalCustomerId: '<string>',
paymentProviderId: '<string>',
provider: 'stripe',
paymentMethodId: '<string>'
})
};
fetch('https://api.monk.com/v1/customers/{customerId}', 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/{customerId}",
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>',
'legalName' => '<string>',
'tags' => [
'<string>'
],
'externalCustomerId' => '<string>',
'paymentProviderId' => '<string>',
'provider' => 'stripe',
'paymentMethodId' => '<string>'
]),
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/{customerId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"legalName\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"externalCustomerId\": \"<string>\",\n \"paymentProviderId\": \"<string>\",\n \"provider\": \"stripe\",\n \"paymentMethodId\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.monk.com/v1/customers/{customerId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"legalName\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"externalCustomerId\": \"<string>\",\n \"paymentProviderId\": \"<string>\",\n \"provider\": \"stripe\",\n \"paymentMethodId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monk.com/v1/customers/{customerId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"legalName\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"externalCustomerId\": \"<string>\",\n \"paymentProviderId\": \"<string>\",\n \"provider\": \"stripe\",\n \"paymentMethodId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"legalName": "<string>",
"tags": [
"<string>"
],
"isPaused": true,
"pausedAt": "<string>",
"pausedUntil": "2023-12-25",
"metadata": {
"externalCustomerId": "<string>",
"externalCompanyIds": [
"<string>"
]
},
"externalIds": [
{
"entityType": "customer",
"id": "<string>"
}
],
"billingContacts": [
{
"name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>"
}
}