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

# Create Return Label


POST https://api.shipbob.com/Experimental/return/{id}/label
Content-Type: application/json

Purchases a return shipping label for an existing return order. If a label has already been purchased, returns the existing label data (200 OK). Otherwise purchases a new label and returns it (201 Created).


Reference: https://developer.shipbob.com/experimental/api/returns/create-return-label

## Authentication

- `Authorization` header (bearer token, required) — Authentication using Personal Access Token (PAT) token
- `Authorization` header (bearer token, required) — OAuth2 authentication using JWT tokens

## Servers

- `https://api.shipbob.com` (https://api.shipbob.com, default)
- `https://sandbox-api.shipbob.com` (https://sandbox-api.shipbob.com)

## Request

### Path parameters

- `id` (integer, required) — The unique identifier of the return order to purchase a label for

### Query parameters

- `api-version` (string, optional, default: 1.0) — The requested API version

### Headers

- `shipbob_channel_id` (string, required) — Retrieve your channel ID from the [GET /channel](/api/channels/get-channels) endpoint. Use the channel ID that has write scopes.

### Body (application/json)

This endpoint expects an object.

- `label_format` (enum, optional, nullable) — Optional label file format. Accepted values: PDF, PNG. If not provided, carrier default format is used
  - Allowed values: `PDF`, `PNG`
- `origin_address` (object, optional) — Customer return address. Required if shipment_id is not provided. Either shipment_id or origin_address must be provided.
  - `city` (string, optional, nullable) — City name
  - `company` (string, optional, nullable) — Company or business name
  - `country` (string, optional, nullable) — ISO 3166-1 alpha-2 country code (e.g. US, CA, GB)
  - `email` (string, optional, nullable) — Contact email address
  - `name` (string, optional, nullable) — Full name of the person at the return origin address
  - `phone` (string, optional, nullable) — Contact phone number
  - `state` (string, optional, nullable) — State or province code (e.g. IL, NY, CA)
  - `street1` (string, optional, nullable) — Primary street address line
  - `street2` (string, optional, nullable) — Secondary street address line (apartment, suite, unit, etc.)
  - `zip_code` (string, optional, nullable) — Postal or ZIP code
- `shipment_id` (integer, optional, nullable) — Original outbound shipment ID. If provided, origin address is extracted from the shipment record. Either shipment_id or origin_address must be provided.
- `shipping_service` (string, optional, nullable) — Ship option name (e.g. "ReturnsStandard"). Resolved against available return ship options for the merchant. Falls back to cheapest available option if not matched

## Response

### 200

Label already purchased — returns existing label data

- `barcode` (list of string, optional, nullable) — Carrier barcode values from label purchase. Currently null in V1
- `carrier` (string, optional) — Name of the shipping carrier (e.g. USPS, UPS, FedEx)
- `carrier_service` (string, optional) — Specific carrier service used (e.g. Ground Advantage, Priority Mail)
- `label_request_id` (long, optional, nullable) — Unique identifier for this label purchase.
- `label_url` (string, optional) — URL to download the shipping label image. Format follows the label_format request parameter (PDF or PNG) when the carrier supports it; otherwise the carrier's default format is returned.
- `label_zpl_url` (string, optional, nullable) — URL to download the shipping label in ZPL format for thermal printers
- `purchase_date` (datetime, optional) — Date and time when the label was purchased
- `qrcode_url` (string, optional, nullable) — QR code image URL for label-less returns. Currently null in V1
- `rate` (list of object, optional) — Shipping rate details including amount and currency
  - `amount` (long, optional, nullable) — Shipping rate amount in cents (e.g. 850 = $8.50). Null when the merchant-facing rate is not known for the return.
  - `currency_code` (string, optional, nullable) — ISO 4217 currency code (e.g. USD). Null when the merchant-facing rate is not known for the return.
- `return_id` (integer, optional) — The ID of the return order this label was purchased for
- `shipment_rate_id` (long, optional) — Unique identifier for the shipment rate from the labeling service
- `tracking_number` (string, optional) — Carrier tracking number for the return shipment
- `tracking_url` (string, optional, nullable) — URL to track the return shipment on the carrier website

### 201

New label purchased successfully

- `barcode` (list of string, optional, nullable) — Carrier barcode values from label purchase. Currently null in V1
- `carrier` (string, optional) — Name of the shipping carrier (e.g. USPS, UPS, FedEx)
- `carrier_service` (string, optional) — Specific carrier service used (e.g. Ground Advantage, Priority Mail)
- `label_request_id` (long, optional, nullable) — Unique identifier for this label purchase.
- `label_url` (string, optional) — URL to download the shipping label image. Format follows the label_format request parameter (PDF or PNG) when the carrier supports it; otherwise the carrier's default format is returned.
- `label_zpl_url` (string, optional, nullable) — URL to download the shipping label in ZPL format for thermal printers
- `purchase_date` (datetime, optional) — Date and time when the label was purchased
- `qrcode_url` (string, optional, nullable) — QR code image URL for label-less returns. Currently null in V1
- `rate` (list of object, optional) — Shipping rate details including amount and currency
  - `amount` (long, optional, nullable) — Shipping rate amount in cents (e.g. 850 = $8.50). Null when the merchant-facing rate is not known for the return.
  - `currency_code` (string, optional, nullable) — ISO 4217 currency code (e.g. USD). Null when the merchant-facing rate is not known for the return.
- `return_id` (integer, optional) — The ID of the return order this label was purchased for
- `shipment_rate_id` (long, optional) — Unique identifier for the shipment rate from the labeling service
- `tracking_number` (string, optional) — Carrier tracking number for the return shipment
- `tracking_url` (string, optional, nullable) — URL to track the return shipment on the carrier website

## Errors

### 400 Bad Request Error

Bad Request

- `detail` (string, optional, nullable) — Human-readable explanation specific to this occurrence of the problem.
- `instance` (string, optional, nullable) — URI reference identifying the specific occurrence.
- `status` (integer, optional, nullable) — HTTP status code.
- `title` (string, optional, nullable) — Short, human-readable summary of the problem.
- `type` (string, optional, nullable) — URI reference identifying the problem type.

### 401 Unauthorized Error

Authorization missing or invalid

- `any`

### 403 Forbidden Error

The provided credentials are not authorized to access this resource

- `any`

### 404 Not Found Error

Return order not found

- `detail` (string, optional, nullable) — Human-readable explanation specific to this occurrence of the problem.
- `instance` (string, optional, nullable) — URI reference identifying the specific occurrence.
- `status` (integer, optional, nullable) — HTTP status code.
- `title` (string, optional, nullable) — Short, human-readable summary of the problem.
- `type` (string, optional, nullable) — URI reference identifying the problem type.

### 422 Unprocessable Entity Error

Validation failed (e.g. missing address, cancelled return, hazmat item)

- `detail` (string, optional, nullable) — Human-readable explanation specific to this occurrence of the problem.
- `instance` (string, optional, nullable) — URI reference identifying the specific occurrence.
- `status` (integer, optional, nullable) — HTTP status code.
- `title` (string, optional, nullable) — Short, human-readable summary of the problem.
- `type` (string, optional, nullable) — URI reference identifying the problem type.

## Examples

### default

**Request**

```json
{
  "origin_address": {
    "city": "Chicago",
    "company": "ACME Corp",
    "country": "US",
    "email": "jane@example.com",
    "name": "Jane Doe",
    "phone": "312-555-0100",
    "state": "IL",
    "street1": "123 Main St",
    "street2": "Apt 4B",
    "zip_code": "60601"
  },
  "shipment_id": 98765,
  "shipping_service": "ReturnsStandard"
}
```

**Response**

```json
{
  "barcode": null,
  "carrier": "USPS",
  "carrier_service": "Ground Advantage",
  "label_request_id": 999,
  "label_url": "https://s3.amazonaws.com/labels/label.pdf",
  "label_zpl_url": "https://blob.core.windows.net/labels/label.zpl",
  "purchase_date": "2026-04-13T12:00:00+00:00",
  "qrcode_url": null,
  "rate": [
    {
      "amount": 850,
      "currency_code": "USD"
    }
  ],
  "return_id": 12345,
  "shipment_rate_id": 999,
  "tracking_number": "9400136105440512280610",
  "tracking_url": "https://tools.usps.com/go/TrackConfirmAction?tLabels=9400136105440512280610"
}
```

**SDK Code**

```python default
import requests

url = "https://api.shipbob.com/Experimental/return/1/label"

querystring = {"api-version":"1"}

payload = {
    "origin_address": {
        "city": "Chicago",
        "company": "ACME Corp",
        "country": "US",
        "email": "jane@example.com",
        "name": "Jane Doe",
        "phone": "312-555-0100",
        "state": "IL",
        "street1": "123 Main St",
        "street2": "Apt 4B",
        "zip_code": "60601"
    },
    "shipment_id": 98765,
    "shipping_service": "ReturnsStandard"
}
headers = {
    "shipbob_channel_id": "shipbob_channel_id",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript default
const url = 'https://api.shipbob.com/Experimental/return/1/label?api-version=1';
const options = {
  method: 'POST',
  headers: {
    shipbob_channel_id: 'shipbob_channel_id',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"origin_address":{"city":"Chicago","company":"ACME Corp","country":"US","email":"jane@example.com","name":"Jane Doe","phone":"312-555-0100","state":"IL","street1":"123 Main St","street2":"Apt 4B","zip_code":"60601"},"shipment_id":98765,"shipping_service":"ReturnsStandard"}'
};

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

```go default
package main

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

func main() {

	url := "https://api.shipbob.com/Experimental/return/1/label?api-version=1"

	payload := strings.NewReader("{\n  \"origin_address\": {\n    \"city\": \"Chicago\",\n    \"company\": \"ACME Corp\",\n    \"country\": \"US\",\n    \"email\": \"jane@example.com\",\n    \"name\": \"Jane Doe\",\n    \"phone\": \"312-555-0100\",\n    \"state\": \"IL\",\n    \"street1\": \"123 Main St\",\n    \"street2\": \"Apt 4B\",\n    \"zip_code\": \"60601\"\n  },\n  \"shipment_id\": 98765,\n  \"shipping_service\": \"ReturnsStandard\"\n}")

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

	req.Header.Add("shipbob_channel_id", "shipbob_channel_id")
	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 default
require 'uri'
require 'net/http'

url = URI("https://api.shipbob.com/Experimental/return/1/label?api-version=1")

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

request = Net::HTTP::Post.new(url)
request["shipbob_channel_id"] = 'shipbob_channel_id'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"origin_address\": {\n    \"city\": \"Chicago\",\n    \"company\": \"ACME Corp\",\n    \"country\": \"US\",\n    \"email\": \"jane@example.com\",\n    \"name\": \"Jane Doe\",\n    \"phone\": \"312-555-0100\",\n    \"state\": \"IL\",\n    \"street1\": \"123 Main St\",\n    \"street2\": \"Apt 4B\",\n    \"zip_code\": \"60601\"\n  },\n  \"shipment_id\": 98765,\n  \"shipping_service\": \"ReturnsStandard\"\n}"

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

```java default
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.shipbob.com/Experimental/return/1/label?api-version=1")
  .header("shipbob_channel_id", "shipbob_channel_id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"origin_address\": {\n    \"city\": \"Chicago\",\n    \"company\": \"ACME Corp\",\n    \"country\": \"US\",\n    \"email\": \"jane@example.com\",\n    \"name\": \"Jane Doe\",\n    \"phone\": \"312-555-0100\",\n    \"state\": \"IL\",\n    \"street1\": \"123 Main St\",\n    \"street2\": \"Apt 4B\",\n    \"zip_code\": \"60601\"\n  },\n  \"shipment_id\": 98765,\n  \"shipping_service\": \"ReturnsStandard\"\n}")
  .asString();
```

```php default
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.shipbob.com/Experimental/return/1/label?api-version=1', [
  'body' => '{
  "origin_address": {
    "city": "Chicago",
    "company": "ACME Corp",
    "country": "US",
    "email": "jane@example.com",
    "name": "Jane Doe",
    "phone": "312-555-0100",
    "state": "IL",
    "street1": "123 Main St",
    "street2": "Apt 4B",
    "zip_code": "60601"
  },
  "shipment_id": 98765,
  "shipping_service": "ReturnsStandard"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'shipbob_channel_id' => 'shipbob_channel_id',
  ],
]);

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

```csharp default
using RestSharp;

var client = new RestClient("https://api.shipbob.com/Experimental/return/1/label?api-version=1");
var request = new RestRequest(Method.POST);
request.AddHeader("shipbob_channel_id", "shipbob_channel_id");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"origin_address\": {\n    \"city\": \"Chicago\",\n    \"company\": \"ACME Corp\",\n    \"country\": \"US\",\n    \"email\": \"jane@example.com\",\n    \"name\": \"Jane Doe\",\n    \"phone\": \"312-555-0100\",\n    \"state\": \"IL\",\n    \"street1\": \"123 Main St\",\n    \"street2\": \"Apt 4B\",\n    \"zip_code\": \"60601\"\n  },\n  \"shipment_id\": 98765,\n  \"shipping_service\": \"ReturnsStandard\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift default
import Foundation

let headers = [
  "shipbob_channel_id": "shipbob_channel_id",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "origin_address": [
    "city": "Chicago",
    "company": "ACME Corp",
    "country": "US",
    "email": "jane@example.com",
    "name": "Jane Doe",
    "phone": "312-555-0100",
    "state": "IL",
    "street1": "123 Main St",
    "street2": "Apt 4B",
    "zip_code": "60601"
  ],
  "shipment_id": 98765,
  "shipping_service": "ReturnsStandard"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.shipbob.com/Experimental/return/1/label?api-version=1")! 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()
```

### default

**Request**

```json
{
  "origin_address": {
    "city": "Chicago",
    "company": "ACME Corp",
    "country": "US",
    "email": "jane@example.com",
    "name": "Jane Doe",
    "phone": "312-555-0100",
    "state": "IL",
    "street1": "123 Main St",
    "street2": "Apt 4B",
    "zip_code": "60601"
  },
  "shipment_id": 98765,
  "shipping_service": "ReturnsStandard"
}
```

**Response**

```json
{
  "barcode": null,
  "carrier": "USPS",
  "carrier_service": "Ground Advantage",
  "label_request_id": 999,
  "label_url": "https://s3.amazonaws.com/labels/label.pdf",
  "label_zpl_url": "https://blob.core.windows.net/labels/label.zpl",
  "purchase_date": "2026-04-13T12:00:00+00:00",
  "qrcode_url": null,
  "rate": [
    {
      "amount": 850,
      "currency_code": "USD"
    }
  ],
  "return_id": 12345,
  "shipment_rate_id": 999,
  "tracking_number": "9400136105440512280610",
  "tracking_url": "https://tools.usps.com/go/TrackConfirmAction?tLabels=9400136105440512280610"
}
```

**SDK Code**

```python default
import requests

url = "https://api.shipbob.com/Experimental/return/1/label"

querystring = {"api-version":"1"}

payload = {
    "origin_address": {
        "city": "Chicago",
        "company": "ACME Corp",
        "country": "US",
        "email": "jane@example.com",
        "name": "Jane Doe",
        "phone": "312-555-0100",
        "state": "IL",
        "street1": "123 Main St",
        "street2": "Apt 4B",
        "zip_code": "60601"
    },
    "shipment_id": 98765,
    "shipping_service": "ReturnsStandard"
}
headers = {
    "shipbob_channel_id": "shipbob_channel_id",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript default
const url = 'https://api.shipbob.com/Experimental/return/1/label?api-version=1';
const options = {
  method: 'POST',
  headers: {
    shipbob_channel_id: 'shipbob_channel_id',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"origin_address":{"city":"Chicago","company":"ACME Corp","country":"US","email":"jane@example.com","name":"Jane Doe","phone":"312-555-0100","state":"IL","street1":"123 Main St","street2":"Apt 4B","zip_code":"60601"},"shipment_id":98765,"shipping_service":"ReturnsStandard"}'
};

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

```go default
package main

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

func main() {

	url := "https://api.shipbob.com/Experimental/return/1/label?api-version=1"

	payload := strings.NewReader("{\n  \"origin_address\": {\n    \"city\": \"Chicago\",\n    \"company\": \"ACME Corp\",\n    \"country\": \"US\",\n    \"email\": \"jane@example.com\",\n    \"name\": \"Jane Doe\",\n    \"phone\": \"312-555-0100\",\n    \"state\": \"IL\",\n    \"street1\": \"123 Main St\",\n    \"street2\": \"Apt 4B\",\n    \"zip_code\": \"60601\"\n  },\n  \"shipment_id\": 98765,\n  \"shipping_service\": \"ReturnsStandard\"\n}")

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

	req.Header.Add("shipbob_channel_id", "shipbob_channel_id")
	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 default
require 'uri'
require 'net/http'

url = URI("https://api.shipbob.com/Experimental/return/1/label?api-version=1")

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

request = Net::HTTP::Post.new(url)
request["shipbob_channel_id"] = 'shipbob_channel_id'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"origin_address\": {\n    \"city\": \"Chicago\",\n    \"company\": \"ACME Corp\",\n    \"country\": \"US\",\n    \"email\": \"jane@example.com\",\n    \"name\": \"Jane Doe\",\n    \"phone\": \"312-555-0100\",\n    \"state\": \"IL\",\n    \"street1\": \"123 Main St\",\n    \"street2\": \"Apt 4B\",\n    \"zip_code\": \"60601\"\n  },\n  \"shipment_id\": 98765,\n  \"shipping_service\": \"ReturnsStandard\"\n}"

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

```java default
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.shipbob.com/Experimental/return/1/label?api-version=1")
  .header("shipbob_channel_id", "shipbob_channel_id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"origin_address\": {\n    \"city\": \"Chicago\",\n    \"company\": \"ACME Corp\",\n    \"country\": \"US\",\n    \"email\": \"jane@example.com\",\n    \"name\": \"Jane Doe\",\n    \"phone\": \"312-555-0100\",\n    \"state\": \"IL\",\n    \"street1\": \"123 Main St\",\n    \"street2\": \"Apt 4B\",\n    \"zip_code\": \"60601\"\n  },\n  \"shipment_id\": 98765,\n  \"shipping_service\": \"ReturnsStandard\"\n}")
  .asString();
```

```php default
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.shipbob.com/Experimental/return/1/label?api-version=1', [
  'body' => '{
  "origin_address": {
    "city": "Chicago",
    "company": "ACME Corp",
    "country": "US",
    "email": "jane@example.com",
    "name": "Jane Doe",
    "phone": "312-555-0100",
    "state": "IL",
    "street1": "123 Main St",
    "street2": "Apt 4B",
    "zip_code": "60601"
  },
  "shipment_id": 98765,
  "shipping_service": "ReturnsStandard"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'shipbob_channel_id' => 'shipbob_channel_id',
  ],
]);

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

```csharp default
using RestSharp;

var client = new RestClient("https://api.shipbob.com/Experimental/return/1/label?api-version=1");
var request = new RestRequest(Method.POST);
request.AddHeader("shipbob_channel_id", "shipbob_channel_id");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"origin_address\": {\n    \"city\": \"Chicago\",\n    \"company\": \"ACME Corp\",\n    \"country\": \"US\",\n    \"email\": \"jane@example.com\",\n    \"name\": \"Jane Doe\",\n    \"phone\": \"312-555-0100\",\n    \"state\": \"IL\",\n    \"street1\": \"123 Main St\",\n    \"street2\": \"Apt 4B\",\n    \"zip_code\": \"60601\"\n  },\n  \"shipment_id\": 98765,\n  \"shipping_service\": \"ReturnsStandard\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift default
import Foundation

let headers = [
  "shipbob_channel_id": "shipbob_channel_id",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "origin_address": [
    "city": "Chicago",
    "company": "ACME Corp",
    "country": "US",
    "email": "jane@example.com",
    "name": "Jane Doe",
    "phone": "312-555-0100",
    "state": "IL",
    "street1": "123 Main St",
    "street2": "Apt 4B",
    "zip_code": "60601"
  ],
  "shipment_id": 98765,
  "shipping_service": "ReturnsStandard"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.shipbob.com/Experimental/return/1/label?api-version=1")! 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()
```