Hướng dẫn đăng ký thẻ line pay Informational, Transactional

Chúng tôi cung cấp iPhone và Galaxy với giá thấp nhất trên thị trường. Hãy nhận sản phẩm tốt nhất với giá tốt nhất!

Nhân viên người Việt tin cậy của chúng tôi sẽ trả lời trực tiếp tin nhắn của bạn. Hãy yên tâm khi liên hệ với chúng tôi.

If a merchant is registered as a LINE Pay Merchant, it can attract LINE users around the world as its customers. Also, the merchant's revenue is expected to grow when its marketing channels are expanded through LINE. For LINE Pay users to make payments using LINE Pay, the website must be registered as a LINE Pay Merchant.

LINE Pay Merchant Registration Process

Once a merchant is registered as a LINE Pay Merchant, an integration key and test key are issued. Merchant registration process is as follows.

Hướng dẫn đăng ký thẻ line pay	Informational, Transactional

Figure 2 Merchant Registration Process

  1. Access the Registration Page (http://pay.line.me)
  2. Fill out basic information and submit required documents.
  3. Merchant registration review.
  4. Consent to fees and settlement cycles and enter identity verification PIN.
  5. Merchant registration completed.
  6. Email sent upon completion of registration.

LINE PAY Features

The following features are provided.

Normal Payment

Normal payment is a payment type where a payment is made after LINE Pay users access LINE Pay, select a payment method and enter their payment password. The payment is completed when captured. When Merchants want to separate the authorization of payment from the capture of the authorized payment, they should call "Capture API" Depending on the payment method selected when the password is confirmed, the amount of money to be paid is deducted from the buyers' balance or credit card limit.

  1. The Merchant server calls "Reserve Payment API".
  2. The buyer selects a payment method and enters the payment password on the LINE Pay payment screen.
  3. The Merchant server calls "Confirm Payment API”.
  4. The payment transaction is completed.

Preapproved Payment

Preapproved payment is made between Merchant server and LINE Pay server, without LINE Pay user intervention. When a LINE Pay user first makes a payment, LINE Pay issues a regKey for preapproved payment, to the Merchant, which goes through payment reservation and confirmation process, like the normal payment. Since then, the Merchant can use the issued regKey to complete following transactions by calling the Preapproved Payment API, without using the LINE app.

  1. First payment and regKey (for preapproved payment) issuance a.The Merchant server calls the Reserve Payment API ("payType" : "PREAPPROVED")
  2. The LINE Pay user is redirected to the confirmUrl (a parameter of the Reserve Payment API) after selecting a payment method and entering the payment password on the LINE Pay payment screen. c.The Merchant server calls the Confirm Payment API and saves a regKey returned as response information.
  3. The payment transaction is completed
  4. Preapproved payment
  5. The Merchant uses the regKey to call the preapproved payment API.
  6. The payment transaction is completed.
  7. Expire regKey Request to expire preapproved payment
  8. Call API to expire the regKey
  9. Expire preapproved payment

Common Features

  1. Get Payment details
  2. Refund Request
  3. Get Authorization details
  4. Void Authorization Request

LINE Pay Payment Status

This chapter explains about status from payment request to payment completion.

Hướng dẫn đăng ký thẻ line pay	Informational, Transactional

  1. RESERVE : Calling Payment Reserve API, First Time Status
  2. AUTH : Select a Payment Method from LINE Pay app and an Authorization for a Payment Password from LINE Pay app succeeded
  3. CANCEL : Cancelling a Payment from LINE Pay app
  4. CAPTURE_WAIT : Capture Status shows Wait (When a “Capture” parameter of Reserve API is delivered as a “False”.)
  5. CAPTURE : Capture
  6. VOID : Cancelling a Capture in Wait Status of a Capture.
  7. REFUND : Refund After a Capture

LINE Pay Integration Flow

Normal Payment

Request Payment – Payment Screen

The payment reservation process, which differs depending on LINE Pay users' access environment, is shown below:

  • For PC

Hướng dẫn đăng ký thẻ line pay	Informational, Transactional

Figure 3 Payment reservation process for PC - Payment screen

  1. The LINE Pay user selects a payment method from the Merchant's purchase order.
  2. The Merchant calls LINE Pay's "Payment Reserve API" to create payment reservation information and gets a transaction Id, which is required information for payment confirmation and must be kept by the Merchant, and "paymentUrl."
  3. The Merchant calls the paymentUrl (provided by LINE Pay) received in step b.
  4. The LINE Pay user goes through channel web login1 that checks if the user is a LINE user. 4.1. This is a process of verifying if the user is a LINE user before using LINE services. The channel web login process is skipped if the Merchant can access the LINE user information and forward mid when reserving payment.
  5. The LINE Pay server pushes a payment request to LINE after the user successfully logs in to LINE.
  6. The LINE user gets notified of the payment request on the LINE app and moves to the payment screen.
  7. For mobile

Hướng dẫn đăng ký thẻ line pay	Informational, Transactional

Figure 4 Payment reservation for mobile - payment screen

  1. The LINE Pay user selects a payment method from the Merchant's purchase order.
  2. The Merchant calls LINE Pay's "Reserve Payment API" to create payment reservation information and gets a transaction Id, which is required information for payment confirmation and must be kept by the Merchant, and "paymentUrl."
  3. The Merchant calls the paymentUrl (provided by LINE Pay) received in step b.
  4. Using the paymentUrl, the Merchant redirects the LINE Pay user to the payment screen in the LINE app. The paymentUrl is divided into web and app, depending on the integration environment. • web: A web screen provided by LINE Pay. The Merchant checks whether the LINE app is installed before redirecting the user to the LINE Pay payment screen. • app: An app scheme URL to directly move to the LINE Pay payment screen. For how to check whether the LINE app is installed and available versions of LINE Pay (for Android only), please refer to

Payment Screen - Payment Completion

After selecting a payment method (credit card or balance) to process the payment, the LINE Pay user moves to the "confirmUrl" (added by transactionId in LINE Pay) received from the Merchant when the payment is reserved. Then, the Merchant calls the "Payment confirm API " to complete the payment.

  • For PC

Hướng dẫn đăng ký thẻ line pay	Informational, Transactional

Figure 5 Payment screen for PC –Payment completion

  1. The LINE Pay user selects a payment method on the LINE Pay payment screen and enters the password.
  2. LINE Pay stores the payment method information and sets the payment status to ‘authorized’.
  3. The LINE Pay user checks the payment information screen.
  4. When the transaction becomes payable on the Awaiting Payment screen, the user is redirected to the "confirmUrl" received from the Merchant when the payment is reserved.
  5. The Merchant calls the Confirm Payment API to complete the payment.
  6. For Mobile

Hướng dẫn đăng ký thẻ line pay	Informational, Transactional

Figure 6 Payment screen for mobile – Payment completion

  1. The LINE Pay user selects a payment method on the LINE Pay payment screen and enters the password.
  2. LINE Pay stores the payment method information and sets the payment status to ‘authorized’.
  3. After checking the payment information screen on the LINE app, the LINE Pay user clicks ‘OK’ on the bottom to move to the "confirmUrl" received when the payment is reserved.
  4. The Merchant calls the Confirm Payment API to complete the payment.

When the authorization of payment is separated from the capture of the authorized payment

The overall process is similar to those above, but the Merchant should set "capture" as "false" when calling the Reserve Payment API. When the Merchant calls the Confirm Payment API, the payment status is saved as AUTHORIZATION

When capturing the payment,

  • To capture the payment: Call the Capture API to complete the payment.
  • Not to capture the payment: Call the Void Authorization API to cancel the authorization of payment.

When Calling confirmUrl from Server to Server

The payment can be made by only the communication between the Merchant server and the LINE Pay server, with delivering confirmUrl.

Hướng dẫn đăng ký thẻ line pay	Informational, Transactional

Figure 7 Calling ConfirmUrl from server to server

  1. When reserving the payment, the Merchant should pass confirmUrlType : "SERVER".
  2. The LINE Pay user selects a payment method and enters the password after entering the LINE Pay payment screen.
  3. The LINE Pay server saves the payment information and calls the confirmUrl received from the Merchant when the payment is reserved.
  4. The Merchant server calls the Confirm Payment API to complete the payment. Please note that the Merchant server can call the Confirm Payment API only after the response for the ConfirmUrl is successfully sent.

Preapproved Payment

Payment Request - Payment Screen

The overall flow is the same as the normal payment, except that "payType" should be set as "PREAPPROVED."

Payment Screen - Payment Completion and regKey (for preapproved payment) Issuance

A regKey is delivered with the response information of payment confirmation additionally. The Merchant must save this key to use preapproved payment later.

Preapproved Payment

Hướng dẫn đăng ký thẻ line pay	Informational, Transactional

Figure 9 Preapproved Payment

When the payment is confirmed, the Merchant server calls "Preapproved Payment API " by using the regKey to make a payment. The LINE Pay user does not intervene during the payment process, but can be notified when the payment is completed.

regKey (for Preapproved Payment) Expiration

You can call the Expire regKey API so that unnecessary regKeys expire. For more information, refer to “Expire regKey”

How to Use LINE Pay APIs

This chapter details how to implement payments using LINE Pay. Before using LINE Pay APIs, Merchant's verification information can be viewed at Merchant Center2 (http://pay.line.me) after evaluation process is complete.

Common Features

LINE Pay Authentication

Required authentication information for LINE Pay integration is as below.

  • channel id
  • channel secret key

Above information is sent by Header script and you can find them in each API specification.

Item Data Type Required? Description Content-Type String Y application/json X-LINE-ChannelId String(10) Y Payment Integration Information - Channel ID X-LINE-ChannelSecret String(32) Y Payment Integration Information - Channel Secret Key X-LINE-MerchantDeviceProfileId String(32) N Offline Support - Device Type

Infra and Tech Support

If you have questions for infra condition, technical support or facing internal error, please contact us via email ([email protected]).

Env. URL Description Sandbox https://sandbox-api-pay.line.me Environment for integration testing You can process the payment by Sandbox’s web simulation payment page instead of LINE Pay app. Please refer to the appendix() Real https://api-pay.line.me Real Service Environment

Contact for Tech Support

If you have questions for integration process or internal error, please contact LINE Pay Tech Support team by sending Email. Please see contact information below.

Department Contact Applied Country LINE Pay Japan [email protected] Japan LINE Pay Thailand [email protected] Thailand LINE Pay Taiwan [email protected] Taiwan LINE Pay Global [email protected] Other countries

Get Payment Details API

Gets the details of payments made with LINE Pay. This API only gets the payments that have been captured.

Get Payment Details Request

  • Connection Timeout : 5 seconds
  • Read Timeout : 20 seconds

Table 1 Get Payment Details API Request Parameter

Item Data Type Required Description transactionId[] number N A transaction ID issued by LINE Pay, for payment or refund. orderId[] String N Merchant Transaction Order ID

  • When the API is called, more than one parameter needs to be passed. You can check details of up to 100 transactions.

Get Payment Details API Response

Table 2 Get Payment Details API Response Body

Item Data Type Description returnCode String(4) Result code

  • 0000: Successful
  • 1104: Merchant not found.
  • 1105: This Merchant cannot use LINE Pay.
  • 1106: Header information error
  • 1150: Transaction record not found.
  • 1177: Exceeding max number(100) of transactions allowed to retrieve
  • 9000: Internal error returnMessage String Result messages or reason for failure info[].transactionId number Transaction number (19 digits) info[].transactionDate String Transaction date & time(ISO-8601) info[].transactionType String Transaction types
  • PAYMENT: Payment
  • PAYMENT_REFUND: Refund
  • PARTIAL_REFUND: Partion refund info[].productName String Merchant's order number info[].merchantName String Merchant Name info[].currency String Currency(ISO 4217) info[].authorizationExpireDate String Expiration Date of Authorization (ISO-8601) info[].payInfo[].method String Payment method used ( Credit card: CREDIT_CARD, Balance: BALANCE, Discount: DISCOUNT ) info[].payInfo[].amount number Transaction amount (Amount transacted when the transaction Id was generated) The final transaction amount when retrieving the original transaction is sum(info[].payInfo[].amount) – sum(refundList[].refundAmount) info[].merchantReference.affiliateCodes[] String Merchant affiliated Codes when belonged to the affiliated transaction info[].merchantReference.affiliateCodes[].cardType String Affiliated card type when belonged to the affiliated transaction and user has an affiliate card. info[].merchantReference.affiliateCodes[].cardId String Affiliated card id when belonged to the affiliated transaction and user has an affiliate card. Retrieving original transactions & When there is a refund info[].refundList[].refundTransactionId number Refunded transaction number (19 digits) info[].refundList[].transactionType String Transaction types
  • PAYMENT_REFUND: Refund
  • PARTIAL_REFUND: Partial Refund info[].refundList[].refundAmount number Refund Amount info[].refundList[].refundTransactionDate String Refunded transaction date & time (ISO-8601) When retrieving a refund info[].originalTransactionId number Original payment transaction number (19 digits) info[].events[].code String(30) Unique event code which allows only alphanumeric. info[].events[].totalAmount Number Amount to be applied to rate promotion. info[].events[].productQuantity Number Amount to be applied to fixed promotion.

Examples of Using Get Payment Details API

Source 1 Get Payment Details API Request


GET https://sandbox-api-pay.line.me/v2/payments?transactionId=2019060112345678910&orderId=20191002045572 HTTP/1.1
Content-Type: application/json
X-LINE-ChannelId: {channel id}
X-LINE-ChannelSecret: {channel secret}
X-LINE-MerchantDeviceProfileId: {DEVICE_PROFILE_ID}

Source 2 Get Payment Details API Response (When retrieving original transactions)

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678910,
      "transactionDate":"2019-06-01T09:00:00Z",
      "transactionType":"PAYMENT",
      "payInfo": [
          {"method":"BALANCE", "amount":10},
          {"method":"DISCOUNT", "amount":10}
        ],
      "productName":"tes production",
      "currency":"USD",
      "orderId":"20191002045572",
      "refundList":[ 
         { 
            "refundTransactionId":"2019060212345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate":"2019-06-02T09:48:52Z"
         },
         { 
            "refundTransactionId":"2019060312345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:49:28Z"
         },
         { 
            "refundTransactionId":"2019060412345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:53:18Z"
         }
      ],
      "events":[
        {
          "code": "alphanumeric",
          "totalAmount": 500,
          "productQuantity": null
        },
        {
          "code": "alphanumeric2",
          "totalAmount": null,
          "productQuantity": 10
        }
      ]
   }]
}

