Pending và chờ bạn cung cấp giá trị key từ hệ thống riêng, nhà cung cấp bên thứ ba hoặc một pool mã hữu hạn.
By the end you will have:
- A product with a License Key entitlement set to
manualfulfillment. - A webhook listener that detects when a customer is waiting for a key.
- A fulfillment call that delivers the key and notifies the customer automatically.
License Keys overview
The full license key lifecycle and the
fulfillment_mode setting.Fulfill License Key Grant API
API reference for the endpoint you call to deliver a key.
How It Works
Manual fulfillment changes only the issuance step. Activation, validation, deactivation, expiry, and revocation behave exactly like an auto-generated key once delivered.Prerequisites
To follow this guide you’ll need:- A Dodo Payments merchant account.
- Your API key (
DODO_PAYMENTS_API_KEY) and webhook secret key from the dashboard. See the API key generation guide. - A backend endpoint that can receive webhooks.
Use
https://test.dodopayments.com and test-mode credentials while building. Switch to https://live.dodopayments.com and live keys when you go to production.Step 1 — Create a License Key Entitlement in Manual Mode
An entitlement is a reusable definition of what you deliver. Create a License Key entitlement and set itsfulfillment_mode to manual.
- Dashboard
- API
1
Open Entitlements
Go to Entitlements in your dashboard and click + to create a new entitlement.
2
Choose License Key
Select License Key as the integration and give it a Name. The form exposes these fields:
- Fulfillment Mode —
Automaticby default. This is the setting that enables manual fulfillment; you change it in the next step. - License Length — how long each issued key stays valid, or No expiration.
- Activations Limit — maximum activations per key, or Unlimited.
- Activation Message — optional customer-facing message shown when they activate the key.

3
Set Fulfillment Mode to Manual
Mở menu thả xuống Fulfillment Mode và chuyển từ Automatic sang Manual. Đây là cài đặt chi phối toàn bộ hướng dẫn này — nếu không bật, key sẽ được tự động tạo và gửi qua email, đồng thời không có grant đang chờ nào được tạo. Khi chọn Manual, mỗi giao dịch mua sẽ tạo một grant
Pending để bạn cấp phát. Nhấp vào Create Entitlement để lưu.fulfillment_mode defaults to auto. Omitting it, or leaving an existing entitlement unchanged, keeps the automatic behavior. Only entitlements explicitly set to manual create pending grants.Step 2 — Attach the Entitlement to a Product
Open the product you want to sell, expand Advanced Settings → Entitlements & Credits, and select the License Key entitlement you set to Manual in Step 1. A single product can deliver this license key alongside other entitlements on the same purchase.
Selecting the License Key entitlement in the product entitlements panel.
Chế độ cấp phát là thuộc tính của entitlement, không phải của product. Vì bạn đã đặt chế độ này thành Manual ở Bước 1, mọi product được liên kết với entitlement này sẽ tạo grant license key
Pending khi mua — bạn không cần cấu hình thêm gì ở đây.Step 3 — Detect Pending Grants
Khi customer mua product, Dodo Payments sẽ tạo một grant ở trạng tháiPending, chưa gắn key, và gửi một webhook entitlement_grant.created. Đây là tín hiệu cho biết có customer đang chờ key.
Listen for the webhook
Set up a webhook endpoint (Developer → Webhooks in the dashboard) and act on pending license-key grants. The implementation follows the Standard Webhooks specification.integration_type: "license_key", so you can recognize a license-key grant without an extra lookup. See the Entitlement Grant webhook reference for the full payload.
Or poll the List Grants API
Nếu bạn không muốn dựa vào webhooks, hãy liệt kê các quyền cấp cho License Key của bạn và lọc theostatus. Mọi quyền cấp trên License Key đều là quyền cấp license-key, vì vậy không cần lọc integration_type:
Step 4 — Deliver the Key
Obtain the key value from your own system, then submit it with the Fulfill License Key Grant endpoint. This requires your secret API key (Editor permission); it is not one of the public license endpoints.Request fields
string
bắt buộc
The license key string to deliver to the customer. Whitespace is trimmed; an empty or whitespace-only value is rejected.
integer
Per-key activation limit. Falls back to the entitlement config when omitted.
string
Per-key expiry (ISO 8601). Falls back to the entitlement config’s duration when omitted. For subscription-issued grants, validity remains tied to the subscription regardless.
Delivered, customer sẽ tự động nhận key (qua email giống như khi sử dụng chế độ cấp phát tự động), đồng thời các sự kiện webhook license_key.created và entitlement_grant.delivered sẽ được gửi.
The customer receives an email with the license key, the product, activation limit, expiry, and your activation instructions:

The license key email the customer receives once you fulfill the grant.
You do not need to email the key yourself — delivery happens automatically when the grant is fulfilled.
Step 5 — Handle Errors and Retries
The endpoint validates the grant before delivering anything. Handle these responses:Verify the Flow
- Mua product ở test mode (xem hướng dẫn checkout).
- Xác nhận webhook của bạn đã nhận
entitlement_grant.createdvớistatus: "Pending"vàintegration_type: "license_key", hoặc grant xuất hiện trong response của List Grants với các bộ lọc đó. - Gọi endpoint fulfill với một key kiểm thử.
- Xác nhận response hiển thị
status: "Delivered"cùng vớilicense_keyđã được điền, customer nhận được email chứa key vàentitlement_grant.deliveredđược gửi.
Once delivered, the customer can activate and validate the key against the public license endpoints exactly like an auto-generated key.
Related API Reference
Create Entitlement
Tạo entitlement License Key với
fulfillment_mode: manual.List Grants
Lọc theo
status và customer_id để tìm các grant đang chờ.Fulfill License Key Grant
Cung cấp giá trị key và chuyển grant sang trạng thái đã gửi.
Entitlement Grant Webhooks
Các sự kiện
entitlement_grant.* báo hiệu grant đang chờ và đã được gửi.