Skip to content
Developer docs
⌘ K
Dashboard ↗

HTTP endpoints

deactivatePartnerPromoCode

DELETE /api/v1/partners/{id}/promo-codes/{codeId}

DELETE /api/v1/partners/by-external-id/{externalId}/promo-codes/{codeId}

Requires partners:write. Keep the Bearer key on your server.

SDK

ts
grizzlee.deactivatePartnerPromoCode(partner: { externalId: string; } | { id: string; }, codeId: string): Promise<ProviderPromoCode>

HTTP

Use your backend's HTTP client. The cURL request shows the wire format. Replace path parameters and example values.

sh
curl --fail-with-body --request DELETE \
  'https://app.grizzlee.ca/api/v1/partners/{id}/promo-codes/{codeId}' \
  -H "Authorization: Bearer $GRIZZLEE_SERVER_KEY"

Response

HTTP responses wrap this value in data. The SDK returns the value directly unless the note above describes a wrapper.

FieldTypeRequiredDetails
idstringYes
companyIdstringYes
partnerIdstringYes
programIdstringYes
integrationIdstringYes
providerunionYes
codestringYes
providerCodeIdunionYesNull until Grizzlee has saved the provider discount ID.
statusunionYes
replacesIdstringNo
couponIdstringNo
incentiveunionYes
programVersionnumberYes
activebooleanYes
createdAtstringYes
deactivatedAtstringNo

provider

Variant 1

Type: string.

Variant 2

Type: string.

providerCodeId

Variant 1

Type: null.

Variant 2

Type: string.

status

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

incentive

Variant 1

FieldTypeRequiredDetails
incentive.type"percent"Yes
incentive.rateBpsnumberYes
incentive.ordersnumberYesHow many of the friend's orders get the incentive.
incentive.newCustomersOnlybooleanYestrue: use the merchant's newCustomer answer, or recorded purchases when omitted. false: returning customers qualify too. A supplied answer uses the order limit after the referral.
incentive.expiresAfterDaysunionYesDays after the referral was captured, claimed or entered. null means it never expires.
incentive.returnOnFullRefundbooleanYestrue: a full refund gives the use back, so the customer can get the offer again.
incentive.maxDiscountCentsnumberNoLargest discount for one order.
incentive.minOrderCentsnumberNoThe friend's order total before the discount must reach this amount. Checked by the merchant's checkout.
incentive.orderCategoriesobjectNoOrder categories that get the discount. Checked apart from the program's own orderCategories, which decide rewards. Absent means every order qualifies.
incentive.currencyunionYes

incentive.expiresAfterDays

Variant 1

Type: null.

Variant 2

Type: number.

incentive.orderCategories

FieldTypeRequiredDetails
incentive.orderCategories.includearrayNo
incentive.orderCategories.excludearrayNo

incentive.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

Variant 2

FieldTypeRequiredDetails
incentive.type"fixed"Yes
incentive.ordersnumberYesHow many of the friend's orders get the incentive.
incentive.newCustomersOnlybooleanYestrue: use the merchant's newCustomer answer, or recorded purchases when omitted. false: returning customers qualify too. A supplied answer uses the order limit after the referral.
incentive.expiresAfterDaysunionYesDays after the referral was captured, claimed or entered. null means it never expires.
incentive.returnOnFullRefundbooleanYestrue: a full refund gives the use back, so the customer can get the offer again.
incentive.amountCentsnumberYes
incentive.minOrderCentsnumberNoThe friend's order total before the discount must reach this amount. Checked by the merchant's checkout.
incentive.orderCategoriesobjectNoOrder categories that get the discount. Checked apart from the program's own orderCategories, which decide rewards. Absent means every order qualifies.
incentive.currencyunionYes

incentive.expiresAfterDays

Variant 1

Type: null.

Variant 2

Type: number.

incentive.orderCategories

FieldTypeRequiredDetails
incentive.orderCategories.includearrayNo
incentive.orderCategories.excludearrayNo

incentive.currency

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

Response schema

