curl --request GET \
--url "https://api.yukoapp.com/api/v1/public/customers/balance?customer_id=9049402769586" \
--header "Authorization: Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
const customerId = "9049402769586";
const response = await fetch(
`https://api.yukoapp.com/api/v1/public/customers/balance?customer_id=${customerId}`,
{
method: "GET",
headers: {
Authorization: "Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
}
);
const data = await response.json();
$customerId = "9049402769586";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.yukoapp.com/api/v1/public/customers/balance?customer_id={$customerId}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
{
"data": {
"customer_id": "9049402769586",
"balance": 350,
"earned": 500,
"redeemed": 150
}
}
{
"error": {
"code": "not_found",
"message": "Customer not found"
}
}
{
"error": {
"code": "internal_error",
"message": "An unexpected error occurred. Please try again later."
}
}
{
"error": {
"code": "invalid_token",
"message": "Invalid or revoked API token"
}
}
Customers
Get customer balance
Returns a customer’s current loyalty points balance, including total earned and redeemed.
GET
/
public
/
customers
/
balance
curl --request GET \
--url "https://api.yukoapp.com/api/v1/public/customers/balance?customer_id=9049402769586" \
--header "Authorization: Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
const customerId = "9049402769586";
const response = await fetch(
`https://api.yukoapp.com/api/v1/public/customers/balance?customer_id=${customerId}`,
{
method: "GET",
headers: {
Authorization: "Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
}
);
const data = await response.json();
$customerId = "9049402769586";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.yukoapp.com/api/v1/public/customers/balance?customer_id={$customerId}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
{
"data": {
"customer_id": "9049402769586",
"balance": 350,
"earned": 500,
"redeemed": 150
}
}
{
"error": {
"code": "not_found",
"message": "Customer not found"
}
}
{
"error": {
"code": "internal_error",
"message": "An unexpected error occurred. Please try again later."
}
}
{
"error": {
"code": "invalid_token",
"message": "Invalid or revoked API token"
}
}
To get the balance along with tier and membership details, use Get customer membership.
Requires the
read:customers scope. See Scopes.Query parameters
string
required
The platform customer ID (for example, the Shopify customer ID). If you leave it out, this endpoint returns a
500 internal_error rather than a 422 validation error, so always send it.Response
object
The customer’s points balance.
Show balance properties
Show balance properties
Errors
| Status | Code | When |
|---|---|---|
401 | missing_token, invalid_token | The API key is missing, wrong or revoked. |
403 | insufficient_scope | The key doesn’t have read:customers. |
404 | not_found | No customer matches customer_id. Message: “Customer not found”. |
429 | The key exceeded the rate limit. | |
500 | internal_error | customer_id was left out. Message: “An unexpected error occurred. Please try again later.” |
curl --request GET \
--url "https://api.yukoapp.com/api/v1/public/customers/balance?customer_id=9049402769586" \
--header "Authorization: Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
const customerId = "9049402769586";
const response = await fetch(
`https://api.yukoapp.com/api/v1/public/customers/balance?customer_id=${customerId}`,
{
method: "GET",
headers: {
Authorization: "Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
}
);
const data = await response.json();
$customerId = "9049402769586";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.yukoapp.com/api/v1/public/customers/balance?customer_id={$customerId}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
{
"data": {
"customer_id": "9049402769586",
"balance": 350,
"earned": 500,
"redeemed": 150
}
}
{
"error": {
"code": "not_found",
"message": "Customer not found"
}
}
{
"error": {
"code": "internal_error",
"message": "An unexpected error occurred. Please try again later."
}
}
{
"error": {
"code": "invalid_token",
"message": "Invalid or revoked API token"
}
}