Create Master Merchant (Vendor) With Default Wallets
curl --request POST \
--url https://crypto.westminister.tech/api/v1/auth/merchants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "merchant1@gmail.com",
"phone_number": "+254700000011",
"first_name": "Alice",
"last_name": "Merchant",
"password": "secret",
"kyc_status": "pending",
"is_active": true,
"pin": "123456"
}
'import requests
url = "https://crypto.westminister.tech/api/v1/auth/merchants"
payload = {
"email": "merchant1@gmail.com",
"phone_number": "+254700000011",
"first_name": "Alice",
"last_name": "Merchant",
"password": "secret",
"kyc_status": "pending",
"is_active": True,
"pin": "123456"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'merchant1@gmail.com',
phone_number: '+254700000011',
first_name: 'Alice',
last_name: 'Merchant',
password: 'secret',
kyc_status: 'pending',
is_active: true,
pin: '123456'
})
};
fetch('https://crypto.westminister.tech/api/v1/auth/merchants', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://crypto.westminister.tech/api/v1/auth/merchants",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'merchant1@gmail.com',
'phone_number' => '+254700000011',
'first_name' => 'Alice',
'last_name' => 'Merchant',
'password' => 'secret',
'kyc_status' => 'pending',
'is_active' => true,
'pin' => '123456'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://crypto.westminister.tech/api/v1/auth/merchants"
payload := strings.NewReader("{\n \"email\": \"merchant1@gmail.com\",\n \"phone_number\": \"+254700000011\",\n \"first_name\": \"Alice\",\n \"last_name\": \"Merchant\",\n \"password\": \"secret\",\n \"kyc_status\": \"pending\",\n \"is_active\": true,\n \"pin\": \"123456\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://crypto.westminister.tech/api/v1/auth/merchants")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"merchant1@gmail.com\",\n \"phone_number\": \"+254700000011\",\n \"first_name\": \"Alice\",\n \"last_name\": \"Merchant\",\n \"password\": \"secret\",\n \"kyc_status\": \"pending\",\n \"is_active\": true,\n \"pin\": \"123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://crypto.westminister.tech/api/v1/auth/merchants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"merchant1@gmail.com\",\n \"phone_number\": \"+254700000011\",\n \"first_name\": \"Alice\",\n \"last_name\": \"Merchant\",\n \"password\": \"secret\",\n \"kyc_status\": \"pending\",\n \"is_active\": true,\n \"pin\": \"123456\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Merchant created successfully with default wallets",
"merchant": {
"id": "a2aeca1d-9686-4158-b4be-d0a3fd04760e",
"email": "merchant1@gmail.com",
"phone_number": "+254700000011",
"first_name": "Alice",
"last_name": "Merchant",
"role": "vendor",
"kyc_status": "pending",
"is_active": true,
"parent_vendor_id": null
},
"wallets": [
{
"id": "ee7104ad-4ac4-4a9f-aee5-3b0445c3b0d9",
"network": "ethereum",
"address": 8.481441789197193e+47,
"is_default": true,
"wallet_type": "hot"
},
{
"id": "4284c38a-4d09-4534-8e9e-43ba65b66ef0",
"network": "tron",
"address": "TSQLub2pZZTmiBf1GUbJpjsx48dnuBj3nY",
"is_default": false,
"wallet_type": "hot"
},
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"network": "solana",
"address": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"is_default": false,
"wallet_type": "hot"
}
]
}{
"error": "email is already registered"
}Merchants
Create Master Merchant (Vendor) With Default Wallets
Creates a new master merchant (vendor user) and best-effort provisions default custodial wallets on ethereum, tron, and solana.
Duplicate contact guard: Returns 409 when email or phone_number is already registered. No user row and no wallets are created.
Wallet provisioning is best-effort: if one network fails (for example BitGo hteth quota), the API still creates wallets on the other networks and returns wallet_errors plus a warning. This applies only after the merchant user is created successfully.
- Role is always set to
vendor parent_vendor_idisnullfor master merchants- Default wallets (best-effort, one per network):
- Ethereum wallet (
is_default=true) - TRON wallet
- Solana wallet (BitGo custody required)
- Ethereum wallet (
POST
/
api
/
v1
/
auth
/
merchants
Create Master Merchant (Vendor) With Default Wallets
curl --request POST \
--url https://crypto.westminister.tech/api/v1/auth/merchants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "merchant1@gmail.com",
"phone_number": "+254700000011",
"first_name": "Alice",
"last_name": "Merchant",
"password": "secret",
"kyc_status": "pending",
"is_active": true,
"pin": "123456"
}
'import requests
url = "https://crypto.westminister.tech/api/v1/auth/merchants"
payload = {
"email": "merchant1@gmail.com",
"phone_number": "+254700000011",
"first_name": "Alice",
"last_name": "Merchant",
"password": "secret",
"kyc_status": "pending",
"is_active": True,
"pin": "123456"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'merchant1@gmail.com',
phone_number: '+254700000011',
first_name: 'Alice',
last_name: 'Merchant',
password: 'secret',
kyc_status: 'pending',
is_active: true,
pin: '123456'
})
};
fetch('https://crypto.westminister.tech/api/v1/auth/merchants', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://crypto.westminister.tech/api/v1/auth/merchants",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'merchant1@gmail.com',
'phone_number' => '+254700000011',
'first_name' => 'Alice',
'last_name' => 'Merchant',
'password' => 'secret',
'kyc_status' => 'pending',
'is_active' => true,
'pin' => '123456'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://crypto.westminister.tech/api/v1/auth/merchants"
payload := strings.NewReader("{\n \"email\": \"merchant1@gmail.com\",\n \"phone_number\": \"+254700000011\",\n \"first_name\": \"Alice\",\n \"last_name\": \"Merchant\",\n \"password\": \"secret\",\n \"kyc_status\": \"pending\",\n \"is_active\": true,\n \"pin\": \"123456\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://crypto.westminister.tech/api/v1/auth/merchants")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"merchant1@gmail.com\",\n \"phone_number\": \"+254700000011\",\n \"first_name\": \"Alice\",\n \"last_name\": \"Merchant\",\n \"password\": \"secret\",\n \"kyc_status\": \"pending\",\n \"is_active\": true,\n \"pin\": \"123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://crypto.westminister.tech/api/v1/auth/merchants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"merchant1@gmail.com\",\n \"phone_number\": \"+254700000011\",\n \"first_name\": \"Alice\",\n \"last_name\": \"Merchant\",\n \"password\": \"secret\",\n \"kyc_status\": \"pending\",\n \"is_active\": true,\n \"pin\": \"123456\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Merchant created successfully with default wallets",
"merchant": {
"id": "a2aeca1d-9686-4158-b4be-d0a3fd04760e",
"email": "merchant1@gmail.com",
"phone_number": "+254700000011",
"first_name": "Alice",
"last_name": "Merchant",
"role": "vendor",
"kyc_status": "pending",
"is_active": true,
"parent_vendor_id": null
},
"wallets": [
{
"id": "ee7104ad-4ac4-4a9f-aee5-3b0445c3b0d9",
"network": "ethereum",
"address": 8.481441789197193e+47,
"is_default": true,
"wallet_type": "hot"
},
{
"id": "4284c38a-4d09-4534-8e9e-43ba65b66ef0",
"network": "tron",
"address": "TSQLub2pZZTmiBf1GUbJpjsx48dnuBj3nY",
"is_default": false,
"wallet_type": "hot"
},
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"network": "solana",
"address": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"is_default": false,
"wallet_type": "hot"
}
]
}{
"error": "email is already registered"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
E.164 format (e.g. +2547xxxxxxx)
Merchant password (min 6 chars).
Available options:
pending, approved, rejected Optional 6-digit PIN for PIN-based login.
Pattern:
^[0-9]{6}$Response
Merchant created with wallets
⌘I