Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add webhook description to giftcard and invoice mutations (#13298)

Maciej Korycinskia35eded05163
diff --git a/saleor/graphql/giftcard/bulk_mutations/gift_card_bulk_activate.py b/saleor/graphql/giftcard/bulk_mutations/gift_card_bulk_activate.py
index 2e89d776f0..739463e657 100644
--- a/saleor/graphql/giftcard/bulk_mutations/gift_card_bulk_activate.py
+++ b/saleor/graphql/giftcard/bulk_mutations/gift_card_bulk_activate.py
@@ -6,11 +6,13 @@ from ....giftcard import events, models
from ....giftcard.error_codes import GiftCardErrorCode
from ....giftcard.utils import is_gift_card_expired
from ....permission.enums import GiftcardPermissions
+from ....webhook.event_types import WebhookEventAsyncType
from ...app.dataloaders import get_app_promise
from ...core import ResolveInfo
from ...core.descriptions import ADDED_IN_31
from ...core.mutations import BaseBulkMutation
from ...core.types import GiftCardError, NonNullList
+from ...core.utils import WebhookEventInfo
from ...plugins.dataloaders import get_plugin_manager_promise
from ..types import GiftCard
@@ -27,6 +29,12 @@ class GiftCardBulkActivate(BaseBulkMutation):
object_type = GiftCard
permissions = (GiftcardPermissions.MANAGE_GIFT_CARD,)
error_type_class = GiftCardError
+ webhook_events_info = [
+ WebhookEventInfo(
+ type=WebhookEventAsyncType.GIFT_CARD_STATUS_CHANGED,
+ description="A gift card was activated.",
+ )
+ ]
@classmethod
def clean_instance(cls, _info: ResolveInfo, instance):
diff --git a/saleor/graphql/giftcard/bulk_mutations/gift_card_bulk_create.py b/saleor/graphql/giftcard/bulk_mutations/gift_card_bulk_create.py
index 8cc4df62ac..4cb8ebdc51 100644
--- a/saleor/graphql/giftcard/bulk_mutations/gift_card_bulk_create.py
+++ b/saleor/graphql/giftcard/bulk_mutations/gift_card_bulk_create.py
@@ -10,6 +10,7 @@ from ....core.utils.validators import is_date_in_future
from ....giftcard import events, models
from ....giftcard.error_codes import GiftCardErrorCode
from ....permission.enums import GiftcardPermissions
+from ....webhook.event_types import WebhookEventAsyncType
from ...app.dataloaders import get_app_promise
from ...core import ResolveInfo
from ...core.descriptions import ADDED_IN_31
@@ -17,6 +18,7 @@ from ...core.doc_category import DOC_CATEGORY_GIFT_CARDS
from ...core.mutations import BaseMutation
from ...core.scalars import Date
from ...core.types import BaseInputObjectType, GiftCardError, NonNullList, PriceInput
+from ...core.utils import WebhookEventInfo
from ...core.validators import validate_price_precision
from ...plugins.dataloaders import get_plugin_manager_promise
from ..mutations import GiftCardCreate
@@ -65,6 +67,16 @@ class GiftCardBulkCreate(BaseMutation):
model = models.GiftCard
permissions = (GiftcardPermissions.MANAGE_GIFT_CARD,)
error_type_class = GiftCardError
+ webhook_events_info = [
+ WebhookEventInfo(
+ type=WebhookEventAsyncType.GIFT_CARD_CREATED,
+ description="A gift card was created.",
+ ),
+ WebhookEventInfo(
+ type=WebhookEventAsyncType.NOTIFY_USER,
+ description="A notification for created gift card.",
+ ),
+ ]
@classmethod
@traced_atomic_transaction()
diff --git a/saleor/graphql/giftcard/bulk_mutations/gift_card_bulk_deactivate.py b/saleor/graphql/giftcard/bulk_mutations/gift_card_bulk_deactivate.py
index 85901c7cf5..71d51a7dc8 100644
--- a/saleor/graphql/giftcard/bulk_mutations/gift_card_bulk_deactivate.py
+++ b/saleor/graphql/giftcard/bulk_mutations/gift_card_bulk_deactivate.py
@@ -3,11 +3,13 @@ import graphene
from ....core.tracing import traced_atomic_transaction
from ....giftcard import events, models
from ....permission.enums import GiftcardPermissions
+from ....webhook.event_types import WebhookEventAsyncType
from ...app.dataloaders import get_app_promise
from ...core import ResolveInfo
from ...core.descriptions import ADDED_IN_31
from ...core.mutations import BaseBulkMutation
from ...core.types import GiftCardError, NonNullList
+from ...core.utils import WebhookEventInfo
from ...plugins.dataloaders import get_plugin_manager_promise
from ..types import GiftCard
@@ -26,6 +28,12 @@ class GiftCardBulkDeactivate(BaseBulkMutation):
object_type = GiftCard
permissions = (GiftcardPermissions.MANAGE_GIFT_CARD,)
error_type_class = GiftCardError
+ webhook_events_info = [
+ WebhookEventInfo(
+ type=WebhookEventAsyncType.GIFT_CARD_STATUS_CHANGED,
+ description="A gift card was deactivated.",
+ )
+ ]
@classmethod
@traced_atomic_transaction()
diff --git a/saleor/graphql/giftcard/bulk_mutations/gift_card_bulk_delete.py b/saleor/graphql/giftcard/bulk_mutations/gift_card_bulk_delete.py
index cab1c9f10c..62ea536785 100644
--- a/saleor/graphql/giftcard/bulk_mutations/gift_card_bulk_delete.py
+++ b/saleor/graphql/giftcard/bulk_mutations/gift_card_bulk_delete.py
@@ -2,10 +2,12 @@ import graphene
from ....giftcard import models
from ....permission.enums import GiftcardPermissions
+from ....webhook.event_types import WebhookEventAsyncType
from ...core import ResolveInfo
from ...core.descriptions import ADDED_IN_31
from ...core.mutations import ModelBulkDeleteMutation
from ...core.types import GiftCardError, NonNullList
+from ...core.utils import WebhookEventInfo
from ...plugins.dataloaders import get_plugin_manager_promise
from ..types import GiftCard
@@ -22,6 +24,12 @@ class GiftCardBulkDelete(ModelBulkDeleteMutation):
object_type = GiftCard
permissions = (GiftcardPermissions.MANAGE_GIFT_CARD,)
error_type_class = GiftCardError
+ webhook_events_info = [
+ WebhookEventInfo(
+ type=WebhookEventAsyncType.GIFT_CARD_DELETED,
+ description="A gift card was deleted.",
+ )
+ ]
@classmethod
def bulk_action(cls, info: ResolveInfo, queryset, /):
diff --git a/saleor/graphql/giftcard/mutations/gift_card_activate.py b/saleor/graphql/giftcard/mutations/gift_card_activate.py
index 4372a796cd..0be2fe955c 100644
--- a/saleor/graphql/giftcard/mutations/gift_card_activate.py
+++ b/saleor/graphql/giftcard/mutations/gift_card_activate.py
@@ -3,11 +3,13 @@ import graphene
from ....giftcard import events
from ....giftcard.utils import activate_gift_card
from ....permission.enums import GiftcardPermissions
+from ....webhook.event_types import WebhookEventAsyncType
from ...app.dataloaders import get_app_promise
from ...core import ResolveInfo
from ...core.doc_category import DOC_CATEGORY_GIFT_CARDS
from ...core.mutations import BaseMutation
from ...core.types import GiftCardError
+from ...core.utils import WebhookEventInfo
from ...plugins.dataloaders import get_plugin_manager_promise
from ..types import GiftCard
from .utils import clean_gift_card
@@ -25,6 +27,12 @@ class GiftCardActivate(BaseMutation):
permissions = (GiftcardPermissions.MANAGE_GIFT_CARD,)
error_type_class = GiftCardError
error_type_field = "gift_card_errors"
+ webhook_events_info = [
+ WebhookEventInfo(
+ type=WebhookEventAsyncType.GIFT_CARD_STATUS_CHANGED,
+ description="A gift card was activated.",
+ )
+ ]
@classmethod
def perform_mutation( # type: ignore[override]
diff --git a/saleor/graphql/giftcard/mutations/gift_card_add_note.py b/saleor/graphql/giftcard/mutations/gift_card_add_note.py
index 7f51955dd0..1c352b630c 100644
--- a/saleor/graphql/giftcard/mutations/gift_card_add_note.py
+++ b/saleor/graphql/giftcard/mutations/gift_card_add_note.py
@@ -4,12 +4,14 @@ from django.core.exceptions import ValidationError
from ....giftcard import events
from ....giftcard.error_codes import GiftCardErrorCode
from ....permission.enums import GiftcardPermissions
+from ....webhook.event_types import WebhookEventAsyncType
from ...app.dataloaders import get_app_promise
from ...core import ResolveInfo
from ...core.descriptions import ADDED_IN_31
from ...core.doc_category import DOC_CATEGORY_GIFT_CARDS
from ...core.mutations import BaseMutation
from ...core.types import BaseInputObjectType, GiftCardError
+from ...core.utils import WebhookEventInfo
from ...core.validators import validate_required_string_field
from ...plugins.dataloaders import get_plugin_manager_promise
from ..types import GiftCard, GiftCardEvent
@@ -40,6 +42,12 @@ class GiftCardAddNote(BaseMutation):
doc_category = DOC_CATEGORY_GIFT_CARDS
permissions = (GiftcardPermissions.MANAGE_GIFT_CARD,)
error_type_class = GiftCardError
+ webhook_events_info = [
+ WebhookEventInfo(
+ type=WebhookEventAsyncType.GIFT_CARD_UPDATED,
+ description="A gift card was updated.",
+ )
+ ]
@classmethod
def clean_input(cls, _info: ResolveInfo, _instance, data):
diff --git a/saleor/graphql/giftcard/mutations/gift_card_create.py b/saleor/graphql/giftcard/mutations/gift_card_create.py
index 92fadcd38b..4a5c78e897 100644
--- a/saleor/graphql/giftcard/mutations/gift_card_create.py
+++ b/saleor/graphql/giftcard/mutations/gift_card_create.py
@@ -12,6 +12,7 @@ from ....giftcard import events, models
from ....giftcard.error_codes import GiftCardErrorCode
from ....giftcard.notifications import send_gift_card_notification
from ....permission.enums import GiftcardPermissions
+from ....webhook.event_types import WebhookEventAsyncType
from ...app.dataloaders import get_app_promise
from ...core import ResolveInfo
from ...core.descriptions import ADDED_IN_31, DEPRECATED_IN_3X_INPUT
@@ -19,6 +20,7 @@ from ...core.doc_category import DOC_CATEGORY_GIFT_CARDS
from ...core.mutations import ModelMutation
from ...core.scalars import Date
from ...core.types import BaseInputObjectType, GiftCardError, NonNullList, PriceInput
+from ...core.utils import WebhookEventInfo
from ...core.validators import validate_price_precision
from ...plugins.dataloaders import get_plugin_manager_promise
from ..types import GiftCard
@@ -93,6 +95,16 @@ class GiftCardCreate(ModelMutation):
permissions = (GiftcardPermissions.MANAGE_GIFT_CARD,)
error_type_class = GiftCardError
error_type_field = "gift_card_errors"
+ webhook_events_info = [
+ WebhookEventInfo(
+ type=WebhookEventAsyncType.GIFT_CARD_CREATED,
+ description="A gift card was created.",
+ ),
+ WebhookEventInfo(
+ type=WebhookEventAsyncType.NOTIFY_USER,
+ description="A notification for created gift card.",
+ ),
+ ]
@classmethod
def clean_input(cls, info: ResolveInfo, instance, data, **kwargs):
diff --git a/saleor/graphql/giftcard/mutations/gift_card_deactivate.py b/saleor/graphql/giftcard/mutations/gift_card_deactivate.py
index e1292aa435..139709cf55 100644
--- a/saleor/graphql/giftcard/mutations/gift_card_deactivate.py
+++ b/saleor/graphql/giftcard/mutations/gift_card_deactivate.py
@@ -3,11 +3,13 @@ import graphene
from ....giftcard import events
from ....giftcard.utils import deactivate_gift_card
from ....permission.enums import GiftcardPermissions
+from ....webhook.event_types import WebhookEventAsyncType
from ...app.dataloaders import get_app_promise
from ...core import ResolveInfo
from ...core.doc_category import DOC_CATEGORY_GIFT_CARDS
from ...core.mutations import BaseMutation
from ...core.types import GiftCardError
+from ...core.utils import WebhookEventInfo
from ...plugins.dataloaders import get_plugin_manager_promise
from ..types import GiftCard
@@ -24,6 +26,12 @@ class GiftCardDeactivate(BaseMutation):
permissions = (GiftcardPermissions.MANAGE_GIFT_CARD,)
error_type_class = GiftCardError
error_type_field = "gift_card_errors"
+ webhook_events_info = [
+ WebhookEventInfo(
+ type=WebhookEventAsyncType.GIFT_CARD_STATUS_CHANGED,
+ description="A gift card was deactivated.",
+ )
+ ]
@classmethod
def perform_mutation( # type: ignore[override]
diff --git a/saleor/graphql/giftcard/mutations/gift_card_delete.py b/saleor/graphql/giftcard/mutations/gift_card_delete.py
index cbf40b56b5..baa9f099b9 100644
--- a/saleor/graphql/giftcard/mutations/gift_card_delete.py
+++ b/saleor/graphql/giftcard/mutations/gift_card_delete.py
@@ -2,10 +2,12 @@ import graphene
from ....giftcard import models
from ....permission.enums import GiftcardPermissions
+from ....webhook.event_types import WebhookEventAsyncType
from ...core import ResolveInfo
from ...core.descriptions import ADDED_IN_31
from ...core.mutations import ModelDeleteMutation
from ...core.types import GiftCardError
+from ...core.utils import WebhookEventInfo
from ...plugins.dataloaders import get_plugin_manager_promise
from ..types import GiftCard
@@ -21,6 +23,12 @@ class GiftCardDelete(ModelDeleteMutation):
permissions = (GiftcardPermissions.MANAGE_GIFT_CARD,)
error_type_class = GiftCardError
error_type_field = "gift_card_errors"
+ webhook_events_info = [
+ WebhookEventInfo(
+ type=WebhookEventAsyncType.GIFT_CARD_DELETED,
+ description="A gift card was deleted.",
+ )
+ ]
@classmethod
def post_save_action(cls, info: ResolveInfo, instance, cleaned_input):
diff --git a/saleor/graphql/giftcard/mutations/gift_card_resend.py b/saleor/graphql/giftcard/mutations/gift_card_resend.py
index 9767bf0e0a..94f4ba194a 100644
--- a/saleor/graphql/giftcard/mutations/gift_card_resend.py
+++ b/saleor/graphql/giftcard/mutations/gift_card_resend.py
@@ -6,12 +6,14 @@ from ....account.models import User
from ....giftcard.error_codes import GiftCardErrorCode
from ....giftcard.notifications import send_gift_card_notification
from ....permission.enums import GiftcardPermissions
+from ....webhook.event_types import WebhookEventAsyncType
from ...app.dataloaders import get_app_promise
from ...core import ResolveInfo
from ...core.descriptions import ADDED_IN_31
from ...core.doc_category import DOC_CATEGORY_GIFT_CARDS
from ...core.mutations import BaseMutation
from ...core.types import BaseInputObjectType, GiftCardError
+from ...core.utils import WebhookEventInfo
from ...plugins.dataloaders import get_plugin_manager_promise
from ..types import GiftCard
from .utils import clean_gift_card
@@ -44,6 +46,12 @@ class GiftCardResend(BaseMutation):
doc_category = DOC_CATEGORY_GIFT_CARDS
permissions = (GiftcardPermissions.MANAGE_GIFT_CARD,)
error_type_class = GiftCardError
+ webhook_events_info = [
+ WebhookEventInfo(
+ type=WebhookEventAsyncType.NOTIFY_USER,
+ description="A notification for gift card resend.",
+ )
+ ]
@classmethod
def clean_input(cls, data):
diff --git a/saleor/graphql/giftcard/mutations/gift_card_update.py b/saleor/graphql/giftcard/mutations/gift_card_update.py
index 826c8d0b9c..2929e8fe1b 100644
--- a/saleor/graphql/giftcard/mutations/gift_card_update.py
+++ b/saleor/graphql/giftcard/mutations/gift_card_update.py
@@ -7,12 +7,14 @@ from ....core.tracing import traced_atomic_transaction
from ....giftcard import events, models
from ....giftcard.error_codes import GiftCardErrorCode
from ....permission.enums import GiftcardPermissions
+from ....webhook.event_types import WebhookEventAsyncType
from ...app.dataloaders import get_app_promise
from ...core import ResolveInfo
from ...core.descriptions import ADDED_IN_31
from ...core.doc_category import DOC_CATEGORY_GIFT_CARDS
from ...core.scalars import PositiveDecimal
from ...core.types import GiftCardError, NonNullList
+from ...core.utils import WebhookEventInfo
from ...core.validators import validate_price_precision
from ...plugins.dataloaders import get_plugin_manager_promise
from ...utils.validators import check_for_duplicates
@@ -48,6 +50,12 @@ class GiftCardUpdate(GiftCardCreate):
permissions = (GiftcardPermissions.MANAGE_GIFT_CARD,)
error_type_class = GiftCardError
error_type_field = "gift_card_errors"
+ webhook_events_info = [
+ WebhookEventInfo(
+ type=WebhookEventAsyncType.GIFT_CARD_UPDATED,
+ description="A gift card was updated.",
+ )
+ ]
@classmethod
def clean_expiry_date(cls, cleaned_input, instance):
diff --git a/saleor/graphql/invoice/mutations/invoice_request.py b/saleor/graphql/invoice/mutations/invoice_request.py
index d7bab0384c..ff4303f1fd 100644
--- a/saleor/graphql/invoice/mutations/invoice_request.py
+++ b/saleor/graphql/invoice/mutations/invoice_request.py
@@ -6,10 +6,12 @@ from ....invoice import events, models
from ....invoice.error_codes import InvoiceErrorCode
from ....order import events as order_events
from ....permission.enums import OrderPermissions
+from ....webhook.event_types import WebhookEventAsyncType
from ...app.dataloaders import get_app_promise
from ...core import ResolveInfo
from ...core.mutations import ModelMutation
from ...core.types import InvoiceError
+from ...core.utils import WebhookEventInfo
from ...order.types import Order
from ...plugins.dataloaders import get_plugin_manager_promise
from ..types import Invoice
@@ -26,6 +28,12 @@ class InvoiceRequest(ModelMutation):
permissions = (OrderPermissions.MANAGE_ORDERS,)
error_type_class = InvoiceError
error_type_field = "invoice_errors"
+ webhook_events_info = [
+ WebhookEventInfo(
+ type=WebhookEventAsyncType.INVOICE_REQUESTED,
+ description="An invoice was requested.",
+ )
+ ]
class Arguments:
order_id = graphene.ID(
diff --git a/saleor/graphql/invoice/mutations/invoice_request_delete.py b/saleor/graphql/invoice/mutations/invoice_request_delete.py
index d76cac9396..9433a667ef 100644
--- a/saleor/graphql/invoice/mutations/invoice_request_delete.py
+++ b/saleor/graphql/invoice/mutations/invoice_request_delete.py
@@ -3,10 +3,12 @@ import graphene
from ....core import JobStatus
from ....invoice import events, models
from ....permission.enums import OrderPermissions
+from ....webhook.event_types import WebhookEventAsyncType
from ...app.dataloaders import get_app_promise
from ...core import ResolveInfo
from ...core.mutations import ModelMutation
from ...core.types import InvoiceError
+from ...core.utils import WebhookEventInfo
from ...plugins.dataloaders import get_plugin_manager_promise
from ..types import Invoice
@@ -24,6 +26,12 @@ class InvoiceRequestDelete(ModelMutation):
permissions = (OrderPermissions.MANAGE_ORDERS,)
error_type_class = InvoiceError
error_type_field = "invoice_errors"
+ webhook_events_info = [
+ WebhookEventInfo(
+ type=WebhookEventAsyncType.INVOICE_DELETED,
+ description="An invoice was requested to delete.",
+ )
+ ]
@classmethod
def perform_mutation( # type: ignore[override]
diff --git a/saleor/graphql/invoice/mutations/invoice_send_notification.py b/saleor/graphql/invoice/mutations/invoice_send_notification.py
index 81865c8dca..fa56b652c1 100644
--- a/saleor/graphql/invoice/mutations/invoice_send_notification.py
+++ b/saleor/graphql/invoice/mutations/invoice_send_notification.py
@@ -9,10 +9,12 @@ from ....invoice import models
from ....invoice.error_codes import InvoiceErrorCode
from ....invoice.notifications import send_invoice
from ....permission.enums import OrderPermissions
+from ....webhook.event_types import WebhookEventAsyncType
from ...app.dataloaders import get_app_promise
from ...core import ResolveInfo
from ...core.mutations import ModelMutation
from ...core.types import InvoiceError
+from ...core.utils import WebhookEventInfo
from ...plugins.dataloaders import get_plugin_manager_promise
from ..types import Invoice
@@ -28,6 +30,16 @@ class InvoiceSendNotification(ModelMutation):
permissions = (OrderPermissions.MANAGE_ORDERS,)
error_type_class = InvoiceError
error_type_field = "invoice_errors"
+ webhook_events_info = [
+ WebhookEventInfo(
+ type=WebhookEventAsyncType.INVOICE_SENT,
+ description="A notification for invoice send",
+ ),
+ WebhookEventInfo(
+ type=WebhookEventAsyncType.NOTIFY_USER,
+ description="A notification for invoice send",
+ ),
+ ]
@classmethod
def clean_instance(cls, _info: ResolveInfo, instance):
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 08900ee986..38b29e3049 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -15562,6 +15562,9 @@ type Mutation {
Request an invoice for the order using plugin.
Requires one of the following permissions: MANAGE_ORDERS.
+
+ Triggers the following webhook events:
+ - INVOICE_REQUESTED (async): An invoice was requested.
"""
invoiceRequest(
"""Invoice number, if not provided it will be generated."""
@@ -15569,17 +15572,20 @@ type Mutation {
"""ID of the order related to invoice."""
orderId: ID!
- ): InvoiceRequest @doc(category: "Orders")
+ ): InvoiceRequest @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [INVOICE_REQUESTED], syncEvents: [])
"""
Requests deletion of an invoice.
Requires one of the following permissions: MANAGE_ORDERS.
+
+ Triggers the following webhook events:
+ - INVOICE_DELETED (async): An invoice was requested to delete.
"""
invoiceRequestDelete(
"""ID of an invoice to request the deletion."""
id: ID!
- ): InvoiceRequestDelete @doc(category: "Orders")
+ ): InvoiceRequestDelete @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [INVOICE_DELETED], syncEvents: [])
"""
Creates a ready to send invoice.
@@ -15621,31 +15627,42 @@ type Mutation {
Send an invoice notification to the customer.
Requires one of the following permissions: MANAGE_ORDERS.
+
+ Triggers the following webhook events:
+ - INVOICE_SENT (async): A notification for invoice send
+ - NOTIFY_USER (async): A notification for invoice send
"""
invoiceSendNotification(
"""ID of an invoice to be sent."""
id: ID!
- ): InvoiceSendNotification @doc(category: "Orders")
+ ): InvoiceSendNotification @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [INVOICE_SENT, NOTIFY_USER], syncEvents: [])
"""
Activate a gift card.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+ Triggers the following webhook events:
+ - GIFT_CARD_STATUS_CHANGED (async): A gift card was activated.
"""
giftCardActivate(
"""ID of a gift card to activate."""
id: ID!
- ): GiftCardActivate @doc(category: "Gift cards")
+ ): GiftCardActivate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_STATUS_CHANGED], syncEvents: [])
"""
Creates a new gift card.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+ Triggers the following webhook events:
+ - GIFT_CARD_CREATED (async): A gift card was created.
+ - NOTIFY_USER (async): A notification for created gift card.
"""
giftCardCreate(
"""Fields required to create a gift card."""
input: GiftCardCreateInput!
- ): GiftCardCreate @doc(category: "Gift cards")
+ ): GiftCardCreate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_CREATED, NOTIFY_USER], syncEvents: [])
"""
Delete gift card.
@@ -15653,26 +15670,35 @@ type Mutation {
Added in Saleor 3.1.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+ Triggers the following webhook events:
+ - GIFT_CARD_DELETED (async): A gift card was deleted.
"""
giftCardDelete(
"""ID of the gift card to delete."""
id: ID!
- ): GiftCardDelete @doc(category: "Gift cards")
+ ): GiftCardDelete @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_DELETED], syncEvents: [])
"""
Deactivate a gift card.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+ Triggers the following webhook events:
+ - GIFT_CARD_STATUS_CHANGED (async): A gift card was deactivated.
"""
giftCardDeactivate(
"""ID of a gift card to deactivate."""
id: ID!
- ): GiftCardDeactivate @doc(category: "Gift cards")
+ ): GiftCardDeactivate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_STATUS_CHANGED], syncEvents: [])
"""
Update a gift card.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+ Triggers the following webhook events:
+ - GIFT_CARD_UPDATED (async): A gift card was updated.
"""
giftCardUpdate(
"""ID of a gift card to update."""
@@ -15680,7 +15706,7 @@ type Mutation {
"""Fields required to update a gift card."""
input: GiftCardUpdateInput!
- ): GiftCardUpdate @doc(category: "Gift cards")
+ ): GiftCardUpdate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_UPDATED], syncEvents: [])
"""
Resend a gift card.
@@ -15688,11 +15714,14 @@ type Mutation {
Added in Saleor 3.1.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+ Triggers the following webhook events:
+ - NOTIFY_USER (async): A notification for gift card resend.
"""
giftCardResend(
"""Fields required to resend a gift card."""
input: GiftCardResendInput!
- ): GiftCardResend @doc(category: "Gift cards")
+ ): GiftCardResend @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [NOTIFY_USER], syncEvents: [])
"""
Adds note to the gift card.
@@ -15700,6 +15729,9 @@ type Mutation {
Added in Saleor 3.1.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+ Triggers the following webhook events:
+ - GIFT_CARD_UPDATED (async): A gift card was updated.
"""
giftCardAddNote(
"""ID of the gift card to add a note for."""
@@ -15707,7 +15739,7 @@ type Mutation {
"""Fields required to create a note for the gift card."""
input: GiftCardAddNoteInput!
- ): GiftCardAddNote @doc(category: "Gift cards")
+ ): GiftCardAddNote @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_UPDATED], syncEvents: [])
"""
Create gift cards.
@@ -15715,11 +15747,15 @@ type Mutation {
Added in Saleor 3.1.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+ Triggers the following webhook events:
+ - GIFT_CARD_CREATED (async): A gift card was created.
+ - NOTIFY_USER (async): A notification for created gift card.
"""
giftCardBulkCreate(
"""Fields required to create gift cards."""
input: GiftCardBulkCreateInput!
- ): GiftCardBulkCreate @doc(category: "Gift cards")
+ ): GiftCardBulkCreate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_CREATED, NOTIFY_USER], syncEvents: [])
"""
Delete gift cards.
@@ -15727,11 +15763,14 @@ type Mutation {
Added in Saleor 3.1.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+ Triggers the following webhook events:
+ - GIFT_CARD_DELETED (async): A gift card was deleted.
"""
giftCardBulkDelete(
"""List of gift card IDs to delete."""
ids: [ID!]!
- ): GiftCardBulkDelete @doc(category: "Gift cards")
+ ): GiftCardBulkDelete @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_DELETED], syncEvents: [])
"""
Activate gift cards.
@@ -15739,11 +15778,14 @@ type Mutation {
Added in Saleor 3.1.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+ Triggers the following webhook events:
+ - GIFT_CARD_STATUS_CHANGED (async): A gift card was activated.
"""
giftCardBulkActivate(
"""List of gift card IDs to activate."""
ids: [ID!]!
- ): GiftCardBulkActivate @doc(category: "Gift cards")
+ ): GiftCardBulkActivate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_STATUS_CHANGED], syncEvents: [])
"""
Deactivate gift cards.
@@ -15751,11 +15793,14 @@ type Mutation {
Added in Saleor 3.1.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+ Triggers the following webhook events:
+ - GIFT_CARD_STATUS_CHANGED (async): A gift card was deactivated.
"""
giftCardBulkDeactivate(
"""List of gift card IDs to deactivate."""
ids: [ID!]!
- ): GiftCardBulkDeactivate @doc(category: "Gift cards")
+ ): GiftCardBulkDeactivate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_STATUS_CHANGED], syncEvents: [])
"""
Update plugin configuration.
@@ -23949,8 +23994,11 @@ input MenuItemMoveInput {
Request an invoice for the order using plugin.
Requires one of the following permissions: MANAGE_ORDERS.
+
+Triggers the following webhook events:
+- INVOICE_REQUESTED (async): An invoice was requested.
"""
-type InvoiceRequest @doc(category: "Orders") {
+type InvoiceRequest @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [INVOICE_REQUESTED], syncEvents: []) {
"""Order related to an invoice."""
order: Order
invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")
@@ -23987,8 +24035,11 @@ enum InvoiceErrorCode @doc(category: "Orders") {
Requests deletion of an invoice.
Requires one of the following permissions: MANAGE_ORDERS.
+
+Triggers the following webhook events:
+- INVOICE_DELETED (async): An invoice was requested to delete.
"""
-type InvoiceRequestDelete @doc(category: "Orders") {
+type InvoiceRequestDelete @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [INVOICE_DELETED], syncEvents: []) {
invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")
errors: [InvoiceError!]!
invoice: Invoice
@@ -24075,8 +24126,12 @@ input UpdateInvoiceInput @doc(category: "Orders") {
Send an invoice notification to the customer.
Requires one of the following permissions: MANAGE_ORDERS.
+
+Triggers the following webhook events:
+- INVOICE_SENT (async): A notification for invoice send
+- NOTIFY_USER (async): A notification for invoice send
"""
-type InvoiceSendNotification @doc(category: "Orders") {
+type InvoiceSendNotification @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [INVOICE_SENT, NOTIFY_USER], syncEvents: []) {
invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")
errors: [InvoiceError!]!
invoice: Invoice
@@ -24086,8 +24141,11 @@ type InvoiceSendNotification @doc(category: "Orders") {
Activate a gift card.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+Triggers the following webhook events:
+- GIFT_CARD_STATUS_CHANGED (async): A gift card was activated.
"""
-type GiftCardActivate @doc(category: "Gift cards") {
+type GiftCardActivate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_STATUS_CHANGED], syncEvents: []) {
"""Activated gift card."""
giftCard: GiftCard
giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")
@@ -24126,8 +24184,12 @@ enum GiftCardErrorCode @doc(category: "Gift cards") {
Creates a new gift card.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+Triggers the following webhook events:
+- GIFT_CARD_CREATED (async): A gift card was created.
+- NOTIFY_USER (async): A notification for created gift card.
"""
-type GiftCardCreate @doc(category: "Gift cards") {
+type GiftCardCreate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_CREATED, NOTIFY_USER], syncEvents: []) {
giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")
errors: [GiftCardError!]!
giftCard: GiftCard
@@ -24211,8 +24273,11 @@ Delete gift card.
Added in Saleor 3.1.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+Triggers the following webhook events:
+- GIFT_CARD_DELETED (async): A gift card was deleted.
"""
-type GiftCardDelete @doc(category: "Gift cards") {
+type GiftCardDelete @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_DELETED], syncEvents: []) {
giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")
errors: [GiftCardError!]!
giftCard: GiftCard
@@ -24222,8 +24287,11 @@ type GiftCardDelete @doc(category: "Gift cards") {
Deactivate a gift card.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+Triggers the following webhook events:
+- GIFT_CARD_STATUS_CHANGED (async): A gift card was deactivated.
"""
-type GiftCardDeactivate @doc(category: "Gift cards") {
+type GiftCardDeactivate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_STATUS_CHANGED], syncEvents: []) {
"""Deactivated gift card."""
giftCard: GiftCard
giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")
@@ -24234,8 +24302,11 @@ type GiftCardDeactivate @doc(category: "Gift cards") {
Update a gift card.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+Triggers the following webhook events:
+- GIFT_CARD_UPDATED (async): A gift card was updated.
"""
-type GiftCardUpdate @doc(category: "Gift cards") {
+type GiftCardUpdate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_UPDATED], syncEvents: []) {
giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")
errors: [GiftCardError!]!
giftCard: GiftCard
@@ -24291,8 +24362,11 @@ Resend a gift card.
Added in Saleor 3.1.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+Triggers the following webhook events:
+- NOTIFY_USER (async): A notification for gift card resend.
"""
-type GiftCardResend @doc(category: "Gift cards") {
+type GiftCardResend @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [NOTIFY_USER], syncEvents: []) {
"""Gift card which has been sent."""
giftCard: GiftCard
errors: [GiftCardError!]!
@@ -24315,8 +24389,11 @@ Adds note to the gift card.
Added in Saleor 3.1.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+Triggers the following webhook events:
+- GIFT_CARD_UPDATED (async): A gift card was updated.
"""
-type GiftCardAddNote @doc(category: "Gift cards") {
+type GiftCardAddNote @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_UPDATED], syncEvents: []) {
"""Gift card with the note added."""
giftCard: GiftCard
@@ -24336,8 +24413,12 @@ Create gift cards.
Added in Saleor 3.1.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+Triggers the following webhook events:
+- GIFT_CARD_CREATED (async): A gift card was created.
+- NOTIFY_USER (async): A notification for created gift card.
"""
-type GiftCardBulkCreate @doc(category: "Gift cards") {
+type GiftCardBulkCreate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_CREATED, NOTIFY_USER], syncEvents: []) {
"""Returns how many objects were created."""
count: Int!
@@ -24369,8 +24450,11 @@ Delete gift cards.
Added in Saleor 3.1.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+Triggers the following webhook events:
+- GIFT_CARD_DELETED (async): A gift card was deleted.
"""
-type GiftCardBulkDelete @doc(category: "Gift cards") {
+type GiftCardBulkDelete @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_DELETED], syncEvents: []) {
"""Returns how many objects were affected."""
count: Int!
errors: [GiftCardError!]!
@@ -24382,8 +24466,11 @@ Activate gift cards.
Added in Saleor 3.1.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+Triggers the following webhook events:
+- GIFT_CARD_STATUS_CHANGED (async): A gift card was activated.
"""
-type GiftCardBulkActivate @doc(category: "Gift cards") {
+type GiftCardBulkActivate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_STATUS_CHANGED], syncEvents: []) {
"""Returns how many objects were affected."""
count: Int!
errors: [GiftCardError!]!
@@ -24395,8 +24482,11 @@ Deactivate gift cards.
Added in Saleor 3.1.
Requires one of the following permissions: MANAGE_GIFT_CARD.
+
+Triggers the following webhook events:
+- GIFT_CARD_STATUS_CHANGED (async): A gift card was deactivated.
"""
-type GiftCardBulkDeactivate @doc(category: "Gift cards") {
+type GiftCardBulkDeactivate @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [GIFT_CARD_STATUS_CHANGED], syncEvents: []) {
"""Returns how many objects were affected."""
count: Int!
errors: [GiftCardError!]!