NAV Navbar
  • Introduction
  • Integration Conditions
  • API Specifications (Payment)
  • API Specifications (After Payment)
  • Appendix
  • Introduction

    This chapter explains LINE Pay function.

    LINE Pay Introduction

    This document is for the developers who would like to integrate LINE Pay.

    Line pay overview offline

    Integration Conditions

    This chapter explains the requirements and preparation for LINE Pay Integration.

    System Requirements

    LINE Pay API Integration is basically a communication between LINE Pay and Merchant Server. Therefore, it needs to be integrated with the Payment Server that merchant separately prepared.

    Preparation prior to Integration

    Prior to LINE Pay Payment API Integration, a merchant needs to register to be a LINE Pay Merchant and check the key information needed for integration.

    Merchant Registration

    A Merchant needs to be registered as a LINE Pay Merchant for LINE Pay payment integration. In order to check the registration process, a merchant can download the LINE Pay Merchant Registration Guide on the merchant portal. (Location: https://pay.line.me/jp/developers/documentation/download/tech?locale=en_EN – LINE Pay Merchant Registration Guide)

    Preparation for Integration

    1. White list registration of Merchant Payment Server
      a. LINE Pay limits the server access in the channel ID uniquely generated for each merchant by IP registration of merchant's Payment Server.
      b. IP registration can be done in this location - "Login to Merchant Center(http://pay.line.me) - Payment Integration Management - Manage Payment Server IP".
    2. Channel ID and Channel Secret Key Confirmation
      a. It's an essential information for API Integration and it can be found in this location - "Login to Merchant Center(http://pay.line.me) - Payment Integration Management - Manage Link Key".
      b. This information must not be exposed anywhere since it is uniquely generated for each merchant.
    3. Available currency check for payment integration
      a. LINE Pay merchant can use only one currency for API Integration and available currencies are as below. It can be also found in this location - "Login to Merchant Center(http://pay.line.me) - Manage Basic Info - Merchant Information".
      • JPY
      • USD
      • THB
      • TWD

    Integration Flow

    Payment Sequence diagram

    It explains the process how to make a payment.

    Target API

    Payment sequence diagram offline

    Figure 2 Payment Sequence diagram

    Payment Sequence diagram Explanation

    1. A LINE Pay user shows MyCode (Barcode/QR Code) to a Merchant's Device.
    2. Merchant's Device reads MyCode (Barcode/QR Code).
    3. Merchant's Device requests for payment to the merchant's Payment Server.
    4. Merchant Payment Server calls the Payment API.
    5. Check the API response information and confirm whether the payment is completed or not.
    6. Merchant's Payment Server responds the payment result to the Merchant's Device.
    7. LINE Pay Server notifies the payment result (Success/Failure) to the LINE Pay user via Push or LINE Pay Official Account Message.

    After Payment Sequence

    API after the payment creation process can be processed by calling API once

    Target API

    API Specifications (Payment)

    This chapter explains the APIs that are used from reading "oneTimeKey" ("MyCode" in the LINE Pay Main menu) generated from LINE Pay User to complete payment.

    Payment

    This API is to process payment by reading MyCode provided from LINE Pay App with Merchant's device.

    Specification

    Table 1 Payment API Endpoint

    Item Description
    Endpoint URL Sandbox : https://sandbox-api-pay.line.me/v2/payments/oneTimeKeys/pay
    Product : https://api-pay.line.me/v2/payments/oneTimeKeys/pay
    Method POST
    Request Header Required
    - Content-Type: application/json; charset=UTF-8
    - X-LINE-ChannelId: {Integration Information - channelId}
    - X-LINE-ChannelSecret: {Integration Information - channelSecretKey}
    Set whether it's necessary or not in the merchant setting information.
    - X-LINE-MerchantDeviceType : device type
    - X-LINE-MerchantDeviceProfileId : device’s serial no
    Timeout Read : 20 seconds

    Table 2 Payment API Request Body

    Name Type Mandatory description
    productName string(4000) Y product name
    amount number(38) Y amount to payment
    currency string(3) Y currency to payment
    orderId string(100) Y OrderId given by merchant device. (unique on merchant-side)
    oneTimeKey string(12-19) Y Result of scanning and reading QR/Bar code information given by LINE Pay App.
    oneTimeKey's valid time is 5 minutes, so it will be valid for 5 minutes from the time when LINE Pay User confirms QR/Bar code after accessing the mycode screen
    The length differ by country
    - JP : 19(from 2019.08.01)
    - TW : 18
    - TH, Global : 12
    capture boolean N Whether to capture or not. A boolean value (true or false) default is true.
    true(default) : payment authorization and capture are handled at once
    false : payment is completed only after it is authorized then separately capture by calling "Capture API"
    Extra Fields
    extras.addFriends object[] N Add friends List
    • type: Service Type
        "LINE_AT" : line@
    • idList : ID List(ID list registered at the LINE@/OA Management menu on Merchant Center)
    • "addFriends": [{
          "type": "LINE_AT",
          "idList": ["@aaa", "@bbb"]
      }]
    extras.branchName string(200) 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
    • "promotionRestriction": {
          "useLimit": 100,
          "rewardLimit": 100
      }
    extras.events[] object[] N Event list which is negotiated with LP.
    "events": [{
        "code": "alphanumeric",
        "totalAmount": 100,
        "productQuantity": null
     },
    ]
    extras.events[].code string(4-30) N Unique event code which allows only alphanumeric.
    extras.events[].totalAmount number N Amount to be applied to rate promotion.
    extras.events[].productQuantity number N Amount to be applied to fixed promotion.

    Table 3 Payment API Response Body

    Name Type Mandatory description
    returnCode string(4) Y Result code generated by LINE Pay.
    - 0000 : API Request Success
    - Other response codes can be found at "Appendix - Response Code by API" in this document.
    returnMessage string(100) Y Result messages or reason for failure
    info.transactionId number(19) Y LINE Pay's transaction id
    info.orderId string(100) Y OrderId given by merchant device. (unique on merchant-side)
    info.transactionDate string(20) Y Transaction Date(ISO8601 UTC).
    - Time Format : yyyy-MM-dd'T'HH:mm:ss'Z'
    * reference : https://en.wikipedia.org/wiki/ISO_8601
    info.payInfo[].method string(20) Y Payment method used
    - CREDIT_CARD
    - BALANCE
    - DISCOUNT
    - POINT (Default is not displayed)
    info.payInfo[].amount number(38) Y payment amount
    info.balance number(38) N remained balance after payment.
    info.authorizationExpireDate string(20) N Authorization Expire Date(ISO8601 UTC).
    - Time Format : yyyy-MM-dd'T'HH:mm:ss'Z'
    when the payment status is "AUTHORIZATION"(capture=false).
    * reference : https://en.wikipedia.org/wiki/ISO_8601
    info.merchantReference.affiliateCards[].cardType string(20) N Affiliated card type when belonged to the affiliated transaction and user has an affiliate card.
    info.merchantReference.affiliateCards[].cardId string(20) N Affiliated card id when belonged to the affiliated transaction and user has an affiliate card.

    Example

    Request

    
    POST https://sandbox-api-pay.line.me/v2/payments/oneTimeKeys/pay HTTP/1.1
    Host: sandbox-api-pay.line.me
    Content-Type: application/json
    X-LINE-ChannelId: {channel id}
    X-LINE-ChannelSecret: {channel secret}
    X-LINE-MerchantDeviceProfileId: {DEVICE_PROFILE_ID}
    
    {
        "productName": "test product",
        "amount": 100,
        "currency": "THB",
        "orderId": "merchant_test_order_1",
        "oneTimeKey": "123456789012",
         "extras" : {
            "addFriends" : [
                {
                 "type" : "LINE_AT",
                 "idList" : ["@aaa"]
                }
            ],
            "branchName" : "test_branch_1",
            "branchId" : "branch1"
        },
        "events": [
            {
                "code": "alphanumeric",
                "totalAmount": 500,
                "productQuantity": null
            },
            {
                "code": "alphanumeric2",
                "totalAmount": null,
                "productQuantity": 10
            }
       ]
    }
    
    
    

    Response Body - Payment completion

    
    {
        "returnCode": "0000",
        "returnMessage": "success",
        "info": {
            "transactionId": "2019010112345678910",
            "orderId": "test_order_#1",
            "transactionDate": "2019-01-01T01:01:00Z",
            "payInfo": [{
                "method": "BALANCE",
                "amount": 10
            }, {
                "method": "DISCOUNT",
                "amount": 5
            }],
            "balance": 9900
        }
    }
    
    

    Response Body - Payment completion (When merchant affiliated cards exist)

    {
        "returnCode": "0000",
        "returnMessage": "success",
        "info": {
            "transactionId": "2019010112345678910",
            "orderId": "test_order_#1",
            "transactionDate": "2019-01-01T01:01:00Z",
            "payInfo": [
                {"method": "BALANCE","amount": 10}
            ],
            "balance": 9900,
            "merchantReference" : {
                "affiliateCards" : [
                    {"cardType": "POINT_CARD","cardId": "4822456212454"}
                ]
            }
        }
    }
    

    Payment Status Check

    It's the API used when the final payment status can't be checked due to read timeout.

    Specification

    Table 4 Payment Status Check API Endpoint

    Item Description
    Endpoint URL Sandbox : https://sandbox-api-pay.line.me/v2/payments/orders/{orderId}/check
    Product : https://api-pay.line.me/v2/payments/orders/{orderId}/check
    Method GET
    Request Header Required
    - Content-Type: application/json; charset=UTF-8
    - X-LINE-ChannelId: {Integration Information - channelId}
    - X-LINE-ChannelSecret: {Integration Information - channelSecretKey}
    Set whether it's necessary or not in the merchant setting information.
    - X-LINE-MerchantDeviceType : device type
    - X-LINE-MerchantDeviceProfileId : device’s serial no
    Timeout Read : 20 seconds

    Table 5 Payment Status Check API URI Parameters

    Name Type Mandatory description
    orderId string(100) Y - The order ID delivered when a merchant requests for payment.
    - It needs to be delivered after encoding to the parameter that exists in URI path.
    * reference : https://en.wikipedia.org/wiki/Percent-encoding

    Table 6 Payment Status Check API Response Body

    Name Type Mandatory description
    returnCode string(4) Y result code
    - 0000 : API Request Success
    - Other response codes can be found at "Appendix - Response Code by API" in this document.
    returnMessage string(100) Y result messages
    info.status string(20) Y payment status
    - COMPLETE : payment completed. - terminated status
    - FAIL : payment failed. - terminated status
    * Note : In case it's “COMPLETE” or “FAIL”, there is additionally responded information.
    case "info.status" : "COMPLETE"
    info.orderId string(100) Y OrderId given by merchant device. (unique on merchant-side)
    info.transactionDate string(20) Y Transaction Date(ISO8601 UTC).
    - Time Format : yyyy-MM-dd'T'HH:mm:ss'Z'
    * reference : https://en.wikipedia.org/wiki/ISO_8601
    info.payInfo[].method string(20) Y Payment method used
    - CREDIT_CARD
    - BALANCE
    - DISCOUNT
    - POINT
    info.payInfo[].amount number(38) Y payment amount
    info.balance number(38) N remained balance after payment.
    info.authorizationExpireDate string(20) N Authorization Expire Date(ISO8601 UTC).
    - Time Format : yyyy-MM-dd'T'HH:mm:ss'Z'
    when the payment status is "AUTHORIZATION"(capture=false).
    * reference : https://en.wikipedia.org/wiki/ISO_8601
    case "info.status" : "FAIL"
    info.failReturnCode string(4) Y Fail result code
    - For the response codes, please check "Appendix - Response Code by API" in this document.
    - The response codes are the same with the Payment API's response codes.
    info.failReturnMessage string(100) Y Fail result messages

    Request

    
    - If “orderId” is “test_order_#1”,
    
    GET https://sandbox-api-pay.line.me/v2/payments/orders/test_order_%231/check HTTP/1.1
    Host: sandbox-api-pay.line.me
    Content-Type: application/json
    X-LINE-ChannelId: {channel id}
    X-LINE-ChannelSecret: {channel secret}
    X-LINE-MerchantDeviceProfileId: {DEVICE_PROFILE_ID}
    
    

    Response Body - In case the status is “COMPLETE”,

    
    {
        "returnCode": "0000",
        "returnMessage": "success",
        "info": {
            "status": "COMPLETE",
            "transactionId": "2019010112345678910",
            "orderId": "test_order_#1",
            "transactionDate": "2019-01-01T01:01:00Z",
            "payInfo": [{
                "method": "BALANCE",
                "amount": 10
            }, {
                "method": "DISCOUNT",
                "amount": 5
            }],
            "balance": 9900
        }
    }
    
    

    Response Body - In case the status is “FAIL”,

    
    {
        "returnCode": "0000",
        "returnMessage": "success",
        "info": {
            "status": "FAIL",
            "failReturnCode": "1142",
            "failReturnMessage" : "Insufficient balance remains."
        }
    }
    
    

    API Specifications (After Payment)

    This chapter explains the API to refund the payment or to search the payment history depending on the merchant order status after the payment is completed.

    Void

    This API is to void the authorization.

    Specification

    Table 7 Void API Endpoint

    Item Description
    Endpoint URL Sandbox : https://sandbox-api-pay.line.me/v2/payments/orders/{orderId}/void
    Product : https://api-pay.line.me/v2/payments/orders/{orderId}/void
    Method POST
    Request Header Required
    - Content-Type: application/json; charset=UTF-8
    - X-LINE-ChannelId: {Integration Information - channelId}
    - X-LINE-ChannelSecret: {Integration Information - channelSecretKey}
    Set whether it's necessary or not in the merchant setting information.
    - X-LINE-MerchantDeviceType : device type
    - X-LINE-MerchantDeviceProfileId : device’s serial no
    Timeout Read : 20 seconds

    Table 8 Void API URI Parameters

    Name Type Mandatory description
    orderId string(100) Y - The order ID delivered when a merchant requests for payment.
    - It needs to be delivered after encoding to the parameter that exists in URI path.
    * reference : https://en.wikipedia.org/wiki/Percent-encoding

    Table 9 Void API Response Body

    Name Type Mandatory description
    returnCode string(4) Y Result code generated by LINE Pay
    - 0000 : Request Success
    - Other response codes can be found at "Appendix - Response Code by API" in this document.
    returnMessage string(100) Y Result messages or reason for failure

    Example

    Request

    
    - If “orderId” is “test_order_#1”,
    
    POST https://sandbox-api-pay.line.me/v2/payments/orders/test_order_%231/void HTTP/1.1
    Host: sandbox-api-pay.line.me
    Content-Type: application/json
    X-LINE-ChannelId: {channel id}
    X-LINE-ChannelSecret: {channel secret}
    X-LINE-MerchantDeviceProfileId: {DEVICE_PROFILE_ID}
    
    

    Response - Payment Completion

    
    {
        "returnCode": "0000",
        "returnMessage": "success"
    }
    
    

    Capture

    This API is to capture the authorized transaction.

    Specification

    Table 10 Capture API Endpoint

    Item Description
    Endpoint URL Sandbox : https://sandbox-api-pay.line.me/v2/payments/orders/{orderId}/capture
    Product : https://api-pay.line.me/v2/payments/orders/{orderId}/capture
    Method POST
    Request Header Required
    - Content-Type: application/json; charset=UTF-8
    - X-LINE-ChannelId: {Integration Information - channelId}
    - X-LINE-ChannelSecret: {Integration Information - channelSecretKey}
    Set whether it's necessary or not in the merchant setting information.
    - X-LINE-MerchantDeviceType : device type
    - X-LINE-MerchantDeviceProfileId : device’s serial no
    Timeout Read : 20 seconds

    Table 11 Capture API URI Parameters

    Name Type Mandatory description
    orderId string(100) Y - The order ID delivered when a merchant requests for payment.
    - It needs to be delivered after encoding to the parameter that exists in URI path.
    * reference : https://en.wikipedia.org/wiki/Percent-encoding

    Table 12 Capture API Request Body

    Name Type Mandatory description
    amount number(38) Y amount to capture
    currency string(3) Y currency to capture
    Extra fields
    extras.promotionRestriction object N Promotion Restriction info.
    • useLimit: amount NOT for Promotions Use
    • rewardLimit: amount NOT for Promotions Rewards
    • "promotionRestriction": {
          "useLimit": 100,
          "rewardLimit": 100
      }

    Table 13 Capture API Response Body

    Name Type Mandatory description
    returnCode string(4) Y Result code generated by LINE Pay
    - 0000 : API Request Success
    - Other response codes can be found at "Appendix - Response Code by API" in this document.
    returnMessage string(100) Y Result messages or reason for failure
    info.transactionId number(19) Y LINE Pay's transaction id
    info.orderId string(100) Y OrderId given by merchant device. (unique on merchant-side)
    info.payInfo[].method string(20) Y Payment method used
    - CREDIT_CARD
    - BALANCE
    - DISCOUNT
    - POINT (Default is not displayed)
    info.payInfo[].amount number(38) Y payment amount

    Example

    Request

    
    - If “orderId” is “test_order_#1”,
    
    POST https://sandbox-api-pay.line.me/v2/payments/orders/test_order_%231/capture HTTP/1.1
    Host: sandbox-api-pay.line.me
    Content-Type: application/json
    X-LINE-ChannelId: {channel id}
    X-LINE-ChannelSecret: {channel secret}
    X-LINE-MerchantDeviceProfileId: {DEVICE_PROFILE_ID}
    
    {
        "amount": "100"
        "currency": "THB
    }
    
    

    Response

    
    {
        "returnCode": "0000",
        "returnMessage": "success",
        "info": {
            "transactionId": "2019010112345678910",
            "orderId": "test_order_#1",
            "transactionDate": "2019-01-01T01:01:00Z",
            "payInfo": [{
                "method": "BALANCE",
                "amount": 95
            }, {
                "method": "DISCOUNT",
                "amount": 5
            }]
        }
    }
    
    

    Refund

    This API is to refund after the payment completion (Captured data).

    Specification

    Table 14 Refund API Endpoint

    Item Description
    Endpoint URL Sandbox : https://sandbox-api-pay.line.me/v2/payments/orders/{orderId}/refund
    Product : https://api-pay.line.me/v2/payments/orders/{orderId}/refund
    Method POST
    Request Header Required
    - Content-Type: application/json; charset=UTF-8
    - X-LINE-ChannelId: {Integration Information - channelId}
    - X-LINE-ChannelSecret: {Integration Information - channelSecretKey}
    Set whether it's necessary or not in the merchant setting information.
    - X-LINE-MerchantDeviceType : device type
    - X-LINE-MerchantDeviceProfileId : device’s serial no
    Timeout Read : 20 seconds

    Table 15 Refund API URI Parameters

    Name Type Mandatory description
    orderId string(100) Y - The order ID delivered when a merchant requests for payment.
    - It needs to be delivered after encoding to the parameter that exists in URI path.
    * reference : https://en.wikipedia.org/wiki/Percent-encoding

    Table 16 Refund API Request Body

    Name Type Mandatory description
    refundAmount number(38) N amount to refund.
    - 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
    • "promotionRestriction": {
          "useLimit": 100,
          "rewardLimit": 100
      }

    Table 17 Refund API Response Body

    Name Type Mandatory description
    returnCode string(4) Y Result code generated by LINE Pay
    - 0000 : API Request Success
    - Other response codes can be found at "Appendix - Response Code by API" in this document.
    returnMessage string(100) Y Result messages or reason for failure
    info.refundTransactionId number(19) Y LINE Pay's refund transaction id
    info.refundTransactionDate string(20) Y Refunded Transaction Date(ISO8601 UTC).
    - Time Format : yyyy-MM-dd'T'HH:mm:ss'Z'
    * reference : https://en.wikipedia.org/wiki/ISO_8601

    Example

    Request

    
    - If “orderId” is “test_order_#1”,
    
    POST https://sandbox-api-pay.line.me/v2/payments/orders/test_order_%231/refund HTTP/1.1
    Host: sandbox-api-pay.line.me
    Content-Type: application/json
    X-LINE-ChannelId: {channel id}
    X-LINE-ChannelSecret: {channel secret}
    X-LINE-MerchantDeviceProfileId: {DEVICE_PROFILE_ID}
    
    {
        "refundAmount": "100"
    }
    
    

    Response

    
    {
        "returnCode": "0000",
        "returnMessage": "success",
        "info": {
            "refundTransactionId": "2019010112345678910",
            "refundTransactionDate": "2019-01-01T01:01:00Z"
        }
    }
    
    

    Authorization Details

    This API is to search the authorization details. Only authorized or cancelled (Void or Expire) data can be searched and the data after capturing can be searched by The Payment Details API.

    Specification

    Table 18 Authorizaiton Details API Endpoint

    Item Description
    Endpoint URL Sandbox : https://sandbox-api-pay.line.me/v2/payments/authrozations
    Product : https://api-pay.line.me/v2/payments/authorizations
    Method GET
    Request Header Required
    - Content-Type: application/json; charset=UTF-8
    - X-LINE-ChannelId: {Integration Information - channelId}
    - X-LINE-ChannelSecret: {Integration Information - channelSecretKey}
    Set whether it's necessary or not in the merchant setting information.
    - X-LINE-MerchantDeviceType : device type
    - X-LINE-MerchantDeviceProfileId : device’s serial no
    Timeout Read : 20 seconds

    Table 19 Authorization Details API Query Parameters

    Name Type Mandatory description
    orderId string(100) N The order ID delivered when a merchant requests for payment.
    transactionId number(19) N LINE Pay’s transaction id

    Table 20 Authorization Details API Response Body

    Name Type Mandatory description
    returnCode string(4) Y Result code generated by LINE Pay
    - 0000 : Request Success
    - Other response codes can be found at "Appendix - Response Code by API" in this document.
    returnMessage string(100) Y Result messages or reason for failure
    info.transactionId number(19) Y LINE Pay's transaction id
    info.orderId string(100) Y OrderId given by merchant device. (unique on merchant-side)
    info.transactionDate string(20) Y Transaction Date(ISO8601 UTC).
    - Time Format : yyyy-MM-dd'T'HH:mm:ss'Z'
    * reference : https://en.wikipedia.org/wiki/ISO_8601
    info.transactionType String(20) Y Transaction Type
    - PAYMENT : payment
    - PAYMENT_REFUND : refund
    - PARTIAL_REFUND : partial refund
    info.payInfo[].method string(20) Y Payment method used
    - CREDIT_CARD
    - BALANCE
    - DISCOUNT
    - POINT (Default is not displayed)
    info.payInfo[].amount number(38) Y Payment amount
    info.currency string(3) Y Payment currency
    * reference : https://en.wikipedia.org/wiki/ISO_4217
    info.productName string( Y Product name
    info.payStatus string(30) Y Payment status
    - AUTHORIZATION : Authorization
    - VOIDED_AUTHORIZATION : Voided Authorization (Completed status by calling “void api”)
    - EXPIRED_AUTHORIZATION : Expired Authorization (The status which allowed Authorization period for a merchant has passed.)
    info.authorizationExpireDate string(20) N Authorization Expire Date(ISO8601 UTC).
    - Time Format : yyyy-MM-dd'T'HH:mm:ss'Z'
    * reference : https://en.wikipedia.org/wiki/ISO_8601
    info.merchantReference.affiliateCards[].cardType string(20) N Affiliated card type when belonged to the affiliated transaction and user has an affiliate card.
    info.merchantReference.affiliateCards[].cardId string(20) N Affiliated card id when belonged to the affiliated transaction and user has an affiliate card.

    Example

    Request

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

    Response

    
    {
      "returnCode": "0000",
      "returnMessage": "success",
      "info": [
        {
          "transactionId": 2019049910005498410,
          "transactionDate": "2019-04-08T07:02:38Z",
          "transactionType": "PAYMENT",
          "productName": "test product",
          "currency": "THB",
          "authorizationExpireDate": "2019-04-13T07:02:38Z",
          "payInfo": [
            {
              "method": "BALANCE",
              "amount": 100
            }
          ],
          "orderId": "20190408003",
          "payStatus": "VOIDED_AUTHORIZATION"
        }
      ]
    }
    
    
    

    Payment Details

    This API is to search the transaction data after capturing.

    Specification

    Table 21 Payment Details API Endpoint

    Item Description
    Endpoint URL Sandbox : https://sandbox-api-pay.line.me/v2/payments
    Product : https://api-pay.line.me/v2/payments
    Method GET
    Request Header Required
    - Content-Type: application/json; charset=UTF-8
    - X-LINE-ChannelId: {Integration Information - channelId}
    - X-LINE-ChannelSecret: {Integration Information - channelSecretKey}
    Set whether it's necessary or not in the merchant setting information.
    - X-LINE-MerchantDeviceType : device type
    - X-LINE-MerchantDeviceProfileId : device’s serial no
    Timeout Read : 20 seconds

    Table 22 Payment Details API Query Parameters

    Name Type Mandatory description
    orderId string(100) N The order ID delivered when a merchant requests for payment.
    transactionId number(19) N LINE Pay’s transaction id

    Table 23 Payment Details API Response Body

    Name Type Mandatory description
    returnCode string(4) Y Result code generated by LINE Pay
    - 0000 : API Request Success
    - Other response codes can be found at "Appendix - Response Code by API" in this document.
    returnMessage string(100) Y Result messages or reason for failure
    info.transactionId number(19) Y LINE Pay's transaction id
    info.orderId string(100) Y OrderId given by merchant device.- unique on merchant-side
    info.transactionDate string(20) Y Transaction Date(ISO8601 UTC).
    - Time Format : yyyy-MM-dd'T'HH:mm:ss'Z'
    * reference : https://en.wikipedia.org/wiki/ISO_8601
    info.transactionType String(20) Y Transaction Type
    - PAYMENT : payment
    - PAYMENT_REFUND : refund
    - PARTIAL_REFUND : partial refund
    info.payInfo[].method string(20) Y Payment method used
    - CREDIT_CARD
    - BALANCE
    - DISCOUNT
    - POINT (Default is not displayed)
    info.payInfo[].amount number(38) Y Payment amount
    info.currency string(3) Y Payment currency
    * reference : https://en.wikipedia.org/wiki/ISO_4217
    info.productName string(4000) Y Product name
    Retrieving original transactions & When there is a refund
    info.refundList[].refundTransactionId number(19) Y Refunded transaction id
    info.refundList[].transactionType string(20) Y Transaction type
    - PAYMENT_REFUND : refund
    - PARTIAL_REFUND : partial refund
    info.refundList[].refundAmount number(38) Y Refund amount
    info.refundList[].refundTransactionDate String(20) Y Refunded transaction date (ISO8601 UTC).
    - Time Format : yyyy-MM-dd'T'HH:mm:ss'Z'
    * reference : https://en.wikipedia.org/wiki/ISO_8601
    When retrieving a refund
    info.originalTransactionId number(19) Y Original apymenttransaction number

    Example

    Request

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

    Response

    
    {
      "returnCode": "0000",
      "returnMessage": "success",
      "info": [
        {
          "transactionId": 2019049910005496810,
          "transactionDate": "2019-04-08T06:31:19Z",
          "transactionType": "PAYMENT",
          "productName": "test product",
          "currency": "THB",
          "payInfo": [
            {
              "method": "BALANCE",
              "amount": 100
            }
          ],
          "refundList": [
            {
              "refundTransactionId": 2019049910005497012,
              "transactionType": "PARTIAL_REFUND",
              "refundAmount": -1,
              "refundTransactionDate": "2019-04-08T06:33:17Z"
            }
          ],
          "orderId": "20190408001"
        }
      ]
    }
    
    

    Appendix

    Response 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 24 LINE Pay Response

    Code(returnCode) Description (300byte)
    0000 Success
    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).
    1133 Invalid oneTimeKey
    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.
    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 Information error for payment confirm (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.
    1183 Payment amount must be greater than 0.
    1184 Payment amount exceeds amount requested.
    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 has been temporarily stopped.
    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.
    1900 Temporary Error. Please, try again later.
    1901 Temporary Error. Please, try again later.
    1902 Temporary Error. Please, try again later.
    1903 Temporary Error. Please, try again later.
    1999 It does not match the requested information. (When retrying a request)
    2101 Parameter error
    2102 JSON data format error
    2103 Incorrect request. Please, check a returnMessage.
    2104 Incorrect request. Please, check a returnMessage.
    9000 Internal error

    Response Code by API

    Table 25 Response Code by API

    Error Code Payment Payment status check Capture Void Refund Authorization Details Payment Details
    1101 v v v
    1102 v v v
    1104 v v v v v v v
    1105 v v v v v v v
    1106 v v v v v v v
    1110 v
    1124 v v
    1133 v
    1141 v
    1142 v
    1145 v
    1150 v v v v v v
    1152 v
    1153 v
    1154
    1155 v v v
    1159 v
    1163 v
    1164 v
    1165 v
    1170 v v v      
    1172 v v
    1177 v v
    1178 v
    1179 v v v
    1183 v v
    1184 v v
    1194 v
    1198 v v v v
    1199 v v v v
    1900 v v v
    1901 v
    1902 v
    1903 v
    1999 v v v
    2101 v v v v v v v
    2102 v v v v v v v
    2103 v v v v v v v
    2104 v v v v v v v
    9000 v v v v v v v