Skip to content

Amazon

service_omni — Endpoints: Amazon

Location: backend/service_omni/app/api/v1/endpoints/amazon.py

Summary

  • Manage Amazon SP-API credentials used for order and report downloads.

Routes

  • GET /amazon/ — List Amazon credentials. Query params: skip, limit. Response: List[AmazonCredentialResponse].

  • POST /amazon/ — Create Amazon credentials. Body model: AmazonCredentialCreate (example fields: name, lwa_client_id, lwa_client_secret, role_arn, marketplace_ids, is_active).

Example request:

{
  "name": "ACME Merchant",
  "lwa_client_id": "amzn1.application-oa2-client.xxxx",
  "lwa_client_secret": "secret",
  "role_arn": "arn:aws:iam::123456789012:role/SpApiRole",
  "marketplace_ids": ["A1PA6795UKMFR9"],
  "is_active": true
}

Curl:

curl -X POST "http://localhost:8000/api/v1/amazon/" \
  -H "Content-Type: application/json" \
  -d '{"name":"ACME Merchant","lwa_client_id":"...","lwa_client_secret":"...","role_arn":"...","marketplace_ids":["A1PA6795UKMFR9"],"is_active":true}'
  • GET /amazon/{id} — Retrieve a credential by id. Response: AmazonCredentialResponse.
  • PUT /amazon/{id} — Update credential (AmazonCredentialUpdate).
  • DELETE /amazon/{id} — Delete a credential.
  • POST /amazon/{id}/toggle-active — Toggle active status.

Implementation & notes