Context
Every endpoint is unauthenticated. Anyone can create payments and GET /payments returns all merchants' payments. merchant_id is just a free-text field on the request.
Tasks
- Add a
merchants table with hashed API keys.
- Require
Authorization: Bearer <key> on POST /payments and the list endpoint.
- Derive
merchant_id from the key; scope GET /payments to the authenticated merchant.
Acceptance criteria
- Unauthenticated writes/list are rejected with
401.
- A merchant only sees its own payments.
Context
Every endpoint is unauthenticated. Anyone can create payments and
GET /paymentsreturns all merchants' payments.merchant_idis just a free-text field on the request.Tasks
merchantstable with hashed API keys.Authorization: Bearer <key>onPOST /paymentsand the list endpoint.merchant_idfrom the key; scopeGET /paymentsto the authenticated merchant.Acceptance criteria
401.