---
title: "Verifycustomerotp"
method: POST
path: "/v2/giftcards/customers/otp/verify"
tags: ["Gift Card Customers"]
---

# Verifycustomerotp

`POST /v2/giftcards/customers/otp/verify`

### 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**:
1. Verify the OTP code against Redis
2. Find or create a GiftCardCustomer document in MongoDB
3. Update customer's trust level and login metadata
4. Create a Redis-backed session (24-hour TTL)
5. Return session token and customer identity

**Request Body**:
- `target`: Email or phone the OTP was sent to
- `code`: 6-digit OTP code
- `name`: Optional customer name (used during first registration)

**Status Codes**:
- 200: OTP verified, session created
- 400: Invalid code, expired, or too many attempts

## Request body

- VerifyOTPRequest — Request to verify an OTP code.
  - `target` string, required — Email address or phone number the OTP was sent to
  - `code` string, required — 6-digit OTP code
  - `name` string, nullable — Customer name (used during registration)

## Response `200`

Successful Response

- VerifyOTPResponse
  - `success` boolean, required
  - `error` string, nullable
  - `verifiedTarget` string, nullable
  - `otpType` string, nullable
  - `sessionToken` string, nullable
  - `identity` CustomerIdentityResponse — Customer identity information returned after successful verification.
    - `id` string, required
    - `email` string, nullable, required
    - `phone` string, nullable, required
    - `name` string, nullable, required
    - `verified` boolean, required
    - `verifiedAt` string, nullable, required
    - `trustLevel` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/loyalty/apis/loyaltydog.md) · [All operations](https://skmtc.net/loyalty/apis/loyaltydog/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/loyalty/loyaltydog/versions/42b7b22af2b6/schema)
