From f1b1daf7519a8cb80365f832fe38f3fa11564798 Mon Sep 17 00:00:00 2001 From: colin Date: Fri, 4 Jul 2025 22:37:57 -0400 Subject: [PATCH] Update API documentation to clarify approval workflow for API-created transactions --- docker/ploughshares/templates/api_docs.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docker/ploughshares/templates/api_docs.html b/docker/ploughshares/templates/api_docs.html index 4637342..390bd76 100644 --- a/docker/ploughshares/templates/api_docs.html +++ b/docker/ploughshares/templates/api_docs.html @@ -93,6 +93,10 @@

3. Create New Transaction

POST /api/transaction

+

+ Note: All transactions created via API are set to "pending approval" status by default. + They must be explicitly approved using the approval endpoint before being considered valid. +

Complete Example:
curl -X POST "http://{{ server_name }}/api/transaction" \
@@ -109,7 +113,7 @@
                     
                     
Response:
{
-  "message": "Transaction created successfully",
+  "message": "Transaction created successfully and is pending approval",
   "transaction_id": 2
 }
@@ -117,6 +121,10 @@

4. Update Transaction

PUT /api/transaction/{id}

+

+ Note: This endpoint only updates transaction details. + It does not change the approval status of a transaction. To approve a transaction, use the dedicated approval endpoint. +

Complete Example:
curl -X PUT "http://{{ server_name }}/api/transaction/2" \
@@ -184,6 +192,11 @@
                 

7. Approve Transaction

POST /api/transaction/{id}/approve

+

+ Important: This endpoint provides human-in-the-loop verification. + All transactions (especially those created via API) require explicit approval before being considered valid. + The approver name is recorded for audit purposes. +

Complete Example:
curl -X POST "http://{{ server_name }}/api/transaction/2/approve" \