| title | Auth And Onboarding |
|---|---|
| description | Curl examples for dashboard auth, merchant selection, and merchant onboarding. |
curl --location "$BASE_URL/auth/signup" \
--header "Content-Type: application/json" \
--data '{
"email": "operator@example.com",
"password": "StrongPass#123",
"merchant_id": "merchant_demo"
}'curl --location "$BASE_URL/auth/login" \
--header "Content-Type: application/json" \
--data '{
"email": "operator@example.com",
"password": "StrongPass#123"
}'Response contains a dashboard JWT:
{
"token": "eyJ...",
"user_id": "user_123",
"email": "operator@example.com",
"merchant_id": "merchant_demo",
"role": "admin",
"merchants": []
}curl "$BASE_URL/auth/me" \
--header "$AUTH_HEADER"curl "$BASE_URL/auth/merchants" \
--header "$AUTH_HEADER"curl --location "$BASE_URL/auth/switch-merchant" \
--header "$AUTH_HEADER" \
--header "Content-Type: application/json" \
--data '{ "merchant_id": "merchant_demo" }'curl --location "$BASE_URL/onboarding/merchant" \
--header "$AUTH_HEADER" \
--header "Content-Type: application/json" \
--data '{ "merchant_name": "Demo Merchant" }'curl --location "$BASE_URL/auth/logout" \
--header "$AUTH_HEADER" \
--request POSTPublic route — the link sent by the signup email-verification flow calls this with the token from the email.
curl "$BASE_URL/auth/verify-email?token=vf_9f21a6c0..."{ "message": "Email verified successfully." }curl --location "$BASE_URL/auth/change-password" \
--header "$AUTH_HEADER" \
--header "Content-Type: application/json" \
--data '{
"current_password": "StrongPass#123",
"new_password": "EvenStrongerPass#456"
}'{ "message": "Password updated successfully." }Invite and manage members on the authenticated merchant account. Inviting requires the caller's JWT to carry the admin role.
curl "$BASE_URL/merchant/members" \
--header "$AUTH_HEADER"[
{ "user_id": "user_123", "email": "operator@example.com", "role": "admin" },
{ "user_id": "user_456", "email": "teammate@example.com", "role": "member" }
]curl --location "$BASE_URL/merchant/members/invite" \
--header "$AUTH_HEADER" \
--header "Content-Type: application/json" \
--data '{ "email": "teammate@example.com", "role": "member" }'role is optional and defaults to "member"; the only other accepted value is "admin".
{
"email": "teammate@example.com",
"is_new_user": true,
"password": "TempPass#8821",
"role": "member"
}password is only present when the invite creates a brand-new user account — share it out of band so they can log in and change it. Inviting an email that's already a user omits password and just adds the membership.