# Orders

## GraphQL partial SDLs

This is a graphql reference page. In the llms.txt variant, those components link to the shared partial SDL key list instead of trying to resolve inline GraphQL reference content.

Fetch all available partial SDL keys first:

```text
GET https://docs.commercetools.com/apis/rest/content/by-id?id=ctp:gql-sphere:returnTypesList
```

Then fetch the one or more relevant partial SDL with a key from that list by calling the same endpoint with a schema ID:

```text
GET https://docs.commercetools.com/apis/rest/content/by-id?id=ctp:gql-sphere:schema:<key>
```

The response body is a JSON object keyed by the requested content ID. For example, the key-list request returns a `ctp:gql-sphere:returnTypesList` field and a schema request returns a `ctp:gql-sphere:schema:<key>` field.

**Queries and mutations for managing Orders in the platform.**

To access Orders as an Associate of a Business Unit, see [AsAssociateArgument](/api/graphql/business-units.md#asassociateargument).

## Queries

### Query Orders

[fetch SDL for query orders](#graphql-partial-sdls).

### Get Order

[fetch SDL for query order](#graphql-partial-sdls).

## Mutations

### Create Order from Cart

[fetch SDL for mutation createOrderFromCart](#graphql-partial-sdls).

### Create Order from Quote

[fetch SDL for mutation createOrderFromQuote](#graphql-partial-sdls).

### Update Order

[fetch SDL for mutation updateOrder](#graphql-partial-sdls).

### Delete Order

[fetch SDL for mutation deleteOrder](#graphql-partial-sdls).

## Output types

### Order

[fetch SDL for type Order](#graphql-partial-sdls).

### Order Query Result

[fetch SDL for type OrderQueryResult](#graphql-partial-sdls).

## Input types

### OrderCartCommand

[fetch SDL for type OrderCartCommand](#graphql-partial-sdls).

### OrderQuoteCommand

[fetch SDL for type OrderQuoteCommand](#graphql-partial-sdls).

### OrderUpdateAction

[fetch SDL for type OrderUpdateAction](#graphql-partial-sdls).

### Update actions

#### on Order

##### Set Order Number

[fetch SDL for type SetOrderNumber](#graphql-partial-sdls).

##### Set Purchase Order Number

[fetch SDL for type SetOrderPurchaseOrderNumber](#graphql-partial-sdls).

##### Set Business Unit &#x20;

[fetch SDL for type SetOrderBusinessUnit](#graphql-partial-sdls).

##### Set Customer ID

[fetch SDL for type SetOrderCustomerId](#graphql-partial-sdls).

##### Set Customer Email

[fetch SDL for type SetOrderCustomerEmail](#graphql-partial-sdls).

##### Add Payment

[fetch SDL for type AddOrderPayment](#graphql-partial-sdls).

##### Remove Payment

[fetch SDL for type RemoveOrderPayment](#graphql-partial-sdls).

##### Change PaymentState

[fetch SDL for type ChangeOrderPaymentState](#graphql-partial-sdls).

##### Set Billing Address

[fetch SDL for type SetOrderBillingAddress](#graphql-partial-sdls).

##### Set Shipping Address

[fetch SDL for type SetOrderShippingAddress](#graphql-partial-sdls).

##### Add ItemShippingAddress

[fetch SDL for type AddOrderItemShippingAddress](#graphql-partial-sdls).

##### Remove ItemShippingAddress

[fetch SDL for type RemoveOrderItemShippingAddress](#graphql-partial-sdls).

##### Update ItemShippingAddress

[fetch SDL for type UpdateOrderItemShippingAddress](#graphql-partial-sdls).

##### Add Delivery

[fetch SDL for type AddOrderDelivery](#graphql-partial-sdls).

##### Remove Delivery

[fetch SDL for type RemoveOrderDelivery](#graphql-partial-sdls).

##### Change ShipmentState

[fetch SDL for type ChangeOrderShipmentState](#graphql-partial-sdls).

##### Add ReturnInfo

[fetch SDL for type AddOrderReturnInfo](#graphql-partial-sdls).

##### Set ReturnInfo

[fetch SDL for type SetOrderReturnInfo](#graphql-partial-sdls).

##### Set ReturnShipmentState

[fetch SDL for type SetOrderReturnShipmentState](#graphql-partial-sdls).

##### Set ReturnPaymentState

[fetch SDL for type SetOrderReturnPaymentState](#graphql-partial-sdls).

##### Change OrderState

[fetch SDL for type ChangeOrderState](#graphql-partial-sdls).

##### Transition State

[fetch SDL for type TransitionOrderState](#graphql-partial-sdls).

##### Update SyncInfo

[fetch SDL for type UpdateOrderSyncInfo](#graphql-partial-sdls).

##### Set Locale

[fetch SDL for type SetOrderLocale](#graphql-partial-sdls).

##### Set Store

[fetch SDL for type SetOrderStore](#graphql-partial-sdls).

##### Set Custom Type

[fetch SDL for type SetOrderCustomType](#graphql-partial-sdls).

##### Set CustomField

[fetch SDL for type SetOrderCustomField](#graphql-partial-sdls).

#### on LineItem

##### Set LineItem ShippingDetails

[fetch SDL for type SetOrderLineItemShippingDetails](#graphql-partial-sdls).

##### Set LineItem Custom Type

[fetch SDL for type SetOrderLineItemCustomType](#graphql-partial-sdls).

##### Set LineItem CustomField

[fetch SDL for type SetOrderLineItemCustomField](#graphql-partial-sdls).

##### Transition LineItem State

[fetch SDL for type TransitionOrderLineItemState](#graphql-partial-sdls).

##### Import LineItem State

[fetch SDL for type ImportOrderLineItemState](#graphql-partial-sdls).

#### on Custom LineItem

##### Set CustomLineItem ShippingDetails

[fetch SDL for type SetOrderCustomLineItemShippingDetails](#graphql-partial-sdls).

##### Transition CustomLineItem State

[fetch SDL for type TransitionOrderCustomLineItemState](#graphql-partial-sdls).

##### Import CustomLineItem State

[fetch SDL for type ImportOrderCustomLineItemState](#graphql-partial-sdls).

##### Set CustomLineItem Custom Type

[fetch SDL for type SetOrderCustomLineItemCustomType](#graphql-partial-sdls).

##### Set CustomLineItem CustomField

[fetch SDL for type SetOrderCustomLineItemCustomField](#graphql-partial-sdls).

#### on Billing Address

##### Set Billing Address Custom Type

[fetch SDL for type SetOrderBillingAddressCustomType](#graphql-partial-sdls).

##### Set Billing Address CustomField

[fetch SDL for type SetOrderBillingAddressCustomField](#graphql-partial-sdls).

#### on Shipping Address

##### Set Shipping Address Custom Type

[fetch SDL for type SetOrderShippingAddressCustomType](#graphql-partial-sdls).

##### Set Shipping Address CustomField

[fetch SDL for type SetOrderShippingAddressCustomField](#graphql-partial-sdls).

#### on ItemShipping Address

##### Set ItemShipping Address Custom Type

[fetch SDL for type SetOrderItemShippingAddressCustomType](#graphql-partial-sdls).

##### Set ItemShipping Address CustomField

[fetch SDL for type SetOrderItemShippingAddressCustomField](#graphql-partial-sdls).

#### on Shipping

##### Set Shipping Custom Type

[fetch SDL for type SetOrderShippingCustomType](#graphql-partial-sdls).

##### Set Shipping CustomField

[fetch SDL for type SetOrderShippingCustomField](#graphql-partial-sdls).

#### on Delivery

##### Set Delivery Address

[fetch SDL for type SetOrderDeliveryAddress](#graphql-partial-sdls).

##### Add Parcel to Delivery

[fetch SDL for type AddOrderParcelToDelivery](#graphql-partial-sdls).

##### Remove Parcel from Delivery

[fetch SDL for type RemoveOrderParcelFromDelivery](#graphql-partial-sdls).

##### Set Delivery Items

[fetch SDL for type SetOrderDeliveryItems](#graphql-partial-sdls).

##### Set Delivery Custom Type

[fetch SDL for type SetOrderDeliveryCustomType](#graphql-partial-sdls).

##### Set Delivery CustomField

[fetch SDL for type SetOrderDeliveryCustomField](#graphql-partial-sdls).

#### on Parcel

##### Set Parcel Measurements

[fetch SDL for type SetOrderParcelMeasurements](#graphql-partial-sdls).

##### Set Parcel Tracking Data

[fetch SDL for type SetOrderParcelTrackingData](#graphql-partial-sdls).

##### Set Parcel Items

[fetch SDL for type SetOrderParcelItems](#graphql-partial-sdls).

##### Set Parcel Custom Type

[fetch SDL for type SetOrderParcelCustomType](#graphql-partial-sdls).

##### Set Parcel CustomField

[fetch SDL for type SetOrderParcelCustomField](#graphql-partial-sdls).

#### on Delivery Address

##### Set Delivery Address Custom Type

[fetch SDL for type SetOrderDeliveryAddressCustomType](#graphql-partial-sdls).

##### Set Delivery Address CustomField

[fetch SDL for type SetOrderDeliveryAddressCustomField](#graphql-partial-sdls).

#### on ReturnItem

##### Set ReturnItem Custom Type

[fetch SDL for type SetOrderReturnItemCustomType](#graphql-partial-sdls).

##### Set ReturnItem CustomField

[fetch SDL for type SetOrderReturnItemCustomField](#graphql-partial-sdls).

## Related pages

- [Area overview page with navigation](/api.md)
- [Previous page: REST](/api/projects/orders.md)
- [Search documentation and API specs](/search.md)