Source 3 Get Payment Details API Response (When retrieving a refund)

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678912,
      "transactionDate":"2019-06-01T09:48:43Z",
      "transactionType":"PARTIAL_REFUND",
      "amount":-5,
      "productName":"",
      "currency":"USD",
      "orderId":"20190101123123123",
      "originalTransactionId":2019060112345678910
   }]
}

Source 4 Get Payment Details API Response (When merchant affiliated codes exist)

{
    "returnCode":"0000",
    "returnMessage":"success",
    "info":[{
        "transactionId":2019062812345678910,
        "transactionDate":"2019-06-28T09:48:43Z",
        "transactionType":"PAYMENT",
        "payInfo": [
             {"method":"BALANCE", "amount":10},
             {"method":"DISCOUNT", "amount":10}
         ],
        "productName":"tes production",
        "currency":"USD",
        "orderId":"20191128123123123",
        "merchantReference" : {
            "affiliateCodes" :["AFFL_18112001","AFFL_18112002"]
        }
    }]
}

Source 5 Get Payment Details API Response (When merchant affiliated cards exist)

{
    "returnCode": "0000",
    "returnMessage": "success",
    "info": [{
        "transactionId": 2019062812345678910,
        "transactionDate": "2019-06-28T09:48:43Z",
        "transactionType": "PAYMENT",
        "payInfo": [
            {"method": "BALANCE","amount": 10},
            {"method": "DISCOUNT","amount": 10}
        ],
        "productName": "tes production",
        "currency": "USD",
        "orderId": "20191128123123123",
        "merchantReference": {
            "affiliateCards": [
                 {"cardType": "POINT_CARD","cardId": "4822456212454"},
                 {"cardType": "LINESHOP_CARD","cardId": "LP822456212454"}
            ]
        }
    }]
}

