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

# Create

### The payin flowchart

<img src="https://mintcdn.com/gopay/sF8dw_ucY0cv3ekq/api-reference/en/images/payin.png?fit=max&auto=format&n=sF8dw_ucY0cv3ekq&q=85&s=5bd1f889f13ae5131f33c9968fb68ec7" alt="flowchart" width="3670" height="1804" data-path="api-reference/en/images/payin.png" />

### Request URL

* `https://gateway.pay247.io/gateway/payin/create`

### Request Method

* POST

### Request Parameters

| Parameter           | Must | Type   | Explanation                                                                                                               |
| :------------------ | :--- | :----- | ------------------------------------------------------------------------------------------------------------------------- |
| mch\_id             | Yes  | string | Merchant ID                                                                                                               |
| mch\_order\_no      | Yes  | string | Merchant Order NO.                                                                                                        |
| mch\_user\_id       | Yes  | string | Merchant's User ID（When a user’s order is not paid, it allows for faster query and troubleshooting.）                      |
| currency            | Yes  | string | Support【CNY,JPY,PHP,THB, Please Contact BD】                                                                               |
| amount              | Yes  | string | 99.11                                                                                                                     |
| pay\_method         | No   | string | [Pay Methods](/api-reference/en/common/#dict) If leave it empty， the user will use our cashier to choose pay method       |
| pay\_theme          | No   | string | 'link': pay247 cashier, 'custom': return pay params for custom cashier, If leave it empty， the user will use our cashier, |
| client\_ip          | Yes  | string | The IP address of the ordering user (must be the user's real IP).                                                         |
| notify\_url         | Yes  | string | If the order changed will notify the server url                                                                           |
| return\_url         | No   | string | If paid success, will return to this url                                                                                  |
| payer\_id           | No   | string | \[Some pay method needs] the payer ID.                                                                                    |
| payer\_name         | No   | string | \[Some pay method needs] the payer name                                                                                   |
| payer\_phone        | No   | string | \[Some pay method needs] the payer phone                                                                                  |
| payer\_email        | No   | string | \[Some pay method needs] the payer email                                                                                  |
| payer\_account\_no  | No   | string | \[Some pay method needs] the payer account\_no                                                                            |
| payer\_address      | No   | string | \[Some pay method needs] the payer address                                                                                |
| payer\_bank\_code   | No   | string | \[Some pay method needs] the payer bank code    [Bank List](/api-reference/en/banks/bank_ph)                              |
| payer\_branch\_code | No   | string | \[Some pay method needs] the payer branch code                                                                            |
| timestamp           | Yes  | string | timestamp millisecond                                                                                                     |
| version             | Yes  | string | v3.0                                                                                                                      |
| uuid                | Yes  | string | Request ID: 550e8400-e29b-41d4-a716-446655440000                                                                          |
| sign                | Yes  | string | Signature                                                                                                                 |

### Optional Parameters

| Currency | Pay method | Required                                           |
| :------- | :--------- | -------------------------------------------------- |
| 🇹🇭 THB | BANK       | payer\_name, payer\_account\_no, payer\_bank\_code |
| 🇯🇵 JPY | BANK       | payer\_name, payer\_address                        |

[//]: # "| 🇯🇵 JPY             | BANK_UN        | payer_name(Katakana), payer_account_no, payer_bank_code, payer_branch_code |"

### For example

```
{
  "mch_id": "Q0P5T8DOGN10000",
  "mch_order_no": "TRADE-405189",
  "mch_user_id": "U405189",
  "currency": "CNY",
  "amount": "99.11",
  "pay_mehod": "GCASH",
  "pay_theme": "link",
  "notify_url": "https://x.com/notify",
  "return_url": "https://x.com/return",
  "timestamp": "1693233334134",
  "version": "v3.0",
  "client_ip": "8.8.8.8",
  "uuid": "550e8400-e29b-41d4-a716-446655440000",
  "sign": "81930c5a04d1c58fd1efe33b06e2ffa7"
}
```

### Response Data

| Parameter      | Must     | Type   | Explanation                                                             |
| :------------- | :------- | :----- | ----------------------------------------------------------------------- |
| mch\_id        | Yes      | string | Merchant ID.                                                            |
| order\_no      | Yes      | string | System Order No.                                                        |
| mch\_order\_no | Yes      | string | Merchant Order No.                                                      |
| currency       | Yes      | string | CNY、 THB、PHP、VND... See more at backoffice                              |
| amount         | Yes      | string | 99.11                                                                   |
| pay\_method    | Yes      | string | pay method                                                              |
| pay\_theme     | Yes      | string | pay theme, link: pay247 cashier, custom: for merhcant to custom cashier |
| pay\_url       | Optional | string | payment url for theme of link,  need to redirect here                   |
| pay\_params    | Optional | object | payment params for theme of custom, need to custom cashier page         |
| status         | No       | string | The order status                                                        |

### For example (Cashier)

```
{
	"code": 0,
	"message": "success",
	"uuid": "550e8400-e29b-41d4-a716-446655440000",
	"timestamp": "1693233334134",
	"data": {
		"mch_id": "MCH12345678",
		"mch_order_no": "23082822325936693122",
		"order_no": "MO202308282232593669984082",
		"currency": "USD",
		"amount": "59.12",
		"pay_method": "BANK",
		"pay_theme": "link",
		"status": "PENDING",
		"pay_url": "https://pay.xxx.com/link/DyDpCjDfkr"
	}
}
```

### For example USDT

* Request

```
{
  "mch_id": "Q0P5T8DOGN10000",
  "mch_order_no": "TRADE-405189",
  "mch_user_id": "U405189",
  "currency": "USDT",
  "amount": "99.11",
  "pay_mehod": "TRC20",
  "notify_url": "https://x.com/notify",
  "return_url": "https://x.com/return",
  "timestamp": "1693233334134",
  "version": "v3.0",
  "client_ip": "8.8.8.8",
  "uuid": "550e8400-e29b-41d4-a716-446655440000",
  "sign": "81930c5a04d1c58fd1efe33b06e2ffa7"
}
```

* Response

```
{
	"code": 0,
	"message": "success",
	"uuid": "550e8400-e29b-41d4-a716-446655440000",
	"timestamp": "1693233334134",
	"data": {
		"mch_id": "MCH12345678",
		"mch_order_no": "23082822325936693122",
		"order_no": "MO202308282232593669984082",
		"currency": "USDT",
		"amount": "59.12",
		"pay_method": "ERC20",
		"status": "PENDING",
		"pay_url": "https://pay.xxx.com/link/DyDpCjDfkr"
	}
}
```

### For example (Custom) Support JPY

```
{
	"code": 0,
	"message": "success",
	"uuid": "550e8400-e29b-41d4-a716-446655440000",
	"timestamp": "1693233334134",
	"data": {
		"mch_id": "MCH12345678",
		"mch_order_no": "23082822325936693122",
		"order_no": "MO202308282232593669984082",
		"currency": "USD",
		"amount": "59.12",
		"pay_method": "BANK",
		"pay_theme": "custom",
		"status": "PENDING",
		"pay_params": {
			"payee_name": "日本測試卡",
			"payee_account_no": "123",
			"payee_bank_name": "三菱UFJ銀行",
			"payee_branch_name": "日本測試卡",
			"qr": ""
		}
	}
}
```

### For example (Custom) Support INR

```
{
	"code": 0,
	"message": "success",
	"uuid": "219bf2a2-8994-4ab0-b850-a5c1c70316e5",
	"timestamp": 1756736237009,
	"data": {
		"mch_order_no": "1119132492",
		"order_no": "PI202509012031309225639045",
		"currency": "INR",
		"amount": "23000.00",
		"pay_method": "UPI",
		"fee": "1495.00",
		"pay_theme": "custom",
		"utr": "395141536523",
		"error": null,
		"status": "PENDING",
		"pay_params": {
			"payee_name": "AJ ENTERPRISE",
			"payee_account_no": "ajenter66@sbi",
			"payee_bank_name": "",
			"payee_branch_name": "",
			"qr": "upi://pay?pa=ajenter66@sbi&pn=AJ ENTERPRISE&tn=O04T&am=22999.48&cu=INR&featuretype=money_transfer",
			"payee_phone": ""
		}
	}
}
```
