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
298 changes: 175 additions & 123 deletions docs/api-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,52 @@ Queue depth metrics for indexer workers.

---

## Invoice Endpoints

### GET /invoices/compare

Compare metrics for up to two invoices in a single request. Accepts a
comma-separated `ids` query parameter; metrics are returned grouped by invoice
ID. Responses are cached for 30 seconds per ID combination.

- **Auth:** None
- **Query:** `ids` - comma-separated invoice IDs (1 or 2; more returns `400`)
- **Response:** `200 OK`

```
GET /invoices/compare?ids=cm123,cm456
```

```json
{
"success": true,
"data": {
"invoice_ids": ["cm123", "cm456"],
"invoices": {
"cm123": {
"invoice_id": "cm123",
"seller_wallet": "GSELLER...",
"currency": "USDC",
"status": "FUNDED",
"amount": "1000",
"rate": "0.05",
"maturity": "2026-12-31T00:00:00.000Z",
"risk_rating": "A",
"funding_progress": "1",
"seller_stats": {
"wallet": "GSELLER...",
"invoice_count": 4,
"total_amount": "12500",
"average_rate": "0.062"
}
}
}
}
}
```

---

## Admin Endpoints

### POST /admin/proposals
Expand All @@ -246,37 +292,43 @@ Create a new multisig proposal requiring multi-sig approval.

```json
{
"changeType": "update_fee",
"payload": { "feeBps": 500, "treasuryAddress": "GATREASURYADDRESSFORACCESSLAYERTESTING123456789" },
"threshold": 2,
"totalSigners": 3
"changeType": "update_fee",
"payload": {
"feeBps": 500,
"treasuryAddress": "GATREASURYADDRESSFORACCESSLAYERTESTING123456789"
},
"threshold": 2,
"totalSigners": 3
}
```

- **Response:** `201 Created`

```json
{
"success": true,
"data": {
"id": "cm123...",
"proposalId": "msig-1234567890-abc123",
"changeType": "update_fee",
"payload": { "feeBps": 500, "treasuryAddress": "GATREASURYADDRESSFORACCESSLAYERTESTING123456789" },
"status": "pending",
"threshold": 2,
"totalSigners": 3,
"proposedBy": "GAADMIN1WALLETADDRESSFORACCESSLAYERTESTING123456789",
"proposedAt": "2026-09-27T10:30:00.000Z",
"executedAt": null,
"rejectedAt": null,
"rejectedBy": null,
"rejectionReason": null,
"createdAt": "2026-09-27T10:30:00.000Z",
"updatedAt": "2026-09-27T10:30:00.000Z",
"signatures": [],
"approvalCount": 0
}
"success": true,
"data": {
"id": "cm123...",
"proposalId": "msig-1234567890-abc123",
"changeType": "update_fee",
"payload": {
"feeBps": 500,
"treasuryAddress": "GATREASURYADDRESSFORACCESSLAYERTESTING123456789"
},
"status": "pending",
"threshold": 2,
"totalSigners": 3,
"proposedBy": "GAADMIN1WALLETADDRESSFORACCESSLAYERTESTING123456789",
"proposedAt": "2026-09-27T10:30:00.000Z",
"executedAt": null,
"rejectedAt": null,
"rejectedBy": null,
"rejectionReason": null,
"createdAt": "2026-09-27T10:30:00.000Z",
"updatedAt": "2026-09-27T10:30:00.000Z",
"signatures": [],
"approvalCount": 0
}
}
```

Expand All @@ -286,52 +338,52 @@ List all multisig proposals with pagination and optional status filter.

- **Auth:** Admin required
- **Query Params:**
- `status` (optional): `pending`, `executed`, or `rejected`
- `page` (number, default: 1)
- `limit` (number, default: 20, max: 100)
- `status` (optional): `pending`, `executed`, or `rejected`
- `page` (number, default: 1)
- `limit` (number, default: 20, max: 100)
- **Response:** `200 OK`