Reserve Payment API

Prior to processing payments with LINE Pay, the Merchant is evaluated if it is a normal Merchant store then the information is reserved for payment. When a payment is successfully reserved, the Merchant gets a "transaction Id" that is a key value used until the payment is completed or refunded.

Reserve Payment Request

  • Connection Timeout : 5 seconds
  • Read Timeout : 20 seconds

Table 3 Reserve Payment API Request Parameter

Item Date Type Required? Description productName String(4000) Y Product Name(charset: UTF-8) productImageUrl String(500) N Product image URL Image URL to be displayed on the Payment screen

  • Size: 84 x 84(Image to be displayed only on the Payment screen. Recommended to follow guidelines) amount number Y Payment amount currency String(3) Y Payment currency(ISO 4217) Supported currencies are as follows.
  • USD
  • JPY
  • TWD
  • THB confirmUrl String(500) Y Merchant's URL that the buyer is redirected to after selecting a payment method and entering the payment password in LINE Pay.
  • On the redirected URL, Merchant can call Confirm Payment API and complete the payment
  • LINE Pay passes an additional parameter, "transactionId" Reference confirmUrlType String N confirmUrl Type Type of URL that the buyer is redirected to after selecting a payment method and entering the payment password in LINE Pay
  • CLIENT: A user based URL (default)
  • SERVER: A server based URL. Users just need to check the payment information screen in LINE Pay which then notifies the Merchant server that the payment is available. checkConfirmUrlBrowser Boolean N When moved to confirmUrl, Check a browser
  • true: When a browser calling a payment and a browser directing to confirmUrl are not identical, LINE Pay provides a Guide Page directing to a previous browse.
  • false(Default Value): Directing to ConfirmUrl without checking a browser Refernce cancelUrl String(500) N Payment Cancellation page URL
  • The URL redirected to, from the LINE App Payment page when the LINE Pay user cancels payment (URL for the Merchant accessing via mobile devices to go to the Merchant's app or website when the payment is canceled)
  • URL sent by Merchant is used as is
  • No additional parameters sent by LINE Pay packageName String(4000) N Information to avoid phishing during transition between apps in Android. orderId String(100) Y Merchant's order number corresponding to the payment request
  • A unique number managed by a Merchant Recipient contact (for Risk Management) deliveryPlacePhone String(100) N Recipient contact (for Risk Management) payType String(12) N Payment types
  • NORMAL(Default Value): Single payment
  • PREAPPROVED: Preapproved payment langCd String N Language codes on the payment waiting screen (paymentUrl). Supports a total of six languages.
  • ja: Japanese
  • ko: Korean
  • en: English
  • zh-Hans: Chinese (Simplified)
  • zh-Hant: Chinese (Traditional)
  • th: Thai
    • Language codes are not mandatory but if not received, multiple languages are supported based on the accept-language header.
    • If an unsupported langCd is received, English ("en") is used by default.
    • BCP-47 format: http://en.wikipedia.org/wiki/IETF_language_tag capture Boolean N Whether to capture or not
  • true(Default value): Payment authorization and capture are handled at once when the Confirm Payment API is called (default).
  • false: A payment is completed only after it is authorized and then separately captured by calling "Capture API" , when the Confirm Payment API is called ExtraFields extras.addFriends object[] N Add Friends List
  • type : Service type
    • "LINE_AT" : line@
  • idList : id list (ID List (ID list registered at the LINE@/OA Management menu on Merchant Center))

    {

    "returnCode":"0000",  
    "returnMessage":"success",  
    "info":[{  
        "transactionId":2019062812345678910,  
        "transactionDate":"2019-06-28T09:48:43Z",  
        "transactionType":"PAYMENT",  
        "payInfo": [  
             {"method":"BALANCE", "amount":10},  
             {"method":"DISCOUNT", "amount":10}  
         ],  
        "productName":"tes production",  
        "currency":"USD",  
        "orderId":"20191128123123123",  
        "merchantReference" : {  
            "affiliateCodes" :["AFFL_18112001","AFFL_18112002"]  
        }  
    }]  
    
    }

    3 extras.branchName String (2000) N Branch Name where the payment is requested from (Only 100 letters will be displayed if it's exceeded.) extras.branchId String (32) N Branch Id where the payment is requested. It can be support alphabets, numbers and special characters. extras.promotionRestriction object N Promotion Restriction info.
  • useLimit: amount NOT for Promotions Use
  • rewardLimit: amount NOT for Promotions Rewards

{
    "returnCode":"0000",
    "returnMessage":"success",
    "info":[{
        "transactionId":2019062812345678910,
        "transactionDate":"2019-06-28T09:48:43Z",
        "transactionType":"PAYMENT",
        "payInfo": [
             {"method":"BALANCE", "amount":10},
             {"method":"DISCOUNT", "amount":10}
         ],
        "productName":"tes production",
        "currency":"USD",
        "orderId":"20191128123123123",
        "merchantReference" : {
            "affiliateCodes" :["AFFL_18112001","AFFL_18112002"]
        }
    }]
}

4

Payment Reserve Response

Table 4 Payment Reserve Response Body

Item Data Type Description returnCode String(4) Result Code

  • 0000: Successful
  • 1104: Merchant not found.
  • 1105: This Merchant cannot use LINE Pay.
  • 1106: Header information error.
  • 1124: Error in amount (scale).
  • 1145: Payment in progress.
  • 1172: Existing same orderId.
  • 1178: Unsupported currency.
  • 1194: This Merchant cannot use preapproved payment.
  • 2101: Parameter error
  • 2102: JSON Data format error
  • 9000: Internal error returnMessage String Result messages or reason for failure. Examples are as follows:
  • Merchant unauthorized for payment
  • Merchant verification information error info.transactionId Number Transaction number(19 digits) info.paymentUrl.web String Web URL to go to after payment request
  • Used if payment request was made in Web environment
  • URL to the LINE Pay payment waiting screen
  • Redirected to the provided URL without any additional parameters
  • When a pop-up browser from a Desktop is opened, Size
    • Width: 700px, Height : 546px info.paymentUrl.app String App URL to the Payment Screen
  • Used if payment request was made in an app
  • Redirecting URL from Merchant's app to LINE Pay App Reference info.paymentAccessToken String Code Value (12 digits) using for input a code instead of using a Scanner on LINE app. (Supports a Scanner of LINE Pay app above LINE 5.1 Version)

Examples of Using Reserve Payment API

Source 4 Reserve Payment API Request


POST https://sandbox-api-pay.line.me/v2/payments/request HTTP/1.1
Content-Type: application/json
X-LINE-ChannelId: {channel id}
X-LINE-ChannelSecret: {channel secret}
X-LINE-MerchantDeviceProfileId: {DEVICE_PROFILE_ID}
{
    "productName": "Test Product",
    "orderId": "ORD_i0q1kW0yFrOp0fCAvctq7g6Y3",
    "confirmUrlType": "CLIENT",
    "currency": "JPY",
    "amount": 100,
    "capture": true,
    "payType": "NORMAL",
    "cancelUrl": "https://tools-merchant.com/payment/general/confirm?type=cancel",
    "confirmUrl": "https://tools-merchant.com/payment/general/confirm?orderId=ORD_i0q1kW0yFrOp0fCAvctq7g6Y3",
    "productImageUrl": "https://tools-merchant.com/cony-money-box-1.jpg",
    "extras": {
        "addFriends": [{
            "type": "LINE_AT",
            "idList": ["@aaa", "@bbb"]
        }],
        "branchName": "test_branch_1",
        "branchId": "branch1"
    }

Source 5 Reserve Payment API Response

{
    "returnCode": "0000",
    "returnMessage": "Success.",
    "info": {
        "paymentUrl": {
            "web": "https://sandbox-web-pay.line.me/web/payment/wait?transactionReserveId=cFJFbUx5aU5NSGxZUmRnWmtQV1ZPT3pZb0c3Ym9NcGMvM0s3WGdHc2JGeGUyU09mNGRJRi83ZWxzL3l3OVEreg",
            "app": "line://pay/payment/cFJFbUx5aU5NSGxZUmRnWmtQV1ZPT3pZb0c3Ym9NcGMvM0s3WGdHc2JGeGUyU09mNGRJRi83ZWxzL3l3OVEreg"
        },
        "transactionId": "2019061311372683710",
        "paymentAccessToken": "113552948987"
    }
}

Payment Confirm API

This API is used for a Merchant to complete its payment. The Merchant must call Confirm Payment API to actually complete the payment. However, when "capture" parameter is "false" on payment reservation, the payment status becomes AUTHORIZATION, and the payment is completed only after "Capture API" is called.

Payment confirm Request

  • Connection Timeout : 5 seconds
  • Read Timeout : 40 seconds

Table 5 Payment confirm API Request Parameter

Item Data Type Required? Description amount number Y Payment amount currency String(3) Y Payment currency(ISO 4217) Supported currencies are as follow:

  • USD
  • JPY
  • TWD
  • THB

Payment ConfirmAPI Response

Table 6 Payment confirm API Response Body

Item Data Type Description returnCode String(4) Result Code

  • 0000: Successful
  • 1101: The purchasing user suspended for transaction.
  • 1102: The purchasing user suspended for transaction.
  • 1104: Merchant not found.
  • 1105: This Merchant cannot use LINE Pay.
  • 1106: Header information error.
  • 1110: Not available credit card.
  • 1124: Error in amount (scale).
  • 1141: Account status error.
  • 1142: Insufficient balance remains.
  • 1150: No transactions found.
  • 1152: Transaction has already been made.
  • 1153: Request amount is different from real amount.
  • 1159: Omitted request payment information.
  • 1169: Payment method and password must be certificated by LINE Pay.
  • 1170: User’s account remains have been changed.
  • 1172: Existing same orderId.
  • 1180: Expired the payment date.
  • 1198: Duplicated the request calling API.
  • 1199: Internal request error.
  • 1280: Temporary error occurred while making payment with credit card
  • 1281: Credit card payment error
  • 1282: Credit card authorization error
  • 1283: The payment has been rejected due to suspected fraud.
  • 1284: Credit card payment is temporarily not available.
  • 1285: Omitted credit card information
  • 1286: Incorrect credit card payment information
  • 1287: Credit card expiration date has passed.
  • 1288: Credit card has insufficient funds.
  • 1289: Maximum credit card limit exceeded
  • 1290: One-time payment limit exceeded.
  • 1291: This card has been reported stolen.
  • 1292: This card has been suspended.
  • 1293: Invalid Card Verification Number (CVN)
  • 1294: This card is blacklisted.
  • 1295: Invalid credit card number.
  • 1296: Invalid amount.
  • 1298: The Credit card payment declined.
  • 9000: Internal error returnMessage String Result messages or reason for failure. Examples are as follows:
  • Merchant unauthorized for payment
  • Merchant Authorization information error info.orderId String Order number sent from Merchant upon reserving a payment info.transactionId number Transaction number (19 digits) received as a result after reserving a payment info.authorizationExpireDate String opt-authorization expiration date(ISO 8601)
  • When the payment status is AUTHORIZATION (capture=false) info.payInfo[].method String Payment method used
  • Credit card: CREDIT_CARD, Balance: BALANCE, Discount: DISCOUNT info.payInfo[].amount number Payment amount info.payInfo[].creditCardNickname String For opt-Preapproved Payment, Credit card nickname
  • Initially registered credit card name managed by LINE Pay.
  • If LINE Pay user has not set a nickname, blank text is displayed.
  • The nickname can be changed when requested by the user in LINE Pay and changed name is not share with the Merchant. info.payInfo[].creditCardBrand String For opt-Preapproved Payment, Credit card brand
  • VISA
  • MASTER
  • AMEX
  • DINERS
  • JCB info.regKey String opt-Key for preapproved payment (15 digits) info.merchantReference.affiliateCodes[] String Merchant affiliated Codes when belonged to the affiliated transaction info.merchantReference.affiliateCards[].cardType String Affiliated card type when belonged to the affiliated transaction and user has an affiliate card. info.merchantReference.affiliateCards[].cardId String Affiliated card id when belonged to the affiliated transaction and user has an affiliate card.

Examples of Payment confirm API

Source 6 Payment Confirm API Request


POST https://sandbox-api-pay.line.me/v2/payments/2019061211372655410/confirm HTTP/1.1
Content-Type: application/json
X-LINE-ChannelId: {channel id}
X-LINE-ChannelSecret: {channel secret}
X-LINE-MerchantDeviceProfileId: {DEVICE_PROFILE_ID}
{
    "amount": 1000,
    "currency": "JPY"
}

Source 7 Payment Confirm API Response (Balance payment when the payType is NORMAL)

{
    "returnCode": "0000",
    "returnMessage": "Success.",
    "info": {
        "transactionId": 2019061211372655410,
        "orderId": "ORD_SMCD1JHbLLvdESnykyJjgGQ3Q",
        "payInfo": [{
            "method": "BALANCE",
            "amount": 889
        }, {
            "method": "DISCOUNT",
            "amount": 111
        }]
    }
}

Source 8 Payment Confirm API Response (Mixed Payment when the payType is NORMAL)

{
    "returnCode": "0000",
    "returnMessage": "Success.",
    "info": {
        "orderId": "ORD_SMCD1JHbLLvdESnykyJjgGQ3Q",
        "transactionId": 2019061211372655410,
        "payInfo": [{
            "method": "BALANCE",
            "amount": 10
        }, {
            "method": "POINT",
            "amount": 5
        }]
    }
}

Source 9 Payment Confirm API Response (When the payType is PREAPPROVED)

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678910,
      "transactionDate":"2019-06-01T09:00:00Z",
      "transactionType":"PAYMENT",
      "payInfo": [
          {"method":"BALANCE", "amount":10},
          {"method":"DISCOUNT", "amount":10}
        ],
      "productName":"tes production",
      "currency":"USD",
      "orderId":"20191002045572",
      "refundList":[ 
         { 
            "refundTransactionId":"2019060212345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate":"2019-06-02T09:48:52Z"
         },
         { 
            "refundTransactionId":"2019060312345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:49:28Z"
         },
         { 
            "refundTransactionId":"2019060412345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:53:18Z"
         }
      ],
      "events":[
        {
          "code": "alphanumeric",
          "totalAmount": 500,
          "productQuantity": null
        },
        {
          "code": "alphanumeric2",
          "totalAmount": null,
          "productQuantity": 10
        }
      ]
   }]
}

