cURL
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" } ] }
Creates a sub-merchant whose parent_vendor_id points to the given master merchant.
parent_vendor_id
parent_vendor_id = null
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
Master merchant ID.
pending
approved
rejected
^[0-9]{6}$
Sub-merchant created