Magento 2 Integration - Webhook Endpoint

Subscribe Pro sends webhooks to your Magento 2 instance in order to keep saved credit cards (payment profiles) in sync.

We do this because Magento 2 requires tokenized customer payment data to be stored in its database. Our M2 extension sends updates from Magento to Subscribe Pro. This webhook is needed to send updates the other way, from Subscribe Pro to Magento.

To set this, configure Subscribe Pro to point to the Webhook Endpoint which is hosted on your Magento 2 server.

Webhook Endpoint Configuration

To set up a webhook endpoint, navigate in the Subscribe Pro Merchant App to System > Webhook Endpoints.

  1. Click New to create a new endpoint.

    New Webhook Endpoint

  2. Note the Shared Secret and save it to be entered in the Magento admin later in the process.

  3. On that page, enter the following into the URL box: https://{}/subscribepro/webhook

    You will need to replace {} with the correct base domain name for your Magento installation. This is most likely the same as the URL configured in System > Configuration > Store Connection Settings.

  4. Uncheck the "Subscribe To All Event Types" box, and then uncheck each of the boxes under Subscribe To Specific Event Types heading, except payment_profile.created, payment_profile.updated, and payment_profile.redacted.

  5. Click Save. This will store the new record and return to you to the Webhook Endpoints list page.

  6. You will need to click the "Enable" button under Actions.

    Enable Webhook Endpoint

  7. Configure shared secret in Magento 2.

    Sign into Magento, and go to Stores > Configuration. Be sure to select your preferred configuration scope. Expand the Swarming section, and click on Subscribe Pro.

    Expand the Advanced section and un-check the Use Default checkbox next to Webhook Secret Key. Paste in the shared secret key value obtained from the Subscribe Pro Merchant App Webhook Endpoint.

    Finally, click Save Config.

    Webhook Security

  8. You can use the "Ping" button under Actions to send a test request to the endpoint and make sure that it responds successfully.

  9. You can also confirm that the endpoint is working successfully with organic requests as change are made to payment profiles in Subscribe Pro by going to System > Webhook Event Log and seeing that the rows show "Delivered".

    Webhook Endpoint Logs

If you have any questions or issues setting up the endpoint, please contact [email protected].