Skip to main content
PATCH
/
v2
/
customers
/
{merchant_id}
cURL
curl --request PATCH \
  --url https://api.loyaltylion.com/v2/customers/{merchant_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customer": {
    "birthday": "<string>",
    "blocked": true
  }
}
'
import requests

url = "https://api.loyaltylion.com/v2/customers/{merchant_id}"

payload = { "customer": {
"birthday": "<string>",
"blocked": True
} }
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({customer: {birthday: '<string>', blocked: true}})
};

fetch('https://api.loyaltylion.com/v2/customers/{merchant_id}', 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.loyaltylion.com/v2/customers/{merchant_id}",
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([
'customer' => [
'birthday' => '<string>',
'blocked' => true
]
]),
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.loyaltylion.com/v2/customers/{merchant_id}"

payload := strings.NewReader("{\n \"customer\": {\n \"birthday\": \"<string>\",\n \"blocked\": true\n }\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.loyaltylion.com/v2/customers/{merchant_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer\": {\n \"birthday\": \"<string>\",\n \"blocked\": true\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.loyaltylion.com/v2/customers/{merchant_id}")

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 \"customer\": {\n \"birthday\": \"<string>\",\n \"blocked\": true\n }\n}"

response = http.request(request)
puts response.read_body
{
  "customer": {
    "id": 123,
    "merchant_id": "<string>",
    "email": "<string>",
    "points_approved": 123,
    "points_pending": 123,
    "points_spent": 123,
    "properties": {},
    "metadata": {
      "shopify_source_url": "<string>"
    },
    "rewards_claimed": 1,
    "rewards_used": 1,
    "blocked": true,
    "guest": true,
    "enrolled": true,
    "enrolled_at": "<string>",
    "referral_id": "<string>",
    "referred_by": {
      "id": 123,
      "merchant_id": "<string>"
    },
    "loyalty_tier_membership": {
      "started_at": "<string>",
      "expires_at": "<string>",
      "manual": true,
      "loyalty_tier": {
        "id": 123,
        "name": "<string>",
        "number": 2,
        "default": true,
        "hidden": true,
        "lower_bound": "<string>",
        "upper_bound": "<string>",
        "position": 1
      }
    },
    "tier_eligibility": {
      "kind": "<string>",
      "valid_until": "2023-11-07T05:31:56Z",
      "tier_points": {
        "now": 123,
        "at_expiration": 123
      },
      "points_needed_for_renewal": 123,
      "points_needed_for_upgrade": 123,
      "upgrade_tier": {
        "id": 123,
        "name": "<string>",
        "threshold": 123
      },
      "forecasted_tier": {
        "id": 123,
        "name": "<string>"
      }
    },
    "birthday": "<string>",
    "referral_url": "<string>",
    "receipt_upload_url": "<string>",
    "loyalty_pass_url": "<string>",
    "created_at": "<string>",
    "updated_at": "<string>",
    "linked_merchant_ids": [
      "<string>"
    ]
  }
}
{
"error": {
"message": "<string>",
"details": {}
}
}
{
"error": {
"message": "<string>",
"details": {}
}
}
{
"error": {
"message": "<string>",
"details": {}
}
}
{
"error": "<string>"
}

Authorizations

Authorization
string
header
required

An API key linked to a Program in LoyaltyLion, with a set of permissions (scopes). API keys can be created manually, or acquired through an OAuth2 flow. The API key should be provided as a Bearer token in the Authorization header

Path Parameters

merchant_id
string
required

The ID of the customer in your platform or ecommerce store

Body

application/json

Body

customer
object
required

Response

200

customer
object
required