0

Source 10 Payment Confirm API Response (When merchant affiliated codes exist)

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678910,
      "transactionDate":"2019-06-01T09:00:00Z",
      "transactionType":"PAYMENT",
      "payInfo": [
          {"method":"BALANCE", "amount":10},
          {"method":"DISCOUNT", "amount":10}
        ],
      "productName":"tes production",
      "currency":"USD",
      "orderId":"20191002045572",
      "refundList":[ 
         { 
            "refundTransactionId":"2019060212345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate":"2019-06-02T09:48:52Z"
         },
         { 
            "refundTransactionId":"2019060312345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:49:28Z"
         },
         { 
            "refundTransactionId":"2019060412345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:53:18Z"
         }
      ],
      "events":[
        {
          "code": "alphanumeric",
          "totalAmount": 500,
          "productQuantity": null
        },
        {
          "code": "alphanumeric2",
          "totalAmount": null,
          "productQuantity": 10
        }
      ]
   }]
}

1

Source 11 Payment Confirm API Response (When merchant affiliated cards exist)

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678910,
      "transactionDate":"2019-06-01T09:00:00Z",
      "transactionType":"PAYMENT",
      "payInfo": [
          {"method":"BALANCE", "amount":10},
          {"method":"DISCOUNT", "amount":10}
        ],
      "productName":"tes production",
      "currency":"USD",
      "orderId":"20191002045572",
      "refundList":[ 
         { 
            "refundTransactionId":"2019060212345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate":"2019-06-02T09:48:52Z"
         },
         { 
            "refundTransactionId":"2019060312345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:49:28Z"
         },
         { 
            "refundTransactionId":"2019060412345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:53:18Z"
         }
      ],
      "events":[
        {
          "code": "alphanumeric",
          "totalAmount": 500,
          "productQuantity": null
        },
        {
          "code": "alphanumeric2",
          "totalAmount": null,
          "productQuantity": 10
        }
      ]
   }]
}

