User Accounts

What you'll learn

  • How to get and update the current user's profile
  • How to manage billing addresses
  • How to check loyalty points and tier
  • How to retrieve available rewards
  • How to handle identity verification
  • How to sync user data with the POS
  • How to deactivate an account
  • Common user-related error scenarios

Prerequisites


Get User Profile

Retrieve the authenticated user's profile.

Endpoint: GET /api/v1/users/me Auth: jwt_authenticated Store: Required (X-Store header)

cURL

curl -X GET https://ecom-api.staging.blaze.me/api/v1/users/me \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -H "X-Store: e87437f2-3e35-4738-af5e-6307e368255c" \
  -H "Authorization: Bearer YOUR_TOKEN"

JavaScript

const response = await fetch(`${BASE_URL}/api/v1/users/me`, {
  headers: {
    "Content-Type": "application/vnd.api+json",
    Accept: "application/vnd.api+json",
    "X-Store": STORE_UUID,
    Authorization: `Bearer ${token}`,
  },
});

const { data } = await response.json();
console.log(`${data.attributes.first_name} ${data.attributes.last_name}`);

Response Example

{
  "data": {
    "id": "123",
    "type": "users",
    "attributes": {
      "email": "jane@example.com",
      "first_name": "Jane",
      "last_name": "Doe",
      "phone_number": "+15551234567",
      "address": {
        "address": "123 Main St",
        "city": "Los Angeles",
        "state": "CA",
        "zip_code": "90001",
        "country": "US"
      },
      "date_of_birth": "1990-01-15T00:00:00Z",
      "medical_id": {
        "number": "MED-123456",
        "expiration_date": "2026-12-31"
      },
      "drivers_license_id": {
        "number": "D1234567",
        "expiration_date": "2027-06-15"
      },
      "num_orders": 12,
      "last_order_at": "2026-04-20T18:30:00Z",
      "confirmed_at": "2026-01-10T14:00:00Z",
      "phone_number_confirmed_at": "2026-01-10T14:00:00Z",
      "email_confirmed_at": "2026-01-10T14:01:00Z",
      "is_active": true,
      "is_pos_confirmed": true,
      "customer_type": "recreational",
      "customer_type_display": "Recreational",
      "role": "consumer",
      "marketing_sms_opt_in": true,
      "marketing_email_opt_in": false,
      "marketing_consent_required": false,
      "billing_address": {
        "address": "123 Main St",
        "city": "Los Angeles",
        "state": "CA",
        "zip_code": "90001"
      },
      "state_residency": "CA",
      "is_anonymous": false,
      "pos_last_sync": "2026-04-18T10:00:00Z"
    },
    "relationships": {
      "documents": { "data": [] },
      "rewards": { "data": [] },
      "reward_points": { "data": null }
    }
  }
}

Errors

Error Code Status When
401 401 Missing or invalid JWT token

Note: If the user account is not yet confirmed, the response uses a reduced view that omits certain fields like rewards and loyalty data.


Update User Profile

Update profile fields, medical ID, driver's license, and marketing preferences.

Endpoint: PUT /api/v1/users/me Auth: jwt_authenticated Store: Required (X-Store header)

cURL

curl -X PUT https://ecom-api.staging.blaze.me/api/v1/users/me \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -H "X-Store: e87437f2-3e35-4738-af5e-6307e368255c" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "data": {
      "type": "users",
      "attributes": {
        "first_name": "Jane",
        "last_name": "Doe",
        "zip_code": "90001",
        "date_of_birth": 632188800000,
        "marketing_email_opt_in": true,
        "marketing_sms_opt_in": false,
        "customer_type": "recreational"
      }
    }
  }'

JavaScript

const response = await fetch(`${BASE_URL}/api/v1/users/me`, {
  method: "PUT",
  headers: {
    "Content-Type": "application/vnd.api+json",
    Accept: "application/vnd.api+json",
    "X-Store": STORE_UUID,
    Authorization: `Bearer ${token}`,
  },
  body: JSON.stringify({
    data: {
      type: "users",
      attributes: {
        first_name: "Jane",
        last_name: "Doe",
        zip_code: "90001",
        date_of_birth: new Date("1990-01-15").getTime(),
        marketing_email_opt_in: true,
        customer_type: "recreational",
      },
    },
  }),
});

const { data } = await response.json();

Updatable Fields

Field Type Description
first_name string First name
last_name string Last name
zip_code string Postal code
address object Delivery address (address, city, state, zip_code, country)
billing_address object Billing address (same structure as address)
date_of_birth integer Date of birth as Unix timestamp in milliseconds
marketing_email_opt_in boolean Email marketing consent
marketing_sms_opt_in boolean SMS marketing consent
customer_type string "recreational" or "medical"
external_notification_id string External push notification identifier
base64_signature string Customer signature as base64 string
medical_id object { "number": "...", "expiration_date": "YYYY-MM-DD" }
drivers_license_id object { "number": "...", "expiration_date": "YYYY-MM-DD" }

Response Example

