Install a new payment method provider for a project.
POST/v2/projects/{project_id}/merchant-accounts Path Parameters
The unique identifier of the project.
Request Body
Payment provider identifier: stripe, paypal, or nowpayments.
Environment: sandbox or production.
Optional label to identify this merchant account.
Provider-Specific Parameters
For Stripe:
For PayPal:
Your PayPal client secret.
For NOWPayments:
Your NOWPayments API key.
Your NOWPayments IPN secret.
curl -X POST "https://api.botsubscription.com/v2/projects/YOUR_PROJECT_ID/merchant-accounts" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"provider": "stripe",
"stripe_secret_key": "sk_live_...",
"environment": "production"
}'
const project_id = 'YOUR_PROJECT_ID';
const response = await fetch(`https://api.botsubscription.com/v2/projects/${project_id}/merchant-accounts`, {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
provider: 'stripe',
stripe_secret_key: 'sk_live_...',
environment: 'production'
})
});
const data = await response.json();
import requests
project_id = 'YOUR_PROJECT_ID'
response = requests.post(
f'https://api.botsubscription.com/v2/projects/{project_id}/merchant-accounts',
headers={
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
},
json={
'provider': 'stripe',
'stripe_secret_key': 'sk_live_...',
'environment': 'production'
}
)
data = response.json()
$project_id = 'YOUR_PROJECT_ID';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.botsubscription.com/v2/projects/{$project_id}/merchant-accounts");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer YOUR_TOKEN',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'provider' => 'stripe',
'stripe_secret_key' => 'sk_live_...',
'environment' => 'production'
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
Merchant account installedapplication/json
{
"ok": true,
"request_id": "11111111-1111-1111-1111-111111111111",
"method": "POST",
"path": "/v2/projects/YOUR_PROJECT_ID/merchant-accounts",
"code": 201,
"message": "Merchant account installed successfully",
"data": {
"merchant_account_id": "11111111-1111-1111-1111-111111111111",
"provider": "stripe",
"environment": "production",
"active": true,
"has_requirements": false,
"configuration_editable": false,
"label": null
}
}
Invalid credentialsapplication/json
{
"ok": false,
"request_id": "11111111-1111-1111-1111-111111111111",
"method": "POST",
"path": "/v2/projects/YOUR_PROJECT_ID/merchant-accounts",
"code": 400,
"error": {
"error_code": "BAD_REQUEST",
"message": "Invalid Stripe credentials"
}
}
Validation errorapplication/json
{
"ok": false,
"request_id": "11111111-1111-1111-1111-111111111111",
"method": "POST",
"path": "/v2/projects/YOUR_PROJECT_ID/merchant-accounts",
"code": 422,
"errors": [
{
"message": "Invalid environment: must be one of: sandbox, production",
"error_code": "VALIDATION_ERROR"
}
]
}
Duplicate credentialsapplication/json
{
"ok": false,
"request_id": "11111111-1111-1111-1111-111111111111",
"method": "POST",
"path": "/v2/projects/YOUR_PROJECT_ID/merchant-accounts",
"code": 422,
"error": {
"error_code": "VALIDATION_ERROR",
"message": "A merchant account with identical credentials already exists in this project"
}
}
Last updated: