# LINE Pay Online API reference
# Payment API
# Infra and Tech Support
For technical support, such as inquiries on internal errors or infra, contact (pay_tech@linecorp.com).
Environment | URL | Description |
---|---|---|
Sandbox | https://sandbox-api-pay.line.me | Environment for integration testing. You can process the payment on Sandbox’s web simulation payment page instead of LINE Pay. |
Production | https://api-pay.line.me | Real service environment. |
# API authentication
Describes authentication and its methods of the Payment API of LINE Pay. You can check Channel ID and Channel SecretKey information required for the authentication from the merchant center (https://pay.line.me (opens new window)) after the merchant review is complete. For synchronization, LINE Pay supports the Sandbox environment. You can check both the test channel info (ID, SecretKey) usable in the Sandbox environment and the actual channel info (ID, SecretKey) in the production environment from the merchant center.
# Hmac Signature
- Algorithm: HMAC-SHA256
- Key: Channel Secret (Provides Channel Id and Channel SecretKey from the LINE Pay merchants)
- Http Method
- GET: Channel Secret + URI + Query String + nonce
- POST: Channel Secret + URI + Request Body + nonce
# X-LINE-Authorization-Nonce
Use the one-time random value nonce when generating HMAC signature to block signature generation and thereby prevent abuse. The one-time nonce can use UUID 1 or 4 (opens new window) or a timestamp.
# HTTP Method: GET
Signature = Base64(HMAC-SHA256(Your ChannelSecret, (Your ChannelSecret + URL Path + Query String + nonce)))
Query String: A query string except ?
(e.g. Name1=Value1&Name2=Value2...)
# HTTP Method: POST
Signature = Base64(HMAC-SHA256(Your ChannelSecret, (Your ChannelSecret + URL Path + RequestBody + nonce)))
The API authentication verifies channels and messages created through the signature using the Channel SecretKey.
Take special care to avoid external exposure, as it could be dangerous.
# Common HTTP Request Header
This is a detailed explanation on common headers of LINE Pay APIs authentication. HTTP header information for the authentication is listed in the table below. X-LINE-ChannelId
is the Channel ID, and the signature information generated with the Channel SecretKey should be set on X-LINE-Authorization
. Generate one-time values randomly to use the X-LINE-Authorization-Nonce
and to prevent the same signature from being used.
Content-Type
String
application/json
X-LINE-ChannelId
String
Payment integration information - Channel ID
X-LINE-MerchantDeviceProfileId
String
Offline support - Device type
X-LINE-Authorization-Nonce
String
UUID or Request timestamp
X-LINE-Authorization
String
HMAC Base64 Signature
# Request
Requests payment information to LINE Pay. User can change settings such as order information or various payment methods. Once the request is successful, a transaction ID is generated, and with the ID, you can complete the payment or process refund.
# API Spec
POST /v3/payments/request
- Connection Timeout: 5 seconds
- Read Timeout: 20 seconds
# Request body
amount
Number
Payment amount.
= sum(packages[].amount) + sum(packages[].userFee) + options.shipping.feeAmount
currency
String
orderId
String
An order ID of payment request from the merchant. A unique ID managed by the merchant.
Max length: 100
packages[].id
String
A unique ID of package list.
Max length: 50
packages[].amount
Number
Total number of products per package.
=sum(products[].quantity * products[].price)
packages[].userFee
Number
User fee: Respond if a commission is found within the payment amount.
packages[].name
String
Name of the package or name of internal shops.
Max length: 100
packages[].products[].id
String
ID of sales products of the merchant.
Max length: 50
packages[].products[].name
String
Name of the sales products.
Max length: 4,000
packages[].products[].imageUrl
String
Image URL of the sales products.
Max length: 500
packages[].products[].quantity
Number
Number of products.
packages[].products[].price
Number
Price of each product.
packages[].products[].originalPrice
Number
Original price of each product.
redirectUrls.appPackageName
String
Information to prevent phishing while transferring between apps in Android.
Max length: 4,000
redirectUrls.confirmUrl
String
A merchant URL that the user moves to after authorizing payment.
Max length: 500
redirectUrls.confirmUrlType
String
A navigation type of the ConfirmURL after the user authorizes payment.
redirectUrls.cancelUrl
String
A URL that moves to the next when LINE Pay member cancels the payment from the payment page.
Max length: 500
options.payment.capture
Boolean
Regarding automatic payment.
- True: Processing authorization and purchase with the Confirm API at the same time.
- False: Authorized with the Confirm API but need to purchase with the Capture API.
options.payment.payType
String
Payment options:
- NORMAL
- PREAPPROVED
options.display.locale
String
Language codes of the payment standby screen. The default language is English (en).
Supported languages:
- en
- ja
- ko
- th
- zh_TW
- zh_CN
options.display.checkConfirmUrlBrowser
Boolean
Checking the payment browser when moving to the ConfirmURL.
- True: Guide user to go to the LINE Pay payment request browser if payment request browser and the ConfirmURL navigation browser are different.
- False: Move the ConfirmURL immediately without checking the browser.
options.shipping.type
String
Shipping address options.
- NO_SHIPPING
- FIXED_ADDRESS
- SHIPPING
options.shipping.feeAmount
String
Shipping fee.
options.shipping.feeInquiryUrl
String
A URL to check shipping method.
Max length: 500
options.shipping.feeInquiryType
String
Shipping fee options.
- CONDITION: Check the shipping method (fee) when the shipping address is changed.
- FIXED: If fixed, not checking the shipping address even after it's changed.
options.shipping.address.country
String
Shipping country.
Max length: 2
options.shipping.address.postalCode
String
Shipping postal code.
Max length: 10
options.shipping.address.state
String
Shipping region.
Max length: 100
options.shipping.address.city
String
Shipping address.
Max length: 100
options.shipping.address.detail
String
Shipping details.
Max length: 1,000
options.shipping.address.optional
String
Additional information of the shipping address.
Max length: 1,000
options.shipping.address.recipient.firstName
String
Recipient name.
Max length: 200
options.shipping.address.recipient.lastName
String
Recipient last name.
Max length: 200
options.shipping.address.recipient.firstNameOptional
String
Additional information of the recipient first name.
Max length: 200
options.shipping.address.recipient.lastNameOptional
String
Additional information of the recipient last name.
Max length: 200
options.shipping.address.recipient.email
String
Recipient email.
Max length: 100
options.shipping.address.recipient.phoneNo
String
Recipient phone number.
Max length: 50
options.familyService.addFriends[].type
String
Service type of the friend add list.
- line@
options.familyService.addFriends[].ids[]
List
A list of ID by service.
options.extra.branchName
String
Branch Name from which the payment is requested (Only 100 letters will be displayed if it's exceeded.)
Max length: 2,000
options.extra.branchId
String
Branch Id from which the payment is requested. It can be support alphanumerics and special characters.
Max length: 32
# Response
returnCode
String
Return code.
Max length: 4
returnMessage
String
Return message.
Max length: 300
info.transactionId
Number
Transaction ID.
Max length: 19
info.paymentAccessToken
String
The code value entered when code is used instead of scanner in LINE Pay.
Max length: 17
info.paymentUrl.app
String
App URL to move to the payment page.
- Used when payment reservation is done in the app.
- URL to move from the merchant app to LINE Pay.
Max length: 300
info.paymentUrl.web
String
Web URL to move to the payment page.
- Used when payment reservation is done in the web.
- URL to move to the LINE Pay payment standby page.
- Move to URL that's delivered without particular parameter.
- If opening a pop-up on desktop, follow the size: Width: 700px, Height: 546px
Max length: 300
# Return Codes
Code | Description |
---|---|
0000 | Success |
1104 | Nonexistent merchant |
1105 | The merchant cannot use the LINE Pay. |
1106 | Header information error |
1124 | Amount info error |
1145 | Payment in process |
1172 | A record of transaction with the same order number already exists. |
1178 | Unsupported currency |
1183 | The payment amount must be greater than 0. |
1194 | The merchant cannot use the preapproved payment. |
2101 | Parameter error |
2102 | JSON data format error |
9000 | Internal error |
# Request Details
Product
The payment order can be comprised of rich information with packages and products. A package refers to shipping unit, and the package can be comprised of various products.
RedirectUrls.confirmUrl
After user approves the payment request, the ConfirmURL is called automatically. The call of ConfirmURL informs the merchant that the payment can be completed with the Confirm API after the approval. The call also displays a screen with payment process status for users who are in between approval to payment completion.
The transactionID and merchant orderID are stored in a query string and sent to the ConfirmURL that's provided when requesting the LINE Pay payment. The orderID doesn't need to be added to the query string if it's already included. On the checkout payment, additionally selected shipping method (shippingMethodId) and shipping fee (shippingFeeAmount) are included.
- Reserved words: transactionId, orderId, shippingFeeAmount, shippingMethodId
RedirectUrls.cancelUrl
If user cancels the payment while processing with LINE Pay, the page moves to the cancellation page using the CancelURL sent through the Request API. Here, transactionID and orderID are also added and sent.
A URL to move to the merchant app or web when the payment is canceled via a mobile device.
confirmUrlType
These are ConfirmURL options to choose after user completes the payment request.
CLIENT
To complete the payment from user page, move to the completion page through the merchant ConfirmURL.
SERVER
Call the ConfirmURL from the LINE Pay server to the merchant server.
Must use
https
protocol, and in real environment use a trustworthy authentication.NONE
The ConfirmURL isn't used for cases, such as offline, that don't require showing the payment completion page. The merchant should regularly check the Payment Status API to check for user approval.
# Options
LINE Pay provides various payment methods and features in the family service. Use the services by setting fields in 'Options'.
Payment
Setting payment options
payType
- NORMAL
General payment
- PREAPPROVED
Automatic payment
# Display
User payment page and user payment flow settings are provided.
Locale
Supported languages in the payment standby page displayed to user
- en
- ja
- ko
- th
- zh_CN
- zh_TW
Reference: https://en.wikipedia.org/wiki/IETF_language_tag (opens new window)
# FamilyService
Describes supported features in the LINE Family services provided by LINE Pay.
addFriends
Add friends feature of LINE@.
Provides the add friends feature between the merchant LINE account and LINE Pay user account.
- Type
- lineAt: Supports LINE@ service add friend
# Confirm
Enables merchant to complete the payment when the user approves with the ConfirmURL or Check Payment Status API. Status of a payment where authorization and purchase are separated because 'options.payment.capture' of the Request API is set as false
will be on purchase standby (Authentication) even after it is completed. To complete the purchase, an additional purchase process is required through the Capture API.
# API Spec
POST /v3/payments/{transactionId}/confirm
- Connection Timeout: 5 seconds
- Read Timeout: 40 seconds
# Request Body
amount
Number
Payment amount.
currency
String
Payment currency (ISO 4217 (opens new window)).
Supported currencies are as follows.
- USD
- JPY
- TWD
- THB
Max length: 3
# Response
returnCode
String
Return code.
Max length: 4
returnMessage
String
Return message.
Max length: 300
info.orderId
String
A unique order ID of the merchant sent upon requesting payment.
Max length: 100
info.transactionId
Number
A transaction ID returned as a result of the payment request (19 digits).
info.authorizationExpireDate
String
Option: Authentication expiration date and time (ISO 8601 (opens new window))
Send if the payment proceeded only up to authentication (capture=false)
Max length: 30
info.regKey
String
Option: A key for automatic payment (15 digits).
info.payInfo[].method
String
Payment method used for payment.
- Credit card: CREDIT_CARD
- Balance: BALANCE
- Discount: DISCOUNT
info.payInfo[].amount
Number
Payment amount.
info.payInfo[].creditCardNickname
String
Option: Credit card nickname for automatic payment
- Credit card name managed at LINE Pay. This is the name registered when first registering on LINE Pay.
- If the LINE Pay user doesn't set a nickname, an empty string will be sent.
- The nickname can be changed upon the user's request, and the change history won't be shared with the merchant.
Max length: 100
info.payInfo[].creditCardBrand
String
Option: Credit card brand used for automatic payment.
- VISA
- MASTER
- AMEX
- DINERS
- JCB
Max length: 20
info.payInfo[].maskedCreditCardNumber
String
Masked credit card number (Send only for Taiwan merchants. Able to use the feature when requesting to the merchant center manager).
Format: **** **** **** 1234
Max length: 17
info.packages[].id
String
An unique ID of package list.
Max length: 50
info.packages[].amount
Number
Total amount of products per package.
=sum(products[].quantity * products[].price)
info.packages[].userFeeAmount
Number
User fee: Sent as a response if a list of fee is found within the payment amount.
info.shipping.methodId
String
An ID of shipping method selected by user.
Max length: 50
info.shipping.feeAmount
Number
Shipping fee.
info.shipping.address.country
String
Shipping country.
Max length: 2
info.shipping.address.postalCode
String
Shipping postal code.
Max length: 10
info.shipping.address.state
String
Shipping region.
Max length: 100
info.shipping.address.city
String
Shipping address.
Max length: 100
info.shipping.address.detail
String
Shipping detail.
Max length: 1,000
info.shipping.address.optional
String
Additional information of the shipping address.
Max length: 1,000
info.shipping.address.recipient.firstName
String
Recipient first name.
Max length: 200
info.shipping.address.recipient.lastName
String
Recipient last name.
Max length: 200
info.shipping.address.recipient.firstNameOptional
String
Additional information of the recipient first name.
Max length: 200
info.shipping.address.recipient.lastNameOptional
String
Additional information of the recipient last name.
Max length: 200
info.shipping.address.recipient.email
String
Recipient email.
Max length: 100
info.shipping.address.recipient.phoneNo
String
Recipient phone number.
Max length: 50
# Return Codes
Code | Description |
---|---|
0000 | Success |
1101 | Not a LINE Pay member |
1102 | The member is unable to proceed with the transaction. |
1104 | Nonexistent merchant |
1105 | The merchant cannot use LINE Pay. |
1106 | Header info error |
1110 | Unacceptable credit card |
1124 | Amount info error (scale) |
1141 | Payment account error |
1142 | Low balance |
1150 | Can't find the transaction history |
1152 | There is a history of transactions with the same transactionId. |
1153 | The payment amount is different from the requested amount. |
1159 | Payment request information isn't found. |
1169 | Must select a payment method and password authorization at LINE Pay. |
1170 | Balance of the member's account has changed. |
1172 | A record of transaction with the same order number already exists. |
1180 | The payment has expired. |
1198 | There has been a duplicate API call request. |
1199 | Internal request error |
1280 | A temporary error occurred while processing the credit card payment. |
1281 | Credit card payment error |
1282 | Credit card authorization error |
1283 | The payment was refused due to suspected fraud. |
1284 | The credit card payment has temporarily stopped. |
1285 | Missing credit card payment information |
1286 | Incorrect credit card payment information |
1287 | The credit card expired |
1288 | The credit card has a low balance |
1289 | Exceeded the credit card limit |
1290 | Exceeded the limit of the credit card per transaction |
1291 | The card has been reported as stolen. |
1292 | The card has been suspended. |
1293 | CVN input error |
1294 | The card is blacklisted. |
1295 | Incorrect credit card number |
1296 | Unable to process the amount |
1298 | The card has been declined. |
9000 | Internal error |
# Capture
Transactions that have set options.payment.capture as false
when requesting the Request API payment will be put on hold when the payment is completed with the Confirm API. To finalize the payment, an additional purchase with Capture API is required.
# API Spec
POST /v3/payments/authorizations/{transactionId}/capture
- Connection Timeout: 5 seconds
- Read Timeout: 60 seconds
# Request Body
amount
Number
Payment amount.
currency
String (3byte)
Payment currency (ISO 4217 (opens new window)).
Supported currencies are as follows.
- USD
- JPY
- TWD
- THB
# Response
returnCode
String (4byte)
Return code.
returnMessage
String
Return message or reason for failure. Examples:
- Unpayable merchant
- Merchant authorization information error
info.orderId
String
Order ID sent from the merchant when reserving a payment.
info.transactionId
Number
Order ID sent from the merchant when reserving a payment.
info[].payInfo[].method
String
A payment method used to process the payment.
- Credit card: CREDIT_CARD
- Balance: BALANCE
- Discount: DISCOUNT
info.payInfo[].amount
Number
Payment amount.
# Status Codes
Code | Description |
---|---|
0000 | Success. |
1104 | Nonexistent merchant. |
1105 | The merchant can't use LINE Pay. |
1106 | Header info error. |
1150 | Can't find the transaction history. |
1155 | Incorrect transaction number. |
1170 | Balance of the member's account has changed. |
1172 | A record of transaction with the same order number already exists. |
1179 | Unable to process the transaction. |
1183 | The payment amount must be greater than 0. |
1184 | The payment amount exceeds requested amount. |
1198 | Either there was a duplicate API call, or purchase API was called while re-authorization was automatically processed (Repeat after several minutes). |
1199 | Internal request error. |
1280 | A temporary error occurred while processing the credit card payment. |
1281 | Credit card payment error. |
1282 | Credit card authorization error. |
1283 | The payment was refused due to suspected fraud. |
1284 | The credit card payment has temporarily stopped. |
1285 | Missing credit card payment information. |
1286 | Incorrect credit card payment information. |
1287 | The credit card expired. |
1288 | The credit card has a low balance. |
1289 | Exceeded the credit card limit. |
1290 | Exceeded the limit of the credit card per transaction. |
1291 | The card has been reported as stolen. |
1292 | The card has been suspended. |
1293 | CVN input error. |
1294 | The card is blacklisted. |
1295 | Incorrect credit card number. |
1296 | Unable to process the amount. |
1298 | The card has been declined. |
9000 | Internal error. |
If 1199 or 1280~1298 error codes occur, the transaction will be automatically canceled.
# Void
Voids payment data that's in authentication status.
The Void API cancels the authentication transaction after the Confirm API completes the payment. Void can only cancel transactions in authentication status. Refund completed transactions with the Refund API.
# HTTP request
POST https://sandbox-api-pay.line.me/v3/payments/authorizations/{transactionId}/void
- Connection Timeout: 5 seconds
- Read Timeout: 20 seconds
# Request headers
Content-Type
application/json
X-LINE-ChannelId
Payment Integration Information - Channel ID
X-LINE-Authorization-Nonce
UUID or Request timestamp
X-LINE-Authorization
HMAC Base64 Signature
X-LINE-MerchantDeviceProfileId
Offline Support - Device Type
# Response
returnCode
String
Return code.
Length: 4
returnMessage
String
Returns message or reason for failure, such as:
- Unpayable merchant
- Merchant authentication information error
Max Length: 300
# Return Codes
Code | Description |
---|---|
0000 | Success |
1101 | Purchaser status error |
1102 | Purchaser status error |
1104 | Nonexistent merchant |
1105 | The merchant can't use LINE Pay. |
1106 | Header info error |
1150 | Can't find the transaction history. |
1155 | Incorrect transaction number |
1165 | This transaction has already been voided. |
1170 | Change in the member's account balance. |
1198 | There has been a duplicate API call request. |
1199 | Internal request error |
1900 | Temporary error. Try again later. |
1902 | Temporary error. Try again later. |
1999 | The request information is different from the previous one. |
9000 | Internal error |
Retry if the code returned is 1900, 1902, or 1999.
# Refund
Refunds transactions whose payment has been completed (purchase). The transaction ID of the LINE Pay user must be passed when refunded. Partial refund is also possible.
# API Spec
POST /v3/payments/{transactionId}/refund
- Connection Timeout: 5 seconds
- Read Timeout: 20 seconds
# Request Body
refundAmount
Number
Refund amount. Full refund if not returned.
# Response
returnCode
String
Return code.
Max length: 4
returnMessage
String
Return message or reason for failure.
Max length: 300
info.refundTransactionId
Number
Refund transaction ID (Newly issued, 19 digits).
info.refundTransactionDate
String
Refund transaction date (ISO 8601 (opens new window)).
Max length: 30
# Return Codes
Code | Description |
---|---|
0000 | Success |
1101 | Purchaser status error |
1102 | Purchaser status error |
1104 | Nonexistent merchant |
1105 | The merchant can't use LINE Pay. |
1106 | Header information error |
1124 | Account status error |
1150 | Can't find the transaction history |
1155 | Number of a transaction type that can't be refunded. |
1163 | Unable to refund since refundable date has passed. |
1164 | Exceeded refundable amount. |
1165 | This transaction has already been refunded. |
1179 | Unable to process the transaction. |
1198 | There has been a duplicate API call request. |
1199 | Internal request error |
9000 | Internal request |
# Payment details
Checks transaction history in LINE Pay. You can check histories of authentications and payment completions. With fields setting, you can selectively check transaction information or order information as needed.
# API Spec
GET /v3/payments
- Connection Timeout: 5 seconds
- Read Timeout: 20 seconds
# Request Parameter
transactionId[]
Number
Payment or refund transaction ID generated by LINE Pay.
orderId[]
String
Order ID of the merchant.
fields
String
Able to select targets to check.
- TRANSACTION
- ORDER
Default is ALL
More than one transaction ID or order ID should be sent in a parameter. Up to 100 IDs can be viewed in a list format.
# Response
Common information
returnCode
String
Return code.
Max length: 4
returnMessage
String
Return message or reason for failure.
Max length: 100
When checking the Transaction
type, the responses are:
info[].transactionId
Number
Transaction ID (19 digits).
info[].transactionDate
String
Transaction date(ISO-8601 (opens new window)).
Max length: 20
info[].transactionType
String
Transaction options:
- PAYMENT: Payment
- PAYMENT_REFUND: Refund
- PARTIAL_REFUND: Partial refund
info[].payStatus
String
Payment status.
- AUTHORIZATION: Authorization
- VOIDED_AUTHORIZATION: Voided authorization (called 'Void authorization API')
- EXPIRED_AUTHORIZATION: Expired authorization (when date given to merchants by LINE Pay has expired).
Max length: 20
info[].productName
String
Product name.
Max length: 4,000
info[].merchantName
String
Merchant name.
info[].currency
String
Currency (ISO 4217).
Max length: 3
info[].authorizationExpireDate
String
Expiration date of authorization (ISO-8601 (opens new window)).
Max length: 20
info[].payInfo[].method
String
A payment method used for payment.
- Credit card: CREDIT_CARD
- Balance: BALANCE
- Discount: DISCOUNT
info[].payInfo[].amount
Number
Transaction amount (Amount when generating the transaction ID).
Calculating method of the final transaction amount when checking the original transaction:
sum(info[].payInfo[].amount) – sum(refundList[].refundAmount)
In case of checking the Transaction
type when original and refund transactions are available
info[].refundList[].refundTransactionId
Number
Refund transaction ID (19 digits).
info[].refundList[].transactionType
String
Transaction options:
- PAYMENT_REFUND: Refund
- PARTIAL_REFUND: Partial refund
info[].refundList[].refundAmount
Number
Refund amount
info[].refundList[].refundTransactionDate
String
Date of refund transaction (ISO-8601 (opens new window)).
In case of checking the Transaction
type when checking the refund transaction
info[].originalTransactionId
Number
Original transaction ID (19 digits).
In case of checking the Order
type
info[].packages[].id
String
A unique ID of a package list
Max length: 50
info[].packages[].amount
Number
Total amount of products per package
= sum(products[].quantity * products[].price)
info[].packages[].userFeeAmount
Number
User fee: Respond if a commission item is found within the payment amount.
info[].packages[].name
String
Name of the package or name of internal shops.
Max length: 100
info[].packages[].products[].id
String
ID of sales products of the merchant.
Max length: 50
info[].packages[].products[].name
String
Name of the sales products.
Max length: 4,000
info[].packages[].products[].imageUrl
String
Image URL of the sales products.
Max length: 500
info[].packages[].products[].quantity
Number
Number of the products
info[].packages[].products[].price
Number
Price of each product
info[].packages[].products[].originalPrice
Number
Original price of each product.
info[].shipping.methodId
String
Shipping method ID selected by user.
Max length: 50
info[].shipping.feeAmount
Number
Shipping fee.
info[].shipping.address.country
String
Shipping country.
Max length: 2
info[].shipping.address.postalCode
String
Shipping postal code.
Max length: 10
info[].shipping.address.state
String
Shipping region
Max length: 100
info[].shipping.address.city
String
Shipping address.
Max length: 100
info[].shipping.address.detail
String
Shipping detail.
Max length: 1,000
info[].shipping.address.optional
String
Additional shipping information.
Max length: 1,000
info[].shipping.address.recipient.firstName
String
Recipient first name.
Max length: 200
info[].shipping.address.recipient.lastName
String
Recipient last name.
Max length: 200
info[].shipping.address.recipient.firstNameOptional
String
Additional information of the recipient first name.
Max length: 200
info[].shipping.address.recipient.lastNameOptional
String
Additional information of the recipient last name.
Max length: 200
info[].shipping.address.recipient.email
String
Recipient email.
Max length: 100
info[].shipping.address.recipient.phoneNo
String
Recipient phone number.
Max length: 50
# Return Codes
Code | Description |
---|---|
0000 | Success |
1104 | Nonexistent merchant |
1105 | The merchant can't use LINE Pay. |
1106 | Header info error |
1150 | Can't find the transaction history |
1177 | Exceeded maximum viewable transactions (Max. 100) |
9000 | Internal error |
# Check payment status
Checks payment request status of LINE Pay. The merchant should regularly check user payment confirm status without using ConfirmURL and decide whether it's possible to complete the payment.
Recommend 1 second for the request cycle of the Check Payment Status API.
# API Spec
GET /v3/payments/requests/{transactionId}/check
- Connection Timeout: 5 seconds
- Read Timeout: 20 seconds
# Response
returnCode
String
Return code.
Max length: 4
returnMessage
String
Return message or reason for failure.
Max length: 100
info.shipping.methodId
String
An ID of shipping method selected for failure.
Max length: 50
info.shipping.feeAmount
Number
Shipping fee.
# Return Code
Code | Description |
---|---|
0000 | Before authorization |
0110 | Completed authorization - Able to call the Confirm API |
0121 | Payment canceled by user or canceled because of timeout (20min). - Completed status |
0122 | Payment failed - Completed status |
0123 | Payment completed - Completed status |
1104 | Nonexistent merchant |
1105 | The merchant cannot use LINE Pay. |
9000 | Internal error |
# Check RegKey
# API Spec
GET /v3/payments/preapprovedPay/{regKey}/check
- Connection Timeout: 5 seconds
- Read Timeout: 20 seconds
# Parameter
creditCardAuth
Boolean
Whether credit cards issued with RegKey have authorized minimum amount.
- True: Through LINE Pay verification and authentication of minimum amount of credit card, check the status of RegKey. This requires review from the LINE Pay manager.
- False: Check the RegKey status with LINE Pay verification.
# Response
returnCode
String
Return code.
Max length: 4
returnMessage
String
Return message.
Max length: 300
# Return Codes**
Code | Description |
---|---|
0000 | Success |
1101 | A purchaser status error |
1102 | A purchaser status error |
1104 | Nonexistent merchant |
1105 | The merchant can't use LINE Pay. |
1106 | Header information error |
1141 | Account status error |
1154 | Unavailable preapproved payment account |
1190 | The regKey doesn't exist. |
1193 | The regKey has expired. |
# Pay preapproved
An automatic payment registration process is required using Request API and Confirm API. With RegKey sent through the Confirm API, the payment can be processed without user approval.
# API Spec
POST /v3/payments/preapprovedPay/{regKey}/payment
- Connection Timeout: 5 seconds
- Read Timeout: 40 seconds
# Request Body
productName
String
Product name.
Max length: 4,000
amount
Number
Payment amount.
currency
String
orderId
String
A unique order ID.
Max length: 100
capture
Boolean
Purchase.
- True: Authorized and purchased
- False: Authorized but need to purchase with Capture API
# Response
returnCode
String
Return code.
Max length: 4
returnMessage
String
Return message.
Max length: 100
info.orderId
String
A unique order ID sent upon requesting payment.
Max length: 100
info.transactionId
Number
A transaction ID returned as a result of payment reservation (19 digits).
info.transactionDate
String
Transaction date (ISO 8601 (opens new window)).
Max length: 30
info.authorizationExpireDate
String
Expiration date (ISO 8601 (opens new window)).
Max length: 30
# Return Codes
Code | Description |
---|---|
0000 | Success |
1101 | Not a LINE Pay member |
1102 | The member is unable to proceed with the transaction. |
1104 | Nonexistent merchant |
1105 | The merchant cannot use the LINE Pay. |
1106 | Header info error |
1110 | Unacceptable credit card |
1124 | Amount info error (scale) |
1141 | Payment account error |
1142 | Low balance |
1150 | Can't find the transaction history |
1152 | There is a history of transactions with the same transactionId. |
1153 | The payment amount is different from the requested amount. |
1159 | Payment request information isn't found. |
1169 | Must select a payment method and password authorization at LINE Pay. |
1170 | Balance of the member's account has changed. |
1172 | A record of transaction with the same order number already exists. |
1180 | The payment has expired. |
1198 | There has been a duplicate API call request. |
1199 | Internal request error |
1280 | A temporary error occurred while processing the credit card payment. |
1281 | Credit card payment error |
1282 | Credit card authorization error |
1283 | The payment was refused due to suspected fraud. |
1284 | The credit card payment has temporarily stopped. |
1285 | Missing credit card payment information |
1286 | Incorrect credit card payment information |
1287 | The credit card expired |
1288 | The credit card has a low balance. |
1289 | Exceeded the credit card limit |
1290 | Exceeded the limit of the credit card per transaction |
1291 | The card has been reported as stolen. |
1292 | The card has been suspended. |
1293 | CVN input error |
1294 | The card is blacklisted. |
1295 | Incorrect credit card number |
1296 | Unable to process the amount |
1298 | The card has been declined. |
9000 | Internal error |
# Expire RegKey
# API Spec
POST /v3/payments/preapprovedPay/{regKey}/expire
- Connection Timeout: 5 seconds
- Read Timeout: 20 seconds
# Response
returnCode
String
Return code.
Max length: 4
returnMessage
String
Return message.
Max length: 300
# Return Codes
Code | Description |
---|---|
0000 | Success |
1104 | Nonexistent merchant |
1105 | The merchant can't use LINE Pay. |
1106 | Header information error |
1190 | The regKey doesn't exist. |
1193 | The regKey has expired. |
# Merchant provided API or page
# Merchant provided API or page
Describes API (or page URL) that should be provided by merchants to LINE Pay. The merchant API must use reliable authentication and HTTPS protocol. In addition, the authentication must use TLS version above 1.2 for security reason.
# A list of access control
If the API provided by the merchant manages access control with IP, you must add the following LINE Pay Server IP by environment:
- Sandbox: 147.92.159.21
- Real: 211.249.40.1 - 211.249.40.30
# confirmURL spec
The merchant must provide the ConfirmURL spec in page or API according to its type. Once the user approves the payment, LINE Pay app displays the merchant's payment process page to the user through the ConfirmURL and notifies the merchant of the approval. The ConfirmURL is an intermediary page before the payment completion page that's displayed through the Confirm API. However, for special payment methods that don't require displaying the payment page to users, you can proceed with HTTP status 200 response.
# List of APIs
Item | Description |
---|---|
Protocol | HTTP |
Method | GET |
Request timeout | Connection: 5 seconds Read: 20 seconds |
# Request Parameters
orderId
An order ID sent from the merchant when payment is requested.
transactionId
Transaction ID received as a result of the request.
shippingFeeAmount
Shipping fee at checkout.
shippingMethodId
An ID selected as shipping method of merchant.
While LINE Pay determines success or failure as a HTTP response code, the merchant shouldn't send additional information as a response. If the HTTP response code results in payment failure (200 OK), notify the LINE Pay user.
Since these four fields are reserved words, they shouldn't be defined as query string of the ConfirmURL: orderId, transactionId, shippingFeeAmount, and shippingMethodId. But since the attribute of the orderId is a unique id of the merchant, if the query string of the Confirm URL exists, add and send the rest of the parameters except the orderdId.
# Response
# Error response
# cancelURL
When a user cancels while processing payment on the LINE Pay app payment page, use the cancelURL sent through the Request API to move to the merchant page. If transactionId
and orderId
aren't found in the query string of the cancelURL, the payment will automatically be canceled and returned.
# Inquiry ShippingMethods
Merchants using checkout are required to implement and provide the ShippingMethods API spec to LINE Pay through the Request API. Once the user designates a shipping address, check the shipping possibility, shipping method, and fees through the API based on the entered postal code. The shipping method and fee selected by the user will be sent to the merchant through the ConfirmURL.
# List of APIs
Item | Description |
---|---|
Protocol | HTTP |
Method | POST |
Request timeout | Connection: 5 seconds Read: 20 seconds |
Recommended URI: https://{your domain}/v1/shippings/methods/get
# Request header
Content-Type
application/json
# Request body
currency
String
Currency of shipping fee.
Max length: 3
orderId
String
Order ID sent from the merchant when requesting the payment.
Max length: 100
transactionId
Number
Transaction ID returned as a result of the payment request.
String
Shipping country.
Max length: 2
String
Shipping postal code.
Max length: 10
String
Shipping state.
Max length: 100
String
Shipping city.
Max length: 300
# Response
returnCode
String
Return code.
Max length: 3
returnMessage
String
Return message.
Max length: 100
info.shippingMethods[].id
String
Shipping method ID of the merchant.
info.shippingMethods[].name
String
Name of the shipping method.
Max length: 100
info.shippingMethods[].amount
Number
Shipping fee.
info.shippingMethods[].toDeliveryYmd
String
Expected shipping date (YYYYMMDD).
Max length: 8
info.shippingMethods[].fromDeliveryHm
String
(HHmm) Expected start time of shipping.
Max length: 4
info.shippingMethods[].toDeliveryHm
String
(HHmm) Expected end time of shipping.
Max length: 4
# Return Codes
Code | Description |
---|---|
0000 | Success |
4001 | Unsupported shipping region |
4002 | Incorrect shipping address |
5001 | Internal server error (Unknown error) |
9999 | System maintenance |