curl -X POST "https://api.yourdomain.com/api/v1/merchants/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d/operations" \
-H "Authorization: Bearer uwk_YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"operationType": "cash-out",
"amount": "20000.00",
"distributorToShortCode": "100000",
"memo": "Cash withdrawal"
}'
curl -X POST "https://api.yourdomain.com/api/v1/merchants/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d/operations" \
-H "Authorization: Bearer uwk_YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"operationType": "pay-merchant",
"amount": "15000.00",
"merchantToShortCode": "100001",
"memo": "Wholesale payment"
}'
curl -X POST "https://api.yourdomain.com/api/v1/merchants/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d/operations" \
-H "Authorization: Bearer uwk_YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"operationType": "pay-individual",
"amount": "3000.00",
"phoneTo": "+234 8123456781",
"memo": "Refund for order #1234"
}'
const axios = require('axios');
const response = await axios.post(
'https://api.yourdomain.com/api/v1/merchants/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d/operations',
{
operationType: 'pay-merchant',
amount: '15000.00',
merchantToShortCode: '100001',
memo: 'Wholesale payment'
},
{
headers: {
'Authorization': 'Bearer uwk_YOUR_API_KEY_HERE',
'Content-Type': 'application/json'
}
}
);
console.log('Operation ID:', response.data.operationID);
import requests
response = requests.post(
'https://api.yourdomain.com/api/v1/merchants/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d/operations',
json={
'operationType': 'pay-individual',
'amount': '3000.00',
'phoneTo': '+234 8123456781',
'memo': 'Refund for order #1234'
},
headers={'Authorization': 'Bearer uwk_YOUR_API_KEY_HERE'}
)
print('Operation ID:', response.json()['operationID'])
{
"operationID": "op_8b7c9d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e"
}
{
"type": "/problems/input-validation-problems",
"status": 400,
"title": "There are some validation errors",
"detail": "Please fix the validation issues and try again",
"errors": [
{
"type": "/problems/input-validation-problems/invalid-field",
"field": "amount",
"detail": "Amount must be a valid decimal number"
}
]
}
{
"type": "/problems/access-forbidden",
"status": 403,
"title": "Access Forbidden",
"detail": "API key does not have Perform Operations permission"
}
{
"type": "/problems/insufficient-balance",
"status": 403,
"title": "Insufficient Balance",
"detail": "Insufficient balance to complete this operation"
}
Merchant API
Create Operation
Create a new merchant operation (cash-out, pay-merchant, or pay-individual)
POST
/
api
/
v1
/
merchants
/
{merchantID}
/
operations
curl -X POST "https://api.yourdomain.com/api/v1/merchants/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d/operations" \
-H "Authorization: Bearer uwk_YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"operationType": "cash-out",
"amount": "20000.00",
"distributorToShortCode": "100000",
"memo": "Cash withdrawal"
}'
curl -X POST "https://api.yourdomain.com/api/v1/merchants/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d/operations" \
-H "Authorization: Bearer uwk_YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"operationType": "pay-merchant",
"amount": "15000.00",
"merchantToShortCode": "100001",
"memo": "Wholesale payment"
}'
curl -X POST "https://api.yourdomain.com/api/v1/merchants/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d/operations" \
-H "Authorization: Bearer uwk_YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"operationType": "pay-individual",
"amount": "3000.00",
"phoneTo": "+234 8123456781",
"memo": "Refund for order #1234"
}'
const axios = require('axios');
const response = await axios.post(
'https://api.yourdomain.com/api/v1/merchants/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d/operations',
{
operationType: 'pay-merchant',
amount: '15000.00',
merchantToShortCode: '100001',
memo: 'Wholesale payment'
},
{
headers: {
'Authorization': 'Bearer uwk_YOUR_API_KEY_HERE',
'Content-Type': 'application/json'
}
}
);
console.log('Operation ID:', response.data.operationID);
import requests
response = requests.post(
'https://api.yourdomain.com/api/v1/merchants/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d/operations',
json={
'operationType': 'pay-individual',
'amount': '3000.00',
'phoneTo': '+234 8123456781',
'memo': 'Refund for order #1234'
},
headers={'Authorization': 'Bearer uwk_YOUR_API_KEY_HERE'}
)
print('Operation ID:', response.json()['operationID'])
{
"operationID": "op_8b7c9d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e"
}
{
"type": "/problems/input-validation-problems",
"status": 400,
"title": "There are some validation errors",
"detail": "Please fix the validation issues and try again",
"errors": [
{
"type": "/problems/input-validation-problems/invalid-field",
"field": "amount",
"detail": "Amount must be a valid decimal number"
}
]
}
{
"type": "/problems/access-forbidden",
"status": 403,
"title": "Access Forbidden",
"detail": "API key does not have Perform Operations permission"
}
{
"type": "/problems/insufficient-balance",
"status": 403,
"title": "Insufficient Balance",
"detail": "Insufficient balance to complete this operation"
}
Endpoint
POST /api/v1/merchants/{merchantID}/operations
Authentication
Path Parameters
The unique identifier of the merchant. Must match the merchant ID associated with the API key.
Request Body
Cash-Out Operation
Pay Merchant Operation
Pay Individual Operation
Response
curl -X POST "https://api.yourdomain.com/api/v1/merchants/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d/operations" \
-H "Authorization: Bearer uwk_YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"operationType": "cash-out",
"amount": "20000.00",
"distributorToShortCode": "100000",
"memo": "Cash withdrawal"
}'
curl -X POST "https://api.yourdomain.com/api/v1/merchants/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d/operations" \
-H "Authorization: Bearer uwk_YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"operationType": "pay-merchant",
"amount": "15000.00",
"merchantToShortCode": "100001",
"memo": "Wholesale payment"
}'
curl -X POST "https://api.yourdomain.com/api/v1/merchants/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d/operations" \
-H "Authorization: Bearer uwk_YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"operationType": "pay-individual",
"amount": "3000.00",
"phoneTo": "+234 8123456781",
"memo": "Refund for order #1234"
}'
const axios = require('axios');
const response = await axios.post(
'https://api.yourdomain.com/api/v1/merchants/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d/operations',
{
operationType: 'pay-merchant',
amount: '15000.00',
merchantToShortCode: '100001',
memo: 'Wholesale payment'
},
{
headers: {
'Authorization': 'Bearer uwk_YOUR_API_KEY_HERE',
'Content-Type': 'application/json'
}
}
);
console.log('Operation ID:', response.data.operationID);
import requests
response = requests.post(
'https://api.yourdomain.com/api/v1/merchants/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d/operations',
json={
'operationType': 'pay-individual',
'amount': '3000.00',
'phoneTo': '+234 8123456781',
'memo': 'Refund for order #1234'
},
headers={'Authorization': 'Bearer uwk_YOUR_API_KEY_HERE'}
)
print('Operation ID:', response.json()['operationID'])
{
"operationID": "op_8b7c9d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e"
}
{
"type": "/problems/input-validation-problems",
"status": 400,
"title": "There are some validation errors",
"detail": "Please fix the validation issues and try again",
"errors": [
{
"type": "/problems/input-validation-problems/invalid-field",
"field": "amount",
"detail": "Amount must be a valid decimal number"
}
]
}
{
"type": "/problems/access-forbidden",
"status": 403,
"title": "Access Forbidden",
"detail": "API key does not have Perform Operations permission"
}
{
"type": "/problems/insufficient-balance",
"status": 403,
"title": "Insufficient Balance",
"detail": "Insufficient balance to complete this operation"
}
Maker-Checker Workflow
Operations created via API follow the maker-checker approval pattern. The operation is created in a pending state and requires approval by a checker before execution.
- Operation is saved with status pending
- A checker with appropriate permissions must approve it via the web interface
- Once approved, the operation is executed on the blockchain
- The operation status changes to completed or failed
Related Endpoints
Get Balance
Check merchant balance before creating operations
Get Operations
Query operation history and status