Input objects
We borrow the shape of a lot of input objects from Shopify.
CalculatedOrderInput
The input fields used to calculate an order.
| Field | Type | Required? | Description |
|---|---|---|---|
| appliedDiscount | AppliedDiscountInput | No | The discount that will be applied to the order. |
| billingAddress | MailingAddressInput | No | The mailing address associated with the payment method. |
| customerId | ID! | Yes | Customer associated with the order. |
| lineItems | [LineItemInput!]! | Yes | Product variant line items associated to the order. Each order must include at least one line item. |
| shippingAddress | MailingAddressInput! | Yes | The mailing address to where the order will be shipped. |
| shippingLine | ShippingLineInput | No | A shipping line object, which details the shipping method used. |
| syncPaymentMethods | Boolean | No | Whether Submarine should sync payment methods with the processor before returning them. Defaults to false. |
| taxExempt | Boolean | No | Whether or not taxes are exempt for the draft order. |
OrderInput
The input fields used to create an order.
NoteThis input mirrors the
OrderCalculateInputabove, with the addition (or update) of the following fields.
| Field | Type | Required? | Description |
|---|---|---|---|
| billingAddress | MailingAddressInput! | Yes | This is now mandatory. |
| chargeTaxOnShipping | Boolean | No | Whether tax should be charged on the shipping lines. Defaults to true. |
| metafields | [MetafieldInput!] | No | A list of metafields to attach to the order. |
| note | String | No | A note to add to the order. |
| noteAttributes | [NoteAttribute!] | No | A list of note attributes to add to the order. |
| paymentMethodId | ID! | Yes | The ID of the payment method to use to pay for the order. |
| sendReceipt | Boolean | No | Instructs Shopify whether to send an order confirmation to the customer. Defaults to false. |
| shippingLine | ShippingLineInput! | Yes | This is now mandatory. |
| tags | [String!] | No | A list of tags to add to the order. |
| taxLines | [TaxLineInput!] | No | The custom tax to be charged on the order. If set, the native Shopify tax rates will be overridden. |
AppliedDiscountInput
The input fields for applying an order-level discount.
| Field | Type | Required? | Description |
|---|---|---|---|
| code | String | Yes | The discount code. |
| value | Float! | Yes | The value of the discount. If the type of the discount is fixed amount, then this is a fixed dollar amount. If the type is percentage, then this is the percentage. |
| valueType | AppliedDiscountType! | Yes | The type of discount. |
LineItemInput
The input fields used to create a line item for an order.
| Field | Type | Required? | Description |
|---|---|---|---|
| customAttributes | AttributeInput | No | An array of key/value pairs that will be translated to line item properties on order creation. |
| price | MoneyInput | No | The price of the item. Ignored if variant is provided. |
| quantity | Int! | Yes | The number of items to add. |
| taxable | Boolean | No | Whether the item is taxable. Ignored if variant is provided. |
| variantId | ID! | Yes | The ID of the Shopify variant to add. |
MailingAddressInput
The input fields used to create a customer address.
| Field | Type | Required? |
|---|---|---|
| address1 | String! | Yes |
| address2 | String! | No |
| city | String! | Yes |
| company | String | No |
| countryCode | CountryCode! | Yes |
| firstName | String | Yes |
| lastName | String | Yes |
| phone | Strig | No |
| provinceCode | String! | Yes |
| zip | String! | Yes |
MetafieldInput
The inout fields used to create a metafield.
| Field | Type | Required |
|---|---|---|
| key | String | Yes |
| namespace | String | No |
| value | String | Yes |
| valueType | MetafieldValueKind | Yes |
NoteAttributeInput
The input fields used to create a note attribute.
| Field | Type | Required? |
|---|---|---|
| name | String | Yes |
| value | String | Yes |
ShippingLineInput
The input fields used to define an order's shipping method.
NoteThere is some conditional validation performed on this input.
- If the handle is supplied, both the price and title must be blank.
- If the handle is not supplied, both the price and title must be set.
| Field | Type | Required? | Description |
|---|---|---|---|
| price | Float | No | The price of the shipping line. |
| shippingRateHandle | String | No | Unique identifier of the shipping rate. |
| title | String | No | The title of the shipping line. |
TaxLineInput
The input fields used to define custom tax lines to be charged on the order.
| Field | Type | Required? | Description |
|---|---|---|---|
| price | Float! | Yes | The amount of tax to be charged, in the shop currency. |
| rate | Float! | Yes | The rate of tax to be applied, as a decimal (e.g. 0.1 represents 10%). Note that no validation is performed on this value, and it is passed as is to Shopify. |
| title | String! | Yes | The name of the tax. |
AttributeInput
The input fields used to define custom tax lines to be charged on the order.
| Field | Type | Required? | Description |
|---|---|---|---|
| key | String! | Yes | The name of the attribute. |
| value | String! | Yes | The value of the attribute. |
CompletableDraftOrderInput
Input specifying an existing draft order on Shopify and the payment method to use to complete it.
| Field | Type | Required? | Description |
|---|---|---|---|
| draftOrderId | ID! | Yes | The global ID of the Shopify draft order that should be completed. |
| paymentMethodId | ID! | Yes | The global ID of the payment method to use to complete the order. |
Updated 9 months ago
