Confirm API

Overview

An API for the merchant to complete the payment when the user approves with the ConfirmURLopen in new window or Check Payment Status APIopen in new window. Status of a payment where authorization and purchase are separated because 'options.payment.confirm' of the Request API is set as false will be in purchase standby (Authentication) even after it is completed. To complete the purchase, an additional purchase process is required through the Confirm APIopen in new window.

send

send(confirmRequestConfig)

Returns Promise<ApiResponse<ConfirmResponseBody>>

Request Config

export type ConfirmRequestBody = {
  /**
   * Payment amount
   */
  amount: number
  /**
   * Payment currency ([ISO 4217](https://en.wikipedia.org/wiki/ISO_4217))\
   * Supported currencies are as follows.
   * - USD
   * - JPY
   * - TWD
   * - THB
   */
  currency: Currency
}

export type ConfirmRequestConfig = GeneralRequestConfig & {
  /**
   * ID of the transaction
   */
  transactionId: string
  /**
   * Request body of confirm API
   */
  body: ConfirmRequestBody
}

Response Body

export type PayInfo = {
  /**
   * A payment method used for payment
   * - Credit card: CREDIT_CARD
   * - Balance: BALANCE
   * - Discount: DISCOUNT
   */
  method: string
  /**
   * Payment amount
   */
  amount: number
  /**
   * Credit card nickname for automatic payment
   * - Credit card name managed at LINE Pay. It is the name registered when registered to LINE Pay.
   * - If LINE Pay user does not set a nickname, an empty string will be sent.
   * - The nickname can be changed upon user's request and the change history will not be shared with the merchant.
   */
  creditCardNickname?: string
  /**
   * Credit card brand used for automatic payment
   * - VISA
   * - MASTER
   * - AMEX
   * - DINERS
   * - JCB
   */
  creditCardBrand?: string
  /**
   * Masked credit card number (Send only for Taiwan merchants. Able to use the feature when requesting to the merchant center manager. Not sending in payment details API).
   * - Format: **** **** **** 1234
   */
  maskedCreditCardNumber?: string
}

export type Package = {
  /**
   * An unique ID of package list
   */
  id: string
  /**
   * Name of the sales products
   */
  name?: string
  /**
   * Total amount of products per package\
   * `=sum(products[].quantity * products[].price)`
   */
  amount: number
  /**
   * User fee: Sent as a respond if a list of fee is found within the payment amount.
   */
  userFeeAmount?: number
}

export type Shipping = {
  /**
   * An ID of shipping method selected by user
   */
  methodId: string
  /**
   * Shipping fee
   */
  feeAmount: number
  /**
   * Shipping address
   */
  address: Address
}

export type Info = {
  /**
   * An unique order ID of the merchant sent upon requesting the payment.
   */
  orderId: string
  /**
   * Transaction ID
   */
  transactionId: string
  /**
   * Authentication expiration date and time (ISO 8601)
   * - Send if the payment proceeded only up to authentication (capture=false)
   */
  authorizationExpireDate?: string
  /**
   * A key for automatic payment (15 digits)
   */
  regKey?: string
  /**
   * Payment information
   */
  payInfo: PayInfo[]
  /**
   * Package information
   */
  packages: Package[]
  /**
   * Shipping information
   */
  shipping?: Shipping
}

export type ConfirmResponseBody = GeneralResponseBody & {
  /**
   * Payment information
   */
  info: Info
}






































































 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 

Return Code

Success

CodeDescription
0000Success

Error

CodeDescription
1101Not a LINE Pay member
1102The member is unable to proceed the transaction.
1104Non-existing merchant
1105The merchant cannot use the LINE Pay.
1106A header info error
1110Unacceptable credit card
1124Amount info error (scale)
1141A payment account error
1142Low balance
1150Cannot find the transaction history
1152There is a history of transactions with the same transactionId.
1153The payment amount is different than the requested amount.
1159Payment request information is not found.
1169Must select a payment method and password authentication at the LINE Pay.
1170Balance of the member's account has been changed.
1172A record of transaction with the same order number already exists.
1180The payment has been expired.
1198API call request has been duplicated.
1199Internal request error
1280A temporary error occurred while processing the credit card payment.
1281A credit card payment error
1282A credit card authorization error
1283The payment was refused due to suspected fraud.
1284The credit card payment has temporarily stopped.
1285Missing credit card payment information
1286Wrong credit card payment information
1287The credit card has been expired
1288The credit card has low balance
1289Exceeded the credit card limit
1290Exceeded the limit of the credit card per payment
1291The card has been reported as a stolen card.
1292The card has been suspended.
1293A CVN input error
1294The card is listed on the blacklist.
1295A wrong credit card number
1296Unable to proceed the amount
1298The card has been declined.
9000An internal error

Example

Request

const res = await linePayClient.confirm
  .send({
    transactionId: '2021121600698709510',
    body: {
      currency: 'TWD',
      amount: 1000
    }
  })

Response

{
  "body": {
    "returnCode": "0000",
    "returnMessage": "Success.",
    "info": {
      "transactionId": "2021121600698709510",
      "orderId": "20211216002",
      "payInfo": [
        {
          "method": "CREDIT_CARD",
          "amount": 1000,
        }
      ],
      "packages": [
        {
          "id": "c99abc79-3b29-4f40-8851-bc618ca57857",
          "amount": 1000,
          "userFeeAmount": 0,
          "products": [
            {
              "name": "Demo Product",
              "quantity": 2,
              "price": 500
            }
          ]
        }
      ]
    }
  },
  "comments": {}
}

addHandler

addHandler(handler)

Returns ConfirmClient

Example:

client.addHandler(({ type, req, next, httpClient }) => {
  console.log(type) // confirm
  return next(req)
})

addHandlers

addHandlers(...handlers)

Returns ConfirmClient

Example:

client.addHandlers(
  ({ req, next }) => next(req),
  ({ req, next }) => next(req),
  ({ req, next }) => next(req)
)
Last Updated:
Contributors: Sean Lin