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

# Payment Inquiry

> Using this endpoint you'll have the ability to get the complete information about a specific invoice or payment using it's identifier (e.g: InvoiceId)

### Query Parameters

<ParamField body="apiKey" type="string" placeholder="API Key" required>
  The API Key of your account.
</ParamField>

<ParamField body="data" type="object" required>
  <Expandable title="properties" defaultOpen={true}>
    <ResponseField name="Key" type="string" requried>
      Refers to the invoice number or payment ID based on the key type

      Samples: `3308076` or `100325710000064334`.
    </ResponseField>

    <ResponseField name="KeyType" type="string" required>
      The key type should be either `InvoiceId` or `PaymentId`.
    </ResponseField>
  </Expandable>
</ParamField>

<ParamField body="test" type="boolean" initialValue={true}>
  Set this property to `true` to send the request to the development
  environment.
</ParamField>

<ResponseExample>
  ```json Success theme={null}
  {
    "IsSuccess": true,
    "Message": "",
    "ValidationErrors": null,
    "Data": {
      "InvoiceId": 2817877,
      "InvoiceStatus": "Paid",
      "InvoiceReference": "2023016636",
      "CustomerReference": null,
      "CreatedDate": "2023-10-04T14:40:56.723",
      "ExpiryDate": "February 1, 2024",
      "ExpiryTime": "14:40:56.723",
      "InvoiceValue": 200,
      "Comments": null,
      "CustomerName": "Anonymous",
      "CustomerMobile": "+965",
      "CustomerEmail": null,
      "UserDefinedField": null,
      "InvoiceDisplayValue": "200.000 KD",
      "DueDeposit": 104.894,
      "DepositStatus": "Not Deposited",
      "InvoiceItems": []
    }
  }
  ```

  ```json Error theme={null}
  {
    "success": false,
    "code": 2,
    "message": "`Key` is a required parameter."
  }
  ```
</ResponseExample>

### Response properties

<ResponseField name="IsSuccess" type="boolean" required>
  The response status.
</ResponseField>

<ResponseField name="Message" type="string" required>
  The description of the response status.
</ResponseField>

<ResponseField name="ValidationErrors" type="array|null" required>
  List of validation errors (if any).
</ResponseField>

<ResponseField name="Data" type="object" required>
  <Expandable title="properties" defaultOpen={true}>
    <ResponseField name="InvoiceId" type="integer" required>
      A unique integer value of the invoice.
    </ResponseField>

    <ResponseField name="InvoiceStatus" type="string" required>
      A string value indicates the invoice status.

      Expected values: `Pending`, `Paid`, or `Canceled`.
    </ResponseField>

    <ResponseField name="InvoiceReference" type="string" required>
      Invoice reference that is generated by DashPay system.
    </ResponseField>

    <ResponseField name="CustomerReference" type="string" required>
      The customer reference data associated with the invoice.
    </ResponseField>

    <ResponseField name="CreatedDate" type="string" required>
      The creation date of the invoice.
    </ResponseField>

    <ResponseField name="ExpiryDate" type="string" required>
      The expiry date for the invoice.
    </ResponseField>

    <ResponseField name="InvoiceValue" type="string" required>
      Invoice total value with the actual base account currency.
    </ResponseField>

    <ResponseField name="Comments" type="string" required>
      Comments that are associated with the invoice.
    </ResponseField>

    <ResponseField name="CustomerName" type="string" required>
      The customer name that was save along with the invoice.
    </ResponseField>

    <ResponseField name="CustomerMobile" type="string" required>
      Customer mobile number.
    </ResponseField>

    <ResponseField name="CustomerEmail" type="string" required>
      Customer email address.
    </ResponseField>

    <ResponseField name="UserDefinedField" type="string" required>
      The user defined filed that was stored during the invoice creation.
    </ResponseField>

    <ResponseField name="InvoiceDisplayValue" type="string" required>
      Invoice value that is displayed in case of different currency from the base one.
    </ResponseField>

    <ResponseField name="DueDeposit" type="number" required>
      The amount that will be deposited to the vendor account.
    </ResponseField>

    <ResponseField name="DepositStatus" type="string" required>
      The deposit status of the invoice, if it is `Deposited` or `Not Deposited`.
    </ResponseField>

    <ResponseField name="InvoiceItems" type="array" required>
      Invoice items as stored in the invoice creation.
    </ResponseField>
  </Expandable>
</ResponseField>

## Error Codes

Here's a list of possible error codes of this endpoint.

| **Code** | **Description**                           |
| -------- | ----------------------------------------- |
| 1        | Missing or invalid api key                |
| 2        | `Key` is a required parameter.            |
| 3        | `KeyType` is a required parameter.        |
| 4        | `Key` is invalid.                         |
| 5        | Unknown error.                            |
| 6        | General error occurred, please try again. |
