# Accepting via Payment Page

By following these steps, you can quickly integrate payment collection into your applications using our payment page. This method is efficient and requires minimal integration effort

## Authentication

LeanX uses **Auth Token** to authenticate in each request's header.

{% hint style="info" %}
**Auth Token** can be retrieved in your portal dashboard under **API** page.
{% endhint %}

**Request Header**

{% code overflow="wrap" %}

```json
{
    "auth-token": "LP-0D7C06DE-MM|7394e58e-edee-4c42-9ca5-bcbc449f1b9f|2141df4a3cb633d5ce8683bb0c55067e5caebfbe07390dde277dc455bcc95c91723a81b5e565c7c02d68fb84e396722563016bf99e576a4b8cdbe4423fbf226b"
}
```

{% endcode %}

## Step 1 : Getting Payment Page URL

This will create a bill and return a URL to our LeanX Payment page.

HTTP Method: <mark style="color:yellow;">POST</mark>

```
https://api.leanx.dev/api/v1/merchant/create-bill-page
```

**Query**

| Query       | Type   | Description      |
| ----------- | ------ | ---------------- |
| invoice\_no | String | Your bill number |

**Request Body**

```json
{
  "collection_uuid": "DP-1F6762F9E4-LX",
  "amount": 119.00,
  "invoice_ref": "INV023312312",
  "redirect_url": "https://www.yourdomain.com/return-page",
  "callback_url": "https://www.yourdomain.com/api-callback-url",
  "full_name": "puteri balqis",
  "email": "puteri.balqis@gmail.com",
  "phone_number": "0112459822"
}
```

**Attributes**

<table><thead><tr><th width="251">Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>collection_uuid<mark style="color:red;">*</mark></td><td>String</td><td>Your <a data-mention href="/pages/uBFnFoiRAhttK0FpKVke">/pages/uBFnFoiRAhttK0FpKVke</a> UUID</td></tr><tr><td>amount<mark style="color:red;">*</mark></td><td>Decimal (10,2)</td><td>Total amount to be paid in MYR</td></tr><tr><td>invoice_ref<mark style="color:red;">*</mark></td><td>String</td><td>Merchant Invoice Reference</td></tr><tr><td>callback_url</td><td>String</td><td>Your callback URL</td></tr><tr><td>redirect_url<mark style="color:red;">*</mark></td><td>String</td><td>Your redirect URL</td></tr><tr><td>full_name<mark style="color:red;">*</mark></td><td>String</td><td>Name of the payer</td></tr><tr><td>email<mark style="color:red;">*</mark></td><td>String</td><td>Email of the payer</td></tr><tr><td>phone_number<mark style="color:red;">*</mark></td><td>String</td><td>Mobile number of the payer</td></tr></tbody></table>

**Response**

```json
{
  "response_code": 2000,
  "description": "SUCCESS",
  "app_version": "/api/v1",
  "talk_to_server_before": "2023-11-28T17:06:33.905941",
  "data": {
    "collection_uuid": "DP-1F6762F9E4-LX",
    "redirect_url": "https://www.yourdomain.com/return-page",
    "bill_no": "bpdp-0C7D3D2826-lx",
    "invoice_ref": "INV023312312"
  },
  "breakdown_errors": "",
  "token": ""
}
```

***

## Step 2 : Getting transaction status

This API provides a link to retrieve the status of previous transactions, encompassing all payment statuses.

HTTP Method: <mark style="color:yellow;">POST</mark>

```
https://api.leanx.dev/api/v1/merchant/manual-checking-transaction
```

#### Request Query

```json
?invoice_no=BP-AD5112621A-LNP
```

#### Attributes

<table><thead><tr><th width="281.3333333333333">Property</th><th width="103">Type</th><th>Description</th></tr></thead><tbody><tr><td>invoice_no</td><td>string</td><td>The transaction <strong>invoice number</strong> for which you want to retrieve the status can be either a system-generated invoice number or an invoice_ref added by the merchant.</td></tr></tbody></table>

#### Response

```json
{
  "response_code": 2000,
  "description": "SUCCESS",
  "app_version": "/api/v1",
  "talk_to_server_before": "2024-03-29T15:59:17.597177",
  "data": {
    "transaction_details": {
      "invoice_no": "BP-AD5112621A-LNP",
      "fpx_invoice_no": "FPX17116902144iiAlu58",
      "amount": "15.00",
      "invoice_status": "SUCCESS",
      "providerTypeReference": "FPX",
      "bank_provider": "Maybank2U",
      "category_code": "WEBPAY",
      "amount_with_fee": 15.80,
      "fee": 0.80,
      "fee_by_customer": false
    },
    "customer_details": {
      "name": "Ahmad Fuad",
      "phone_number": "0123249478",
      "email": "ahmadfuadzamri@gmail.com"
    }
  },
  "breakdown_errors": "",
  "token": ""
}
```


---

# 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.leanx.io/api-docs/quick-start/accepting-via-payment-page.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.
