Skip to content

Add discount webhook types #659

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -3233,6 +3233,11 @@ declare namespace Shopify {
| 'customers/update'
| 'customers_email_marketing_consent/update'
| 'customers_marketing_consent/update'
| 'discounts/create'
| 'discounts/delete'
| 'discounts/redeemcode_added'
| 'discounts/redeemcode_removed'
| 'discounts/update'
| 'disputes/create'
| 'disputes/update'
| 'domains/create'
@@ -3399,6 +3404,16 @@ declare namespace Shopify {
? ICustomerSavedSearch
: T extends 'customer_groups/delete'
? IDeletedItem
: T extends 'discounts/create'
? IDiscountUpsertWebhook
: T extends 'discounts/delete'
? IDiscountDeleteWebhook
: T extends 'discounts/redeemcode_added'
? IDiscountRedeemCodeWebhook
: T extends 'discounts/redeemcode_removed'
? IDiscountRedeemCodeWebhook
: T extends 'discounts/update'
? IDiscountUpsertWebhook
: T extends 'draft_orders/create'
? IDraftOrder
: T extends 'draft_orders/update'
@@ -3528,4 +3543,28 @@ declare namespace Shopify {
min_delivery_date?: string;
max_delivery_date?: string;
}

type DiscountStatus = 'ACTIVE' | 'EXPIRED' | 'SCHEDULED';

interface IDiscountUpsertWebhook {
admin_graphql_api_id: string;
title: string;
status: DiscountStatus;
created_at: string;
updated_at: string;
}

interface IDiscountDeleteWebhook {
admin_graphql_api_id: string;
deleted_at: string;
}

interface IDiscountRedeemCodeWebhook {
admin_graphql_api_id: string;
redeem_code: {
id: string;
code: string;
};
updated_at: string;
}
}