# Royal Mail

> Manage Royal Mail Click & Drop orders, labels and manifests.

App · 15 actions. Web page: https://docs.lodol.com/docs/integrations/royal-mail

## Actions

### Create manifest

Create manifest.

**Inputs**

- Shipping account (`shipping_account`, text): Shipping account to manifest.
- Skip paperwork (`skip_paperwork`, true/false): Skip generating manifest paperwork.

**Outputs**

- `data` (object): The response from Royal Mail.

**Example output**

```json
{
  "data": {
    "manifests": [
      {}
    ]
  }
}
```

### Create order

Create order.

**Inputs**

- Order reference (`order_reference`, text): Your own reference for the order.
- Recipient (`recipient`, object, required): Recipient’s address and contact details.
- Order date (`order_date`, date and time, required): When the order was placed.
- Subtotal (`subtotal`, number, required): Order subtotal. At least 0.
- Shipping cost (`shipping_cost`, number, required): Shipping cost charged to the buyer. At least 0.
- Total (`total`, number, required): Total amount charged. At least 0.
- Currency code (`currency_code`, text): Three-letter order currency.
- Packages (`packages`, list): Packages and the items they contain.

**Outputs**

- `data` (object): The response from Royal Mail.

**Example output**

```json
{
  "data": {
    "createdOrders": [
      {
        "orderIdentifier": 1,
        "orderReference": "example"
      }
    ],
    "errorsCount": 1,
    "successCount": 1
  }
}
```

### Delete order

Delete order.

**Inputs**

- Order identifier (`order_identifier`, number, required): Numeric order ID returned by Click & Drop. At least 1.

**Outputs**

- `data` (object): The response from Royal Mail.

**Example output**

```json
{
  "data": {
    "deletedOrders": [
      {}
    ]
  }
}
```

### Get API version

Get API version.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Royal Mail.

**Example output**

```json
{
  "data": {
    "build": "example",
    "release": "example"
  }
}
```

### Get manifest

Get manifest.

**Inputs**

- Manifest ID (`manifest_id`, text, required): Manifest ID from Create manifest.

**Outputs**

- `data` (object): The response from Royal Mail.

**Example output**

```json
{
  "data": {
    "documentStatus": "example",
    "manifestStatus": "example",
    "pdf": "example"
  }
}
```

### Get order

Get order.

**Inputs**

- Order identifier (`order_identifier`, number, required): Numeric order ID returned by Click & Drop. At least 1.

**Outputs**

- `data` (list): The response from Royal Mail.

**Example output**

```json
{
  "data": [
    {
      "orderIdentifier": 1,
      "orderReference": "example"
    }
  ]
}
```

### Get order details

Get order details.

**Inputs**

- Order identifier (`order_identifier`, number, required): Numeric order ID returned by Click & Drop. At least 1.

**Outputs**

- `data` (list): The response from Royal Mail.

**Example output**

```json
{
  "data": [
    {
      "orderIdentifier": 1,
      "orderReference": "example"
    }
  ]
}
```

### Get order label

Get order label.

**Inputs**

- Order identifier (`order_identifier`, number, required): Numeric order ID returned by Click & Drop. At least 1.
- Document type (`document_type`, text, required): Which document to download. One of: `postageLabel`, `despatchNote`, `CN22`, `CN23`, `commercialInvoice`.
- Include return label (`include_return_label`, true/false): Include the return label.

**Outputs**

- `data` (object): The response from Royal Mail.

**Example output**

```json
{
  "data": {
    "content_base64": "example",
    "content_type": "example"
  }
}
```

### List carriers

List carriers.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Royal Mail.

**Example output**

```json
{
  "data": [
    {}
  ]
}
```

### List online postage services

List online postage services.

**Inputs**

- Country (`country`, text, required): Three-letter destination country code.
- Weight (`weight`, number): Package weight in grams. At least 1.
- Postcode (`postcode`, text): Destination postcode.
- Package format (`package_format`, text): Package size. One of: `Letter`, `LargeLetter`, `SmallParcel`, `MediumParcel`, `LargeParcel`.

**Outputs**

- `data` (object): The response from Royal Mail.

**Example output**

```json
{
  "data": {
    "guidanceText": "example",
    "services": [
      {}
    ]
  }
}
```

### List order details

List order details.

**Inputs**

- Page size (`page_size`, number): Number of orders per page. From 1 to 100.
- Start time (`start_time`, date and time): Earliest order creation time.
- End time (`end_time`, date and time): Latest order creation time.
- Continuation token (`continuation_token`, text): Continuation token from the previous page.

**Outputs**

- `data` (object): The response from Royal Mail.

**Example output**

```json
{
  "data": {
    "continuationToken": "example",
    "orders": [
      {
        "orderIdentifier": 1,
        "orderReference": "example"
      }
    ]
  }
}
```

### List orders

List orders.

**Inputs**

- Page size (`page_size`, number): Number of orders per page. From 1 to 100.
- Start time (`start_time`, date and time): Earliest order creation time.
- End time (`end_time`, date and time): Latest order creation time.
- Continuation token (`continuation_token`, text): Continuation token from the previous page.

**Outputs**

- `data` (object): The response from Royal Mail.

**Example output**

```json
{
  "data": {
    "continuationToken": "example",
    "orders": [
      {
        "orderIdentifier": 1,
        "orderReference": "example"
      }
    ]
  }
}
```

### List shipping services

List shipping services.

**Inputs**

- Country code (`country_code`, text): Three-letter destination country code, such as GBR.
- Postcode (`postcode`, text): Destination postcode.
- Package weight (`package_weight`, number): Package weight in grams. At least 1.
- Carrier ID (`carrier_id`, text): Carrier ID from List carriers.
- Shipping account (`shipping_account`, text): Shipping account name.

**Outputs**

- `data` (list): The response from Royal Mail.

**Example output**

```json
{
  "data": [
    {}
  ]
}
```

### Retry manifest

Retry manifest.

**Inputs**

- Manifest ID (`manifest_id`, text, required): Failed manifest ID.

**Outputs**

- `data` (object): The response from Royal Mail.

**Example output**

```json
{
  "data": {}
}
```

### Set order status

Set order status.

**Inputs**

- Updates (`updates`, list, required): Status updates, each with one order identifier or reference and its new status.

**Outputs**

- `data` (object): The response from Royal Mail.

**Example output**

```json
{
  "data": {
    "errors": [
      {}
    ],
    "updatedOrders": [
      {}
    ]
  }
}
```
