issue_credits
Issue (add) credits to a user; creates the user if they don't exist (email-first lookup). Pass idempotency_key on anything an agent might retry: a replay returns the original transaction with idempotent_replay: true and issues nothing more (no second webhook or mint). Without a key, every call issues again. For on-chain credit types with mint_on_issue, the response includes on_chain mint status. Costs 1 CRD (platform credit) per call, charged even when the call is then rejected (a 429 RATE_LIMITED costs nothing). Error results include request_id; quote it to support.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Credits to issue (positive) | |
| reason | No | Reason, shown in the ledger | |
| api_key | No | Cred API key (optional if set via the x-api-key header) | |
| user_id | Yes | External user ID | |
| user_name | No | Display name for a new user | |
| project_id | No | Cred project ID (optional; the API key already identifies the project) | |
| signup_url | No | App/page URL a new user signed up from (first-touch attribution) | |
| user_email | No | User email (matched first, stored on a new user) | |
| reference_id | No | Your reference for tracking (not a dedupe key — use idempotency_key) | |
| x402_payment | No | Base64 x402 PaymentPayload, only when a previous call failed with an x402 PaymentRequired because the account is out of CRD | |
| credit_type_id | Yes | Credit type to issue | |
| wallet_address | No | EVM address to mint this issuance to, overriding the one on file (on-chain types only) | |
| idempotency_key | No | Unique key for this issuance (max 255 chars). Retrying with the same key and same arguments returns the first result instead of repeating it; reusing it for different arguments fails with 409 IDEMPOTENCY_KEY_REUSED. Generate a fresh key (e.g. a UUID) per intended operation and reuse it only to retry that operation. | |
| signup_credit_type_id | No | Credit type the user signed up for (attribution) |