创建卡信息
将卡的信息存储在Liquido的服务器上,并返回一个卡的标识,可用于以后付款。
HTTP请求
POST
/v1/payments/vault/card
Request Headers{
"Content-Type": "application/json",
"Authorization": "Bearer {{access_token}}",
"x-api-key": "{{api_key}}"
}
Request Body{
"country": "PE",
"card": {
"cardHolderName": "card_holder_name",
"cardNumber": "4242424242424242",
"expirationMonth": "09",
"expirationYear": "2024",
"cvc": "123"
},
"payer": {
"name": "username",
"email": "username@liquido.com",
"document": {
"documentId": "700123456",
"type": "DNI"
}
}
}
Response{
"cardId": "123121123",
"card": {
"cardHolderName": "card_holder_name",
"expirationMonth": 9,
"expirationYear": 2024,
"brand": "VISA",
"bin": "458124",
"last4": "0000"
}
}
Key |
Value |
Authorization |
"bearer" + " " + {{access_token}} |
x-api-key |
{{api_key}} |
Request Body 字段说明
Parameter |
Required |
Type |
Description |
country |
|
String |
国家编码. |
card |
|
JSON |
卡信息. |
payer |
|
JSON |
买家个人信息. |
Card 对象字段说明
Parameter |
Required |
Type |
Description |
cardHolderName |
|
String |
持卡人全称. |
cardNumber |
|
String |
卡号, 16位纯数字字符串,不能有横杠空格等分隔符. |
cvc |
|
String |
信用卡安全码. |
expirationMonth |
|
String |
信用卡有效期月份,2位数。 |
expirationYear |
|
String |
信用卡有效期年份,4位数。 |
Payer 对象字段说明
参数 |
必填 |
类型 |
描述 |
name |
|
String |
名字,全称 |
email |
|
String |
邮箱 |
document |
|
JSON |
支付人的身份信息 |
Document 对象字段说明
Parameter |
Required |
Type |
Description |
documentId |
|
String |
证件号码. |
type |
|
String |
证件类型.如DNI |
Response Body 字段说明
Parameter |
Type |
Description |
cardId |
String |
保存的卡ID. |
card |
JSON |
卡详细信息. |
Card (响应)对象字段说明
参数 |
类型 |
描述 |
cardHolderName |
String |
持卡人姓名 |
bin |
String |
卡号前6位数字 |
last4 |
String |
卡号后4位数字 |
brand |
String |
信用卡组织. 如 VISA, MASTERCARD |
expirationMonth |
Integer |
1位数或者2位数的信用卡有效期月份。 |
expirationYear |
Integer |
信用卡有效期年份,4位数。 |
创建一个卡ID付款的信用卡支付
HTTP请求
POST
/v1/payments/charges/card
Request Headers{
"Content-Type": "application/json",
"Authorization": "Bearer {{access_token}}",
"x-api-key": "{{api_key}}"
}
Request Body{
"idempotencyKey": "1ec983fa-1a37-679b-809b-067861d87ab0",
"amount": 500,
"currency": "PEN",
"country": "PE",
"paymentMethod": "CREDIT_CARD",
... # other basic request fields
"cardId": "8736453a-dad0-4f26-85f0-95e8787d0237",
}
Response{
"transferStatusCode": 200,
"idempotencyKey": "1ec983fa-1a37-679b-809b-067861d87ab0",
"referenceId": "1ec983fa-1a37-679b-809b-067861d87ab0",
"paymentMethod": "CREDIT_CARD",
"amount": 500,
"currency": "PEN",
"finalAmount": 500,
"finalCurrency": "PEN",
"country": "PE",
... # other basic response fields
"transferDetails": {
"card": {
"cardInfo": {
"cardHolderName": "card_holder_name",
"expirationMonth": 9,
"expirationYear": 2024,
"brand": "VISA",
"bin": "458124",
"last4": "0000"
},
"cardId": "8736453a-dad0-4f26-85f0-95e8787d0237"
}
},
}