跳转至

退款

该服务可以对已完成的支付发起退款。

以下付款方式将向客户进行银行转账退款, 需要额外提供银行账户信息

支付方式
PAGO_EFECTIVO
BCP
PAYVALIDA

HTTP请求

POST /v1/payments/charges/refund

Request Headers
{
    "Content-Type": "application/json",
    "Authorization": "Bearer {{access_token}}",
    "x-api-key": "{{api_key}}"
}
Request Body
{
    "idempotencyKey": "2022030214000007-1",
    "referenceId": "2022030214000007",
    "amount": 500,
    "currency": "PEN",
    "country": "PE",
    "description": "refund test",
    "additionalInfo": {
        "bankTransferAccountInfo": {
            "bankCode": "332",
            "beneficiaryName": "antonio silva",
            "bankAccountNumber": "286435",
            "bankAccountType": "CHECKING",
            "bankBranchId": "0001",
            "ispb": "13140088"
        }
    },
    "callbackUrl": "https://api.client.com/callback/"
}
Response
{
    "transferStatusCode": 200,
    "transferErrorMsg": null,
    "idempotencyKey": "2022030214000007-1",
    "referenceId": "2022030214000007",
    "paymentMethod": "CREDIT_CARD",
    "amount": 500,
    "currency": "PEN",
    "country": "PE",
    "finalAmount": 500,
    "finalCurrency": "PEN",
    "createTime": "2022-03-01 21:18:56 GMT-08:00",
    "scheduledTime": "2022-03-01 21:18:56 GMT-08:00",
    "finalStatusTime": "2022-03-01 21:18:57 GMT-08:00",
    "payer": {
        "name": "username",
        "email": "username@liquido.com",
        "document" : "700254258",
        "phone": "+52 1234567890",
        "billingAddress": {  
            "zipCode": "03400",
            "state": "CDMX",
            "city": "Álamos",
            "street": "Simón Bolívar",
            "number": "12121"
        }
    },
    "transferStatus": "SETTLED",
    "description": "refund test",
    "callbackUrl": "https://api.client.comcallback/"
}

通知 / 回调

Notification / Callback
{
    "eventType": "CHARGE_REFUND_SUCCEEDED",
    "data": {
        "chargeDetails" : {
            "amount" : 500,
            "callbackUrl" : "https://api.client.com/callback/",
            "country" : "PE",
            "finalAmount": 500,
            "finalCurrency": "PEN",
            "createTime" : "2022-03-01 15:10:35 GMT+08:00",
            "currency" : "PEN",
            "description" : "refund test",
            "finalStatusTime" : "2022-03-01 15:10:37 GMT+08:00",
            "idempotencyKey" : "2022030114000005-1",
            "payer" : {
                "email" : "username@liquido.com",
                "name" : "username"
            },
            "paymentMethod" : "CREDIT_CARD",
            "referenceId" : "2022030214000007",
            "scheduledTime" : "2022-03-01 15:10:35 GMT+08:00",
            "transferStatus" : "SETTLED",
            "transferStatusCode" : 200
        }
    }
}
HTTP Headers 字段说明
Key Value
Authorization "bearer" + " " + {{access_token}}
x-api-key {{api_key}}
Request Body 字段说明
参数 必填 类型 描述
idempotencyKey String 退款记录在的商家系统的唯一id。
referenceId String 需要退款的支付记录的idempotencyKey。
amount Long 退款金额
country String 国家编号国际缩写码,遵循ISO 3166-1 alpha-2 code标准, 如秘鲁PE
currency String 货币代码,如秘鲁新索尔PEN
description String 描述
additionalInfo JSON 退款附加信息,如银行账号
callbackUrl String 接收交易状态变更通知的地址。接收post请求。
Response Body 字段说明
参数 类型 描述
idempotencyKey String 退款记录在的商家系统的唯一id。
referenceId String 需要退款的支付记录的idempotencyKey。
amount Long 退款金额
country String 国家编号国际缩写码,遵循ISO 3166-1 alpha-2 code标准, 如秘鲁PE
currency String 货币代码,如秘鲁新索尔PEN
description String 描述
callbackUrl String 接收交易状态变更通知的地址。接收post请求。
finalAmount Long 用于创建收款订单的最终金额。对于需要转换汇率的收款订单,这个字段的值表示源请求金额被转换后的金额。
finalCurrency String finalAmount的收款货币代码
createTime String 创建时间
scheduledTime String 执行时间
finalStatusTime String 最终状态更新时间. 最终状态,包括"SETTLED", "FAILED"
description String 退款原因
transferStatus String 退款状态,枚举值,"SETTLED", "FAILED", "IN_PROGRESS"
transferStatusCode Integer 此次交易的状态码, 200表示交易成功或者进行中, 其他代表失败
transferErrorMsg String 此次交易失败原因

对象字段说明

AdditionalInfo 对象字段说明

Parameter Required Type Description
bankTransferAccountInfo JSON 银行转账账户信息

BankTransferAccountInfo 对象字段说明

Parameter Required Type Description
bankCode String 银行代码,3位数字
beneficiaryName String 受益人名称
bankAccountNumber String 受益人账号
bankAccountType String 受益人账号类型, 如 CHECKING, SAVINGS, CLABE
bankBranchId String 银行分行Id
bankName String 银行名称
ispb String 银行的ISPB, 用途和bankCode一致

Notification Event Type
CHARGE_SUCCEEDED,
CHARGE_FAILED,
CHARGE_CHARGED_BACK,
CHARGE_REFUND_SUCCEEDED,
CHARGE_REFUND_FAILED;
回到页面顶部