Ostorya dev docs

Admin API/Discounts/Mutations

discountRedeemCodeBulkAdd

mutation

Adds more codes to a code discount (e.g. one per influencer). Up to 250 per call.

Returns DiscountRedeemCodeBulkAddPayload!

mutation DiscountRedeemCodeBulkAdd($codes: [DiscountRedeemCodeInput!]!, $discountId: ID!) {
  discountRedeemCodeBulkAdd(codes: $codes, discountId: $discountId) {
    addedCount
    codeDiscountNode {
      id
      discountType
      method
    }
    userErrors {
      code
      message
      field
    }
  }
}

# Variables
{
  "codes": [
    {
      "code": ""
    }
  ],
  "discountId": "gid://ostorya/Discount/0f8c5b1e-…"
}

Arguments

discountIdID!required

Payload

addedCountInt!required
Codes added (Ostorya adds them right away).
codeDiscountNodeDiscountNode
userErrors[UserError!]!required