Skip to content

Get the buyer's membership as a UCP loyalty object

GET /customers/{customer_id}/ucp-loyalty
Scopecustomers:read
Customer session tokenAccepted with the read scope, for the token’s own customer
Rate limit classread (limits)
Idempotency keyNot used
MCP toolcharm_get_ucp_loyalty

The Universal Commerce Protocol loyalty extension (dev.ucp.common.loyalty) for this customer: tier, benefits and reward currency, keyed by the program’s reverse-domain claim id. For merchants and platforms answering UCP catalog, cart and checkout requests for AI agents. A non-member answers an empty map with an eligibility_invalid message.

NameInTypeDescription
customer_idpathstringShopify customer GID (percent-encoded, e.g. gid%3A%2F%2Fshopify%2FCustomer%2F123) or the numeric customer id.
locale (optional)querystringLanguage for benefit texts, e.g. de.

Returns UcpLoyalty.

FieldTypeDescription
loyaltyobjectThe UCP dev.ucp.common.loyalty map, keyed by the program’s reverse-domain claim id (com.myshopify.<handle>.loyalty). Empty when the buyer is not a member.
messagesarray of UcpMessage
{
"loyalty": {},
"messages": [
{
"type": "info",
"code": "code",
"path": "path",
"content": "content"
}
]
}
Terminal window
curl -X GET "https://charm.appfleece.app/api/v1/customers/7712345/ucp-loyalty" \
-H "Authorization: Bearer chrm_live_..."

unauthorized · invalid_token · token_expired · insufficient_scope · access_required · not_found · validation_error · rate_limited

Every error body carries code, message, request_id and a doc_url pointing at the matching entry in the error catalog.