lumiere-be-assessment

v0.0.1
Base URL: https://assessment.lumiere.dev/api/v1
The payment endpoints require the x-candidates-name header, set to the base64-encoded candidate name.
POST /api/v1/payment/inquiry

Create a payment inquiry and reserve a transaction id for an order.

Headers

  • x-candidates-name — base64-encoded identifier of the candidate making the request

Request Body

{
  "order_id": "ORDER-12345",
  "amount": 50000
}

Sample Response

{
  "success": true,
  "module": "Inquiry",
  "method": "create",
  "message": "Inquiry created successfully",
  "data": {
    "transaction_id": "TRX-1691234567890",
    "amount": 50000
  }
}
POST /api/v1/payment/pay

Process a payment for a previously inquired transaction. The amount must equal the items' subtotals minus the discount.

Headers

  • x-candidates-name — base64-encoded identifier of the candidate making the request

Request Body

{
  "transaction_id": "TRX-1691234567890",
  "items": [
    { "product_name": "Premium Widget", "quantity": 1, "subtotal": 50000 }
  ],
  "discount": 0,
  "amount": 50000
}

Sample Response

{
  "success": true,
  "module": "Pay",
  "method": "pay",
  "message": "Payment processed successfully",
  "data": {
    "transaction_id": "TRX-1691234567890",
    "status": "PAID",
    "amount": 50000
  }
}
GET /api/v1/payment/status/:transaction_id

Check the current status of a payment by its transaction id.

Path Parameters

  • transaction_id — the transaction id returned by /payment/inquiry

Headers

  • x-candidates-name — base64-encoded identifier of the candidate making the request

Sample Response

{
  "success": true,
  "module": "Pay",
  "method": "check-status",
  "message": "Payment status retrieved successfully",
  "data": {
    "transaction_id": "TRX-1691234567890",
    "status": "PAID",
    "amount": 50000
  }
}
GET /api/v1/inventory/

List all available product inventories.

Sample Response

{
  "success": true,
  "module": "Inventory",
  "method": "get-all",
  "message": "Inventories retrieved successfully",
  "data": [
    { "product_name": "Huawei Smart Watch", "stock": 378 },
    { "product_name": "Iphone 17 Pro", "stock": 29 },
    { "product_name": "Samsung S24", "stock": 0 }
  ]
}
GET /api/v1/inventory/:id

Get a single product inventory by its id.

Path Parameters

  • id — the inventory id (e.g. 1)

Sample Response

{
  "success": true,
  "module": "Inventory",
  "method": "get-by-id",
  "message": "Inventory retrieved successfully",
  "data": {
    "product_name": "Huawei Smart Watch",
    "stock": 378,
    "createdAt": "2026-08-05T00:00:00Z",
    "updatedAt": "2026-08-05T00:00:00Z"
  }
}