Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tailwind-plus-icpay",
"version": "1.2.36",
"version": "1.2.37",
"private": true,
"packageManager": "pnpm@9.12.3",
"scripts": {
Expand Down
17 changes: 13 additions & 4 deletions src/app/webhooks/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Sections below describe the **data.object** (and where applicable **data.previou
| description | string \| null | Optional description. |
| expectedSenderPrincipal | string \| null | Optional expected sender address. |
| status | string | e.g. `requires_payment`, `processing`, `completed`, `failed`, `canceled`, `mismatched`. |
| intentCode | number | Intent code. |
| intentCode | number | Intent code (always a number in webhook payloads). |
| metadata | object | Key-value metadata from the intent. |
| createdAt | string | ISO 8601 timestamp. |

Expand Down Expand Up @@ -144,7 +144,9 @@ Sections below describe the **data.object** (and where applicable **data.previou
"metadata": { "orderId": "ORD-123" },
"requestedAmount": "150000000",
"paidAmount": "140000000",
"createdAt": "2025-01-01T12:00:00.000Z"
"createdAt": "2025-01-01T12:00:00.000Z",
"network": "ic",
"token": "ICP"
}
```

Expand All @@ -166,7 +168,10 @@ Sections below describe the **data.object** (and where applicable **data.previou
| metadata | object | From the payment intent. |
| requestedAmount | string \| null | Intent amount (for mismatch comparison). |
| paidAmount | string \| null | Actual paid amount from transaction. |
| createdAt | string | ISO 8601. |
| createdAt | string | ISO 8601 (mandatory). |
| network | string \| null | Chain type from the chains table (e.g. `ic`, `evm`, `sol`). |
| token | string \| null | Token symbol from the ledger (e.g. `ICP`, `USDC`). |
| intent | object \| undefined | When present, includes `intentCode` (number), `amount`, `metadata`, etc. |

If the payment is created with status `failed`, a `payment.failed` event is also emitted.

Expand All @@ -180,7 +185,7 @@ If the payment is created with status `failed`, a `payment.failed` event is also

**Triggered when:** A payment’s status becomes `completed` (funds received and payment recorded).

**data.object**: Same payment shape as **payment.created**. Typically includes `transactionId`, `ledgerTxId`, `amount`, and optional `requestedAmount` / `paidAmount` for mismatch handling. Use this event to fulfill orders or unlock content.
**data.object**: Same payment shape as **payment.created**, with **createdAt** (mandatory), **completedAt** (when the payment was completed), **network** (chain type: `ic` \| `evm` \| `sol`) and **token** (symbol). When the payment has an associated intent, **intent** is included with **intentCode** as a number. Typically includes `transactionId`, `ledgerTxId`, `amount`, and optional `requestedAmount` / `paidAmount` for mismatch handling. Use this event to fulfill orders or unlock content.

## payment.failed

Expand All @@ -204,6 +209,10 @@ If the payment is created with status `failed`, a `payment.failed` event is also

### Payment object fields (summary)

- **createdAt**: ISO 8601 timestamp; mandatory on all payment events (including `payment.completed`).
- **network**: Chain type from the chains table (e.g. `ic`, `evm`, `sol`). Always present so you don't need to derive it from `ledgerCanisterId`.
- **token**: Token symbol from the ledger (e.g. `ICP`, `USDC`). Always present.
- **intent**: When present, includes **intentCode** (number), `amount`, `metadata`, and other intent fields.
- **transactionSplitId**: Id of the transaction split that this payment represents.
- **basePaymentAccountId**: Base account for the intent/transaction (e.g. split rules).
- **ledgerTxId**: Linked ledger transaction id after sweep/linking.
Expand Down