Void API

Overview

An API to void payment data that are in authorization status. The API cancels authorization transaction after the payment is completed with the Confirm API. Only the transactions that are in authorization status(purchase standby status) can be cancelled and purchased transactions should be refunded with Refund APIopen in new window.

send

send(voidRequestConfig)

Returns Promise<ApiResponse<VoidResponseBody>>

Request Config

export type VoidRequestBody = EmptyObject

export type VoidRequestConfig = GeneralRequestConfig & {
  /**
   * ID of the transaction
   */
  transactionId: string
  /**
   * Request body of void API
   */
  body?: VoidRequestBody
}

Response Body

export type VoidResponseBody = GeneralResponseBody

Return Code

Success

CodeDescription
0000Success

Error

CodeDescription
1101A purchaser status error
1102A purchaser status error
1104Non-existing merchant
1105The merchant cannot use the LINE Pay.
1106A header info error
1150Cannot find the transaction history
1155Wrong transaction number
1165A transaction has already been voided.
1170Balance of the member's account has been changed.
1198API call request has been duplicated.
1199An internal request error
1900A temporary error. Please try again later.
1902A temporary error. Please try again later.
1999The request information is different than the previous one.
9000An internal error

Example

Request

const res = await linePayClient.void
  .send({
    transactionId: '2021121300698360310'
  })

Response

{
  "body": {
    "returnCode": "0000",
    "returnMessage": "Success."
  },
  "comments": {}
}

addHandler

addHandler(handler)

Returns VoidClient

Example:

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

addHandlers

addHandlers(...handlers)

Returns VoidClient

Example:

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