> ## Documentation Index
> Fetch the complete documentation index at: https://sendcloud.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Integration connected

> A request is sent to the defined webhook whenever the integration is created within our system.

<Warning>
  **API v2 is entering maintenance mode.** New users should start with API v3 to access our latest features and improved performance. Already using v2? Don't worry, your current integration remains fully functional. Read more about [maintenance mode](/docs/getting-started/api-version-guide), or check out the [migration guide for API v3](/docs/getting-started/migration-guidelines-for-api-v3).
</Warning>


## OpenAPI

````yaml /.openapi/v2/webhooks/openapi.yaml webhook IntegrationConnected
openapi: 3.1.0
info:
  title: Webhooks
  version: 2.0.0
  description: >-
    Sendcloud is able to actively communicate updates in a parcel (such as
    updates in the delivery status) to your application using webhooks.


    You should specify an JSON API endpoint in which Sendcloud will make
    requests to, whenever a change occurs. You can set this using the
    webhook_url field in your integration settings in Sendcloud.


    To verify a request is coming from Sendcloud, Sendcloud is signing each
    request that we send to your endpoint using a HMAC signature (Hash-based
    Message Authentication Code) with SHA256 algorithm and the `Secret Key` or
    the `Webhook Signature Key` as secret, depending on your integration type.


    For your store to validate that the webhook is coming from us, you should
    hash the message received from us using your secret and compare against the
    Sendcloud-Signature header received from us.


    ```php

    <?php

    // From example:

    // $data = "{\"key\": \"value\"}";

    // $secret_key = "secretkey";

    // hashed data from example:
    1eed4b3d41f4653ac64fd56f1bf1cbfd349e4482cbc11dff7134bd93e5da4b0a

    $secret_key = "secretkey";

    $data = $_POST;

    $Sendcloud_Signature = apache_request_headers()['Sendcloud-Signature'];

    $hashed_signature = hash_hmac ( "sha256" , $data , $secret_key );

    // You can compare the hashed signature from example with the one you can
    hash yourself using the example $data variable.

    assert("1eed4b3d41f4653ac64fd56f1bf1cbfd349e4482cbc11dff7134bd93e5da4b0a" ==
    $hashed_signature);

    ```


    ```python

    import hmac

    import json


    data = {'key': 'value'}

    message = json.dumps(data)

    signature = hmac.new(key='secretkey'.encode('utf-8'),
    msg=message.encode('utf-8'), digestmod='sha256')

    signature.hexdigest()


    > '1eed4b3d41f4653ac64fd56f1bf1cbfd349e4482cbc11dff7134bd93e5da4b0a'

    ```


    **To receive the parcel data for every update that happens in a parcel, you
    need to:**

    - Visit your Integration settings within the Sendcloud platform.

    - Enable the webhook feedback checkbox.

    - Set the webhook url to your application that will process the data
    received. * You can also test if the webhook works by sending a test webhook
    to your application by clicking on “Test API Webhook” button.

    - Save the shop settings.


    **Additional notes:**

    - Please note that the data your application will receive is the same as the
    payload you would get when retrieving information about a specific parcel.

    - If for any reason the call to your webhook fails, Sendcloud will retry
    sending the update 10 times with an exponential delay. Starting with a 5
    minute delay, and a maximum delay of 1 hour between retries. If after 10
    tries, the call is still failing, Sendcloud will stop trying, and report the
    issue to your Failed Request logs.

    - Because your shop might be unreachable for some time, the webhook arrival
    order might be scattered (unordered) which is why each webhook includes a
    timestamp which can be used to identify which webhook is the later one.

    - For return parcels, you will receive webhook updates only if the outgoing
    shipment was created through the API Shop.
  contact:
    name: Sendcloud API Support
    url: https://www.sendcloud.dev
    email: contact@sendcloud.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://www.shop_url.com/webhook
    description: User API endpoint
security:
  - Sendcloud-Signature: []
tags:
  - name: Webhooks
paths: {}
components:
  securitySchemes:
    Sendcloud-Signature:
      name: Sendcloud-Signature
      type: apiKey
      in: header

````