Skip to main content
POST
/
api
/
v1
/
auth
/
merchants
/
{merchant_id}
/
sub-merchants
Create sub-merchant under a master merchant
curl --request POST \
  --url https://crypto.westminister.tech/api/v1/auth/merchants/{merchant_id}/sub-merchants \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "merchant1.branch1@gmail.com",
  "phone_number": "+254700000002",
  "first_name": "Bob",
  "last_name": "Branch",
  "password": "secret",
  "kyc_status": "pending",
  "is_active": true,
  "pin": "654321"
}
'
{
  "message": "Sub-merchant created successfully with default wallets",
  "sub_merchant": {
    "id": "f004fba4-7b6c-423a-983b-fdc283f8a1ab",
    "email": "merchant1.branch1@gmail.com",
    "phone_number": "+254700000002",
    "first_name": "Bob",
    "last_name": "Branch",
    "role": "vendor",
    "kyc_status": "pending",
    "is_active": true,
    "parent_vendor_id": "a2aeca1d-9686-4158-b4be-d0a3fd04760e"
  },
  "wallets": [
    {
      "id": "74b2bdea-8cf1-4fbf-9b28-5c48a56bda6b",
      "network": "ethereum",
      "address": 1.4545186821318902e+47,
      "is_default": true,
      "wallet_type": "hot"
    },
    {
      "id": "2f7e7c32-9623-4ca4-8733-fd07449bd6b8",
      "network": "tron",
      "address": "TXpgi7XLZEQQgC7pR1iKuRsKyesskZkEqM",
      "is_default": false,
      "wallet_type": "hot"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

merchant_id
string<uuid>
required

Master merchant ID.

Body

application/json
email
string<email>
required
phone_number
string
required
first_name
string
required
last_name
string
required
password
string<password>
required
kyc_status
enum<string>
required
Available options:
pending,
approved,
rejected
is_active
boolean
pin
string
Pattern: ^[0-9]{6}$

Response

201 - application/json

Sub-merchant created

message
string
sub_merchant
any
wallets
any[]