WS SendCloud
The SendCloud API consists of several resources. Below you can find the list of the resources. Click on the one you need and you will find more information about the resource.
Get Parcels
To receive the parcels from the user you should do a GET request
Example
https://wsmedia.tlsecure.com/api//json/XXXXX/admin/carrier/1/parcels
Request
HTTP Verb : GET
URL : http://{WS_URL}/api/{returnType}/{domainCode}/admin/carrier/{carrier_id}/parcels
Response
Success
{
"response": {
"success": true,
"code": 0,
"message": "parcel retrieved",
"object": {
"parcels": {
"parcel": [
{
"id": 2889994,
"address": "Albert II straat 5",
"address_divided": {
"house_number": "5",
"street": "Albert II straat"
},
"city": "Gouda",
"country": {
"iso_2": "NL",
"iso_3": "NLD",
"name": "Netherlands"
},
"date_created": "25-10-2016 10:06:57",
"email": "XXXXX",
"name": "Mevr. XXXXX",
"postal_code": "2802 AT",
"reference": "0",
"shipment": {
"id": 39,
"name": "PostNL Mailbox Parcel Extra"
},
"status": {
"id": 1000,
"message": "Ready to send"
},
"tracking_number": "XXXX",
"weight": "1.010",
"label": {
"normal_printer": [
"https://panel.sendcloud.sc/api/v2/labels/normal_printer/XXXX?start_from=0",
"https://panel.sendcloud.sc/api/v2/labels/normal_printer/XXXX?start_from=1",
"https://panel.sendcloud.sc/api/v2/labels/normal_printer/XXXX?start_from=2",
"https://panel.sendcloud.sc/api/v2/labels/normal_printer/XXXX?start_from=3"
],
"label_printer": "https://panel.sendcloud.sc/api/v2/labels/label_printer/XXXX"
},
"order_number": "17674",
"carrier": {
"code": "postnl"
},
"tracking_url": "https://jouw.postnl.nl/#!/track-en-trace/XXXX/NL/2802%20AT"
},...
}
]
}
}
}
}
Codelist
Code | Success | Message |
---|---|---|
0 | v | get parcels |
1 |
| domaincode malformed |
2 |
| connexion error |
99 |
| uncatched exception |
Get Parcel
To receive the parcel from the user you should do a GET request
Example
https://wsmedia.tlsecure.com/api//json/XXXXX/admin/carrier/1/parcels/XXXX
Request
HTTP Verb : GET
URL : http://{WS_URL}/api/{returnType}/{domainCode}/admin/carrier/{carrier_id}/parcels/{parcel_id}
Parameters | Location | Type | Required | Default | Accepted |
---|---|---|---|---|---|
parcel_id | Query | integer | v |
|
|
Response
Success
{
"response": {
"success": true,
"code": 0,
"message": "parcel retrieved",
"object": {
"parcel": {
"id": 2879708,
"address": "Bilderdijkstraat 9",
"address_divided": {
"house_number": "9",
"street": "Bilderdijkstraat"
},
"city": "Haarlem",
"country": {
"iso_2": "NL",
"iso_3": "NLD",
"name": "Netherlands"
},
"date_created": "24-10-2016 12:08:46",
"email": "XXXX",
"name": "XXXX",
"postal_code": "2013 EK",
"reference": "0",
"shipment": {
"id": 39,
"name": "PostNL Mailbox Parcel Extra"
},
"status": {
"id": 3,
"message": "En route to sorting center"
},
"tracking_number": "XXXX",
"weight": "1.000",
"label": {
"normal_printer": [
"https://panel.sendcloud.sc/api/v2/labels/normal_printer/XXXX?start_from=0",
"https://panel.sendcloud.sc/api/v2/labels/normal_printer/XXXX?start_from=1",
"https://panel.sendcloud.sc/api/v2/labels/normal_printer/XXXX?start_from=2",
"https://panel.sendcloud.sc/api/v2/labels/normal_printer/XXXX?start_from=3"
],
"label_printer": "https://panel.sendcloud.sc/api/v2/labels/label_printer/XXXX"
},
"order_number": "17610",
"carrier": {
"code": "postnl"
},
"tracking_url": "https://jouw.postnl.nl/#!/track-en-trace/XXXX/NL/2013%20EK"
}
}
}
}
Error
{
"response": {
"success": false,
"code": 11,
"message": "not parcel with this ID"
}
}
Codelist
Code | Success | Message |
---|---|---|
0 | v | get parcels |
1 |
| domaincode malformed |
2 |
| connexion error |
11 |
| not parcel with this ID |
99 |
| uncatched exception |
Get Labels
To get the PDF files of a parcel you can use labels/{parcel_id}
Example
https://wsmedia.tlsecure.com/api//json/XXXXX/admin/carrier/1/labels/XXXX
Request
HTTP Verb : GET
URL : http://{WS_URL}/api/{returnType}/{domainCode}/admin/carrier/{carrier_id}/labels/{parcel_id}
Parameters | Location | Type | Required | Default | Accepted |
---|---|---|---|---|---|
parcel_id | Query | integer | v |
|
|
Response
Success
Error
Codelist
Code | Success | Message |
---|---|---|
0 | v | get labels |
1 |
| domaincode malformed |
2 |
| connexion error |
11 |
| not labels with this ID |
99 |
| uncatched exception |
Get Shipping methods
To get all PDF you can use the label resource. The resource will send you a JSON object back with the available options.
Example
https://wsmedia.tlsecure.com/api//json/XXXXX/admin/carrier/1/shippingMethods
Request
HTTP Verb : GET
URL : http://{WS_URL}/api/{returnType}/{domainCode}/admin/carrier/{carrier_id}/shippingMethods
Response
Success
Codelist
Code | Success | Message |
---|---|---|
0 | v | get shippingMethods |
1 |
| domaincode malformed |
2 |
| connexion error |
11 |
| not parcel with this ID |
99 |
| uncatched exception |
—-
Get Shipping method
To get a PDF you can use the label resource. The resource will send you a JSON object back with the available options.
Example
https://wsmedia.tlsecure.com/api//json/XXXXX/admin/carrier/1/shippingMethods/XXXX
Request
HTTP Verb : GET
Parameters | Location | Type | Required | Default | Accepted |
---|---|---|---|---|---|
shippingMethods_id | Query | integer | v |
|
|
Response
Success
Error
Codelist
Code | Success | Message |
---|---|---|
0 | v | get shippingMethod |
1 |
| domaincode malformed |
2 |
| connexion error |
11 |
| not shippingMethod with this ID |
99 |
| uncatched exception |
Create parcel
To create a parcel you should do a POST request to the parcel resource.
Example
https://wsmedia.tlsecure.com/api//json/XXXXX/admin/carrier/1/parcels
Request
HTTP Verb : POST
URL : http://{WS_URL}/api/{returnType}/{domainCode}/admin/carrier/{carrier_id}/parcels
Parameters | Location | Type | Required | Default | Accepted |
---|---|---|---|---|---|
name | Form | String | v |
|
|
company_name | Form | String |
|
|
|
address | Form | String | v |
|
|
house_number | Form | String |
|
|
|
city | Form | String | v |
|
|
postal_code | Form | String | v |
|
|
telephone | Form | Integer |
|
|
|
Form | String |
|
|
| |
country | Form | String | v |
|
|
shipment | Form | Integer | v |
| |
requestShipment | Form | Boolean | v |
| false if for account test and true for the production |
weight | Form | Double |
|
|
|
order_number | Form | String |
|
|
|
package_id | Form | Integer | v |
|
|
Response
Success
Codelist
Code | Success | Message |
---|---|---|
0 | v | parcel created |
1 |
| domaincode malformed |
2 |
| connexion error |
11 |
| parcel not created |
99 |
| uncatched exception |
Update parcel
To change a parcel you should send a PUT request to the parcel resource. You tell us which one to change via parcel_id.
You can change all known fields from the POST example. A parcel object can no longer be changed if the parcel has a trackingcode.
Example
https://wsmedia.tlsecure.com/api//json/XXXXX/admin/carrier/1/parcels/2876965
Request
HTTP Verb : PUT
URL : http://{WS_URL}/api/{returnType}/{domainCode}/admin/carrier/{carrier_id}/parcels/{parcel_id}
Parameters | Location | Type | Required | Default | Accepted |
---|---|---|---|---|---|
parcel_id | Form | Integer | v |
|
|
name | Form | String | v |
|
|
company_name | Form | String |
|
|
|
address | Form | String | v |
|
|
house_number | Form | String |
|
|
|
city | Form | String | v |
|
|
postal_code | Form | String | v |
|
|
telephone | Form | Integer |
|
|
|
Form | String |
|
|
| |
country | Form | String | v |
|
|
shipment | Form | Integer | v |
| |
requestShipment | Form | Boolean | v |
| false if for account test and true for the production |
weight | Form | Double |
|
|
|
order_number | Form | String |
|
|
|
Response
Success
Codelist
Code | Success | Message |
---|---|---|
0 | v | parcel updated |
1 |
| domaincode malformed |
2 |
| connexion error |
11 |
| parcel not updated |
99 |
| uncatched exception |