Authentication

How to authenticate with the Marketplace Service API

Overview

The Marketplace Service uses JWT Bearer tokens for authentication. All endpoints (except health checks) require a valid JWT in the Authorization header.

Multi-Tenant Isolation

Every request is scoped to a tenant via the x-tenant-id header or the tenantId claim in the JWT. Row-Level Security (RLS) enforces data isolation at the database level across all 13 marketplace tables.

Getting a JWT Token

Authenticate via the Auth Service to obtain a JWT:

curl -X POST https://535ubezkse.execute-api.us-east-1.amazonaws.com/auth/v1/auth/login/email \
  -H "Content-Type: application/json" \
  -d '{
    "email": "your-email@example.com",
    "password": "your-password"
  }'

The response includes an accessToken in the data envelope:

{
  "data": {
    "accessToken": "eyJhbGciOiJIUzI1NiIs...",
    "refreshToken": "eyJhbGciOiJIUzI1NiIs...",
    "expiresIn": 3600
  }
}

Using the Token

Include the token in every request:

curl https://535ubezkse.execute-api.us-east-1.amazonaws.com/marketplace/v1/listings \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
  -H "x-tenant-id: 00000000-0000-0000-0000-000000000001"

Required Headers

HeaderRequiredDescription
AuthorizationYesBearer JWT token
x-tenant-idYesUUID of the tenant
Content-TypeFor POST/PATCHapplication/json
Idempotency-KeyRecommendedUUID for write operations

JWT Payload

{
  "sub": "user-uuid",
  "email": "user@example.com",
  "tenantId": "00000000-0000-0000-0000-000000000001",
  "roles": ["user", "organizer"],
  "iat": 1700000000,
  "exp": 1700003600
}

Role-Based Access Control

RoleAccess
userBrowse listings, submit quotes, create orders, manage own resources
organizerCreate listings, manage exhibitor slots, sponsorships, RFPs, service tiers
adminFull access including disputes, analytics, bulk operations
super_adminPlatform-wide access across all tenants

Test Accounts

Staging Environment

Use these credentials against the staging API Gateway.
EmailPasswordRole
admin@eventzr.comPassword123!super_admin
organizer@eventzr.comPassword123!organizer
user@eventzr.comPassword123!user

Default Tenant

00000000-0000-0000-0000-000000000001