API reference
DiscountCodeOrders
Page through orders that used one discount code, with revenue totals. Read access, discounts toolset, MCP tool get_discount_code_orders.
Access: Read
Variables
| Variable | Type | Required | Accepts | Description |
|---|---|---|---|---|
filter | OrderFilter | no | OrderFilter | |
first | Int | no | 32-bit integer. Default 20 | |
id | UUID! | yes | ||
offset | Int | no | 32-bit integer. Default 0 | Skip the first n values from our after cursor, an alternative to cursor based pagination. May not be used with last. |
Call it
bash
curl https://api.missin.co.uk/graphql/v1 \
-H "Authorization: Bearer $MISSIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"operationName":"DiscountCodeOrders","variables":{"id":"00000000-0000-0000-0000-000000000000"},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4b510e04fa8b0b8af4bed63373b06d2deeebc138e560c1a78348ae9343621c99"}}}'Document
graphql
fragment DiscountCodeOrderRow on Order { __typename connectionByConnectionId { __typename displayName externalRef id } currencyByCurrencyId { __typename code decimalPlaces decimalSeparator id symbol symbolPosition thousandsSeparator } currencyId financialStatus id orderNumber orderReportedByOrderId { __typename converted id nativeCurrency nativeTotalPrice placedDay rate rateDate rateProvider reportedTotalPrice reportingCurrency } placedAt rowId totalPrice } query DiscountCodeOrders($filter: OrderFilter, $first: Int = 20, $id: UUID!, $offset: Int = 0) { __typename discountCodeByRowId(rowId: $id) { __typename id ordersByDiscountCodeId( first: $first offset: $offset orderBy: [PLACED_AT_DESC] filter: $filter ) { __typename nodes { __typename ...DiscountCodeOrderRow } totalCount } } }