Automatically deliver license keys, downloadable files, feature flags, and access to platforms like Discord, GitHub, Telegram, Framer, and Notion when customers pay.
Entitlements turn a successful payment or active subscription into real access: a license key in your customer’s inbox, a feature flag your app checks, a Discord role, a GitHub repository, a Notion template, a Framer remix link, a Telegram chat invite, or a downloadable file bundle. Dodo Payments issues, tracks, and revokes that access automatically as the payment lifecycle changes.
The Entitlements dashboard. Each entitlement is a reusable template; the right pane shows individual customer grants.
An entitlement is a reusable definition of something you deliver to a customer: a Pro license key, a “Patrons” Discord role, access to your private GitHub repository, a downloadable e-book bundle. You attach entitlements to products, and Dodo Payments handles the rest.Saat pelanggan membeli produk, Dodo Payments membuat sebuah grant, yaitu penerbitan entitlement untuk satu pelanggan. Grant bergerak melalui sejumlah kecil status: Pending saat proses delivery berlangsung, Delivered setelah pelanggan mendapatkan akses, Failed jika delivery tidak dapat diselesaikan, dan Revoked saat akses dicabut.
Entitlements gate fulfillment (does the customer have access?). Credits gate consumption (how much of it can they use?). Both can be attached to the same product. See Credit-Based Billing for credits.
Grants are driven by the same payment and subscription events you already receive as webhooks. You don’t need to call the grant API yourself for purchases. Dodo Payments creates and revokes grants automatically based on the underlying payment lifecycle.
Grant dibuat ketika pembayaran selesai atau subscription menjadi aktif. Feature flags langsung menuju Delivered. License keys juga langsung menuju Delivered ketika entitlement menggunakan fulfillment_mode: auto (default); pada fulfillment_mode: manual, grant dibuat dalam Pending tanpa key hingga Anda menyediakannya melalui Fulfill License Key Grant. Setiap integrasi lainnya dimulai dalam Pending. Integrasi berbasis OAuth (Discord, GitHub, Notion) menampilkan oauth_url yang harus dikunjungi customer untuk menyelesaikan consent; field tersebut adalah null pada grant yang baru dibuat dan diisi setelah customer memulai accept flow dari email delivery atau customer portal. Integrasi langsung platform (Telegram, Framer, Digital Files) hanya berada dalam Pending sebentar saat delivery disiapkan, lalu beralih ke Delivered.
2
Delivered
Setelah delivery selesai (license key dibuat, role ditetapkan, akses repository diberikan, link file diselesaikan, OAuth selesai), grant beralih ke Delivered dan delivered_at ditetapkan.
3
Failed
Jika panggilan integration mengembalikan error yang tidak dapat di-retry (token OAuth dicabut, permission ditolak, file tidak lagi ada), grant beralih ke Failed. Field error_code dan error_message mencatat alasannya.
4
Revoked
Saat akses dicabut (subscription dibatalkan, refund diterbitkan, atau revoke yang dimulai merchant), grant beralih ke Revoked. Field revocation_reason mencatat pemicunya.
Terbitkan satu grant untuk setiap entitlement yang terlampir.
payment.succeeded (subscription-linked payment)
No-op. Grant dikendalikan oleh subscription event di bawah.
subscription.active
Terbitkan grant untuk setiap entitlement terlampir yang belum memilikinya. Terbitkan kembali grant yang sebelumnya dicabut untuk subscription yang sama.
subscription.renewed
No-op. Grant yang ada tetap bertahan selama renewal.
subscription.on_hold
Cabut semua grant yang telah dan sedang dikirim. revocation_reason: subscription_on_hold.
subscription.paused
Cabut semua grant yang telah dan sedang dikirim. revocation_reason: SubscriptionPaused.
subscription.unpaused
Terbitkan kembali grant yang sebelumnya dicabut untuk subscription yang sama, persis seperti yang dilakukan subscription.active.
Cabut semua grant saat ini, lalu terbitkan grant untuk entitlement pada plan baru. revocation_reason: plan_changed.
refund.succeeded (one-time payment)
Cabut grant untuk pembayaran tersebut. revocation_reason: refund.
Manual API revoke
Cabut dengan revocation_reason: manual. Pencabutan manual tidak akan otomatis diterbitkan kembali saat subscription renewal.
License key disabled
Untuk grant license key, menonaktifkan key yang mendasarinya akan mencabut grant dengan revocation_reason: license_key_disabled. Grant akan diaktifkan kembali secara otomatis jika key diaktifkan kembali.
Platform drift detected
Jika sisi platform dari suatu integrasi tidak lagi sinkron (role Discord dihapus secara manual, GitHub App kehilangan akses ke repository, atau proses rekonsiliasi mendeteksi target yang hilang), grant akan dicabut dengan revocation_reason: platform_external. Tidak otomatis diterbitkan kembali saat subscription renewal hingga masalah pada platform yang mendasarinya terselesaikan.
Subscription-driven grants are idempotent per (entitlement, customer, subscription); renewals and re-activations do not create duplicate grants. One-time grants are idempotent per (entitlement, customer, payment).
Go to Entitlements in your Dodo Payments dashboard and click + to create a new entitlement.
2
Pick an integration
Pilih jenis integrasi: License Key, Digital Files, Feature Flag, Discord, GitHub, Telegram, Figma, Framer, atau Notion. Untuk integrasi platform, hubungkan akun Anda terlebih dahulu jika Anda belum melakukannya.
3
Configure delivery
Fill in the integration-specific fields. For example, GitHub asks for a repository and a permission level; Discord asks for a server and an optional role; License Key asks for activation limits and expiry.
Creating a GitHub entitlement. Each integration shows the fields it needs.
4
Save
Save the entitlement. You can now attach it to any product.
Open a product, expand Advanced Settings → Entitlements & Credits, and select the entitlements that should be delivered when the product is purchased. A single product can deliver multiple entitlements at once. For example, a Pro plan can include a license key, GitHub access, and a Discord role.
Attaching entitlements to a product. Selected entitlements are delivered on every successful purchase or active subscription.
Customers receive a delivery email after purchase containing the license key, download links, OAuth invitation links, or platform invite, whichever applies to the entitlements on the product. The same details remain available indefinitely from the Customer Portal under their order history.
Akses subscriber Discord, GitHub, dan Notion mengharuskan pelanggan mengotorisasi Dodo Payments untuk memberikan akses kepada mereka. Grant ini tetap berstatus Pending hingga pelanggan menyelesaikan flow OAuth menggunakan link dari email atau customer portal mereka. Setelah memberikan otorisasi, grant beralih ke Delivered dan akses platform langsung disediakan.
Revoked grants are removed at the platform level: the Discord role is removed, the GitHub collaborator is removed, the license key is disabled. Customers see the change reflected in the customer portal.
For Digital Files, revocation removes access to the presigned URLs going forward but does not invalidate copies a customer has already downloaded. Plan content gating accordingly.
Open any entitlement from the dashboard to see its grants. The grant detail panel shows total grants, status filters, customer information, delivery dates, and a revoke action.You can also manage grants programmatically:
import DodoPayments from 'dodopayments';const client = new DodoPayments({ bearerToken: process.env['DODO_PAYMENTS_API_KEY'],});// List grants for an entitlementconst grants = await client.entitlements.grants.list('ent_abc123', { status: 'Delivered',});// Revoke a single grantawait client.entitlements.grants.revoke('entg_xyz789', { id: 'ent_abc123',});
Dodo Payments fires four webhook events for the grant lifecycle. Subscribe to these events to keep your application in sync with what each customer can access.
Event
Dipicu saat
entitlement_grant.created
Grant baru dibuat. Grant license key berada dalam Delivered dengan fulfillment auto dan dalam Pending dengan fulfillment manual; setiap integration lainnya berada dalam Pending dan beralih ke Delivered setelah panggilan platform berhasil (atau, untuk integration berbasis OAuth, setelah pelanggan memberikan otorisasi).
entitlement_grant.delivered
Grant beralih ke status delivered. Pelanggan kini memiliki akses.
entitlement_grant.failed
Grant tidak dapat disampaikan. Periksa error_code dan error_message.
entitlement_grant.revoked
Akses telah dicabut. Periksa revocation_reason.
Entitlement Grant Webhook Payloads
View the full payload schema, sample events, and revocation_reason reference.
Gunakan satu entitlement per delivery channel. Jangan membagikan satu entitlement Discord ke beberapa produk dengan tujuan role yang berbeda; buat satu entitlement per role agar pencabutan tetap rapi.
Uji dalam test mode terlebih dahulu. Buat entitlement, lampirkan ke produk pengujian, lakukan checkout, dan pantau transisi grant melalui Pending → Delivered. Pastikan pembatalan subscription pengujian mencabut grant.
Dengarkan entitlement_grant.delivered, bukan payment.succeeded. Pembayaran dapat berhasil sebelum fulfilment selesai (terutama untuk OAuth flows). Tunggu event delivered sebelum membuka fitur yang bergantung padanya di sistem Anda sendiri.
Perlakukan entitlement_grant.failed sebagai hal yang memerlukan tindakan. Grant yang gagal berarti customer telah membayar tetapi tidak mendapatkan akses. Tampilkan hal ini kepada tim support Anda atau picu regrant.
Petakan revocation_reason ke retention flows Anda. Pencabutan subscription_on_hold dapat dipulihkan (customer mungkin memperbarui kartunya). Pencabutan manual disengaja. Perlakukan keduanya secara berbeda dalam komunikasi dengan customer.