json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "companyId": {
      "type": "string"
    },
    "partnerId": {
      "type": "string"
    },
    "programId": {
      "type": "string"
    },
    "integrationId": {
      "type": "string"
    },
    "provider": {
      "anyOf": [
        {
          "type": "string",
          "const": "stripe"
        },
        {
          "type": "string",
          "const": "shopify"
        }
      ]
    },
    "code": {
      "type": "string"
    },
    "providerCodeId": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "string"
        }
      ],
      "description": "Null until Grizzlee has saved the provider discount ID."
    },
    "status": {
      "anyOf": [
        {
          "type": "string",
          "const": "pending"
        },
        {
          "type": "string",
          "const": "active"
        },
        {
          "type": "string",
          "const": "inactive"
        }
      ]
    },
    "replacesId": {
      "type": "string"
    },
    "couponId": {
      "type": "string"
    },
    "incentive": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "percent"
            },
            "rateBps": {
              "type": "number"
            },
            "orders": {
              "type": "number",
              "description": "How many of the friend's orders get the incentive."
            },
            "newCustomersOnly": {
              "type": "boolean",
              "description": "true: use the merchant's newCustomer answer, or recorded purchases when omitted. false:\nreturning customers qualify too. A supplied answer uses the order limit after the referral."
            },
            "expiresAfterDays": {
              "anyOf": [
                {
                  "type": "null"
                },
                {
                  "type": "number"
                }
              ],
              "description": "Days after the referral was captured, claimed or entered. null means it never expires."
            },
            "returnOnFullRefund": {
              "type": "boolean",
              "description": "true: a full refund gives the use back, so the customer can get the offer again."
            },
            "maxDiscountCents": {
              "type": "number",
              "description": "Largest discount for one order."
            },
            "minOrderCents": {
              "type": "number",
              "description": "The friend's order total before the discount must reach this amount. Checked by the merchant's checkout."
            },
            "orderCategories": {
              "type": "object",
              "properties": {
                "include": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "exclude": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "description": "Order categories that get the discount. Checked apart from the program's own orderCategories,\nwhich decide rewards. Absent means every order qualifies."
            },
            "currency": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "CAD"
                },
                {
                  "type": "string",
                  "const": "USD"
                },
                {
                  "type": "string",
                  "const": "EUR"
                },
                {
                  "type": "string",
                  "const": "GBP"
                }
              ]
            }
          },
          "required": [
            "type",
            "rateBps",
            "orders",
            "newCustomersOnly",
            "expiresAfterDays",
            "returnOnFullRefund",
            "currency"
          ]
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "fixed"
            },
            "orders": {
              "type": "number",
              "description": "How many of the friend's orders get the incentive."
            },
            "newCustomersOnly": {
              "type": "boolean",
              "description": "true: use the merchant's newCustomer answer, or recorded purchases when omitted. false:\nreturning customers qualify too. A supplied answer uses the order limit after the referral."
            },
            "expiresAfterDays": {
              "anyOf": [
                {
                  "type": "null"
                },
                {
                  "type": "number"
                }
              ],
              "description": "Days after the referral was captured, claimed or entered. null means it never expires."
            },
            "returnOnFullRefund": {
              "type": "boolean",
              "description": "true: a full refund gives the use back, so the customer can get the offer again."
            },
            "amountCents": {
              "type": "number"
            },
            "minOrderCents": {
              "type": "number",
              "description": "The friend's order total before the discount must reach this amount. Checked by the merchant's checkout."
            },
            "orderCategories": {
              "type": "object",
              "properties": {
                "include": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "exclude": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "description": "Order categories that get the discount. Checked apart from the program's own orderCategories,\nwhich decide rewards. Absent means every order qualifies."
            },
            "currency": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "CAD"
                },
                {
                  "type": "string",
                  "const": "USD"
                },
                {
                  "type": "string",
                  "const": "EUR"
                },
                {
                  "type": "string",
                  "const": "GBP"
                }
              ]
            }
          },
          "required": [
            "type",
            "orders",
            "newCustomersOnly",
            "expiresAfterDays",
            "returnOnFullRefund",
            "amountCents",
            "currency"
          ]
        }
      ]
    },
    "programVersion": {
      "type": "number"
    },
    "active": {
      "type": "boolean"
    },
    "createdAt": {
      "type": "string"
    },
    "deactivatedAt": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "companyId",
    "partnerId",
    "programId",
    "integrationId",
    "provider",
    "code",
    "providerCodeId",
    "status",
    "incentive",
    "programVersion",
    "active",
    "createdAt"
  ]
}

Errors

Failures return { "error": { "code": "...", "message": "...", "details": {} } }. Details are optional. See error statuses. Reuse an unchanged event payload when retrying.