Skip to main content
PUT
/
v1
/
merchants
/
{id}
Update Merchant
curl --request PUT \
  --url https://olp-api.nipuntheekshana.com/v1/merchants/{id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "businessName": "<string>",
  "phone": "<string>",
  "walletAddress": "<string>",
  "webhookUrl": "<string>",
  "businessType": "<string>"
}
'
This endpoint requires a valid Bearer token in the Authorization header. Merchants can only update their own profile.

Path Parameters

id
string
required
The unique merchant identifier (e.g., merch_abc123).

Request Body

businessName
string
Updated business name.
phone
string
Updated phone number in international format.
walletAddress
string
Blockchain wallet address for receiving payments.
webhookUrl
string
URL to receive webhook event notifications.
businessType
string
Type of business. One of individual, company, nonprofit.

Example Request

{
  "businessName": "Acme Payments International",
  "walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
  "webhookUrl": "https://acmepay.com/webhooks/openpay"
}

Example Response (200)

{
  "id": "merch_abc123",
  "businessName": "Acme Payments International",
  "email": "admin@acmepay.com",
  "phone": "+94771234567",
  "businessType": "company",
  "status": "active",
  "walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
  "webhookUrl": "https://acmepay.com/webhooks/openpay",
  "twoFactorEnabled": true,
  "createdAt": "2026-03-26T10:00:00Z",
  "updatedAt": "2026-03-26T14:00:00Z"
}

Error Responses

400 Validation Error
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid wallet address format"
  }
}
403 Forbidden
{
  "error": {
    "code": "FORBIDDEN",
    "message": "You do not have permission to update this merchant"
  }
}