# Duplicate a delivery

`POST https://api.cademi.com.br/api/v3/sales/deliveries/{delivery_id}/copies`

Operation ID: `deliveries.copies.create` · API v3

Creates a copy of the delivery and returns it.

The copy does not include the gateway product codes or the secret, because these identify the original delivery with the gateway. Configure them on the copy before using it to process sales.

Required permissions: `deliveries.create`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `delivery_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | yes |  |

## Responses

### 201

Returns the newly created copy of the delivery.

Body: `data`: Delivery.

Fields of Delivery:

| Field | Type | Required | Description |
|---|---|---|---|
| `created_at` | string (date-time) | yes |  |
| `enrollments_count` | integer | yes |  |
| `external_ids` | array of string | yes | Product codes on the payment gateway. Existing codes are never rewritten, because cancellations are matched to the delivery by these codes. |
| `gateway` | string | yes | Public ID of the payment gateway from the catalog, prefixed with gtw_. |
| `hidden` | boolean | yes |  |
| `id` | string | yes | Public ID of the delivery, prefixed with dlv_. |
| `kind` | string, one of `one_time`, `subscription` | yes |  |
| `name` | string | yes |  |
| `object` | string, one of `delivery` | yes |  |
| `postback_url` | string | yes | URL that the payment gateway calls when a sale occurs. |
| `products_count` | integer | yes |  |
| `revision` | string | yes |  |
| `secret` | object | yes | The gateway secret is write-only. Responses only indicate whether it is configured. |
| `status` | string, one of `active`, `archived` | yes | Lifecycle status of the delivery. Archiving a delivery stops new sales through it; users who already purchased keep their access. |
| `tags_count` | integer | yes |  |
| `updated_at` | string (date-time) | yes |  |

### 401

The credential is missing, malformed, expired, or revoked.

Body: Error.

### 403

The current credentials do not have the permission required by this operation.

Body: Error.

### 404

The delivery was not found or is not accessible with the current credentials.

Body: Error.

### 422

The request body or query parameters failed validation.

Body: ValidationFailed.

Full schema: https://cademi.dev/openapi/v3.json
