HTTP endpoints
createPartnerPromoCode
POST /api/v1/partners/{id}/promo-codes
POST /api/v1/partners/by-external-id/{externalId}/promo-codes
Requires partners:write. Keep the Bearer key on your server.
SDK
grizzlee.createPartnerPromoCode(partner: { externalId: string; } | { id: string; }, input: { code: string; programId: string; integrationId: string; }): Promise<ProviderPromoCode>HTTP
Use your backend's HTTP client. The cURL request shows the wire format. Replace path parameters and example values.
curl --fail-with-body --request POST \
'https://app.grizzlee.ca/api/v1/partners/{id}/promo-codes' \
-H "Authorization: Bearer $GRIZZLEE_SERVER_KEY" \
-H 'Content-Type: application/json' \
--data '{"programId":"program-example","integrationId":"integrationId-example","code":"2026-10-11"}'Request body
| Field | Type | Required | Details |
|---|---|---|---|
programId | string | Yes | |
integrationId | string | Yes | |
code | string | Yes |
Request schema
{
"type": "object",
"properties": {
"programId": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"integrationId": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"code": {
"type": "string",
"minLength": 2,
"maxLength": 80,
"pattern": "^[A-Za-z0-9-]+$"
}
},
"required": [
"programId",
"integrationId",
"code"
],
"additionalProperties": false
}Response
HTTP responses wrap this value in data. The SDK returns the value directly unless the note above describes a wrapper.
| Field | Type | Required | Details |
|---|---|---|---|
id | string | Yes | |
companyId | string | Yes | |
partnerId | string | Yes | |
programId | string | Yes | |
integrationId | string | Yes | |
provider | union | Yes | |
code | string | Yes | |
providerCodeId | union | Yes | Null until Grizzlee has saved the provider discount ID. |
status | union | Yes | |
replacesId | string | No | |
couponId | string | No | |
incentive | union | Yes | |
programVersion | number | Yes | |
active | boolean | Yes | |
createdAt | string | Yes | |
deactivatedAt | string | No |
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
| Field | Type | Required | Details |
|---|---|---|---|
incentive.type | "percent" | Yes | |
incentive.rateBps | number | Yes | |
incentive.orders | number | Yes | How many of the friend's orders get the incentive. |
incentive.newCustomersOnly | boolean | Yes | true: 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.expiresAfterDays | union | Yes | Days after the referral was captured, claimed or entered. null means it never expires. |
incentive.returnOnFullRefund | boolean | Yes | true: a full refund gives the use back, so the customer can get the offer again. |
incentive.maxDiscountCents | number | No | Largest discount for one order. |
incentive.minOrderCents | number | No | The friend's order total before the discount must reach this amount. Checked by the merchant's checkout. |
incentive.orderCategories | object | No | Order categories that get the discount. Checked apart from the program's own orderCategories, which decide rewards. Absent means every order qualifies. |
incentive.currency | union | Yes |
incentive.expiresAfterDays
Variant 1
Type: null.
Variant 2
Type: number.
incentive.orderCategories
| Field | Type | Required | Details |
|---|---|---|---|
incentive.orderCategories.include | array | No | |
incentive.orderCategories.exclude | array | No |
incentive.currency
Variant 1
Type: string.
Variant 2
Type: string.
Variant 3
Type: string.
Variant 4
Type: string.
Variant 2
| Field | Type | Required | Details |
|---|---|---|---|
incentive.type | "fixed" | Yes | |
incentive.orders | number | Yes | How many of the friend's orders get the incentive. |
incentive.newCustomersOnly | boolean | Yes | true: 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.expiresAfterDays | union | Yes | Days after the referral was captured, claimed or entered. null means it never expires. |
incentive.returnOnFullRefund | boolean | Yes | true: a full refund gives the use back, so the customer can get the offer again. |
incentive.amountCents | number | Yes | |
incentive.minOrderCents | number | No | The friend's order total before the discount must reach this amount. Checked by the merchant's checkout. |
incentive.orderCategories | object | No | Order categories that get the discount. Checked apart from the program's own orderCategories, which decide rewards. Absent means every order qualifies. |
incentive.currency | union | Yes |
incentive.expiresAfterDays
Variant 1
Type: null.
Variant 2
Type: number.
incentive.orderCategories
| Field | Type | Required | Details |
|---|---|---|---|
incentive.orderCategories.include | array | No | |
incentive.orderCategories.exclude | array | No |
incentive.currency
Variant 1
Type: string.
Variant 2
Type: string.
Variant 3
Type: string.
Variant 4
Type: string.
Response schema
{
"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.