Create Market
Create a new market for a node.
Endpoint: POST /api/v1/integration/markets
Authentication: Required (Bearer token)
Required Headers:
Authorization: Bearer <access_token>
X-Target-Server: integration
Request Body
Note: The webhook field is optional. You can create a market with or without webhook configuration.
With Webhook:
{
"node_id": "550e8400-e29b-41d4-a716-446655440000",
"domain": "example.com",
"webhook": {
"host": "https://webhook.example.com",
"path": "/webhook",
"method": 1,
"authentication": {
"type": 1,
"username": "user",
"password": "pass"
},
"timeout": 30
}
}
Without Webhook:
{
"node_id": "550e8400-e29b-41d4-a716-446655440000",
"domain": "example.com"
}
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
node_id | string (UUID) | Yes | Node ID |
domain | string | Yes | Market domain |
webhook | object | No | Webhook configuration (optional) |
webhook.host | string | No | Webhook host URL (required if webhook is provided) |
webhook.path | string | No | Webhook path (required if webhook is provided) |
webhook.method | integer | No | HTTP method (1=GET, 2=POST, etc.) |
webhook.authentication | object | No | Authentication configuration |
webhook.authentication.type | integer | No | Authentication type (1=Basic, 2=Token) |
webhook.authentication.username | string | No | Username (required if type=1) |
webhook.authentication.password | string | No | Password (required if type=1) |
webhook.timeout | integer | No | Request timeout in seconds |
Webhook Authentication
The authentication.type field specifies the authentication method for the webhook:
| Type | Value | Description |
|---|---|---|
| Basic | 1 | HTTP Basic Authentication (requires username and password) |
| Token | 2 | Token-based authentication (requires token) |
See Authentication Types for more details.
Response
Status: 201 Created
Returns the created market object.
Example cURL Request
With Webhook:
curl -X POST https://<base-url>/api/v1/integration/markets \
-H "Authorization: Bearer <access_token>" \
-H "X-Target-Server: integration" \
-H "Content-Type: application/json" \
-d '{
"node_id": "550e8400-e29b-41d4-a716-446655440000",
"domain": "example.com",
"webhook": {
"host": "https://webhook.example.com",
"path": "/webhook",
"method": 1,
"authentication": {
"type": 1,
"username": "user",
"password": "pass"
},
"timeout": 30
}
}'
Without Webhook:
curl -X POST https://<base-url>/api/v1/integration/markets \
-H "Authorization: Bearer <access_token>" \
-H "X-Target-Server: integration" \
-H "Content-Type: application/json" \
-d '{
"node_id": "550e8400-e29b-41d4-a716-446655440000",
"domain": "example.com"
}'