# Payment Link

## Integration

See integration detail in [General integration steps](/upc/payment-gateway/payment-solution/general-integration-steps.md)

{% hint style="info" %}
Refer to the [Code Samples and API Playground](https://uat-demo.galaxypay.vn/documents#post-/api/v1/transaction/createPaymentLink) for detailed sample code and API testing.
{% endhint %}

| Endpoint URL | Route                                |
| ------------ | ------------------------------------ |
| Base URL     | api/v1/transaction/createPaymentLink |

Example:

{% embed url="<https://uat-secure.galaxypay.vn/api/v1/transaction/createPaymentLink>" %}

### Request Message

#### Header

<table><thead><tr><th width="92">Level</th><th width="152">Field Name</th><th width="199">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>apiKey</td><td>Alphanumeric<br><em><mark style="color:blue;">mandatory</mark></em></td><td>Request authenticate</td></tr><tr><td>1</td><td>signature</td><td>Alphanumeric<br><em><mark style="color:blue;">mandatory</mark></em></td><td>Request signature</td></tr></tbody></table>

#### Body

<table><thead><tr><th width="89">Level</th><th width="166">Field Name</th><th width="197">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>requestID</td><td>Alphanumeric(50)<br><em><mark style="color:blue;">mandatory</mark></em></td><td><p>Unique ID for each transaction request</p><p></p><p><strong>Recommend</strong>: GUID</p></td></tr><tr><td>1</td><td>requestDateTime</td><td>Numeric(14)<br><em><mark style="color:blue;">mandatory</mark></em></td><td><strong>yyyyMMddHHmmss</strong></td></tr><tr><td>1</td><td>requestData</td><td>JSON Object</td><td><br></td></tr><tr><td>2</td><td>orderID</td><td>Alphanumeric(50)<br><em><mark style="color:blue;">mandatory</mark></em></td><td>Transaction ID at Merchant</td></tr><tr><td>2</td><td>orderName</td><td>Alphanumeric(250)<br><em><mark style="color:blue;">mandatory</mark></em></td><td>Transaction Reference</td></tr><tr><td>2</td><td>orderAmount</td><td>Numeric(16)<br><em><mark style="color:blue;">mandatory</mark></em></td><td>Transaction Amount</td></tr><tr><td>2</td><td>orderCurrency</td><td>Alpha(3)<br><em><mark style="color:blue;">mandatory</mark></em></td><td>Send the code in <a href="https://docs.galaxypay.vn/upc/payment-gateway/appendix/currencies">Currencies</a></td></tr><tr><td>2</td><td>orderDescription</td><td>Alphanumeric(250)<br><em><mark style="color:blue;">mandatory</mark></em></td><td>Transaction Description</td></tr><tr><td>2</td><td>expiryDuration</td><td>Integer<br><em><mark style="color:blue;">mandatory</mark></em></td><td>Payment link expiration </td></tr><tr><td>2</td><td>expiryUnit</td><td>Alpha<br><em><mark style="color:blue;">optional</mark></em></td><td><strong>DAY</strong> or <strong>HOUR</strong> or <strong>MINUTE</strong><br>Default = <strong>DAY</strong></td></tr><tr><td>2</td><td>paymentMethods</td><td>JSON Array<br><em><mark style="color:blue;">mandatory</mark></em></td><td><pre><code>[
        "GALAXYPAY",
        "MPGS",
        "QRPAY",
        "MOMO",
        "ZALOPAY",
        "NAPAS"
]
</code></pre></td></tr><tr><td>2</td><td>paymentFields</td><td>JSON Array<br><em><mark style="color:blue;">mandatory</mark></em></td><td><pre><code>[
        "email",
        "fullname",
        "phone",
        "shippingAddress"
]
</code></pre></td></tr><tr><td>2</td><td>ipnURL</td><td>Alphanumeric(500)<br><em><mark style="color:blue;">optional</mark></em></td><td>IPN URL</td></tr><tr><td>2</td><td>language</td><td>Alpha(2)<br><em><mark style="color:blue;">optional</mark></em></td><td><p><strong>vi</strong> or <strong>en</strong></p><p>vi: Vietnamese</p><p>en: English</p></td></tr><tr><td>2</td><td>subMerchant</td><td>JSON Object<br><em><mark style="color:blue;">optional</mark></em></td><td>Only use for master merchant scope</td></tr><tr><td>3</td><td>identifier</td><td>String(50)<br><em><mark style="color:blue;">optional</mark></em></td><td>Sub-merchant </td></tr></tbody></table>

```
{
    "requestID": "7543669308d942569694bc2eb9e1117b",
    "requestDateTime": 20250410094723,
    "requestData": {
        "orderID": "a8f400e2f53744f1a72f6676988a677a",
        "orderName": "Payment for API Playground",
        "orderAmount": 100000,
        "orderCurrency": "VND",
        "orderDescription": "API Playground Demo",
        "expiryDuration": 3,
        "expiryUnit": "DAY",
        "paymentMethods": [
            "GALAXYPAY",
            "MPGS",
            "QRPAY",
            "MOMO",
            "ZALOPAY",
            "NAPAS"
        ],
        "paymentFields": [
            "mail",
            "fullname",
            "phone",
            "shippingAddress"
        ],
        "ipnURL": "https://uat-merchant.galaxypay.vn/api/ipn",
        "language": "vi"
    }
}' 
```

### Response Message

#### Header

<table><thead><tr><th width="91">Level</th><th width="166">Field name</th><th width="192">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>signature</td><td>Alphanumeric<br><em><mark style="color:blue;">mandatory</mark></em></td><td>Response signature</td></tr></tbody></table>

#### Body

<table><thead><tr><th width="94">Level</th><th width="180">Field name</th><th width="188">Data type</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>requestID</td><td>Alphanumeric(50)<br><em><mark style="color:blue;">mandatory</mark></em></td><td>Original Request ID</td></tr><tr><td>1</td><td>responseDateTime</td><td>Numeric(14)<br><em><mark style="color:blue;">mandatory</mark></em></td><td><strong>yyyyMMddHHmmss</strong></td></tr><tr><td>1</td><td>responseData</td><td>JSON Object<br><em><mark style="color:blue;">mandatory</mark></em></td><td>Response data</td></tr><tr><td>2</td><td>orderNo</td><td>Alphanumeric<br><em><mark style="color:blue;">mandatory</mark></em></td><td>GALAXY PAY order no</td></tr><tr><td>2</td><td>shortLink</td><td>Alphanumeric<br><em><mark style="color:blue;">mandatory</mark></em></td><td>Payment Link URL</td></tr><tr><td>1</td><td>responseCode</td><td>Numeric(3)<br><em><mark style="color:blue;">mandatory</mark></em></td><td>See <a href="/pages/sBk2eUqKYscTG2fiXwOK">Response Codes</a> for more detail</td></tr><tr><td>1</td><td>responseMessage</td><td>Alphanumeric(250)<br><em><mark style="color:blue;">mandatory</mark></em></td><td>Response message</td></tr></tbody></table>

```
{
  "requestID": "307826170e3e4a1b80430e074c7ba762",
  "responseDateTime": 20250410094723,
  "responseData": {
    "orderNo": "3258202405201716180392818",
    "shortLink": "https://example-payment..."
  },
  "responseCode": "200",
  "responseMessage": "Success"
}
```


---

# 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.galaxypay.vn/upc/payment-gateway/api-specification/payment/payment-link.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.
