Input objects

We borrow the shape of a lot of input objects from Shopify.

CalculatedOrderInput

The input fields used to calculate an order.

FieldTypeRequired?Description
appliedDiscountAppliedDiscountInputNoThe discount that will be applied to the order.
billingAddressMailingAddressInputNoThe mailing address associated with the payment method.
customerIdID!YesCustomer associated with the order.
lineItems[LineItemInput!]!YesProduct variant line items associated to the order. Each order must include at least one line item.
shippingAddressMailingAddressInput!YesThe mailing address to where the order will be shipped.
shippingLineShippingLineInputNoA shipping line object, which details the shipping method used.
syncPaymentMethodsBooleanNoWhether Submarine should sync payment methods with the processor before returning them. Defaults to false.
taxExemptBooleanNoWhether or not taxes are exempt for the draft order.

OrderInput

The input fields used to create an order.

📘

Note

This input mirrors the OrderCalculateInput above, with the addition (or update) of the following fields.

FieldTypeRequired?Description
billingAddressMailingAddressInput!YesThis is now mandatory.
chargeTaxOnShippingBooleanNoWhether tax should be charged on the shipping lines. Defaults to true.
metafields[MetafieldInput!]NoA list of metafields to attach to the order.
noteStringNoA note to add to the order.
noteAttributes[NoteAttribute!]NoA list of note attributes to add to the order.
paymentMethodIdID!YesThe ID of the payment method to use to pay for the order.
sendReceiptBooleanNoInstructs Shopify whether to send an order confirmation to the customer. Defaults to false.
shippingLineShippingLineInput!YesThis is now mandatory.
tags[String!]NoA list of tags to add to the order.
taxLines[TaxLineInput!]NoThe 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.

FieldTypeRequired?Description
codeStringYesThe discount code.
valueFloat!YesThe 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.
valueTypeAppliedDiscountType!YesThe type of discount.

LineItemInput

The input fields used to create a line item for an order.

FieldTypeRequired?Description
customAttributesAttributeInputNoAn array of key/value pairs that will be translated to line item properties on order creation.
priceMoneyInputNoThe price of the item. Ignored if variant is provided.
quantityInt!YesThe number of items to add.
taxableBooleanNoWhether the item is taxable. Ignored if variant is provided.
variantIdID!YesThe ID of the Shopify variant to add.

MailingAddressInput

The input fields used to create a customer address.

FieldTypeRequired?
address1String!Yes
address2String!No
cityString!Yes
companyStringNo
countryCodeCountryCode!Yes
firstNameStringYes
lastNameStringYes
phoneStrigNo
provinceCodeString!Yes
zipString!Yes

MetafieldInput

The inout fields used to create a metafield.

FieldTypeRequired
keyStringYes
namespaceStringNo
valueStringYes
valueTypeMetafieldValueKindYes

NoteAttributeInput

The input fields used to create a note attribute.

FieldTypeRequired?
nameStringYes
valueStringYes

ShippingLineInput

The input fields used to define an order's shipping method.

📘

Note

There 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.
FieldTypeRequired?Description
priceFloatNoThe price of the shipping line.
shippingRateHandleStringNoUnique identifier of the shipping rate.
titleStringNoThe title of the shipping line.

TaxLineInput

The input fields used to define custom tax lines to be charged on the order.

FieldTypeRequired?Description
priceFloat!YesThe amount of tax to be charged, in the shop currency.
rateFloat!YesThe 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.
titleString!YesThe name of the tax.

AttributeInput

The input fields used to define custom tax lines to be charged on the order.

FieldTypeRequired?Description
keyString!YesThe name of the attribute.
valueString!YesThe value of the attribute.

CompletableDraftOrderInput

Input specifying an existing draft order on Shopify and the payment method to use to complete it.

FieldTypeRequired?Description
draftOrderIdID!YesThe global ID of the Shopify draft order that should be completed.
paymentMethodIdID!YesThe global ID of the payment method to use to complete the order.