2

Refund Payment API

Requests refund of payments made with LINE Pay. To refund a payment, the LINE Pay user's payment transaction Id must be forwarded. A partial refund is also possible depending on the refund amount.

Refund Payment Request

  • Connection Timeout : 5 seconds
  • Read Timeout : 20 seconds

Table 7 Refund Payment API Request Parameter

Item Data Type Required? Description refundAmount number N Refund amount

  • Full refund if this parameter is not passed Extra fields extras.promotionRestriction object N Promotion Restriction info.
  • useLimit: amount NOT for Promotions Use
  • rewardLimit: amount NOT for Promotions Rewards

{
    "returnCode":"0000",
    "returnMessage":"success",
    "info":[{
        "transactionId":2019062812345678910,
        "transactionDate":"2019-06-28T09:48:43Z",
        "transactionType":"PAYMENT",
        "payInfo": [
             {"method":"BALANCE", "amount":10},
             {"method":"DISCOUNT", "amount":10}
         ],
        "productName":"tes production",
        "currency":"USD",
        "orderId":"20191128123123123",
        "merchantReference" : {
            "affiliateCodes" :["AFFL_18112001","AFFL_18112002"]
        }
    }]
}

4

Refund Payment Response

Table 8 Refund Payment API Response Body

Item Data Type Description returnCode String(4) Result Code

  • 0000: Successful
  • 1101: The purchasing user suspended for transaction.
  • 1102: The purchasing user suspended for transaction.
  • 1104: Merchant not found.
  • 1105: This Merchant cannot use LINE Pay.
  • 1106: Header information error
  • 1124: Payment Amount error
  • 1150: Transaction record not found.
  • 1155: The transaction Id not eligible for Refund.
  • 1163: Exceeded the expiration for Refund.
  • 1164: Refund limit exceeded.
  • 1165: The transaction has already been refunded.
  • 1179: Status can not be processed.
  • 1198: Duplicated the request calling API.
  • 1199: Internal request error.
  • 9000: Internal error returnMessage String Result messages or reason for failure info.refundTransactionId number Refunded transaction number (newly issued number - 19 digits) info.refundTransactionDate String Refunded transaction date & time (ISO 8601)

Examples of Using Refund Payment API

Source 10 Refund Payment API Request

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678910,
      "transactionDate":"2019-06-01T09:00:00Z",
      "transactionType":"PAYMENT",
      "payInfo": [
          {"method":"BALANCE", "amount":10},
          {"method":"DISCOUNT", "amount":10}
        ],
      "productName":"tes production",
      "currency":"USD",
      "orderId":"20191002045572",
      "refundList":[ 
         { 
            "refundTransactionId":"2019060212345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate":"2019-06-02T09:48:52Z"
         },
         { 
            "refundTransactionId":"2019060312345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:49:28Z"
         },
         { 
            "refundTransactionId":"2019060412345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:53:18Z"
         }
      ],
      "events":[
        {
          "code": "alphanumeric",
          "totalAmount": 500,
          "productQuantity": null
        },
        {
          "code": "alphanumeric2",
          "totalAmount": null,
          "productQuantity": 10
        }
      ]
   }]
}

3

Source 11 Refund Payment API Response

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678910,
      "transactionDate":"2019-06-01T09:00:00Z",
      "transactionType":"PAYMENT",
      "payInfo": [
          {"method":"BALANCE", "amount":10},
          {"method":"DISCOUNT", "amount":10}
        ],
      "productName":"tes production",
      "currency":"USD",
      "orderId":"20191002045572",
      "refundList":[ 
         { 
            "refundTransactionId":"2019060212345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate":"2019-06-02T09:48:52Z"
         },
         { 
            "refundTransactionId":"2019060312345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:49:28Z"
         },
         { 
            "refundTransactionId":"2019060412345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:53:18Z"
         }
      ],
      "events":[
        {
          "code": "alphanumeric",
          "totalAmount": 500,
          "productQuantity": null
        },
        {
          "code": "alphanumeric2",
          "totalAmount": null,
          "productQuantity": 10
        }
      ]
   }]
}

4

Gets the details authorized with LINE Pay. This API only gets data that is authorized or whose authorization is voided; the one that is already captured can be viewed by using "Get Payment Details API”.

Get Authorization Details Request

  • Connection Timeout : 5 seconds
  • Read Timeout : 20 seconds

Table 9 Get Authorization Details API Request Parameter

Item Data Type Required? Description transactionId[] number N Transaction number issued by LINE Pay orderId[] String N Order number of Merchant

  • When this API is called, more than one parameter needs to be passed. You can check details of up to 100 transactions.

Get Authorization Details Response

Table 10 Get Authorization Details API Response Body

Item Data Type Description returnCode String(4) Results code

  • 0000: Successful
  • 1104: Merchant not found.
  • 1105: This Merchant cannot use LINE Pay.
  • 1106: Header information error
  • 1150: Transaction record not found.
  • 1177: Exceeded max number of transactions (100) allowed to be retrieved.
  • 9000: Internal error returnMessage String Result messages or reason for failure info[].transactionId number Transaction number (19 digits) info[].transactionDate String Transaction date(ISO 8601) info[].transactionType String Transaction type
  • PAYMENT: Payment
  • PAYMENT_REFUND: Refund
  • PARTIAL_REFUND: Partial Refund info[].payStatus String Payment status
  • AUTHORIZATION: Authorized
  • VOIDED_AUTHORIZATION: Authorization voided “Void Authorization API” is called)
  • EXPIRED_AUTHORIZATION: Authorization expired (The authorization period allowed by LINE Pay expired) info[].payInfo[].method String Payment method
  • (Credit card: CREDIT_CARD, balance: BALANCE, Discount: DISCOUNT) info[].payInfo[].amount number Transaction amount (when a transaction Id is created) The final transaction amount is sum(info[].payInfo[].amount) – sum(refundList[].refundAmount) info[].productName String Product name info[].currency String Currency(ISO 4217) info[].orderId String Order number of Merchant info[].authorizationExpireDate String Authorization expiration date and time(ISO 8601) info[].events[].code String(30) Unique event code which allows only alphanumeric. info[].events[].totalAmount Number Amount to be applied to rate promotion. info[].events[].productQuantity Number Amount to be applied to fixed promotion.

Examples of Using Get Authorization Details API

Source 12 Get Authorization Details API Request

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678910,
      "transactionDate":"2019-06-01T09:00:00Z",
      "transactionType":"PAYMENT",
      "payInfo": [
          {"method":"BALANCE", "amount":10},
          {"method":"DISCOUNT", "amount":10}
        ],
      "productName":"tes production",
      "currency":"USD",
      "orderId":"20191002045572",
      "refundList":[ 
         { 
            "refundTransactionId":"2019060212345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate":"2019-06-02T09:48:52Z"
         },
         { 
            "refundTransactionId":"2019060312345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:49:28Z"
         },
         { 
            "refundTransactionId":"2019060412345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:53:18Z"
         }
      ],
      "events":[
        {
          "code": "alphanumeric",
          "totalAmount": 500,
          "productQuantity": null
        },
        {
          "code": "alphanumeric2",
          "totalAmount": null,
          "productQuantity": 10
        }
      ]
   }]
}

5

Get Authorization Details API Response

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678910,
      "transactionDate":"2019-06-01T09:00:00Z",
      "transactionType":"PAYMENT",
      "payInfo": [
          {"method":"BALANCE", "amount":10},
          {"method":"DISCOUNT", "amount":10}
        ],
      "productName":"tes production",
      "currency":"USD",
      "orderId":"20191002045572",
      "refundList":[ 
         { 
            "refundTransactionId":"2019060212345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate":"2019-06-02T09:48:52Z"
         },
         { 
            "refundTransactionId":"2019060312345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:49:28Z"
         },
         { 
            "refundTransactionId":"2019060412345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:53:18Z"
         }
      ],
      "events":[
        {
          "code": "alphanumeric",
          "totalAmount": 500,
          "productQuantity": null
        },
        {
          "code": "alphanumeric2",
          "totalAmount": null,
          "productQuantity": 10
        }
      ]
   }]
}