Returns the full user object (same shape as Get User Profile).

Errors

Error Code Status When
locked_verified_user_uploads 400 User's identity is verified — ID/medical info updates are locked. Contact support.
name_and_dob_update_not_alowed 400 Name or date of birth updates are locked after verification. Contact support.
user_is_not_confirmed 400 Cannot update an unconfirmed user's email
failed_to_update_email 400 Email update failed in the POS system
age_not_allowed 400 Date of birth doesn't meet minimum age requirement
dob_is_required 400 Date of birth is required but missing

Billing Address

Get Billing Address

Endpoint: GET /api/v1/users/me/billing/ Auth: jwt_authenticated Store: Required

curl -X GET https://ecom-api.staging.blaze.me/api/v1/users/me/billing/ \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -H "X-Store: e87437f2-3e35-4738-af5e-6307e368255c" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response Example

{
  "data": {
    "id": "",
    "type": "billing",
    "attributes": {
      "address": {
        "address": "456 Billing Ave",
        "city": "Los Angeles",
        "state": "CA",
        "zip_code": "90002"
      },
      "use_delivery_address_in_billing": false
    }
  }
}

Update Billing Address

Endpoint: PATCH /api/v1/users/me/billing/ Auth: jwt_authenticated Store: Required

curl -X PATCH https://ecom-api.staging.blaze.me/api/v1/users/me/billing/ \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -H "X-Store: e87437f2-3e35-4738-af5e-6307e368255c" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "data": {
      "type": "billing",
      "attributes": {
        "address": {
          "address": "456 Billing Ave",
          "city": "Los Angeles",
          "state": "CA",
          "zip_code": "90002"
        }
      }
    }
  }'

Errors

Error Code Status When
missing_billing_address 400 Billing address fields are missing or invalid

Loyalty Points

Check the user's loyalty points balance and tier. Use v3 for the enriched response with tier information.

Endpoint: GET /api/v3/users/me/loyalty Auth: jwt_authenticated Store: Required

cURL

curl -X GET https://ecom-api.staging.blaze.me/api/v3/users/me/loyalty \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -H "X-Store: e87437f2-3e35-4738-af5e-6307e368255c" \
  -H "Authorization: Bearer YOUR_TOKEN"

JavaScript

const response = await fetch(`${BASE_URL}/api/v3/users/me/loyalty`, {
  headers: {
    "Content-Type": "application/vnd.api+json",
    Accept: "application/vnd.api+json",
    "X-Store": STORE_UUID,
    Authorization: `Bearer ${token}`,
  },
});

const { data } = await response.json();
console.log(`Points: ${data.attributes.points}, Tier: ${data.attributes.tier}`);

Response Example (v3)

{
  "data": {
    "id": "",
    "type": "loyalties",
    "attributes": {
      "points": "150.00",
      "tier": "Gold"
    }
  }
}

Response Example (v1)

The v1 endpoint (GET /api/v1/users/me/loyalty) returns points only, without tier:

{
  "data": {
    "id": "points",
    "type": "loyalties",
    "attributes": {
      "points": "150.00"
    }
  }
}

Errors

Error Code Status When
no_loyalty 400 No loyalty provider is configured for this store

Rewards

Retrieve the list of rewards available to the authenticated user. These can be applied to the cart at checkout.

Endpoint: GET /api/v1/users/me/rewards Auth: jwt_authenticated Store: Required

curl -X GET https://ecom-api.staging.blaze.me/api/v1/users/me/rewards \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -H "X-Store: e87437f2-3e35-4738-af5e-6307e368255c" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response Example

{
  "data": [
    {
      "id": "42",
      "type": "rewards",
      "attributes": {
        "name": "$5 Off Next Purchase",
        "description": "Get $5 off any order over $25",
        "points_required": 100,
        "is_stackable": false,
        "source": "blaze",
        "discount_amount": "5.00",
        "discount_type": "dollar",
        "reward_good": null,
        "loyalty_service_mapping": null
      }
    },
    {
      "id": "43",
      "type": "rewards",
      "attributes": {
        "name": "Free Preroll",
        "description": "Redeem for a free house preroll",
        "points_required": 200,
        "is_stackable": false,
        "source": "blaze",
        "discount_amount": "",
        "discount_type": "product",
        "reward_good": {
          "name": "House Preroll",
          "product_id": "prod-abc-123"
        },
        "loyalty_service_mapping": null
      }
    }
  ]
}

Errors

Error Code Status When
invalid_rewards_option 400 The store's rewards configuration is invalid

Identity Verification

Some stores require identity verification (e.g., via Berbix or similar services) before allowing purchases.

Get Verification Status

Check the current user's identity verification report.

Endpoint: GET /api/v1/users/me/identity-verification/ Auth: jwt_authenticated Store: Required

curl -X GET https://ecom-api.staging.blaze.me/api/v1/users/me/identity-verification/ \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -H "X-Store: e87437f2-3e35-4738-af5e-6307e368255c" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response Example

