API reference
DiscountDetail
Get one discount code by id with orders, revenue, partner, placements and incentive rules. Read access, discounts toolset, MCP tool get_discount.
Access: Read
Variables
| Variable | Type | Required | Accepts | Description |
|---|---|---|---|---|
id | UUID! | yes |
Call it
bash
curl https://api.missin.co.uk/graphql/v1 \
-H "Authorization: Bearer $MISSIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"operationName":"DiscountDetail","variables":{"id":"00000000-0000-0000-0000-000000000000"},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"865b99d514967467f72e817822b3f44b410e0def3d7365a0a16770b8e5d97abb"}}}'Document
graphql
fragment DiscountCodeDetailFields on DiscountCode { __typename aliasedCodes attributedRevenue attributedRevenueUnconvertedOrders code createdAt createdBy placements: discountPlacementsByDiscountCodeId { __typename nodes { __typename ...DiscountPlacementCell } totalCount } displayName endsAt id oneTimePurchase redemptionsCount rowId startAt status tags title updatedAt usageCount usageLimit valueAmount valuePercent } fragment DiscountPlacementCell on DiscountPlacement { __typename connectionId externalId id integrationSlug lastError lastSyncedAt rowId status targets { __typename totalCount } ... on DiscountPlacementKlaviyo { __typename codePool klaviyoCouponId: couponId } ... on DiscountPlacementShopify { __typename appliesOncePerCustomer combinesWithOrder combinesWithProduct combinesWithShipping } ... on DiscountPlacementStripe { __typename stripeCouponId: couponId } } fragment PartnerCard on Partner { __typename profileImage: avatarUrl email id name rowId status username } query DiscountDetail($id: UUID!) { __typename discountCodeByRowId(rowId: $id) { __typename incentiveRulesByDiscountCodeId(first: 20) { __typename nodes { __typename id incentiveByIncentiveId { __typename id name rowId } outcome rowId } totalCount } ordersByDiscountCodeId { __typename totalCount } partnerByPartnerId { __typename ...PartnerCard } partnerId tier ...DiscountCodeDetailFields } }