Skip to content

Commit 3dbf82a

Browse files
authored
[ts] Add discount webhook topics (#659)
Fixes: #658
1 parent 159c2e7 commit 3dbf82a

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

types/index.d.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3233,6 +3233,11 @@ declare namespace Shopify {
32333233
| 'customers/update'
32343234
| 'customers_email_marketing_consent/update'
32353235
| 'customers_marketing_consent/update'
3236+
| 'discounts/create'
3237+
| 'discounts/delete'
3238+
| 'discounts/redeemcode_added'
3239+
| 'discounts/redeemcode_removed'
3240+
| 'discounts/update'
32363241
| 'disputes/create'
32373242
| 'disputes/update'
32383243
| 'domains/create'
@@ -3399,6 +3404,16 @@ declare namespace Shopify {
33993404
? ICustomerSavedSearch
34003405
: T extends 'customer_groups/delete'
34013406
? IDeletedItem
3407+
: T extends 'discounts/create'
3408+
? IDiscountUpsertWebhook
3409+
: T extends 'discounts/delete'
3410+
? IDiscountDeleteWebhook
3411+
: T extends 'discounts/redeemcode_added'
3412+
? IDiscountRedeemCodeWebhook
3413+
: T extends 'discounts/redeemcode_removed'
3414+
? IDiscountRedeemCodeWebhook
3415+
: T extends 'discounts/update'
3416+
? IDiscountUpsertWebhook
34023417
: T extends 'draft_orders/create'
34033418
? IDraftOrder
34043419
: T extends 'draft_orders/update'
@@ -3528,4 +3543,28 @@ declare namespace Shopify {
35283543
min_delivery_date?: string;
35293544
max_delivery_date?: string;
35303545
}
3546+
3547+
type DiscountStatus = 'ACTIVE' | 'EXPIRED' | 'SCHEDULED';
3548+
3549+
interface IDiscountUpsertWebhook {
3550+
admin_graphql_api_id: string;
3551+
title: string;
3552+
status: DiscountStatus;
3553+
created_at: string;
3554+
updated_at: string;
3555+
}
3556+
3557+
interface IDiscountDeleteWebhook {
3558+
admin_graphql_api_id: string;
3559+
deleted_at: string;
3560+
}
3561+
3562+
interface IDiscountRedeemCodeWebhook {
3563+
admin_graphql_api_id: string;
3564+
redeem_code: {
3565+
id: string;
3566+
code: string;
3567+
};
3568+
updated_at: string;
3569+
}
35313570
}

0 commit comments

Comments
 (0)