# Configure a webhook or Cloud Code module for purchase fulfillment

> Configure your entitlement delivery options in the Unity Dashboard to define how you grant purchases to your players.

Unity IAP manages entitlements for off-platform payment providers, similar to how Apple and Google handle entitlements for their stores. If you need to sync purchases with your backend or use server-authoritative entitlements, you can optionally configure a webhook or Cloud Code module to receive purchase events.

## Configure a webhook

To configure a webhook in the [Unity Dashboard](https://cloud.unity.com/home/organizations/default/projects/default/environments/default/in-app-purchase/payment-providers):

1. Select **Payment Providers** > **Entitlement Delivery Method**.
2. Select the **Your own server webhooks** option and enter your webhook URL.
3. Select **Save Configuration**.

For more information, refer to [Fulfill purchases through the backend API](./implement-backend.md).

## Configure a Cloud Code module

Configure your project to receive purchase information from your Cloud Code module in the Unity Dashboard:

1. In the [Unity Dashboard](https://cloud.unity.com), select **IAP** > **Payment Providers**.
2. Under Entitlement Delivery Method, select **Edit**.
3. Select the **Cloud Code module** option and then select your module and endpoint from the dropdowns.
4. Select **Save Configuration**.

For more information, refer to [Implement a Cloud Code module to fulfill purchases](./cloud-code-fulfillment.md).

## Next steps

This page is part of a workflow to set up Direct to Consumer (D2C) payment providers with IAP. To continue this workflow, choose one of the following options:

[Integrate D2C payment providers](./workflow.md#configure-a-webhook-or-cloud-code-module-for-purchase-fulfillment-\(optional\)): Return to the Integrate D2C payment providers with IAP workflow page.
[Configure your payment provider](./configure-payment-provider.md): Proceed to the next step in the workflow to set up your D2C payment provider.
