# Get Payout

This endpoint retrieves the current status of a previously initiated payout transaction. It supports lookup by either the system-generated `invoice_no` or your own `external_invoice_ref`.

Use this endpoint to check whether a payout has been completed, is still processing, or has failed.

## Endpoint

<table data-header-hidden><thead><tr><th width="73.109375">Method</th><th>Endpoint</th></tr></thead><tbody><tr><td><mark style="color:green;">GET</mark></td><td><pre><code>https://api.payright.my/api/v1/merchant/payout/:reference
</code></pre></td></tr></tbody></table>

### Usage Examples

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X GET "https://api.payright.my/api/v1/merchant/payout/Payright03" \
  -H "auth-token: eyJhbGciO...XZI3CLi_a0BeUOJMPUK00"
```

{% endtab %}

{% tab title="Python" %}

```python
import http.client
import urllib.parse

# Parse the URL
url = "https://api.payright.my/api/v1/merchant/payout/Payright03"
parsed_url = urllib.parse.urlparse(url)

# Create HTTPS connection
conn = http.client.HTTPSConnection(parsed_url.hostname)

# Prepare headers
headers = {
    "auth-token": "eyJhbGciO...XZI3CLi_a0BeUOJMPUK00" #Insert auth-token here
}

# Send GET request
conn.request("GET", parsed_url.path, headers=headers)

# Read response
response = conn.getresponse()
print("Status:", response.status)
print("Response body:", response.read().decode())

# Close connection
conn.close()
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'net/http'
require 'uri'

# Parse the URL
url = URI.parse("https://api.payright.my/api/v1/merchant/payout/Payright03")

# Create HTTP request
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["auth-token"] = "eyJhbGciO...XZI3CLi_a0BeUOJMPUK00" #Insert auth-token here

# Execute request
response = http.request(request)

# Output result
puts "Status: #{response.code}"
puts "Response body: #{response.body}"
```

{% endtab %}
{% endtabs %}

## Authentication

`string` `header` <mark style="color:red;">`required`</mark>

To authenticate requests, include an Authorization header with the value

<table><thead><tr><th width="114.81640625">Key</th><th>Value</th></tr></thead><tbody><tr><td>auth-token</td><td>&#x3C;Your Payright auth token></td></tr></tbody></table>

{% hint style="info" %}
You can retrieve your token by visiting your [Payright dashboard](https://portal.payright.my/) and clicking `Accounts > API Keys > View API Keys (magnify icon) > Auth Token`
{% endhint %}

## Request

### Path Parameter

`string` <mark style="color:red;">`required`</mark>

<table><thead><tr><th width="114.81640625">Key</th><th>Value</th></tr></thead><tbody><tr><td>reference</td><td>&#x3C;Input either <code>invoice_no</code> or <code>external_invoice_ref</code>></td></tr></tbody></table>

### Example URLs

{% tabs %}
{% tab title="Invoice No" %} <mark style="color:green;">GET</mark>  `https://api.payright.my/api/v1/merchant/payout/po-6DC1:125037-pyt`
{% endtab %}

{% tab title="External Invoice Ref" %} <mark style="color:green;">GET</mark>  `https://api.payright.my/api/v1/merchant/payout/Payright03`
{% endtab %}
{% endtabs %}

## Response

`application/json`

{% tabs %}
{% tab title="Success Example" %}

```json
{
    "status": "ok",
    "code": 2000,
    "data": {
        "value": 13.0,
        "external_invoice_ref": "Payright03",
        "payout_invoice_no": "po-6DC1:125037-pyt",
        "payout_account_number": "12345678901",
        "created_at": "2025-02-26T12:50:37.852852",
        "transaction_status": "SUCCESS"
    },
    "uuid": "408ed601-0cf9-4835-9bef-f734410741dc",
    "message": null,
    "error": null
}
```

{% endtab %}

{% tab title="Error Example" %}

```json
{
    "status": "fail",
    "code": 1234,
    "data": null,
    "uuid": "408ed601-0cf9-4835-9bef-f734410741dc",
    "message": "Something about this doesn't seem right.",
    "error": null
}
```

{% endtab %}
{% endtabs %}

### Response Attributes

<details>

<summary>status  <sup><sub><code>string</code></sub></sup> </summary>

Response status indicator (e.g., "ok" or "fail").

</details>

<details>

<summary>code  <sup><sub><code>number</code></sub></sup></summary>

HTTP-like status code representing result (200 = success).

</details>

<details>

<summary>data  <sup><sub><code>object | null</code></sub></sup></summary>

<table><thead><tr><th width="208.50390625">Field</th><th width="88.3359375">Type</th><th>Description</th></tr></thead><tbody><tr><td>value</td><td>number</td><td>The payout amount in MYR.</td></tr><tr><td>external_invoice_ref</td><td>string</td><td>External reference number you assign the client for tracking the payout.</td></tr><tr><td>payout_invoice_no</td><td>string</td><td>Unique internal invoice number for this payout transaction.</td></tr><tr><td>payout_account_number</td><td>string</td><td>The destination bank account number used in the payout.</td></tr><tr><td>created_at</td><td>string</td><td>ISO 8601 timestamp when the payout was initiated.</td></tr><tr><td>transaction_status</td><td>string</td><td>Status of the payout transaction. Possible values: SUCCESS, FAILED, PENDING.</td></tr></tbody></table>

</details>

<details>

<summary>uuid  <sup><sub><code>string | null</code></sub></sup> </summary>

Unique request identifier useful for debugging or tracing logs.

</details>

<details>

<summary>message  <sup><sub><code>string | null</code></sub></sup> </summary>

Optional human-readable message (e.g., for error or info).

</details>

<details>

<summary>error  <sup><sub><code>string | null</code></sub></sup> </summary>

Optional error description if something went wrong.

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.payright.my/api/payout/get-payout.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