6

Capture API

If "capture" is "false" when the Merchant calls the “Reserve Payment API” , the payment is completed only after the Capture API is called.

Capture Request

  • Connection Timeout : 5 seconds
  • Read Timeout : 60 seconds

Table 11 Captire API Request Parameter

Item Data Type Required? Description amount number Y Payment amount currency String(3) Y Payment currency (ISO 4217) The following currencies are supported.

  • USD
  • JPY
  • TWD
  • THB Extra fields extras.promotionRestriction object N Promotion Restriction info.
  • useLimit: amount NOT for Promotions Use
  • rewardLimit: amount NOT for Promotions Rewards

{
    "returnCode":"0000",
    "returnMessage":"success",
    "info":[{
        "transactionId":2019062812345678910,
        "transactionDate":"2019-06-28T09:48:43Z",
        "transactionType":"PAYMENT",
        "payInfo": [
             {"method":"BALANCE", "amount":10},
             {"method":"DISCOUNT", "amount":10}
         ],
        "productName":"tes production",
        "currency":"USD",
        "orderId":"20191128123123123",
        "merchantReference" : {
            "affiliateCodes" :["AFFL_18112001","AFFL_18112002"]
        }
    }]
}

4

Capture Response

Table 12 Capture API Response Body

Item Data Type Description returnCode String(4) Result code

  • 0000: Successful
  • 1104: Merchant not found.
  • 1105: This Merchant cannot use LINE Pay.
  • 1106: Header information error
  • 1150: Transaction record not found.
  • 1155: Wrong TransactionId.
  • 1170: User’s account remains have been changed.
  • 1172: Existing same orderId.
  • 1179: Status can not be processed.
  • 1180: Expired the payment date.
  • 1183: Payment Amount Error
  • 1184: Payment amount exceeds amount requested.
  • 1198: Duplicated the request calling API or Called Capture API during processing internal re- authorization. (Re-try in a few minutes)
  • 1199: Internal request error.
  • 1280: Temporary error occurred while making a payment with credit card
  • 1281: Credit card payment error
  • 1282: Credit card authorization error.
  • 1283: The payment has been declined due to suspected fraud.
  • 1284: Credit card payment is temporarily not available.
  • 1285: Omitted credit card information.
  • 1286: Incorrect credit card payment information.
  • 1287: Credit card expiration date has passed.
  • 1288: Credit card has insufficient funds.
  • 1289: Maximum credit card limit exceeded.
  • 1290: One-time payment limit exceeded.
  • 1291: This card has been reported stolen.
  • 1292: This card has been suspended.
  • 1293: INVALID CARD VERIFICATION NUMBER (CVN)
  • 1294: This card is blacklisted.
  • 1295: Invalid credit card number.
  • 1296: Invalid amount.
  • 1298: The credit card payment declined.
  • 9000: Internal error
  • When an Error code 1199,1280~1298 occurs, the transaction cancels automatically. returnMessage String Result messages or reason for failure. Examples are as follows:
  • Merchant unauthorized for payment
  • Merchant verification information error info.orderId String Order number passed from the Merchant when a payment reservation is made. info.transactionId number Transaction number (19 digits) info[].payInfo[].method String Payment method
  • (Credit card: CREDIT_CARD, balance: BALANCE, Discount: DISCOUNT) info.payInfo[].amount number Payment amount

Examples of Using Capture API

Source 14 Capture API Request

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678910,
      "transactionDate":"2019-06-01T09:00:00Z",
      "transactionType":"PAYMENT",
      "payInfo": [
          {"method":"BALANCE", "amount":10},
          {"method":"DISCOUNT", "amount":10}
        ],
      "productName":"tes production",
      "currency":"USD",
      "orderId":"20191002045572",
      "refundList":[ 
         { 
            "refundTransactionId":"2019060212345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate":"2019-06-02T09:48:52Z"
         },
         { 
            "refundTransactionId":"2019060312345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:49:28Z"
         },
         { 
            "refundTransactionId":"2019060412345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:53:18Z"
         }
      ],
      "events":[
        {
          "code": "alphanumeric",
          "totalAmount": 500,
          "productQuantity": null
        },
        {
          "code": "alphanumeric2",
          "totalAmount": null,
          "productQuantity": 10
        }
      ]
   }]
}

7

Source 15 Capture API Response

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678910,
      "transactionDate":"2019-06-01T09:00:00Z",
      "transactionType":"PAYMENT",
      "payInfo": [
          {"method":"BALANCE", "amount":10},
          {"method":"DISCOUNT", "amount":10}
        ],
      "productName":"tes production",
      "currency":"USD",
      "orderId":"20191002045572",
      "refundList":[ 
         { 
            "refundTransactionId":"2019060212345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate":"2019-06-02T09:48:52Z"
         },
         { 
            "refundTransactionId":"2019060312345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:49:28Z"
         },
         { 
            "refundTransactionId":"2019060412345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:53:18Z"
         }
      ],
      "events":[
        {
          "code": "alphanumeric",
          "totalAmount": 500,
          "productQuantity": null
        },
        {
          "code": "alphanumeric2",
          "totalAmount": null,
          "productQuantity": 10
        }
      ]
   }]
}

8

Void Authorization API

Voids a previously authorized payment. A payment that has been already captured can be refunded by using the “Refund Payment API”.

Void Authorization Request

  • Connection Timeout : 5 seconds
  • Read Timeout : 20 seconds

Void Authorization Response

Table 13 Void Authorization API Response Body

Item Data Type Description returnCode String(4) Result code

  • 0000: Successful
  • 1101: The purchasing user suspended for transaction.
  • 1102: The purchasing user suspended for transaction.
  • 1104: Merchant not found.
  • 1105: This Merchant cannot use LINE Pay.
  • 1106: Header information error.
  • 1150: Transaction record not found.
  • 1155: Wrong TransactionId.
  • 1165: Voided Transaction.
  • 1170: User’s account remains have been changed.
  • 1198: Duplicated the request calling API.
  • 1199: Internal request error.
  • 1900: Temporary Error. Please, try again later.
  • 1902: Temporary Error. Please, try again later.
  • 1999: It does not match the requested information. (When re-trying a request)
  • 9000: Internal error
  • When an Error code 1900,1903,1999 occurs, allowing re-try. returnMessage String Result messages or reason for failure. Examples are as follows:
  • Merchant unauthorized for payment
  • Merchant verification information error

Examples of Using Void Authorization API

Source 16 Void Authorization API Request

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678910,
      "transactionDate":"2019-06-01T09:00:00Z",
      "transactionType":"PAYMENT",
      "payInfo": [
          {"method":"BALANCE", "amount":10},
          {"method":"DISCOUNT", "amount":10}
        ],
      "productName":"tes production",
      "currency":"USD",
      "orderId":"20191002045572",
      "refundList":[ 
         { 
            "refundTransactionId":"2019060212345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate":"2019-06-02T09:48:52Z"
         },
         { 
            "refundTransactionId":"2019060312345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:49:28Z"
         },
         { 
            "refundTransactionId":"2019060412345678912",
            "transactionType":"PARTIAL_REFUND",
            "refundAmount":-1,
            "refundTransactionDate ":"2019-06-02T09:53:18Z"
         }
      ],
      "events":[
        {
          "code": "alphanumeric",
          "totalAmount": 500,
          "productQuantity": null
        },
        {
          "code": "alphanumeric2",
          "totalAmount": null,
          "productQuantity": 10
        }
      ]
   }]
}

9

Source 17 Void Authorization API Response

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678912,
      "transactionDate":"2019-06-01T09:48:43Z",
      "transactionType":"PARTIAL_REFUND",
      "amount":-5,
      "productName":"",
      "currency":"USD",
      "orderId":"20190101123123123",
      "originalTransactionId":2019060112345678910
   }]
}

0

Preapproved Payment API

When the payment type of the Reserve Payment API was set as PREAPPROVED, a regKey is returned with the payment result. Preapproved Payment API uses this regKey to directly complete a payment without using the LINE app.

Preapproved Payment Request

  • Connection Timeout : 5 seconds
  • Read Timeout : 40 seconds

