DELETE /fuel-pump-inventories/async-delete/fuel-pump-inventories-purchase-order-line-items-delete-one¶
Summary¶
Source repository:
jef-systems/jef-fuel-pump-inventories-backendSource SHA:
146a6bf7c9b0f38bf4b9af19f4ecd577dc24e516Source run id:
29102191743Lambda function:
jef-fuel-pump-inventories-delete-004Lambda ARN:
arn:aws:lambda:ap-southeast-1:246715082475:function:jef-fuel-pump-inventories-delete-004HTTP method:
DELETEOperation:
delete-oneInvoke mode:
asynchronousPublic DELETE endpoint:
https://api.jefoffice.com/fuel-pump-inventories/async-delete/fuel-pump-inventories-purchase-order-line-items-delete-onePublic status endpoint:
https://api.jefoffice.com/fuel-pump-inventories/async-delete/fuel-pump-inventories-purchase-order-line-items-delete-one/statusPublic DELETE path:
/fuel-pump-inventories/async-delete/fuel-pump-inventories-purchase-order-line-items-delete-onePublic status path:
/fuel-pump-inventories/async-delete/fuel-pump-inventories-purchase-order-line-items-delete-one/statusAWS DELETE path:
/fuel-pump-inventories-purchase-order-line-items-delete-oneAWS status path:
/fuel-pump-inventories-purchase-order-line-items-delete-one/statusCloudflare origin:
https://api.jefoffice.comCloudflare operation base URL:
https://api.jefoffice.com/fuel-pump-inventories/async-deleteCloudflare module path:
/fuel-pump-inventoriesCloudflare operation path:
/async-deleteCloudflare parent path:
/fuel-pump-inventories/async-deleteCloudflare mode:
one-worker-for-lambda-async-deleteShared Cloudflare Worker:
jef-fuel-pump-inventories-backend-lambda-async-deleteCloudflare route host:
api.jefoffice.comCloudflare route pattern:
api.jefoffice.com/fuel-pump-inventories/async-delete/\*DynamoDB table:
jef-fuel-pump-inventories-purchase-order-line-itemsPrimary key:
purchase\_order\_line\_item\_idCascade mode:
durable-jobNo-scan cascade:
trueThrottle safe:
true
Required Input¶
The DELETE request must include the primary key. The Lambda accepts the real primary key field name, primary_key_value, or id.
Accepted primary key aliases:
purchase\_order\_line\_item\_idprimary_key_valueid
Optional fields:
cascade_delete: defaults totrue. When true, the Lambda creates a durable async delete job.delete_job_id: used only when polling the status endpoint.
DELETE Request Body Example¶
{
"purchase_order_line_item_id": "00000000-0000-4000-8000-000000000000",
"cascade_delete": true
}
Alternative Body Example¶
{
"primary_key_value": "00000000-0000-4000-8000-000000000000",
"cascade_delete": true
}
Query Example¶
DELETE /fuel-pump-inventories/async-delete/fuel-pump-inventories-purchase-order-line-items-delete-one?purchase_order_line_item_id=00000000-0000-4000-8000-000000000000&cascade_delete=true
CMD curl¶
curl -X DELETE "https://api.jefoffice.com/fuel-pump-inventories/async-delete/fuel-pump-inventories-purchase-order-line-items-delete-one" -H "Content-Type: application/json" --data-raw '{"purchase_order_line_item_id": "00000000-0000-4000-8000-000000000000", "cascade_delete": true}'
PowerShell curl¶
curl.exe -X DELETE "https://api.jefoffice.com/fuel-pump-inventories/async-delete/fuel-pump-inventories-purchase-order-line-items-delete-one" -H "Content-Type: application/json" --data-raw "{\"purchase_order_line_item_id\": \"00000000-0000-4000-8000-000000000000\", \"cascade_delete\": true}"
Status Polling¶
After a cascade delete returns 202 Accepted, poll the status endpoint with the returned delete_job_id.
{
"delete_job_id": "<delete_job_id>"
}
Status curl:
curl "https://api.jefoffice.com/fuel-pump-inventories/async-delete/fuel-pump-inventories-purchase-order-line-items-delete-one/status?delete_job_id=<delete_job_id>"
Status PowerShell curl:
curl.exe "https://api.jefoffice.com/fuel-pump-inventories/async-delete/fuel-pump-inventories-purchase-order-line-items-delete-one/status?delete_job_id=<delete_job_id>"
Accepted Async Response¶
{
"ok": true,
"is_deleted": false,
"is_committed": false,
"is_async": true,
"operation": "delete-one",
"method": "DELETE",
"primary_key": "purchase_order_line_item_id",
"primary_key_value": "00000000-0000-4000-8000-000000000000",
"cascade_delete": true,
"cascade_mode": "durable-job",
"delete_job_id": "<delete_job_id>",
"status": "running",
"status_path": "/fuel-pump-inventories/async-delete/fuel-pump-inventories-purchase-order-line-items-delete-one/status",
"message": "Cascade delete job accepted."
}
Expected Responses¶
Status |
Meaning |
|---|---|
202 |
Cascade delete job accepted. Use |
200 |
Direct delete completed, or status endpoint returned the current job state. |
400 |
Missing primary key, missing |
404 |
Item or delete job not found. |
409 |
Delete blocked because child records exist and cascade was not requested. |
405 |
Wrong HTTP method. |
500 |
Unexpected delete error. |
Cloudflare Worker Behavior¶
All async DELETE endpoints from this backend are routed through one shared Cloudflare Worker. The Worker matches the public path, forwards the request to the correct AWS API Gateway DELETE or status endpoint, and injects the internal AWS API key. Public clients call the Cloudflare URL only, so public examples must not include the AWS API key header.
Durable Cascade Notes¶
Cascade deletion uses a durable job with
delete_job_id.Child-record checks must be query-backed. Table scans are not allowed for cascade safety.
Large cascades continue through status polling instead of a single blocking request.