```json
{
"success": true,
"data": {
"items": [
{
"id": "cm123...",
"proposalId": "msig-1234567890-abc123",
"changeType": "update_fee",
"payload": { "feeBps": 500 },
"status": "pending",
"threshold": 2,
"totalSigners": 3,
"proposedBy": "GAADMIN1WALLETADDRESSFORACCESSLAYERTESTING123456789",
"proposedAt": "2026-09-27T10:30:00.000Z",
"executedAt": null,
"rejectedAt": null,
"rejectedBy": null,
"rejectionReason": null,
"createdAt": "2026-09-27T10:30:00.000Z",
"updatedAt": "2026-09-27T10:30:00.000Z",
"signatures": [
{
"id": "cm456...",
"success": true,
"data": {
"items": [
{
"id": "cm123...",
"proposalId": "msig-1234567890-abc123",
"signer": "GAADMIN1WALLETADDRESSFORACCESSLAYERTESTING123456789",
"signedAt": "2026-09-27T10:31:00.000Z"
}
],
"approvalCount": 1
"changeType": "update_fee",
"payload": { "feeBps": 500 },
"status": "pending",
"threshold": 2,
"totalSigners": 3,
"proposedBy": "GAADMIN1WALLETADDRESSFORACCESSLAYERTESTING123456789",
"proposedAt": "2026-09-27T10:30:00.000Z",
"executedAt": null,
"rejectedAt": null,
"rejectedBy": null,
"rejectionReason": null,
"createdAt": "2026-09-27T10:30:00.000Z",
"updatedAt": "2026-09-27T10:30:00.000Z",
"signatures": [
{
"id": "cm456...",
"proposalId": "msig-1234567890-abc123",
"signer": "GAADMIN1WALLETADDRESSFORACCESSLAYERTESTING123456789",
"signedAt": "2026-09-27T10:31:00.000Z"
}
],
"approvalCount": 1
}
],
"meta": {
"page": 1,
"limit": 20,
"totalCount": 1,
"totalPages": 1,
"hasNextPage": false,
"hasPrevPage": false
}
],
"meta": {
"page": 1,
"limit": 20,
"totalCount": 1,
"totalPages": 1,
"hasNextPage": false,
"hasPrevPage": false
}
}
}
}
```

Expand All @@ -344,33 +396,33 @@ Get detailed information for a single multisig proposal including all signatures

```json
{
"success": true,
"data": {
"id": "cm123...",
"proposalId": "msig-1234567890-abc123",
"changeType": "update_fee",
"payload": { "feeBps": 500 },
"status": "pending",
"threshold": 2,
"totalSigners": 3,
"proposedBy": "GAADMIN1WALLETADDRESSFORACCESSLAYERTESTING123456789",
"proposedAt": "2026-09-27T10:30:00.000Z",
"executedAt": null,
"rejectedAt": null,
"rejectedBy": null,
"rejectionReason": null,
"createdAt": "2026-09-27T10:30:00.000Z",
"updatedAt": "2026-09-27T10:30:00.000Z",
"signatures": [
{
"id": "cm456...",
"proposalId": "msig-1234567890-abc123",
"signer": "GAADMIN1WALLETADDRESSFORACCESSLAYERTESTING123456789",
"signedAt": "2026-09-27T10:31:00.000Z"
}
],
"approvalCount": 1
}
"success": true,
"data": {
"id": "cm123...",
"proposalId": "msig-1234567890-abc123",
"changeType": "update_fee",
"payload": { "feeBps": 500 },
"status": "pending",
"threshold": 2,
"totalSigners": 3,
"proposedBy": "GAADMIN1WALLETADDRESSFORACCESSLAYERTESTING123456789",
"proposedAt": "2026-09-27T10:30:00.000Z",
"executedAt": null,
"rejectedAt": null,
"rejectedBy": null,
"rejectionReason": null,
"createdAt": "2026-09-27T10:30:00.000Z",
"updatedAt": "2026-09-27T10:30:00.000Z",
"signatures": [
{
"id": "cm456...",
"proposalId": "msig-1234567890-abc123",
"signer": "GAADMIN1WALLETADDRESSFORACCESSLAYERTESTING123456789",
"signedAt": "2026-09-27T10:31:00.000Z"
}
],
"approvalCount": 1
}
}
```

