Queries and mutations for managing Subscriptions in the platform.

Queries

Query Subscriptions

QUERYsubscriptions
Arguments
where​
String​
sort​
Array of String​
limit​
Int​
offset​
Int​

Get Subscription

QUERYsubscription
Arguments
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

Mutations

Create Subscription

MUTATIONcreateSubscription
Arguments
draft​

Update Subscription

MUTATIONupdateSubscription
Arguments
version​
Long​
actions​
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

Delete Subscription

MUTATIONdeleteSubscription
Arguments
version​
Long​
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

Output types

CommercetoolsSubscription

This type is equivalent to Subscription in REST.
key​
String​
destination​
messages​
changes​
Array of ChangeSubscription​
events​
Array of EventSubscription​
format​
Can be ConfigurationError, ConfigurationErrorDeliveryStopped, Healthy, ManuallySuspended, or TemporaryError​
id​
String​
version​
Long​
createdAt​
lastModifiedAt​
createdBy​
lastModifiedBy​

CommercetoolsSubscriptionQueryResult

offset​
Int​
count​
Int​
total​
Long​
exists​
Boolean​
results​

ChangeSubscription

Notification about changes to a resource. The payload format differs for resource creation, update, and deletion.
resourceTypeId​
String​
Unique identifier for the type of resource, for example, order.

EventSubscription

For EventSubscription, the format of the payload is custom for each specific notification.

resourceTypeId​
String​

Unique identifier for the type of resource.

types​
Array of String​
Must contain valid event types for the resource. For example, for resource type import-api the event type ImportContainerCreated is valid. If no types are given, the Subscription will receive all events for the defined resource type.

MessageSubscription

In GraphQL, resourceTypeId is a String, not an enum. For MessageSubscription, it accepts the values listed in MessageSubscriptionResourceTypeId. The same applies to ChangeSubscription with ChangeSubscriptionResourceTypeId, and to EventSubscription with EventSubscriptionResourceTypeId.
Messages will be delivered even if the Messages API is not enabled.
For MessageSubscriptions, the format of the payload is MessageDeliveryPayload.
resourceTypeId​
String​
Unique identifier for the type of resource, for example, order.
types​
Array of String​
Must contain valid message types for the resource. For example, for resource type product the message type ProductPublished is valid. If no types of messages are given, the Subscription will receive all messages for this resource.

SubscriptionHealthStatus

ConfigurationError
ConfigurationErrorDeliveryStopped
Healthy
ManuallySuspended
TemporaryError

AwsAuthenticationMode

Credentials
IAM

Destination

type​
String​

SQSDestination

queueUrl​
String​
accessKey​
String​
accessSecret​
String​
region​
String​
authenticationMode​
Can be Credentials, or IAM​
type​
String​

SNSDestination

topicArn​
String​
accessKey​
String​
accessSecret​
String​
authenticationMode​
Can be Credentials, or IAM​
type​
String​

EventBridgeDestination

AWS EventBridge can be used to push events and messages to a serverless event bus that can forward them to AWS SQS, SNS, Lambda, and other AWS services based on forwarding rules. Once the Subscription is created, an equivalent "partner event source" is created in AWS EventBridge. This event source must be associated with an event bus for the Subscription setup to be complete.
source​
String​

URN for the EventBridge destination.

region​
String​

AWS region that receives the events.

accountId​
String​

ID of the AWS account that receives the events.

type​
String​

AzureServiceBusDestination

GoogleCloudPubSubDestination

ConfluentCloudDestination

This destination can be used to push notifications to Confluent Cloud. To set up a Subscription of this type, first, create a topic in Confluent Cloud. Then, to allow Composable Commerce to push notifications to your topic, generate API keys for your topic, and create the Subscription destination using the generated credentials.
The Composable Commerce producer uses the following values: SASL_SSL forsecurity.protocol, PLAIN forsasl.mechanism, and the default value (1048576) for max.request.size.
bootstrapServer​
String​
URL to the bootstrap server including the port number in the format <xxxxx>.<region>.<provider>.confluent.cloud:9092.
apiKey​
String​

Partially hidden on retrieval for security reasons.

apiSecret​
String​

Partially hidden on retrieval for security reasons.

acks​
String​
The Kafka acks value.
topic​
String​

The name of the topic.

key​
String​

The Kafka record key.

type​
String​

EventGridDestination

uri​
String​
accessKey​
String​
type​
String​

NotificationFormat

type​
String​

PlatformFormat

The PlatformFormat uses constructs that are similar to the ones used in the REST API, for example, on the Messages API.
type​
String​

CloudEventsSubscriptionsFormat

type​
String​
cloudEventsVersion​
String​

Input types

SubscriptionDraft

Either messages, changes, or events must be set.
key​
String​

User-defined unique identifier for the Subscription.

destination​

Messaging service to which the notifications are sent.

messages​

Messages to be subscribed to.

changes​

Changes to be subscribed to.

events​

Events to be subscribed to.

format​
Format in which the payload is delivered. When not provided, the PlatformFormat is selected by default.

ChangeSubscriptionInput

resourceTypeId​
String​

EventSubscriptionInput

resourceTypeId​
String​
types​
Array of String​

MessageSubscriptionInput

resourceTypeId​
String​
types​
Array of String​

DestinationInput

REST identifies the destination with a type field. In GraphQL, the input has one field per destination type instead: SQS, SNS, AzureServiceBus, EventGrid, GoogleCloudPubSub, EventBridge, and ConfluentCloud. These names match the type values of Destination in REST. The deprecated IronMQ destination isn't available in GraphQL.
SQS​
SNS​
AzureServiceBus​
EventGrid​
GoogleCloudPubSub​
EventBridge​
ConfluentCloud​

SQSDestinationInput

queueUrl​
String​
accessKey​
String​
accessSecret​
String​
region​
String​
authenticationMode​
Can be Credentials, or IAM​Default: Credentials​

SNSDestinationInput

topicArn​
String​
accessKey​
String​
accessSecret​
String​
authenticationMode​
Can be Credentials, or IAM​Default: Credentials​

EventBridgeDestinationInput

region​
String​
accountId​
String​

AzureServiceBusDestinationInput

connectionString​
String​

GoogleCloudPubSubDestinationInput

projectId​
String​
topic​
String​

ConfluentCloudDestinationInput

bootstrapServer​
String​
apiKey​
String​
apiSecret​
String​
acks​
String​
topic​
String​
key​
String​

EventGridDestinationInput

uri​
String​
accessKey​
String​

SubscriptionFormatInput

Platform​
CloudEvents​

PlatformFormatInput

dummy​
String​

CloudEventsSubscriptionsFormatInput

cloudEventsVersion​
String​

SubscriptionUpdateAction

changeDestination​
setChanges​
setEvents​
setKey​
setMessages​

Update actions

Change Destination

destination​

Set Changes

changes​

Set Events

events​

Set Key

key​
String​

Set Messages

messages​