Create a subscription (returns the signing secret ONCE)
POST
/admin/v1/webhooks/subscriptions
const url = 'https://your-store.example.com/admin/v1/webhooks/subscriptions';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"url":"https://example.com","events":["order.created"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://your-store.example.com/admin/v1/webhooks/subscriptions \ --header 'Content-Type: application/json' \ --data '{ "url": "https://example.com", "events": [ "order.created" ] }'Request Body required
Section titled “Request Body required ” Media type application/json
object
url
required
string format: uri
events
required
Array<string>