Create Trade
Creates a new trade in the system.
Request
POST /api/v1/trades
Parameters
| Name | Type | In | Description |
|---|---|---|---|
name | string | body | Required. The name of the trade |
node_id | string | body | Required. The ID of the node to create trade under |
type | number | body | Required. Type of the trade (1: Import, 2: Export) |
Trade Types
| Value | Description |
|---|---|
| 1 | Import |
| 2 | Export |
Trade Status
| Value | Description |
|---|---|
| 1 | Pending |
| 2 | Completed |
| 3 | Fail |
| 4 | Rejected |
Headers
| Name | Description |
|---|---|
Authorization | Required. Bearer token for authentication |
Content-Type | Required. Must be application/json |
X-Target-Server | Required. Target server identifier |
Example
curl --request POST \
--url '{{HOST}}/api/v1/trades?page=1&per_page=10' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
--header 'Content-Type: application/json' \
--header 'X-Target-Server: declaration' \
--data '{
"name": "API Trade",
"node_id": "6784fea5481a2963fcb2d74c",
"type": 1
}'
Response
A successful request returns an HTTP 200 status code with the created trade information.
{
"id": "68247532b5e19b4fafa3f894",
"declaration_id": "7428912381230128310238",
"name": "API Trade",
"node_name": "Interzoon A.S",
"node_id": "6784fea5481a2963fcb2d74c",
"status": 1,
"type": 1,
"permissions": [],
"created_by": "6784fea5481a2963fcb2d74d",
"created_at": "2025-05-14T13:49:22.835726+03:00",
"updated_at": "2025-05-14T13:49:22.835726+03:00"
}
Status Codes
| Status Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing authentication token |
| 404 | Not Found - Node ID does not exist |
| 500 | Internal Server Error |