Table 14 Preapproved Payment API Request Parameter

Item Data Type Required? Description productName String(4000) Y Product name amount number Y Payment amount currency String(3) Y Payment currency (ISO 4217) Supported currencies are as follows:

  • USD
  • JPY
  • TWD
  • THB orderId String(100) Y Merchant's order number corresponding to the payment request. A unique number managed by a Merchant. capture Boolean N Whether to be captured or not
  • true(Default Value): Authorization and capture are handled at once.
  • false: Handled Capture process and Called “Capture API” in order to complete a payment.

Preapproved Payment Response

Table 15 Preapproved Payment API Response Body

Data Data Type Description returnCode String(4) Result code

  • 0000: Successful
  • 1101: The purchasing user suspended for transaction.
  • 1102: The purchasing user suspended for transaction.
  • 1104: Merchant not found.
  • 1105: This Merchant cannot use LINE Pay.
  • 1106: Header information error
  • 1110: Not available credit card.
  • 1124: Error in Amount (scale).
  • 1141: Account status error.
  • 1154: Preapproved payment account not available.
  • 1172: Existing a transaction with the same order ID.
  • 1183: Payment amount must be greater than 0.
  • 1190: The regKey does not exist.
  • 1193: The regKey expired.
  • 1197: Already processing payment with regKey.
  • 1198: Duplicated the request calling API.
  • 1199: Internal request error.
  • 1280: Temporary error while making a payment with credit card
  • 1281: Credit card payment error.
  • 1282: Credit card authorization error.
  • 1283: The payment has been declined due to suspected fraud.
  • 1284: Credit card payment is temporarily not available.
  • 1285: Omitted credit card information.
  • 1286: Incorrect credit card payment information.
  • 1287: Credit card expiration date has passed.
  • 1288: Credit card has insufficient funds.
  • 1289: Maximum credit card limit exceeded.
  • 1290: One-time payment limit exceeded.
  • 1291: This card has been reported stolen.
  • 1292: This card has been suspended.
  • 1293: INVALID CARD VERIFICATION NUMBER (CVN)
  • 1294: This card is blacklisted.
  • 1295: Invalid credit card number.
  • 1296: Invalid amount.
  • 1298: The credit card payment declined.
  • 9000: Internal error
  • When an error code 1141, 1282~1287, 1290~1295 occurs, expire the regKey. returnMessage String Result messages or reason for failure info.transactionId number Transaction number (19 digits) info.transactionDate String Transaction date and time(ISO 8601) info.authorizationExpireDate String Expiration Date of Authorization(ISO 8601)
  • Deliver for a transaction authorized only.(Capture=false)

Examples of Using Preapproved Payment API

Source 18 Preapproved Payment API Request

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678912,
      "transactionDate":"2019-06-01T09:48:43Z",
      "transactionType":"PARTIAL_REFUND",
      "amount":-5,
      "productName":"",
      "currency":"USD",
      "orderId":"20190101123123123",
      "originalTransactionId":2019060112345678910
   }]
}

1

Source 19 Preapproved Payment API Response

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678912,
      "transactionDate":"2019-06-01T09:48:43Z",
      "transactionType":"PARTIAL_REFUND",
      "amount":-5,
      "productName":"",
      "currency":"USD",
      "orderId":"20190101123123123",
      "originalTransactionId":2019060112345678910
   }]
}

2

Check regKey Status API

Checks if regKey is available before using the preapproved payment API.

Check regKey Status Request

  • Connection Timeout : 5 seconds
  • Read Timeout : 20 second

Table 16 Check regkey Status API Request Parameter

Item Data Type Required? Description creditCardAuth Boolean N Check Authorization for Credit Card minimum amount saved in regKey

  • true : - Check Validity Data within LINE Pay - Authorize a Credit Card minimum Amount - Allow to activate a function of authorizing a Minimum amount in Merchant Information, it is required an inspection from LINE PAY Administrator.
  • false(Default Value) : - Check Validity data within LINE Pay.

Check regKey Status Response

Table 17 Check regKey Status API Response Body

Item Data Type Description returnCode String(4) Result Code

  • 0000: Successful
  • 1101: The purchasing user suspended for transaction.
  • 1102: The purchasing user suspended for transaction.
  • 1104: Merchant not found.
  • 1105: This Merchant cannot use LINE Pay.
  • 1106: Header information error
  • 1141: Can not authorize a credit card saved in regKey
  • 1154: Preapproved payment account not available
  • 1190: The regKey does not exist.
  • 1193: The regKey expired. returnMessage String Result messages or reason for failure

Examples of Using Check regKey Status API

Source 20 Check regKey Status API Request

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678912,
      "transactionDate":"2019-06-01T09:48:43Z",
      "transactionType":"PARTIAL_REFUND",
      "amount":-5,
      "productName":"",
      "currency":"USD",
      "orderId":"20190101123123123",
      "originalTransactionId":2019060112345678910
   }]
}

3

Source 21 Check regKey Status API Response

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678912,
      "transactionDate":"2019-06-01T09:48:43Z",
      "transactionType":"PARTIAL_REFUND",
      "amount":-5,
      "productName":"",
      "currency":"USD",
      "orderId":"20190101123123123",
      "originalTransactionId":2019060112345678910
   }]
}

0

Expire regKey API

Expires the regKey information registered for preapproved payment. Once the API is called, the regKey is no longer used for preapproved payments.

Expire regKey Request

  • Connection Timeout : 5 seconds
  • Read Timeout : 20 seconds

Expire regKey Response

Table 18 Expire regKey API Response

Item Data Type Description returnCode String(4) Result code

  • 0000: Successful
  • 1104: Merchant not found.
  • 1105: This Merchant cannot use LINE Pay.
  • 1106: Header information error.
  • 1190: The regKey does not exist.
  • 1193: The regKey expired.
  • 9000: Internal error returnMessage String Result messages or reason for failure

Examples of Expire regKey API

Source 22 Expire regKey API Request

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678912,
      "transactionDate":"2019-06-01T09:48:43Z",
      "transactionType":"PARTIAL_REFUND",
      "amount":-5,
      "productName":"",
      "currency":"USD",
      "orderId":"20190101123123123",
      "originalTransactionId":2019060112345678910
   }]
}

5

Source 23 Expire regKey API Response

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678912,
      "transactionDate":"2019-06-01T09:48:43Z",
      "transactionType":"PARTIAL_REFUND",
      "amount":-5,
      "productName":"",
      "currency":"USD",
      "orderId":"20190101123123123",
      "originalTransactionId":2019060112345678910
   }]
}

6

Appendix

LINE Pay Error Codes

This section defines error codes of LINE Pay. returnMessage for an error code is provided in English, and if there is no message, hyphen (-) is shown.

Table 19 LINE Pay Error Codes

Code Description 1101 This user is not a LINE Pay user. 1102 The purchasing user suspended for transaction. 1104 Merchant not found. 1105 This Merchant cannot use LINE Pay. 1106 Header information error 1110 Not available credit card. 1124 Error in Amount (scale). 1141 Account status error. 1142 Insufficient balance remains. 1145 Payment in progress. 1150 Transaction record not found. 1152 Transaction has already been made. 1153 Request amount is different from real amount. 1154 Preapproved payment account not available. 1155 The transaction Id not eligible for Refund. 1159 Omitted request payment information. 1163 Exceeded the expiration for Refund. 1164 Refund limit exceeded. 1165 The transaction has already been refunded. 1169 Payment method and password must be certificated by LINE Pay. 1170 User’s account remains have been changed. 1172 Existing same orderId. 1177 Exceeded max. number of transactions (100) allowed to be retrieved. 1178 Unsupported currency. 1179 Status can not be processed. 1180 Expired the payment date. 1183 Payment amount must be greater than 0. 1184 Payment amount exceeds amount requested. 1190 The regKey does not exist. 1193 The regKey expired. 1194 This Merchant cannot use Preapproved Payment. 1197 Already processing payment with regKey. 1198 Duplicated the request calling API. 1199 Internal request error. 1280 Temporary error while making a payment with Credit Card. 1281 Credit Card Payment Error 1282 Credit Card Authorization Error 1283 The payment has been declined due to suspected fraud. 1284 Payment amount must be greater than 0. 1285 Omitted credit card information 1286 Incorrect credit card payment information 1287 Credit card expiration date has passed. 1288 Credit card has insufficient funds. 1289 Maximum credit card limit exceeded. 1290 One-time payment limit exceeded. 1291 This card has been reported stolen. 1292 This card has been suspended. 1293 Invalid Card Verification Number (CVN) 1294 This card is blacklisted. 1295 Invalid credit card number. 1296 Invalid amount 1298 The credit card payment declined. 2101 Parameter error 2102 JSON data format error 9000 Internal error

