TanqoryDocs

tanqoryExtOrderEditAddOrderDiscount

  • Mutation
  • Orders and payments

Adds a custom discount on the whole order to an order edit (the reference admin's "Add custom discount" in the Edit order Payment card). Staged like the other edit changes; orderEditCommit writes it as a manual discount application spread across the line items. Change or remove it with orderEditUpdateDiscount / orderEditRemoveDiscount and the id of its calculated discount application. One per edit. Resolvers: apps/api/src/domains/order-edits/order-discount-ext.ts.

Arguments

ArgumentTypeRequiredDefaultDescription
discountOrderEditAppliedDiscountInput!Required

The discount: a fixed amount or a percentage, with the reason shown to the customer as its description.

idID!Required

The edit in progress: a CalculatedOrder ID or an OrderEditSession ID.

Returns

TanqoryExtOrderEditAddOrderDiscountPayload

FieldTypeDescription
addedDiscountStagedChangeOrderStagedChangeAddLineItemDiscount

The discount added during this order edit.

calculatedOrderCalculatedOrder

The order as it would look with the pending changes, before they are committed.

orderEditSessionOrderEditSession

The edit session holding the pending changes, before they are committed.

userErrors[UserError!]!

Problems with the input. Empty when the call succeeded.

Example request

A starting point: required arguments as variables and a few fields of the result. Replace the placeholders.

Set STORE_ID and TANQORY_ACCESS_TOKEN in your environment first (Make your first API call).

curl
curl -X POST "https://api.tanqory.com/admin/2026-10/stores/$STORE_ID/graphql" \
  -H "Authorization: Bearer $TANQORY_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"query":"mutation TanqoryExtOrderEditAddOrderDiscount($discount: OrderEditAppliedDiscountInput!, $id: ID!) {\n  tanqoryExtOrderEditAddOrderDiscount(discount: $discount, id: $id) {\n    addedDiscountStagedChange { id }\n    calculatedOrder { id }\n    orderEditSession { id }\n    userErrors {\n      field\n      message\n    }\n  }\n}","variables":{"discount":{},"id":"gid://tanqory/Type/id"}}'

Built from commit c0b3fb3fdef7 · API version 2026-10