Ready-made prompts

Requests to copy and paste into your AI assistant, together with the implementation guide.

Each prompt assumes the implementation guide is in your project at docs/project-api.md. Replace what is in brackets with your case.

The prompts never include the token. The code reads it from PROJECT_TOKEN, which you put in the .env yourself.

API client

The starting point of any integration.

Read docs/project-api.md and follow its rules.

Create a client for the Project reseller API in [Node.js/TypeScript | PHP | Python]:
- a single request function (address from PROJECT_API_URL, token from PROJECT_TOKEN,
  30 s timeout, reads { success, message, data, errors }, error with the HTTP status);
- one function for each endpoint in the Reference;
- tests with a fake HTTP client, never calling the real API.
At the end, tell me how to test the connection with GET /me.

Discord bot that delivers keys

Read docs/project-api.md and follow its rules.

Create a Discord bot in [discord.js | discord.py] with the /key command, only for
members with the [role name] role:
- /key product:<choice from GET /products, only the available ones> days:<product plans>
- generates 1 key with POST /keys (Idempotency-Key created and stored before the call),
  and sends the key by direct message to whoever used the command;
- on 402, replies that the balance is too low; on other errors, shows the API message;
- stores generation_id, user_id and key_code of each key in a [SQLite | JSON] file.

Store that delivers the key after payment

Read docs/project-api.md and follow its rules.

In my store on [WooCommerce | Next.js | Laravel | other], when an order is confirmed
as paid:
- create an Idempotency-Key, store it on the order and call POST /keys with the
  product_id and days mapped to the store product (create that mapping as config);
- store the key_code on the order and show/send it to the customer;
- if the call fails with a network error, timeout or 5xx, retry with the SAME Idempotency-Key;
- on 402 (no balance), mark the order as "waiting for key" and notify me.
Never generate a key twice for the same order.

Support: look up a key and reset HWID

Read docs/project-api.md and follow its rules.

Create a support screen [or bot command] that:
- receives the key_code the customer provides and finds its user_id in my database;
- shows status, hwid_status and the time remaining (GET /keys with user_ids[]);
- has a "Reset HWID" button (POST /keys/{user_id}/reset-hwid) that asks for confirmation.

Receive webhooks

Read docs/project-api.md and follow its rules.

Create a POST /webhooks/project endpoint in [Express | Laravel | Flask | other] that:
- validates X-Project-Signature-256 with PROJECT_WEBHOOK_SECRET over the raw body,
  in constant time, and rejects notifications older than 5 minutes;
- ignores an id it has already processed;
- answers 204 right away and handles the event afterwards: [what to do with key.generated,
  key.hwid_reset and credits.*];
- has tests with a valid signature, a wrong one and an old one.

Balance and statement page

Read docs/project-api.md and follow its rules.

Create a page [in my panel] that shows the balance (GET /credits) and the statement
(GET /credits/transactions) paginated 50 at a time, with each transaction type in plain
English. The API call happens on the server, never in the browser.

On this page