Shipment | Create | Batch
POST /api/v0/shipment/batch
Request
Headers
| Header |
Required |
Description |
| Content-Type |
yes |
Type of data sent (application/json) |
| X-Auth-Token |
yes |
Authentication token |
Body
| Parameter |
Required |
Type |
Description |
| recipientEmail |
yes |
string |
Recipient email |
| recipientEmailsCC |
no |
array |
Recipient CC emails |
| recipientTaxId |
no |
string |
Recipient Tax ID number |
| senderEmailReplyTo |
no |
string |
Sender Reply-To email |
| senderTaxId |
no |
string |
Sender Tax ID number |
| description |
no |
string |
Description |
| contentType |
no |
string |
Content type |
| notificationMailTemplate |
no |
string |
BASE64-encoded notification mail HTML body * |
| notificationMailItemsAttached |
no |
boolean |
Attach shipment items to notification mail? (default: false) |
| sealed |
no |
boolean |
Seal shipment? (default: false) |
| items |
no |
array |
Shipment items |
| > items.*.file |
yes |
string |
BASE64-encoded file content |
| > items.*.name |
yes |
string |
File name |
| > items.*.description |
no |
string |
Description |
* Notification mail HTML body variables
| Variable |
Required |
Description |
| {{ shipment.items }} |
yes |
Shipment items |
| {{ shipment.confirmationLink }} |
no |
Shipment confirmation link |
Example
curl --request POST
--url https://net.wings.rs/api/v0/shipment
--header 'Content-Type: application/json'
--header 'X-Auth-Token: <TOKEN>'
--data '{
"recipientEmail": "nbatocanin@wings.rs",
"recipientEmailsCC": [
"office@wings.rs",
"podrska@wings.rs"
],
"recipientTaxId": "123456789",
"senderEmailReplyTo": "office@example.com",
"senderTaxId": "987654321",
"description": "Invoice 001",
"contentType": "FAK",
"notificationMailTemplate": "RG9jdW1lbnRzIGF0dGFjaGVkOiB7eyBzaGlwbWVudC5pdGVtcyB9fQ==",
"notificationMailItemsAttached": true,
"sealed": true,
"items": [
{
"file": "V2luZ3NOZXQgSXRlbSAjMQ==",
"name": "Invoice 001.PDF",
"description": "PDF invoice #001"
},
{
"file": "V2luZ3NOZXQgSXRlbSAjMg==",
"name": "Invoice 001.XML",
"description": "XML invoice #001"
}
]
}'
Response
Body
| Parameter |
Type |
Description |
| id |
string |
Shipment ID (UUID) |
| items |
array |
Shipment items |
| items.*.id |
integer |
Shipment item ID (UUID) |
| items.*.name |
string |
Shipment item file name |
Example
{
"data": {
"id": "07f4ba89-eacf-11ea-99c3-0242ac190005",
"items": [
{
"id": "0814fe17-eacf-11ea-99c3-0242ac190005",
"name": "Invoice 001.PDF"
},
{
"id": "082356df-eacf-11ea-99c3-0242ac190005",
"name": "Invoice 001.XML"
}
]
}
}
In case of an error (status code 400):
{
"error": {
"message": "This value is not a valid email address.",
"field": "recipientEmail"
}
}