Expand All @@ -385,36 +437,36 @@ Submit a signature/approval for a multisig proposal. When the threshold is reach

```json
{
"signer": "GAADMIN1WALLETADDRESSFORACCESSLAYERTESTING123456789"
"signer": "GAADMIN1WALLETADDRESSFORACCESSLAYERTESTING123456789"
}
```

- **Response:** `200 OK`

```json
{
"success": true,
"data": {
"proposalId": "msig-1234567890-abc123",
"status": "executed",
"approvalCount": 2,
"threshold": 2,
"executed": true,
"signature": {
"id": "cm789...",
"success": true,
"data": {
"proposalId": "msig-1234567890-abc123",
"signer": "GAADMIN2WALLETADDRESSFORACCESSLAYERTESTING987654321",
"signedAt": "2026-09-27T10:32:00.000Z"
}
}
"status": "executed",
"approvalCount": 2,
"threshold": 2,
"executed": true,
"signature": {
"id": "cm789...",
"proposalId": "msig-1234567890-abc123",
"signer": "GAADMIN2WALLETADDRESSFORACCESSLAYERTESTING987654321",
"signedAt": "2026-09-27T10:32:00.000Z"
}
}
}
```

- **Error Responses:**
- `400 Bad Request` if proposal is not in `pending` state
- `403 Forbidden` if signer is not authorized
- `404 Not Found` if proposal does not exist
- `409 Conflict` if signer has already signed
- `400 Bad Request` if proposal is not in `pending` state
- `403 Forbidden` if signer is not authorized
- `404 Not Found` if proposal does not exist
- `409 Conflict` if signer has already signed

### POST /admin/proposals/:id/reject

Expand All @@ -425,30 +477,30 @@ Reject a multisig proposal.

```json
{
"rejector": "GAADMIN1WALLETADDRESSFORACCESSLAYERTESTING123456789",
"reason": "Optional rejection reason"
"rejector": "GAADMIN1WALLETADDRESSFORACCESSLAYERTESTING123456789",
"reason": "Optional rejection reason"
}
```

- **Response:** `200 OK`

```json
{
"success": true,
"data": {
"proposalId": "msig-1234567890-abc123",
"status": "rejected",
"rejectedAt": "2026-09-27T10:33:00.000Z",
"rejectedBy": "GAADMIN1WALLETADDRESSFORACCESSLAYERTESTING123456789",
"rejectionReason": "Optional rejection reason"
}
"success": true,
"data": {
"proposalId": "msig-1234567890-abc123",
"status": "rejected",
"rejectedAt": "2026-09-27T10:33:00.000Z",
"rejectedBy": "GAADMIN1WALLETADDRESSFORACCESSLAYERTESTING123456789",
"rejectionReason": "Optional rejection reason"
}
}
```

- **Error Responses:**
- `400 Bad Request` if proposal is not in `pending` state
- `403 Forbidden` if rejector is not authorized
- `404 Not Found` if proposal does not exist
- `400 Bad Request` if proposal is not in `pending` state
- `403 Forbidden` if rejector is not authorized
- `404 Not Found` if proposal does not exist

### PATCH /admin/creators/:id/metadata

Expand Down Expand Up @@ -553,4 +605,4 @@ window, with alert and auto-suspension state.

---

See [Local Setup](./local-setup.md) for development environment configuration.
See [Local Setup](./local-setup.md) for development environment configuration.
Loading
Loading