Skip to main content

Create Trade

Creates a new trade in the system.

Request

POST /api/v1/trades

Parameters

NameTypeInDescription
namestringbodyRequired. The name of the trade
node_idstringbodyRequired. The ID of the node to create trade under
typenumberbodyRequired. Type of the trade (1: Import, 2: Export)

Trade Types

ValueDescription
1Import
2Export

Trade Status

ValueDescription
1Pending
2Completed
3Fail
4Rejected

Headers

NameDescription
AuthorizationRequired. Bearer token for authentication
Content-TypeRequired. Must be application/json
X-Target-ServerRequired. 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 CodeDescription
200Success
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing authentication token
404Not Found - Node ID does not exist
500Internal Server Error