StayMe

Partner Merchant Earn API

Award StayMe loyalty points to your customers when they spend at your venue. Integrate in minutes with our simple REST API.

Base URL
https://staybook-quf2jwtmya-as.a.run.app/api/partner

Authentication

All API requests must include your API key in the request header. Contact StayMe admin to obtain your API key.

X-Partner-API-Key: your_api_key_here
GET /api/partner/check-member

Check Member

Verify that a customer is a StayMe member before processing a transaction. Returns the member's name, tier, and your applicable earn rate.

Query Parameters

Parameter Type Required Description
email string Yes Customer's email address

Example Request

curl -X GET "https://staybook-quf2jwtmya-as.a.run.app/api/partner/check-member?email=guest@example.com" \
     -H "X-Partner-API-Key: your_api_key_here" \
     -H "Accept: application/json"

Example Response (member found)

{
  "exists": true,
  "member_name": "Jane Smith",
  "tier": "Gold",
  "earn_rate": 2.0
}
POST /api/partner/earn

Award Points

Award loyalty points to a StayMe member for a spend at your merchant location. Points are calculated as: floor(spend_amount × earn_rate), optionally capped at your configured maximum.

Request Body (JSON)

Field Type Required Description
member_email string Yes Member's email address
spend_amount number Yes Amount spent in USD (e.g. 45.50)
transaction_ref string No Your unique transaction ID (prevents duplicates)
description string No Human-readable description shown to the member

Example Request

curl -X POST "https://staybook-quf2jwtmya-as.a.run.app/api/partner/earn" \
     -H "X-Partner-API-Key: your_api_key_here" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json" \
     -d '{
       "member_email": "guest@example.com",
       "spend_amount": 87.50,
       "transaction_ref": "TXREF-20260101-001",
       "description": "Dinner at The Grand Bistro"
     }'

Example Response

{
  "status": "success",
  "points_awarded": 175,
  "member_name": "Jane Smith",
  "new_balance": 2350
}

Error Codes

HTTP Status Meaning
401Missing or invalid API key
404Member email not found
409Duplicate transaction reference
422Validation error or spend too low to earn points

Need Help?

Contact your StayMe account manager to obtain your API key, adjust earn rates, or get integration support.

🍪 我们使用 Cookie 个性化您的体验并分析流量。 See our 隐私政策 and 服务条款.

StayMe 助手 AI
可代您执行操作
正在输入...
对比:
对比
StayMe

将 StayMe 添加到主屏幕

即时访问您的预订