> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api-docs.zippd.com/llms.txt.
> For full documentation content, see https://api-docs.zippd.com/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api-docs.zippd.com/_mcp/server.

# Generate Package Labels

POST https://sandbox-api.deliveryapp.com/api/v1/orders/{orderId}/labels
Content-Type: application/json

Generate the labels for all items associated with this delivery job. This endpoint returns links that point to PDFs of the labels.

Generation only takes place on the first time this endpoint is used for an order, all subsequent requests will retrieve the previously generated labels.

This endpoint only supports Non-dedicated and Rapid Delivery orders.

Reference: https://api-docs.zippd.com/orders/generate-package-labels

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /orders/{orderId}/labels:
    post:
      operationId: generate-package-labels
      summary: Generate Package Labels
      description: >-
        Generate the labels for all items associated with this delivery job.
        This endpoint returns links that point to PDFs of the labels.


        Generation only takes place on the first time this endpoint is used for
        an order, all subsequent requests will retrieve the previously generated
        labels.


        This endpoint only supports Non-dedicated and Rapid Delivery orders.
      tags:
        - subpackage_orders
      parameters:
        - name: orderId
          in: path
          description: The UUID of the order to generate labels for.
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: ''
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Orders_Generate Package
                  Labels_Response_200
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Post-orders-orderId-labelsRequestNotFoundError
        '422':
          description: The data sent contained errors.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Post-orders-orderId-labelsRequestUnprocessableEntityError
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                packages:
                  type: integer
                  description: The number of labels to generate.
              required:
                - packages
servers:
  - url: https://sandbox-api.deliveryapp.com/api/v1
components:
  schemas:
    OrdersOrderIdLabelsPostResponsesContentApplicationJsonSchemaLabelsItems:
      type: object
      properties:
        barcode:
          type: string
        label_url:
          type: string
          format: uri
      required:
        - barcode
        - label_url
      title: OrdersOrderIdLabelsPostResponsesContentApplicationJsonSchemaLabelsItems
    Orders_Generate Package Labels_Response_200:
      type: object
      properties:
        order_id:
          type: string
        packages:
          type: integer
        labels:
          type: array
          items:
            $ref: >-
              #/components/schemas/OrdersOrderIdLabelsPostResponsesContentApplicationJsonSchemaLabelsItems
      required:
        - order_id
        - packages
        - labels
      title: Orders_Generate Package Labels_Response_200
    Post-orders-orderId-labelsRequestNotFoundError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: Post-orders-orderId-labelsRequestNotFoundError
    OrdersOrderIdLabelsPostResponsesContentApplicationJsonSchemaErrors:
      type: object
      properties:
        '[field_key]':
          type: array
          items:
            type: string
      description: >-
        A list of errors. Each item will represent a single field and contain a
        simple array of error messages.
      title: OrdersOrderIdLabelsPostResponsesContentApplicationJsonSchemaErrors
    Post-orders-orderId-labelsRequestUnprocessableEntityError:
      type: object
      properties:
        message:
          type: string
          description: An overview of the error response.
        errors:
          $ref: >-
            #/components/schemas/OrdersOrderIdLabelsPostResponsesContentApplicationJsonSchemaErrors
          description: >-
            A list of errors. Each item will represent a single field and
            contain a simple array of error messages.
      title: Post-orders-orderId-labelsRequestUnprocessableEntityError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: ''

```

## SDK Code Examples

```python Orders_Generate Package Labels_example
import requests

url = "https://sandbox-api.deliveryapp.com/api/v1/orders/ff9499df-b4df-433d-93c2-e68e50b71f71/labels"

payload = { "packages": 1 }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Orders_Generate Package Labels_example
const url = 'https://sandbox-api.deliveryapp.com/api/v1/orders/ff9499df-b4df-433d-93c2-e68e50b71f71/labels';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"packages":1}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Orders_Generate Package Labels_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox-api.deliveryapp.com/api/v1/orders/ff9499df-b4df-433d-93c2-e68e50b71f71/labels"

	payload := strings.NewReader("{\n  \"packages\": 1\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Orders_Generate Package Labels_example
require 'uri'
require 'net/http'

url = URI("https://sandbox-api.deliveryapp.com/api/v1/orders/ff9499df-b4df-433d-93c2-e68e50b71f71/labels")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"packages\": 1\n}"

response = http.request(request)
puts response.read_body
```

```java Orders_Generate Package Labels_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox-api.deliveryapp.com/api/v1/orders/ff9499df-b4df-433d-93c2-e68e50b71f71/labels")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"packages\": 1\n}")
  .asString();
```

```php Orders_Generate Package Labels_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox-api.deliveryapp.com/api/v1/orders/ff9499df-b4df-433d-93c2-e68e50b71f71/labels', [
  'body' => '{
  "packages": 1
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Orders_Generate Package Labels_example
using RestSharp;

var client = new RestClient("https://sandbox-api.deliveryapp.com/api/v1/orders/ff9499df-b4df-433d-93c2-e68e50b71f71/labels");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"packages\": 1\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Orders_Generate Package Labels_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["packages": 1] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox-api.deliveryapp.com/api/v1/orders/ff9499df-b4df-433d-93c2-e68e50b71f71/labels")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```