{
  "data": {
    "id": "berbix-delivery",
    "type": "identity_verification_report",
    "attributes": {
      "service": "berbix",
      "delivery_type": "delivery",
      "is_verified": true,
      "has_drivers_license": true,
      "has_selfie_id": true,
      "verified_by": "berbix",
      "can_see_menu": true
    }
  }
}

Create Verification Transaction

Start a new identity verification session with a supported service.

Endpoint: POST /api/v1/users/me/identity-verification/{service} Auth: jwt_authenticated Store: Required

curl -X POST https://ecom-api.staging.blaze.me/api/v1/users/me/identity-verification/berbix \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -H "X-Store: e87437f2-3e35-4738-af5e-6307e368255c" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "data": {
      "type": "identity_verifications",
      "attributes": {
        "identity_verification_id": "iv-uuid-if-existing"
      }
    }
  }'

Response Example

{
  "data": {
    "id": "iv-123",
    "type": "identity_verifications",
    "attributes": {
      "external_service": "berbix",
      "status": "pending",
      "public_token_1": "berbix_client_token_abc123",
      "external_id": "berbix-txn-456"
    }
  }
}

Check Transaction Status

Endpoint: GET /api/v1/users/me/identity-verification/{service} Auth: jwt_authenticated Store: Required

Get Service Configuration

Check if a verification service is configured for the store.

Endpoint: GET /api/v1/store/integrations/identity-verification/{service}/configuration Auth: jwt_optional_authenticated Store: Required

Errors

Error Code Status When
invalid_identity_verification_option 400 The identity verification service is not valid
user_already_verified 400 User is already verified by this service
missing_identity_verification_data 400 Required verification fields are missing
inactive_service_config 400 The verification service configuration is inactive
missing_service_config 400 The verification service is not configured for this store

Sync with POS

Sync the current user's profile with the Point of Sale system to pull the latest data (e.g., loyalty balance, order history, member status).

Endpoint: POST /api/v1/users/me/sync Auth: jwt_authenticated Store: Required

curl -X POST https://ecom-api.staging.blaze.me/api/v1/users/me/sync \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -H "X-Store: e87437f2-3e35-4738-af5e-6307e368255c" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "data": {
      "type": "users",
      "attributes": {}
    }
  }'

Response Example

Returns the updated user object (same shape as Get User Profile).

Errors

Error Code Status When
user_is_not_linked 400 User is not linked to any POS profile — sync is not possible

Account Deactivation

Deactivate the current user's account. This is a soft-delete — the account is marked inactive.

Endpoint: DELETE /api/v1/users/me Auth: jwt_authenticated Store: Required

curl -X DELETE https://ecom-api.staging.blaze.me/api/v1/users/me \
  -H "Content-Type: application/vnd.api+json" \
  -H "X-Store: e87437f2-3e35-4738-af5e-6307e368255c" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response

Returns 204 No Content on success.


Document Uploads

Upload identity documents (driver's license, medical ID photos, selfie).

Get Upload URL

Request a pre-signed upload URL for a document type.

Endpoint: POST /api/v1/users/me/documents/{type}/upload-url Auth: jwt_authenticated Store: Required

Supported types: drivers_license, medical_id, selfie

curl -X POST https://ecom-api.staging.blaze.me/api/v1/users/me/documents/drivers_license/upload-url \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -H "X-Store: e87437f2-3e35-4738-af5e-6307e368255c" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "data": {
      "type": "users",
      "attributes": {
        "filename": "my-id-photo.jpg"
      }
    }
  }'

Confirm Upload

After uploading the file to S3 using the pre-signed URL, confirm the upload:

Endpoint: POST /api/v1/users/me/documents/{type}/url

curl -X POST https://ecom-api.staging.blaze.me/api/v1/users/me/documents/drivers_license/url \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -H "X-Store: e87437f2-3e35-4738-af5e-6307e368255c" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "data": {
      "type": "users",
      "attributes": {
        "key": "uploads/documents/abc123.jpg"
      }
    }
  }'

Check Upload Status

Endpoint: GET /api/v1/users/me/documents/{type}/url/{token}

Errors

Error Code Status When
invalid_document_type 400 The document type is not recognized
invalid_file_format 400 The uploaded file format is not accepted
locked_verified_user_uploads 400 User is verified — document updates are locked. Contact support.
s3_key_length_exceeded 400 The upload URL is too long

Common Error Scenarios

These errors can occur across multiple user account endpoints:

Error Code Status Meaning
user_is_not_confirmed 400 Account has not been verified yet. Complete phone/email verification first.
inactive_user 401 The user account is deactivated.
invalid_user 400 No user matching the provided information could be found.
bad_request 400 General invalid request parameters.
not_found 404 The requested resource does not exist.
locked_verified_user_uploads 400 ID/medical info is locked after identity verification. Contact support to update.
name_and_dob_update_not_alowed 400 Name and birthday updates are locked. Contact support.
not_a_member 400 The POS has not accepted the user's membership yet.
consumer_not_found 404 User record not found.

What's Next?