Verifycustomerotp
curl --request POST \
--url https://api.loyalty.dog/v2/giftcards/customers/otp/verify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target": "<string>",
"code": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({target: '<string>', code: '<string>'})
};
fetch('https://api.loyalty.dog/v2/giftcards/customers/otp/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.loyalty.dog/v2/giftcards/customers/otp/verify"
payload = {
"target": "<string>",
"code": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"error": "<string>",
"verifiedTarget": "<string>",
"otpType": "<string>",
"sessionToken": "<string>",
"identity": {
"id": "5eb7cf5a86d9755df3a6c593",
"email": "<string>",
"phone": "<string>",
"name": "<string>",
"verified": true,
"verifiedAt": "<string>",
"trustLevel": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Gift Card Customers
Verifycustomerotp
Verify OTP and Login Customer
Verify the OTP code sent to the customer’s email or phone. On success, finds or creates a GiftCardCustomer record and returns a session token.
Flow:
- Verify the OTP code against Redis
- Find or create a GiftCardCustomer document in MongoDB
- Update customer’s trust level and login metadata
- Create a Redis-backed session (24-hour TTL)
- Return session token and customer identity
Request Body:
target: Email or phone the OTP was sent tocode: 6-digit OTP codename: Optional customer name (used during first registration)
Status Codes:
- 200: OTP verified, session created
- 400: Invalid code, expired, or too many attempts
POST
/
v2
/
giftcards
/
customers
/
otp
/
verify
Verifycustomerotp
curl --request POST \
--url https://api.loyalty.dog/v2/giftcards/customers/otp/verify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target": "<string>",
"code": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({target: '<string>', code: '<string>'})
};
fetch('https://api.loyalty.dog/v2/giftcards/customers/otp/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.loyalty.dog/v2/giftcards/customers/otp/verify"
payload = {
"target": "<string>",
"code": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"error": "<string>",
"verifiedTarget": "<string>",
"otpType": "<string>",
"sessionToken": "<string>",
"identity": {
"id": "5eb7cf5a86d9755df3a6c593",
"email": "<string>",
"phone": "<string>",
"name": "<string>",
"verified": true,
"verifiedAt": "<string>",
"trustLevel": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
JWT access token obtained from POST /v2/token.
Body
application/json
