|
| 1 | +# API Documentation |
| 2 | + |
| 3 | +GET /catalog/ |
| 4 | +Description: Retrieve the current catalog of items. |
| 5 | +Request: None |
| 6 | +Response (200 OK): |
| 7 | +[ |
| 8 | + { |
| 9 | + "id": "string", |
| 10 | + "name": "string", |
| 11 | + "price": 0 |
| 12 | + } |
| 13 | +] |
| 14 | + |
| 15 | +GET /health |
| 16 | +Description: Check service health status including dependencies. |
| 17 | +Response (200 OK / 503 Service Unavailable): |
| 18 | +{ |
| 19 | + "status": "healthy|degraded|unhealthy", |
| 20 | + "service": "agenticpay-backend", |
| 21 | + "timestamp": "2026-03-26T07:00:00.000Z", |
| 22 | + "uptime": 12345.67, |
| 23 | + "dependencies": { |
| 24 | + "stellar": "healthy|unhealthy", |
| 25 | + "openai": "healthy|unhealthy", |
| 26 | + "scheduler": "healthy|unhealthy" |
| 27 | + }, |
| 28 | + "latency_ms": 123 |
| 29 | +} |
| 30 | + |
| 31 | +GET /ready |
| 32 | +Description: Kubernetes readiness probe. |
| 33 | +Response (200 OK): |
| 34 | +{ |
| 35 | + "status": "ready", |
| 36 | + "timestamp": "2026-03-26T07:00:00.000Z" |
| 37 | +} |
| 38 | + |
| 39 | +POST /invoice/generate |
| 40 | +Description: Generate AI-powered invoice. |
| 41 | +Request Body: |
| 42 | +{ |
| 43 | + "projectId": "string", |
| 44 | + "workDescription": "string", |
| 45 | + "hoursWorked": 10, |
| 46 | + "hourlyRate": 50 |
| 47 | +} |
| 48 | +Response (200 OK): |
| 49 | +{ |
| 50 | + "invoiceId": "string", |
| 51 | + "projectId": "string", |
| 52 | + "total": 500, |
| 53 | + "details": "Invoice details" |
| 54 | +} |
| 55 | +Errors: |
| 56 | +- 400 VALIDATION_ERROR – Missing required fields |
| 57 | + |
| 58 | +GET /jobs/ |
| 59 | +Description: Retrieve all scheduled job statuses. |
| 60 | +Response (200 OK): |
| 61 | +{ |
| 62 | + "jobs": [ |
| 63 | + { |
| 64 | + "id": "string", |
| 65 | + "status": "pending|running|completed|failed", |
| 66 | + "lastRun": "2026-03-26T07:00:00.000Z" |
| 67 | + } |
| 68 | + ] |
| 69 | +} |
| 70 | + |
| 71 | +GET /stellar/account/:address |
| 72 | +Description: Get Stellar account information. |
| 73 | +Path Parameters: |
| 74 | +- address – Stellar account address |
| 75 | +Response (200 OK): |
| 76 | +{ |
| 77 | + "address": "string", |
| 78 | + "balances": [ |
| 79 | + { |
| 80 | + "asset": "XLM", |
| 81 | + "amount": "100.0" |
| 82 | + } |
| 83 | + ] |
| 84 | +} |
| 85 | +Errors: |
| 86 | +- 400 – InvalidStellarInputError |
| 87 | +- 500 – Failed to fetch account info |
| 88 | + |
| 89 | +GET /stellar/tx/:hash |
| 90 | +Description: Get Stellar transaction status. |
| 91 | +Path Parameters: |
| 92 | +- hash – Transaction hash |
| 93 | +Response (200 OK): |
| 94 | +{ |
| 95 | + "hash": "string", |
| 96 | + "status": "pending|success|failed", |
| 97 | + "ledger": 12345 |
| 98 | +} |
| 99 | +Errors: |
| 100 | +- 400 – InvalidStellarInputError |
| 101 | +- 500 – Failed to fetch transaction |
| 102 | + |
| 103 | +POST /verification/verify |
| 104 | +Description: AI-powered work verification. |
| 105 | +Request Body: |
| 106 | +{ |
| 107 | + "repositoryUrl": "string", |
| 108 | + "milestoneDescription": "string", |
| 109 | + "projectId": "string" |
| 110 | +} |
| 111 | +Response (200 OK): |
| 112 | +{ |
| 113 | + "verificationId": "string", |
| 114 | + "status": "passed|failed|pending", |
| 115 | + "score": 85, |
| 116 | + "summary": "Verification summary" |
| 117 | +} |
| 118 | + |
| 119 | +POST /verification/verify/batch |
| 120 | +Description: Bulk verification of work. |
| 121 | +Request Body: |
| 122 | +{ |
| 123 | + "items": [ |
| 124 | + { |
| 125 | + "repositoryUrl": "string", |
| 126 | + "milestoneDescription": "string", |
| 127 | + "projectId": "string" |
| 128 | + } |
| 129 | + ] |
| 130 | +} |
| 131 | +Response (200 OK): |
| 132 | +{ |
| 133 | + "results": [ |
| 134 | + { "index": 0, "status": "success", "data": {} }, |
| 135 | + { "index": 1, "status": "error", "error": "Missing required fields" } |
| 136 | + ] |
| 137 | +} |
| 138 | + |
| 139 | +PATCH /verification/batch |
| 140 | +Description: Bulk update verification results. |
| 141 | +Request Body: |
| 142 | +{ |
| 143 | + "items": [ |
| 144 | + { |
| 145 | + "id": "string", |
| 146 | + "status": "passed|failed|pending", |
| 147 | + "score": 90, |
| 148 | + "summary": "Updated summary", |
| 149 | + "details": ["detail1", "detail2"] |
| 150 | + } |
| 151 | + ] |
| 152 | +} |
| 153 | +Response (200 OK): |
| 154 | +{ |
| 155 | + "results": [ |
| 156 | + { "index": 0, "status": "success", "data": {} }, |
| 157 | + { "index": 1, "status": "error", "error": "Missing verification id" } |
| 158 | + ], |
| 159 | + "updatedCount": 1 |
| 160 | +} |
| 161 | + |
| 162 | +DELETE /verification/batch |
| 163 | +Description: Bulk delete verification results. |
| 164 | +Request Body: |
| 165 | +{ |
| 166 | + "ids": ["string", "string"] |
| 167 | +} |
| 168 | +Response (200 OK): |
| 169 | +{ |
| 170 | + "results": [ |
| 171 | + { "id": "string", "status": "deleted" }, |
| 172 | + { "id": "string", "status": "not_found" } |
| 173 | + ], |
| 174 | + "deletedCount": 1 |
| 175 | +} |
| 176 | + |
| 177 | +GET /verification/:id |
| 178 | +Description: Get verification result by ID. |
| 179 | +Response (200 OK): |
| 180 | +{ |
| 181 | + "verificationId": "string", |
| 182 | + "status": "passed|failed|pending", |
| 183 | + "score": 85, |
| 184 | + "summary": "Verification summary" |
| 185 | +} |
| 186 | +Errors: |
| 187 | +- 404 – Verification not found |
0 commit comments