Dashboard
Your profile

API Documentation: Fetch Orders

This API endpoint retrieves a list of orders. Each order contains information such as the order ID, merchant ID, reference ID, status, EMV QR code, currency, amount, actual amount, and timestamps for creation, updates, and payment.

Endpoint

URL: https://laoqr.techcafe.dev/v1/orders

Method

HTTP Method: GET

Headers

  • Content-Type: application/json
  • X-API-KEY: kmmnLOh2gO8jfVlDAdSjL04GndHrIRfW

Example Request

1curl -X GET "https://laoqr.techcafe.dev/v1/orders" \
2    -H "Content-Type: application/json" \
3    -H "X-API-KEY: kmmnLOh2gO8jfVlDAdSjL04GndHrIRfW"

Response

The response is a JSON array containing order objects. Each object has the following structure:

1[
2  {
3    "id": "string",
4    "mid": "string",
5    "refId": "string",
6    "status": "string",
7    "emvQr": "string",
8    "currency": "string",
9    "amount": "string",
10    "actualAmt": "string",
11    "createdAt": "string",
12    "updatedAt": "string",
13    "paidAt": "string or null"
14  }
15]

Response Fields

  • id: (string) Unique identifier for the order.
  • mid: (string) Merchant identifier.
  • refId: (string) Reference ID for the order.
  • status: (string) Status of the order. Possible values are:
    • OPEN: The order is open and pending payment.
    • PAID: The order has been paid.
  • emvQr: (string) EMV QR code associated with the order.
  • currency: (string) Currency of the order amount (e.g., LAK).
  • amount: (string) Original amount of the order.
  • actualAmt: (string) Actual amount paid for the order.
  • createdAt: (string) Timestamp when the order was created.
  • updatedAt: (string) Timestamp when the order was last updated.
  • paidAt: (string or null) Timestamp when the order was paid. It is null if the order is not paid.

Example Response

1[
2  {
3    "id": "01J30JBDECD4EJQ1PBPP24RBG3",
4    "mid": "MPUK3P6IFV8IKVK5DPH5MX0XV",
5    "refId": "QH7AQGHHOT4YF079",
6    "status": "OPEN",
7    "emvQr": "00020101...049AD0",
8    "currency": "LAK",
9    "amount": "1000",
10    "actualAmt": "0",
11    "createdAt": "2024-07-17T21:43:12.460888+07:00",
12    "updatedAt": "2024-07-17T21:43:12.460888+07:00",
13    "paidAt": null
14  },
15  {
16    "id": "01J30J1F20KRXRSJ1509C6YHS8",
17    "mid": "MPUK3P6IFV8IKVK5DPH5MX0XV",
18    "refId": "QH7AQGHHOT4YF078",
19    "status": "OPEN",
20    "emvQr": "00020101...0422EA",
21    "currency": "LAK",
22    "amount": "1000",
23    "actualAmt": "0",
24    "createdAt": "2024-07-17T21:37:46.432678+07:00",
25    "updatedAt": "2024-07-17T21:37:46.432678+07:00",
26    "paidAt": null
27  },
28  {
29    "id": "01J2Y54094SNTC1PTT0457R2ZS",
30    "mid": "MPUK3P6IFV8IKVK5DPH5MX0XV",
31    "refId": "QH7AQGHHOT4YF077",
32    "status": "PAID",
33    "emvQr": "00020101...04AB5A",
34    "currency": "LAK",
35    "amount": "1000",
36    "actualAmt": "1000",
37    "createdAt": "2024-07-16T23:13:29.252891+07:00",
38    "updatedAt": "2024-07-16T23:13:29.252891+07:00",
39    "paidAt": "2024-07-17T14:44:02+07:00"
40  }
41]
42

Error Handling

In case of an error, the response will include an error message explaining the issue. Common errors include:

  • Invalid API key.
  • Network issues.
  • Unexpected response format.

Notes

Ensure that the API key provided in the X-API-KEY header is valid.

This endpoint fetches all orders. To fetch specific orders or filter the results, additional query parameters may be required (not covered in this documentation).