<- Orders API

Orders API

All versions ->

Clone orderBeta

POST

 /v2/orders/clone

Creates a new order, in the DRAFT state, by duplicating an existing order.

The newly created order has only the core fields (such as line items, taxes, and discounts) copied from the original order.

Permissions:ORDERS_WRITE
Try in API Explorer
Link to section

Request body

Example code

Link to section

order_id

string

Required

The ID of the order to clone.

Link to section

version

integer(32-bit)

An optional order version for concurrency protection.

If a version is provided, it must match the latest stored version of the order to clone. If a version is not provided, the API clones the latest version.

Link to section

idempotency_key

string

A value you specify that uniquely identifies this clone request.

If you are unsure whether a particular order was cloned successfully, you can reattempt the call with the same idempotency key without worrying about creating duplicate cloned orders. The originally cloned order is returned.

For more information, see Idempotency.

Link to section

Response fields

Link to section

order

The cloned order.

Link to section

errors

Any errors that occurred during the request.