Name | Type | Required | Data |
---|---|---|---|
username | Text varchar(50) | YES | Username |
password | Text varchar(100) | YES | Password |
user_token | Text | YES | Token provided |
Name | Type | Required | Data |
---|---|---|---|
{order_id} | Numeric (int 11) | YES | Order id |
Name | Type | Required | Data |
---|---|---|---|
label_type | String | NO | Label format type. Allowed values: "pdf" (default), "zpl". Note: ZPL format is only supported for UPS, GLS and Geodis providers. |
$post = [
'username' => '',
'password' => '',
'user_token' => '',
];
// For PDF format (default)
$ch = curl_init('https://api.rrr.lt/get/print_shipping_label/{order_id}');
// For ZPL format
// $ch = curl_init('https://api.rrr.lt/get/print_shipping_label/{order_id}?label_type=zpl');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
curl_close($ch);
Content-Type: application/pdfOn success (ZPL format):
Content-Type: application/zplOn failure:
json response with error message