Skip to main content

Payment request

Use the entered payment information to request payment to the LINE Pay server. Specify the customer's order details and payment method in the payment information. If the payment request is processed without any issues, the customer is redirected to the LINE Pay authentication screen.

Also, a transaction ID is issued as a response to this API, which can be used to request payment confirmation, void, capture, and refund.

POST /v3/payments/request

Set the read timeout to at least 10 seconds.

Path

None

Query

None

Body

Name
TypeLengthDescription
Required
amountnumber

Payment amount. This is the sum of the purchase amounts (packages[].amount) and fees (packages[].userFee) of the entire product package.

currencystring3

Payment currency code (ISO 4217). Supported currency codes are as follows.

  • "USD"
  • "TWD"
  • "THB"
optionsobject

Payment request settings

orderIdstring100

Order ID. Enter the ID generated by the merchant to manage orders.

packages[]object array

Product package information classified by delivery unit or store unit

redirectUrlsobject

Redirection URL information for post-processing of payment request

Headers
  • Content-Type
  • X-LINE-Authorization
  • X-LINE-Authorization-Nonce
  • X-LINE-ChannelId
  • X-LINE-MerchantDeviceProfileId

For more information, see Request header.

Request examples

curl -X POST \
-H "Content-Type: application/json" \
-H "X-LINE-ChannelId: YOUR_CHANNEL_ID" \
-H "X-LINE-Authorization-Nonce: GENERATED_NONCE" \
-H "X-LINE-Authorization: PROCESSED_SIGNATURE" \
-H "X-LINE-MerchantDeviceProfileId: YOUR_DEVICE_PROFILE_ID" \
-d '{
"amount": 100,
"currency": "TWD",
"orderId": "MKSI_S_20180904_1000001",
"packages": [
{
"id": "1",
"amount": 100,
"products": [
{
"id": "PEN-B-001",
"name": "Pen Brown",
"imageUrl": "https://pay-store.example.com/images/pen_brown.jpg",
"quantity": 2,
"price": 50
}
]
}
],
"redirectUrls": {
"confirmUrl": "https://pay-store.example.com/order/payment/authorize",
"cancelUrl": "https://pay-store.example.com/order/payment/cancel"
}
}'
https://sandbox-api-pay.line.me/v3/payments/request