Update subscriptions

You can make changes on existing subscriptions.

Prerequisites

  • Make sure that the authorisation is working.
  • Make sure that the destination URL on your server is up and running.

Step 1: Retrieve the subscription UUID

  1. Retrieve all existing subscriptions.
1
GET /organizations/{organizationUuid}/subscriptions
Example: The following example retrieves all subscriptions for the organization with UUID a3931584-82b2-4873-a32f-12b254d43539.
1
GET /organizations/a3931584-82b2-4873-a32f-12b254d43539/subscriptions
  1. Copy and save the UUID of the subscription that you want to update. It will be used for updating subscription.

Step 2: Update a subscription

  1. Send a PUT request to update a subscription. In the request, subscriptionUuid is the version 1 UUID that you retrieved in Step 1: Retrieve the subscription UUID.
1
PUT /organizations/{organizationUuid}/subscriptions/{subscriptionUuid}
1
{
2
"eventNames": ["<event names>"],
3
"destination": "<URL to receive events>",
4
"contactEmail": "<email to receive notifications>"
5
}
Example: The following example updates the subscription ef64c5e2-4e16-11e8-9c2d-fa7ae01bbebc and subscribes to event ProductCreated and PurchaseCreated.
1
PUT /organizations/self/subscriptions/ef64c5e2-4e16-11e8-9c2d-fa7ae01bbebc
1
{
2
"eventNames": ["ProductCreated", "PurchaseCreated"],
3
"destination": "https://yoururl.domain",
4
"contactEmail": "email_if_it_breaks@domain.com"
5
}
  1. Check that the response returns with an HTTP status code 200 OK.
    • If yes, the subscription is updated successfully.
    • If no, update the PUT request according to the error message. For more information on error messages, see HTTP status code.