# Checkout(for modal checkout)

## Integration

See integration detail in [General integration steps](https://docs.galaxypay.vn/upc/payment-gateway/payment-solution/general-integration-steps)

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

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

Example:

<https://uat-secure.galaxypay.vn/api/v1/transaction/checkout>

### 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="175">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>orderNumber</td><td>Alphanumeric(20)<br><em><mark style="color:blue;">optional</mark></em></td><td>Order Number or Bill Number</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>orderNetAmount</td><td>Numeric(16)<br><em><mark style="color:blue;">mandatory</mark></em></td><td>Subtotal Amount</td></tr><tr><td>2</td><td>orderFeeAmount</td><td>Numeric(16)<br><em><mark style="color:blue;">mandatory</mark></em></td><td>Fee Amount</td></tr><tr><td>2</td><td>orderDiscountAmount</td><td>Numeric(16)<br><em><mark style="color:blue;">mandatory</mark></em></td><td>Discount 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="../../appendix/currencies">Currencies</a></td></tr><tr><td>2</td><td>orderDateTime</td><td>Numeric(14)<br><em><mark style="color:blue;">mandatory</mark></em></td><td><strong>yyyyMMddHHmmss</strong></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>paymentMethod</td><td>Alphanumeric<br><em><mark style="color:blue;">mandatory</mark></em></td><td>See <a href="../../../appendix#payment-methods">Payment Method</a></td></tr><tr><td>2</td><td>sourceType</td><td>Alphanumeric(20)<br><em><mark style="color:blue;">condition</mark></em></td><td><p><strong>NOT Required</strong> <strong>when</strong> paymentMethod = <strong>DOMESTIC</strong> or <strong>INTERNATIONAL</strong> <br></p><p>See <a href="../../../appendix#payment-methods">Payment Method</a> for more detail</p></td></tr><tr><td>2</td><td>language</td><td>Alpha(2)<br><em><mark style="color:blue;">optional</mark></em></td><td><p>vi or en</p><p></p><p>vi: Vietnamese</p><p>en: English</p></td></tr><tr><td>2</td><td>customerToken</td><td>Alphanumeric<br><em><mark style="color:blue;">optional</mark></em></td><td>Customer identify information that is use for management the linked payment tokens.</td></tr><tr><td>2</td><td>extraData</td><td>JSON Object</td><td><p>Extra data. </p><p>Same as <a href="../pay#body">API Pay</a></p></td></tr></tbody></table>

```
{
  "requestID": "aaa04cf8d97f4c6ebede69135d1bce35",
  "requestDateTime": "20230726175152",
  "requestData": {
    "orderID": "2a43e4b9-c5df-49e6-8b18-42af9bcd150e",
    "orderNumber": 205249008064,
    "orderDateTime": 20230726175152,
    "orderAmount": 100000,
    "orderNetAmount": 100000,
    "orderFeeAmount": 0,
    "orderDiscountAmount": 0,
    "orderCurrency": "VND",
    "orderDescription": "DEMO TRANSACTION",
    "paymentMethod": "DOMESTIC",
    "sourceType": "",
    "customerToken": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI5NXU2MzRKYkZ4VnlBOTVwLVA3ZnpiS3NzcEFhaUFHYmdpcVBmbGktcG9RIn0",
    "language": "vi",
    "extraData": {
    }
  }
}

```

### 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="173">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>responseCode</td><td>Numeric(3)<br><em><mark style="color:blue;">mandatory</mark></em></td><td>See <a href="../../appendix/response-codes">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><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>transactionID</td><td>Alphanumeric<br><em><mark style="color:blue;">mandatory</mark></em></td><td>GALAXY PAY transaction ID</td></tr><tr><td>2</td><td>endpoint</td><td>Alphanumeric<br><em><mark style="color:blue;">mandatory</mark></em></td><td>Checkout URL</td></tr></tbody></table>

```
{
    "requestID": "aaa04cf8d97f4c6ebede69135d1bce35",
    "responseDateTime": "20230726175152",
    "responseCode": "200",
    "responseMessage": "Success",
    "responseData": {
        "transactionID": "2307264957979741566492040",
        "endpoint": "https://uat-payment.galaxypay.vn/checkout/2307264957979741566492040/20230726175152/88170618c769f6af5e599403de5722cb1d1b775b62a8714435d3c4dfba51fed5"
    }
}
```


---

# 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/checkout-for-modal-checkout.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.
