curl --request PATCH \
--url https://api.farthing.ai/v1/buyer-profiles/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"shipping": {
"addressLines": [
"221B Baker Street"
],
"locality": "London",
"postalCode": "NW1 6XE",
"countryCode": "GB"
}
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"subject": "user_a91f",
"name": {},
"contact": {},
"shipping": {},
"createdAt": "2023-11-07T05:31:56Z"
}Update a buyer profile
Partial at the top level, wholesale underneath. name, contact and shipping are each stored as one JSON document: omit a key and that document is untouched; supply one and it replaces the old document entirely.
That is deliberate. Merging half an address into an old one is how you ship a parcel to a street in the wrong city — so send a whole shipping object or none at all.
An empty body is a 400, not a no-op. Send "shipping": null to clear a document outright — which is how an address you no longer want held is removed short of deleting the whole profile. {} stores an empty object instead, which is a different thing.
Requires the buyer-profiles.write scope.
curl --request PATCH \
--url https://api.farthing.ai/v1/buyer-profiles/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"shipping": {
"addressLines": [
"221B Baker Street"
],
"locality": "London",
"postalCode": "NW1 6XE",
"countryCode": "GB"
}
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"subject": "user_a91f",
"name": {},
"contact": {},
"shipping": {},
"createdAt": "2023-11-07T05:31:56Z"
}Authorizations
Body
Partial at the top level only: omit a key and that document is untouched, supply one and it is replaced wholesale. There is no deep merge. null clears a document outright.
Strict: any key outside these four — subject in particular — is a 400 rather than a silently dropped field, because a caller trying to move a profile to another end user should be told it did not happen.
Response
Updated. The full profile.