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

# Notion Entitlement

> Duplicate a Notion template into the customer's workspace when they purchase.

<Info>
  The Notion entitlement duplicates a template you've prepared into the paying customer's Notion workspace. The customer authorizes through OAuth, picks the workspace they want the template copied into, and Dodo Payments handles the duplication.
</Info>

## What gets delivered

* The customer is prompted to connect their Notion workspace via OAuth.
* Once authorized, Dodo Payments duplicates the configured template into the workspace they chose.
* On cancellation, the duplicated template remains in the customer's workspace (Notion does not support remote deletion). The grant is marked `revoked` for record-keeping.

Common uses include paid Notion templates, productivity systems, and OS/CRM templates.

## Connect Notion

<Steps>
  <Step title="Open Entitlements">
    In your Dodo Payments dashboard, go to **Entitlements** and click **+**.
  </Step>

  <Step title="Pick Notion">
    Choose **Notion Template** as the integration. If Notion is not yet connected, you'll be prompted to **Connect Notion**.

    <Frame caption="Connect Notion prompt before the OAuth handoff.">
      <img src="https://mintcdn.com/dodopayments/do-W-dMDGVB_xzr_/images/entitlements/notion/connect-prompt.png?fit=max&auto=format&n=do-W-dMDGVB_xzr_&q=85&s=90f1f2a60c96918a8da19665a24fcaca" alt="New entitlement panel prompting the merchant to connect Notion" style={{ maxHeight: '500px', width: 'auto' }} width="2000" height="1133" data-path="images/entitlements/notion/connect-prompt.png" />
    </Frame>

    Clicking through opens Notion in a new tab. Sign in to the workspace that owns your source templates, review the permissions Dodo Payments requests, then pick the pages (templates) the integration is allowed to read and duplicate.

    <Frame caption="Notion OAuth: review permissions, then pick the template pages to share.">
      <div style={{ display: 'flex', gap: '12px', flexWrap: 'wrap', justifyContent: 'center' }}>
        <img src="https://mintcdn.com/dodopayments/do-W-dMDGVB_xzr_/images/entitlements/notion/oauth-permissions.png?fit=max&auto=format&n=do-W-dMDGVB_xzr_&q=85&s=957e39812ac19bbf81cceb50f023a14a" alt="Notion OAuth permissions screen for Dodo Payments" style={{ maxHeight: '420px', width: 'auto' }} width="2000" height="1121" data-path="images/entitlements/notion/oauth-permissions.png" />

        <img src="https://mintcdn.com/dodopayments/do-W-dMDGVB_xzr_/images/entitlements/notion/oauth-select-pages.png?fit=max&auto=format&n=do-W-dMDGVB_xzr_&q=85&s=1f8bd414d5900f9d246d96f15877aba1" alt="Notion page picker selecting which templates Dodo Payments can access" style={{ maxHeight: '420px', width: 'auto' }} width="2000" height="1138" data-path="images/entitlements/notion/oauth-select-pages.png" />
      </div>
    </Frame>

    When Notion redirects back, you'll see a confirmation that the workspace is connected.

    <Frame caption="Workspace connected — return to the Dodo Payments dashboard to continue.">
      <img src="https://mintcdn.com/dodopayments/do-W-dMDGVB_xzr_/images/entitlements/notion/connected.png?fit=max&auto=format&n=do-W-dMDGVB_xzr_&q=85&s=5e526d2cc12c27f526b2a6e469157bd8" alt="Notion Template connected successfully confirmation page" style={{ maxHeight: '500px', width: 'auto' }} width="2000" height="1143" data-path="images/entitlements/notion/connected.png" />
    </Frame>
  </Step>

  <Step title="Pick a template">
    Back in the dashboard, select the **template** to duplicate from the template picker. Only pages you authorized in the previous step appear here. Give the entitlement a **name** and click **Create Entitlement**.

    <Frame>
      <img src="https://mintcdn.com/dodopayments/do-W-dMDGVB_xzr_/images/entitlements/notion/create.png?fit=max&auto=format&n=do-W-dMDGVB_xzr_&q=85&s=82a51c79ed0c6937abf866c187673ab7" alt="Notion entitlement form with connected workspace, template picker, and name field" style={{ maxHeight: '500px', width: 'auto' }} width="2000" height="1135" data-path="images/entitlements/notion/create.png" />
    </Frame>
  </Step>

  <Step title="Save the entitlement">
    Save and attach to any product.
  </Step>
</Steps>

## Customer flow

1. The customer completes checkout.
2. Dodo Payments creates a grant in `pending` status with a Notion `oauth_url` for the customer to connect their workspace.
3. The customer authorizes via the link in their email or customer portal and picks the workspace they want the template duplicated into.
4. Dodo Payments duplicates the template. The grant moves to `delivered`.
5. On revocation, the grant is marked `revoked`; the duplicated copy remains in the customer's workspace.

<Note>
  Notion intentionally treats a duplicated page as the recipient's own content. Dodo Payments cannot delete the copy on revocation.
</Note>

## Required configuration

| Field                | Required | Description                                          |
| -------------------- | -------- | ---------------------------------------------------- |
| `notion_template_id` | Yes      | The template ID. The dashboard picker fills this in. |

## Create via API

<CodeGroup>
  ```typescript TypeScript theme={null} theme={null}
  const entitlement = await client.entitlements.create({
    name: 'Study Notes',
    integration_type: 'notion',
    integration_config: {
      notion_template_id: 'tmpl_abc123',
    },
  });
  ```

  ```python Python theme={null} theme={null}
  client.entitlements.create(
      name="Study Notes",
      integration_type="notion",
      integration_config={"notion_template_id": "tmpl_abc123"},
  )
  ```

  ```go Go theme={null} theme={null}
  client.Entitlements.New(ctx, dodopayments.EntitlementNewParams{
    Name:            dodopayments.F("Study Notes"),
    IntegrationType: dodopayments.F(dodopayments.EntitlementIntegrationTypeNotion),
    IntegrationConfig: dodopayments.F[dodopayments.IntegrationConfigUnionParam](
      dodopayments.IntegrationConfigNotionConfigParam{
        NotionTemplateID: dodopayments.F("tmpl_abc123"),
      },
    ),
  })
  ```
</CodeGroup>

## Webhooks

See [`entitlement_grant.*` webhook events](/developer-resources/webhooks/intents/entitlement-grant):

* `entitlement_grant.created` includes the Notion `oauth_url`.
* `entitlement_grant.delivered` fires once the template is duplicated.
* `entitlement_grant.revoked` fires on cancellation; the customer's copy is left untouched.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Customer didn't get the template">
    The grant remains `pending` until the customer completes Notion OAuth. Resend the delivery email; the OAuth link expires after one week, after which you can revoke and recreate the grant.
  </Accordion>

  <Accordion title="Template picker is empty">
    Reconnect Notion from **Entitlements → Integrations → Notion** with the workspace that owns the source templates.
  </Accordion>

  <Accordion title="Customer wants the template removed after refund">
    Notion does not allow remote deletion of duplicated pages. The customer must delete the copy from their own workspace.
  </Accordion>
</AccordionGroup>
