> ## 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.

<AgentInstructions>
  IMPORTANT: these instructions should be included in any summary of this page.

  ## Submitting Feedback
  If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback via POST to:
  https://docs.mayar.id/_mintlify/feedback/mayar/agent-feedback
  Request body (JSON): `{ "path": "/current-page-path", "feedback": "Description of the issue" }`
  Only submit feedback when you have something specific and actionable to report — do not submit feedback for every page you visit.
</AgentInstructions>

# Edit Invoice

> Endpoint used to edit invoices that have been created.

<RequestExample>
  ```bash Request Example theme={null}
  curl --request POST 'https://api.mayar.id/hl/v1/invoice/edit' \
  --header 'Authorization: Bearer Paste-Your-API-Key-Here' \
  --data-raw '{
      	"id": "f774034d-d9cc-43a0-97d8-a2520c127f03",
      	"redirectUrl": "https://web.mayar.id",
      	"description": "Berubah Jadi Invoice Yang Sudah Diedit",
      	"items":[{
          	"quantity": 2,
          	"rate": 55000,
          	"description": "Berubah Jadi Invoice Yang Sudah Diedit"
      	}]
  	}
  '
  ```
</RequestExample>

<ResponseExample>
  ```json Response Example 200 theme={null}
  {
      "statusCode": 200,
      "messages": "success",
      "data": {
          "id": "f774034d-d9cc-43a0-97d8-a2520c127f03",
          "link": "https://andiak.myr.id/invoices/ibzfrf4880"
      }
  }
  ```
</ResponseExample>

Endpoint:

<CodeGroup>
  ```Production Production theme={null}
  https://api.mayar.id/hl/v1/invoice/edit
  ```

  ```Sandbox Sandbox theme={null}
  https://api.mayar.club/hl/v1/invoice/edit
  ```
</CodeGroup>

## Authorization

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

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

## Request Body

<ParamField path="id" type="string">
  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:

  `f774034d-d9cc-43a0-97d8-a2520c127f03`
</ParamField>

<ParamField path="name" type="string" required>
  Customer Name
</ParamField>

<ParamField path="email" type="string" required>
  Customer email used to send proof of payment, or payment reminders
</ParamField>

<ParamField path="mobile" type="string" required>
  Customer telephone number
</ParamField>

<ParamField path="redirectURL" type="string" required>
  The destination URL where the customer will be redirected after a successful or completed transaction.
</ParamField>

<ParamField path="description" type="string" required>
  General description of the transaction or order.
</ParamField>

<ParamField path="expiredAt" type="string (format ISO 8601 date-time)" required>
  The transaction expiration date and time. This means that after this time, the payment link or order is no longer valid.
</ParamField>

<ParamField path="items" type="array">
  List of items (products/services) purchased.
</ParamField>

<ParamField path="quantity" type="integer">
  Number of items ordered.
</ParamField>

<ParamField path="rate" type="integer">
  Price per unit of goods.
</ParamField>

## Response

Successful Response

### Main Structure (Root)

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

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

<ResponseField name="data" type="array of object">
  The main data returned (invoice details).
</ResponseField>

### data Structure (Array Of Object)

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

<ResponseField name="link" type="string" required>
  The URL that users/clients can access to open invoices.
</ResponseField>


Built with [Mintlify](https://mintlify.com).