> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mayar.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Detail Invoice

> Endpoint used to view details and status of an invoice that has been created

<RequestExample>
  ```bash Request Example theme={null}
  curl --request GET 'https://api.mayar.id/hl/v2/invoices/6f8c19ff-5b97-4792-aa89-d2a12797b356' \
  --header 'Authorization: Bearer Paste-Your-API-Key-Here'
  ```
</RequestExample>

<ResponseExample>
  ```json Response Example 200 theme={null}
  {
      "statusCode": 200,
      "messages": "success",
      "data": {
          "id": "6f8c19ff-5b97-4792-aa89-d2a12797b356",
          "amount": 110000,
          "status": "paid",
          "userId": "348e083d-315a-4e5c-96b1-5a2a98c48413",
          "link": "ibzfrf4880",
          "expiredAt": 1768371411000,
          "transactions": [
              {
                  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                  "extraData": null
              },
              {
                  "id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
                  "extraData": null
              }
          ],
          "customerId": "21d84338-b46d-42d7-9b49-d402520407a5",
          "customer": {
              "id": "21d84338-b46d-42d7-9b49-d402520407a5",
              "email": "budi.santoso@example.com",
              "mobile": "081234567890",
              "name": "Budi Santoso"
          },
          "transactionId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "paymentUrl": "https://testingmayar.myr.id/invoices/ibzfrf4880",
          "paymentLinkId": "6f8c19ff-5b97-4792-aa89-d2a12797b356"
      }
  }
  ```
</ResponseExample>

Endpoint:

<CodeGroup>
  ```Production Production theme={null}
  https://api.mayar.id/hl/v2/invoices/{id}
  ```

  ```Sandbox Sandbox theme={null}
  https://api.mayar.club/hl/v2/invoices/{id}
  ```
</CodeGroup>

## Authorization

<ResponseField name="Authorization" type="string" required>
  Example:

  `Authorization | Bearer Paste-Your-API-Key-Here`
</ResponseField>

## Path Parameters

<ParamField path="id" type="string<uuid>" required>
  A unique identifier obtained when creating an invoice. If accessed through the dashboard, it can be found at the URL on the invoice details page.

  Example:

  `6f8c19ff-5b97-4792-aa89-d2a12797b356`
</ParamField>

## Response

Successful Response

### Main Structure (Root)

<ResponseField name="statusCode" type="integer">
  Status code form API.
</ResponseField>

<ResponseField name="messages" type="string">
  Status message that describes the status code.
</ResponseField>

<ResponseField name="data" type="object">
  The invoice detail object.
</ResponseField>

### data Structure (Object)

<ResponseField name="id" type="string<uuid>">
  Unique invoice ID.
</ResponseField>

<ResponseField name="amount" type="integer">
  Invoice price or nominal value.
</ResponseField>

<ResponseField name="status" type="string">
  Invoice status (e.g. `paid`, `unpaid`, `closed`).
</ResponseField>

<ResponseField name="userId" type="string<uuid>">
  Identifier of the merchant that owns this invoice.
</ResponseField>

<ResponseField name="link" type="string">
  Invoice slug/short URL.
</ResponseField>

<ResponseField name="expiredAt" type="integer">
  Invoice expiration time in timestamp form (epoch millis).
</ResponseField>

<ResponseField name="transactions" type="array of object">
  List of invoice related transactions.
</ResponseField>

<ResponseField name="customerId" type="string<uuid>">
  Unique customer ID.
</ResponseField>

<ResponseField name="customer" type="object">
  Details of the customer associated with this invoice.
</ResponseField>

<ResponseField name="transactionId" type="string<uuid>">
  The primary transaction ID for this invoice.
</ResponseField>

<ResponseField name="paymentUrl" type="string">
  URL for the invoice payment page.
</ResponseField>

<ResponseField name="paymentLinkId" type="string<uuid>">
  Unique ID of the payment link (usually the same as invoice ID).
</ResponseField>

### transactions Structure (Array Of Object)

<ResponseField name="id" type="string <uuid>">
  Unique transaction ID.
</ResponseField>

<ResponseField name="extraData" type="object | null">
  Additional custom data attached to the transaction, can be null.
</ResponseField>

### customer Structure (Object)

<ResponseField name="id" type="string <uuid>">
  Unique customer ID.
</ResponseField>

<ResponseField name="email" type="string">
  Customer's email address.
</ResponseField>

<ResponseField name="mobile" type="string">
  Customer's mobile phone number.
</ResponseField>

<ResponseField name="name" type="string">
  Customer's name.
</ResponseField>

### Errors

<ResponseField name="401 Unauthorized" type="object">
  Returned when the API key is missing or invalid:
  `{ "statusCode": 401, "messages": "Unauthorized" }`.
</ResponseField>

<ResponseField name="404 Not Found" type="object">
  Returned when no invoice matches the provided ID:
  `{ "statusCode": 404, "messages": "Not Found" }`.
</ResponseField>
