younifyd
Menu

orderEditAddCustomItem

Adds a custom line item to an existing Order. Custom line items represent products or services not in your catalog, such as gift wrapping, installation fees, or one-off charges.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the orderEditAddCustomItem action (under Order).
  3. Fill in the fields below, then reference the result from later steps as {{ordereditaddcustomitem.response.data}}.

Query

This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
mutation OrderEditAddCustomItem($id: ID!, $title: String!, $locationId: ID, $price: MoneyInput!, $quantity: Int!, $taxable: Boolean, $requiresShipping: Boolean) {
  orderEditAddCustomItem(
    id: $id
    title: $title
    locationId: $locationId
    price: $price
    quantity: $quantity
    taxable: $taxable
    requiresShipping: $requiresShipping
  ) {
    calculatedLineItem {
      calculatedDiscountAllocations {
        allocatedAmountSet
        discountApplication
      }
      customAttributes {
        key
        value
      }
      discountAllocations {
        allocatedAmount
        allocatedAmountSet
        discountApplication
      }
      discountedUnitPriceSet {
        presentmentMoney
        shopMoney
      }
      editableQuantity
      editableQuantityBeforeChanges
      editableSubtotalSet {
        presentmentMoney
        shopMoney
      }
      hasStagedLineItemDiscount
      id
      image {
        altText
        height
        id
        originalSrc
        src
        thumbhash
        width
      }
      originalUnitPriceSet {
        presentmentMoney
        shopMoney
      }
      quantity
      restockable
      restocking
      sku
      stagedChanges
      title
      uneditableSubtotalSet {
        presentmentMoney
        shopMoney
      }
      variant {
        availableForSale
        availablePublicationsCount
        barcode
        compareAtPrice
        createdAt
        defaultCursor
        deliveryProfile
        displayName
        id
        inventoryItem
        inventoryPolicy
        inventoryQuantity
        legacyResourceId
        position
        price
        product
        publishedOnCurrentChannel
        publishedOnCurrentPublication
        requiresComponents
        selectedOptions
        sellableOnlineQuantity
        sellingPlanGroupCount
        sellingPlanGroupsCount
        showUnitPrice
        sku
        storefrontId
        taxCode
        taxable
        title
        unitPrice
        unitPriceMeasurement
        updatedAt
      }
      variantTitle
    }
    calculatedOrder {
      cartDiscountAmountSet {
        presentmentMoney
        shopMoney
      }
      committed
      id
      notificationPreviewHtml
      notificationPreviewTitle
      originalOrder {
        additionalFees
        alerts
        app
        attribution
        billingAddress
        billingAddressMatchesShippingAddress
        canMarkAsPaid
        canNotifyCustomer
        cancelReason
        cancellation
        cancelledAt
        capturable
        cartDiscountAmount
        cartDiscountAmountSet
        cartToken
        channel
        channelInformation
        checkoutToken
        clientIp
        closed
        closedAt
        confirmationNumber
        confirmed
        createdAt
        currencyCode
        currentCartDiscountAmountSet
        currentShippingPriceSet
        currentSubtotalLineItemsQuantity
        currentSubtotalPriceSet
        currentTaxLines
        currentTotalAdditionalFeesSet
        currentTotalDiscountsSet
        currentTotalDutiesSet
        currentTotalPriceSet
        currentTotalTaxSet
        currentTotalWeight
        customAttributes
        customer
        customerAcceptsMarketing
        customerJourney
        customerJourneySummary
        customerLocale
        discountCode
        discountCodes
        displayAddress
        displayFinancialStatus
        displayFulfillmentStatus
        disputes
        dutiesIncluded
        edited
        email
        estimatedTaxes
        fulfillable
        fulfillmentsCount
        fullyPaid
        hasTimelineComment
        id
        landingPageDisplayText
        landingPageUrl
        legacyResourceId
        merchantBusinessEntity
        merchantEditable
        merchantEditableErrors
        merchantOfRecordApp
        name
        netPayment
        netPaymentSet
        note
        number
        originalTotalAdditionalFeesSet
        originalTotalDutiesSet
        originalTotalPriceSet
        paymentCollectionDetails
        paymentGatewayNames
        paymentTerms
        phone
        physicalLocation
        poNumber
        presentmentCurrencyCode
        processedAt
        productNetwork
        publication
        purchasingEntity
        referralCode
        referrerDisplayText
        referrerUrl
        refundDiscrepancySet
        refundable
        registeredSourceUrl
        requiresShipping
        restockable
        retailLocation
        returnStatus
        risk
        riskLevel
        shippingAddress
        shippingLine
        shopifyProtect
        sourceIdentifier
        sourceName
        staffMember
        subtotalLineItemsQuantity
        subtotalPrice
        subtotalPriceSet
        tags
        taxExempt
        taxLines
        taxesIncluded
        test
        totalCapturable
        totalCapturableSet
        totalCashRoundingAdjustment
        totalDiscounts
        totalDiscountsSet
        totalOutstandingSet
        totalPrice
        totalPriceSet
        totalReceived
        totalReceivedSet
        totalRefunded
        totalRefundedSet
        totalRefundedShippingSet
        totalShippingPrice
        totalShippingPriceSet
        totalTax
        totalTaxSet
        totalTipReceived
        totalTipReceivedSet
        totalWeight
        transactionsCount
        unpaid
        updatedAt
      }
      shippingLines {
        id
        price
        stagedStatus
        title
      }
      subtotalLineItemsQuantity
      subtotalPriceSet {
        presentmentMoney
        shopMoney
      }
      taxLines {
        channelLiable
        price
        priceSet
        rate
        ratePercentage
        source
        title
      }
      totalOutstandingSet {
        presentmentMoney
        shopMoney
      }
      totalPriceSet {
        presentmentMoney
        shopMoney
      }
    }
    orderEditSession {
      id
    }
    userErrors {
      field
      message
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

idstringrequired

The ID of the [calculated order](https://shopify.dev/api/admin-graphql/latest/objects/calculatedorder) or the order edit session to edit. This is the edit to which the custom item is added.

titlestringrequired

The name of the custom item to add.

locationIdstring

The ID of the retail [location](https://shopify.dev/api/admin-graphql/latest/objects/location) (if applicable) from which the custom item is sold. Used for tax calculations. A default location will be chosen automatically if none is provided.

priceobjectrequired

The unit price of the custom item. This value can't be negative.

amountstringrequired
currencyCodestringrequired

One ofUSDEURGBPCADAFNALLDZDAOAARSAMDAWGAUDBBDAZNBDTBSDBHDBIFBYNBZDBMDBTNBAMBRLBOBBWPBNDBGNMMKKHRCVEKYDXAFCLPCNYCOPKMFCDFCRCHRK

quantitynumberrequired

The quantity of the custom item. This value must be greater than zero.

taxableboolean

Whether the custom item is taxable. Defaults to `true`.

requiresShippingboolean

Whether the custom item requires shipping. Defaults to `false`.

json
{
  "id": "string",
  "title": "string",
  "price": {
    "amount": "string",
    "currencyCode": "USD"
  },
  "quantity": 0,
  "locationId": "string",
  "taxable": false,
  "requiresShipping": false
}

Response

Read the result with {{ordereditaddcustomitem.response.data.data.orderEditAddCustomItem}}. If the API returns errors, the step fails and they are at {{ordereditaddcustomitem.response.data.errors}}.

calculatedLineItemobject
calculatedDiscountAllocationsarray<object>
customAttributesarray<object>
discountAllocationsarray<object>
discountedUnitPriceSetobject2 fields
editableQuantitynumber
editableQuantityBeforeChangesnumber
editableSubtotalSetobject2 fields
hasStagedLineItemDiscountboolean
idstring
imageobject7 fields
originalUnitPriceSetobject2 fields
quantitynumber
restockableboolean
restockingboolean
skustring
stagedChangesarray<object>
titlestring
uneditableSubtotalSetobject2 fields
variantobject32 fields
variantTitlestring
calculatedOrderobject
cartDiscountAmountSetobject2 fields
committedboolean
idstring
notificationPreviewHtmlstring
notificationPreviewTitlestring
originalOrderobject40 fields
shippingLinesarray<object>
subtotalLineItemsQuantitynumber
subtotalPriceSetobject2 fields
taxLinesarray<object>
totalOutstandingSetobject2 fields
totalPriceSetobject2 fields
orderEditSessionobject
idstring
userErrorsarray<object>
fieldobject
messageobject

Need more? See the Shopify guide for connection setup and behaviour shared by every action.

orderEditAddCustomItem — Shopify — Documentation