Skip to content

Latest commit

 

History

History
82 lines (65 loc) · 1.47 KB

File metadata and controls

82 lines (65 loc) · 1.47 KB
title Auth And Onboarding
description Curl examples for dashboard auth, merchant selection, and merchant onboarding.

Auth And Onboarding

Sign Up

curl --location "$BASE_URL/auth/signup" \
  --header "Content-Type: application/json" \
  --data '{
    "email": "[email protected]",
    "password": "StrongPass#123",
    "merchant_id": "merchant_demo"
  }'

Login

curl --location "$BASE_URL/auth/login" \
  --header "Content-Type: application/json" \
  --data '{
    "email": "[email protected]",
    "password": "StrongPass#123"
  }'

Response contains a dashboard JWT:

{
  "token": "eyJ...",
  "user_id": "user_123",
  "email": "[email protected]",
  "merchant_id": "merchant_demo",
  "role": "admin",
  "merchants": []
}

Current User

curl "$BASE_URL/auth/me" \
  --header "$AUTH_HEADER"

List User Merchants

curl "$BASE_URL/auth/merchants" \
  --header "$AUTH_HEADER"

Switch Merchant

curl --location "$BASE_URL/auth/switch-merchant" \
  --header "$AUTH_HEADER" \
  --header "Content-Type: application/json" \
  --data '{ "merchant_id": "merchant_demo" }'

Create Merchant From Dashboard

curl --location "$BASE_URL/onboarding/merchant" \
  --header "$AUTH_HEADER" \
  --header "Content-Type: application/json" \
  --data '{ "merchant_name": "Demo Merchant" }'

Logout

curl --location "$BASE_URL/auth/logout" \
  --header "$AUTH_HEADER" \
  --request POST