If an internal error, 1199, 9000 occurs, contact Technical Support at: ([email protected]).

Table 20 Error code by API

ErrorCode reserve confirm Capture Void Refund AuthorizationDetails PaymentDetails PreapprovedPayment Check regKey Expired regKey 1101 v v v v v 1102 v v v v v 1104 v v v v v v v v v v 1105 v v v v v v v v v v 1106 v v v v v v v v v v 1110 v v 1124 v v v v 1141 v v 1142 v 1145 v 1150 v v v v v 1152 v 1153 v 1154 v v 1155 v v v 1159 v 1163 v 1164 v 1165 v 1169 v 1170 v v v 1172 v v v v 1177 v v 1178 v 1179 v v v 1180 v 1183 v v v 1184 v 1190 v v v 1193 v v 1194 v 1198 v v v v v 1199 v v v v v 2101 v v v v v v v v v v 2102 v v v v v v v v v v 9000 v v v v v v v v v v

Since the error codes from 1280 to 1298 are occurred from Credit Card company, they not necessarily mentioned in this document.

How to Use PaymentUrl App

This section provides instructions for redirecting to LINE App after the Merchant's app requests a payment.

For Android Applications

Use the following example code to check if the LINE app is installed and the available version of LINE Pay. If the LINE app is installed and the available version of LINE Pay is checked, the user is redirected to the LINE Pay payment screen.

Android Application example

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678912,
      "transactionDate":"2019-06-01T09:48:43Z",
      "transactionType":"PARTIAL_REFUND",
      "amount":-5,
      "productName":"",
      "currency":"USD",
      "orderId":"20190101123123123",
      "originalTransactionId":2019060112345678910
   }]
}

7

File : res/values/Strings.xml

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678912,
      "transactionDate":"2019-06-01T09:48:43Z",
      "transactionType":"PARTIAL_REFUND",
      "amount":-5,
      "productName":"",
      "currency":"USD",
      "orderId":"20190101123123123",
      "originalTransactionId":2019060112345678910
   }]
}

8

For iOS Applications

Use the following example code to check if the LINE app is installed. If the LINE app is installed, the user is redirected to the LINE Pay payment screen.

iPhone Application example

{ 
   "returnCode":"0000",
   "returnMessage":"success",
   "info":[{ 
      "transactionId":2019060112345678912,
      "transactionDate":"2019-06-01T09:48:43Z",
      "transactionType":"PARTIAL_REFUND",
      "amount":-5,
      "productName":"",
      "currency":"USD",
      "orderId":"20190101123123123",
      "originalTransactionId":2019060112345678910
   }]
}

9

File : en.lproj/Localized.Strings

{
    "returnCode":"0000",
    "returnMessage":"success",
    "info":[{
        "transactionId":2019062812345678910,
        "transactionDate":"2019-06-28T09:48:43Z",
        "transactionType":"PAYMENT",
        "payInfo": [
             {"method":"BALANCE", "amount":10},
             {"method":"DISCOUNT", "amount":10}
         ],
        "productName":"tes production",
        "currency":"USD",
        "orderId":"20191128123123123",
        "merchantReference" : {
            "affiliateCodes" :["AFFL_18112001","AFFL_18112002"]
        }
    }]
}

0

Detailed Explanation and Exceptional Case of ConfirmUrl

Detailed Explanation of ConfirmUrl

Once user completes Payment Authorization process (Select a Payment method and confirm a Payment Password) in LINE Pay app, User is redirected to callback Url.The Url does not represent a Payment Process completion. It is the Url for Merchant page allowing to Call confirm API given by LINE Pay and it will be completed a Final Payment Process.

Exceptional Case of ConfirmUrl

When calling confirmUrl after user gets Payment Authorization from LINE Pay, the Browser requested payment and the Browser receiving ConfirmUrl may not be the same browser depending on the user’s type of Operating System (OS).

Hướng dẫn đăng ký thẻ line pay	Informational, Transactional

When “checkConfirmUrlBrowser” for Payment reserve API is “true”,

LINE Pay checks out and determines the Browsers whether or not the browser starting Payment process is the same as the browser redirecting automatically according to the result of the following criteria,

  • For the Same Browser : Move user to ConfirmUrl
  • For Different Browser : Move user to Browser requested Payment

When “checkConfirmUrlBrowser” for Payment reserve API is “false (basic value)”,

When the processing already occurred based upon session data(e.g. Log in session) is saved in the browser history of merchant User’s payment process can not be continued while calling ConfirmUrl. Therefore, to link to LINE Pay Payment ,Merchant should select the method below and implement it.

  1. ConfirmUrl,which already called,does not authorize based upon session data. It is completed a Payment Process based upon Information in confirmUrl
  2. Examples of Performing session data Process
    • Confirmed session data, Display Browser for Payment Result of Existing Merchant.
    • When Session data is unidentified, Merchant selects one of the 2 methods below and implements it.
      • Display Browser for Payment Result After session data is re-produced (e.g. Log in).
      • User is redirected to the Browser requested payment.

When Calling confirmUrl from Server to Server

This section describes specification and examples of confirmUrl called from the LINE Pay server to Merchant server.

When a merchant manages ACL(Access Control List)

A merchant should be registered/managed an IP from LINE Pay server. The following IP information is for each environment.

  • Sandbox :147.92.159.209, 147.92.159.21, 147.92.159.68
  • Real : 211.249.40.1~211.249.40.30, 147.92.220.5~147.92.220.8

ConfirmUrl Specification

Table 21 confirmUrl Endpoint Specification

Item Description Protocol HTTP Method GET Request timeout Connection: 5 seconds Read: 20 seconds

Table 22 confirmURL Parameters

Parameter Description orderId Order number passed from the Merchant when a payment reservation is made. transactionId Transaction number returned as results when a payment reservation is made.

Merchants do not respond to the confirmUrl call, so LINE Pay determines whether it is successful or not by checking HTTP request Code. If the status code is not "200 OK," inform the LINE Pay user that the payment is not successfully completed.

Examples of Using confirmUrl

Examples of using confirmUrl are as follows, where the confirmUrl provided by the Merchant is 'https://testmall.com/pay/result’.

Request(LINE Pay -> Merchant)

{
    "returnCode":"0000",
    "returnMessage":"success",
    "info":[{
        "transactionId":2019062812345678910,
        "transactionDate":"2019-06-28T09:48:43Z",
        "transactionType":"PAYMENT",
        "payInfo": [
             {"method":"BALANCE", "amount":10},
             {"method":"DISCOUNT", "amount":10}
         ],
        "productName":"tes production",
        "currency":"USD",
        "orderId":"20191128123123123",
        "merchantReference" : {
            "affiliateCodes" :["AFFL_18112001","AFFL_18112002"]
        }
    }]
}

1

Response

{
    "returnCode":"0000",
    "returnMessage":"success",
    "info":[{
        "transactionId":2019062812345678910,
        "transactionDate":"2019-06-28T09:48:43Z",
        "transactionType":"PAYMENT",
        "payInfo": [
             {"method":"BALANCE", "amount":10},
             {"method":"DISCOUNT", "amount":10}
         ],
        "productName":"tes production",
        "currency":"USD",
        "orderId":"20191128123123123",
        "merchantReference" : {
            "affiliateCodes" :["AFFL_18112001","AFFL_18112002"]
        }
    }]
}

2

Using Sandbox Methods

For testing in the Sandbox of LINE Pay, the section, ‘API Endpoint Specification’,in this Integration Guide is stated that merchant should attempt to make a payment using sandbox only and merchant should create page for making a payment. For attempting to make a payment in Sandbox environment, the payment process should be followed as shown below.