app webhook triggercommand
Triggers the delivery of a sample Admin API event topic payload to a designated address.
You should use this command to experiment with webhooks, to initially test your webhook configuration, or for unit testing. However, to test your webhook configuration from end to end, you should always trigger webhooks by performing the related action in Shopify.
Because most webhook deliveries use remote endpoints, you can trigger the command from any directory where you can use Shopify CLI, and send the webhook to any of the supported endpoint types. For example, you can run the command from your app's local directory, but send the webhook to a staging environment endpoint.
To learn more about using webhooks in a Shopify app, refer to Webhooks overview.
Limitations
- Webhooks triggered using this method always have the same payload, so they can't be used to test scenarios that differ based on the payload contents.
- Webhooks triggered using this method aren't retried when they fail.
- Trigger requests are rate-limited using the Partner API rate limit.
- You can't use this method to validate your API webhook subscriptions.
Anchor to flagsFlags
The following flags are available for the app webhook trigger
command:
- Anchor to --address <value>--address <value>stringenv: SHOPIFY_FLAG_ADDRESS
The URL where the webhook payload should be sent. You will need a different address type for each delivery-method: · For remote HTTP testing, use a URL that starts with https:// · For local HTTP testing, use http://localhost:{port}/{url-path} · For Google Pub/Sub, use pubsub://{project-id}:{topic-id} · For Amazon EventBridge, use an Amazon Resource Name (ARN) starting with arn:aws:events:
- Anchor to --api-version <value>--api-version <value>stringenv: SHOPIFY_FLAG_API_VERSION
The API Version of the webhook topic.
- Anchor to --client-id <value>--client-id <value>stringenv: SHOPIFY_FLAG_CLIENT_ID
The Client ID of your app.
- Anchor to --client-secret <value>--client-secret <value>stringenv: SHOPIFY_FLAG_CLIENT_SECRET
Your app's client secret. This secret allows us to return the X-Shopify-Hmac-SHA256 header that lets you validate the origin of the response that you receive.
- Anchor to --delivery-method <value>--delivery-method <value>stringenv: SHOPIFY_FLAG_DELIVERY_METHOD
Method chosen to deliver the topic payload. If not passed, it's inferred from the address.
- Anchor to --help--helpenv: SHOPIFY_FLAG_HELP
This help. When you run the trigger command the CLI will prompt you for any information that isn't passed using flags.
- Anchor to --path <value>--path <value>stringenv: SHOPIFY_FLAG_PATH
The path to your app directory.
- Anchor to --reset--resetenv: SHOPIFY_FLAG_RESET
Reset all your settings.
- stringenv: SHOPIFY_FLAG_SHARED_SECRET
Deprecated. Please use client-secret.
- Anchor to --topic <value>--topic <value>stringenv: SHOPIFY_FLAG_TOPIC
The requested webhook topic.
- Anchor to -c, --config <value>-c, --config <value>stringenv: SHOPIFY_FLAG_APP_CONFIG
The name of the app configuration.
appwebhooktrigger
- --address <value>
The URL where the webhook payload should be sent. You will need a different address type for each delivery-method: · For remote HTTP testing, use a URL that starts with https:// · For local HTTP testing, use http://localhost:{port}/{url-path} · For Google Pub/Sub, use pubsub://{project-id}:{topic-id} · For Amazon EventBridge, use an Amazon Resource Name (ARN) starting with arn:aws:events:
string
- --api-version <value>
The API Version of the webhook topic.
string
- --client-id <value>
The Client ID of your app.
string
- --client-secret <value>
Your app's client secret. This secret allows us to return the X-Shopify-Hmac-SHA256 header that lets you validate the origin of the response that you receive.
string
- --delivery-method <value>
Method chosen to deliver the topic payload. If not passed, it's inferred from the address.
string
- --help
This help. When you run the trigger command the CLI will prompt you for any information that isn't passed using flags.
""
- --path <value>
The path to your app directory.
string
- --reset
Reset all your settings.
""
- --shared-secret <value>
Deprecated. Please use client-secret.
string
- --topic <value>
The requested webhook topic.
string
- -c, --config <value>
The name of the app configuration.
string
export interface appwebhooktrigger {
/**
* The URL where the webhook payload should be sent.
You will need a different address type for each delivery-method:
· For remote HTTP testing, use a URL that starts with https://
· For local HTTP testing, use http://localhost:{port}/{url-path}
· For Google Pub/Sub, use pubsub://{project-id}:{topic-id}
· For Amazon EventBridge, use an Amazon Resource Name (ARN) starting with arn:aws:events:
* @environment SHOPIFY_FLAG_ADDRESS
*/
'--address <value>'?: string
/**
* The API Version of the webhook topic.
* @environment SHOPIFY_FLAG_API_VERSION
*/
'--api-version <value>'?: string
/**
* The Client ID of your app.
* @environment SHOPIFY_FLAG_CLIENT_ID
*/
'--client-id <value>'?: string
/**
* Your app's client secret. This secret allows us to return the X-Shopify-Hmac-SHA256 header that lets you validate the origin of the response that you receive.
* @environment SHOPIFY_FLAG_CLIENT_SECRET
*/
'--client-secret <value>'?: string
/**
* The name of the app configuration.
* @environment SHOPIFY_FLAG_APP_CONFIG
*/
'-c, --config <value>'?: string
/**
* Method chosen to deliver the topic payload. If not passed, it's inferred from the address.
* @environment SHOPIFY_FLAG_DELIVERY_METHOD
*/
'--delivery-method <value>'?: string
/**
* This help. When you run the trigger command the CLI will prompt you for any information that isn't passed using flags.
* @environment SHOPIFY_FLAG_HELP
*/
'--help'?: ''
/**
* The path to your app directory.
* @environment SHOPIFY_FLAG_PATH
*/
'--path <value>'?: string
/**
* Reset all your settings.
* @environment SHOPIFY_FLAG_RESET
*/
'--reset'?: ''
/**
* Deprecated. Please use client-secret.
* @environment SHOPIFY_FLAG_SHARED_SECRET
*/
'--shared-secret <value>'?: string
/**
* The requested webhook topic.
* @environment SHOPIFY_FLAG_TOPIC
*/
'--topic <value>'?: string
}
App webhook trigger
examples
app webhook trigger
app webhook trigger
shopify app webhook trigger [flags]