---
title: "Email an order confirmation"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.nicer.travel/llms.txt
> Use this file to discover all available pages before exploring further.

# Email an order confirmation

Path: Nicer API › Commerce

`POST /commerce/orders/{orderId}/confirmation-emails`

URL: `https://api.nicer.travel/commerce/orders/{orderId}/confirmation-emails`

Queues the order's confirmation email to up to ten recipient addresses, deduplicated. Requires an advisor in the order's company and an `Idempotency-Key`, and is rate-limited per company. Returns how many recipients were queued.

## Authentication

- `bearerAuth`, http bearer, header `Authorization`, format `JWT`

## Path parameters

- `orderId` (`commerce.orders.confirmationEmails.create.path.orderId`; string, required)

## Header parameters

- `Idempotency-Key` (`commerce.orders.confirmationEmails.create.header.Idempotency-Key`; string, required) — Unique key (8–255 chars) per request; replays return the original result.
- `x-nicer-company` (`commerce.orders.confirmationEmails.create.header.x-nicer-company`; string, required) — Company context. Authentication and tenant membership are validated by the API.

## Request body

_Required._

- `emails` (`commerce.orders.confirmationEmails.create.emails`; array of string, required)
  - format: `email` · pattern: `^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$`

## Example request

```json
{
  "emails": [
    "user@example.com"
  ]
}
```

## Code samples

### JavaScript SDK

```javascript
import { createClient } from "@nicertravel/sdk";

const nicer = createClient({
  baseUrl: "https://api.nicer.travel",
  token: process.env.NICER_TOKEN,
  headers: { "Idempotency-Key": process.env.NICER_IDEMPOTENCY_KEY, "x-nicer-company": process.env.NICER_COMPANY },
});

await nicer.commerce.orders.confirmationEmails.create({
  "orderId": "string",
  "emails": [
    "user@example.com"
  ]
});
```

### Nicer CLI

```bash
nicer commerce orders confirmation-emails create --order-id 'string' --company "$NICER_COMPANY" --input - <<'JSON'
{
  "emails": [
    "user@example.com"
  ]
}
JSON
```

### cURL

```bash
curl --request POST \
  --url 'https://api.nicer.travel/commerce/orders/<orderId>/confirmation-emails' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: string' \
  --header 'x-nicer-company: string' \
  --data '
{
  "emails": [
    "user@example.com"
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/commerce/orders/<orderId>/confirmation-emails';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Idempotency-Key': 'string',
    'x-nicer-company': 'string',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({emails: ['user@example.com']})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.nicer.travel/commerce/orders/<orderId>/confirmation-emails"

payload = { "emails": ["user@example.com"] }
headers = {
    "Content-Type": "application/json",
    "Idempotency-Key": "string",
    "x-nicer-company": "string",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "queuedRecipients": 9007199254740991,
  "success": true
}
```

- `queuedRecipients` (`commerce.orders.confirmationEmails.create.response.200.queuedRecipients`; integer, required)
  - maximum: `9007199254740991`
- `success` (`commerce.orders.confirmationEmails.create.response.200.success`; boolean, required)

### 400

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`commerce.orders.confirmationEmails.create.response.400.errorCode`; string, required)
- `errorMessage` (`commerce.orders.confirmationEmails.create.response.400.errorMessage`; string, required)

### 401

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`commerce.orders.confirmationEmails.create.response.401.errorCode`; string, required)
- `errorMessage` (`commerce.orders.confirmationEmails.create.response.401.errorMessage`; string, required)

### 403

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`commerce.orders.confirmationEmails.create.response.403.errorCode`; string, required)
- `errorMessage` (`commerce.orders.confirmationEmails.create.response.403.errorMessage`; string, required)

### 429

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`commerce.orders.confirmationEmails.create.response.429.errorCode`; string, required)
- `errorMessage` (`commerce.orders.confirmationEmails.create.response.429.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/Commerce/commerce.orders.confirmationEmails.create/index.md
