diff --git a/docs/api/payment.md b/docs/api/payment.md index 760247b7..a265e60c 100644 --- a/docs/api/payment.md +++ b/docs/api/payment.md @@ -29,6 +29,49 @@ --- +## GET `/api/v1/my/payments` + +List the **authenticated user's own** payments (derived from the token — there is no userId in the URL). Used by the public dashboard's transactions tab. + +**Permission:** `IS_AUTHENTICATED_FULLY` + +### Query Parameters +| Param | Type | Default | Description | +|-------|------|---------|-------------| +| `page` | integer | 1 | Page number | +| `limit` | integer | 20 | Items per page (max 100) | +| `status` | string | — | Optional filter: `pending` / `success` / `failed` / `cancelled` / `refunded` | + +### Response `200` (paginated) +```json +{ + "success": true, + "data": [ + { + "uuid": "pay-uuid-...", + "order_id": "ORD-84FB82E12A4A45CE", + "amount_rials": 590000, + "status": "success", + "gateway": "mellat", + "type": "appointment", + "reference_id": "...", + "appointment_uuid": "appt-uuid-...", + "created_at": 1781521834 + } + ], + "meta": { "totalRecords": 1, "totalPages": 1, "currentPage": 1 } +} +``` + +> Items at `data` (flat array), total at `meta.totalRecords`. Ordered by `created_at` DESC. + +### Errors +| Code | HTTP | Description | +|------|------|-------------| +| `ERR_AUTH_001` | 401 | Missing token | + +--- + ## POST `/api/v1/payment/appointment` Initiate payment for an appointment. Returns a redirect URL to the payment gateway.