Create a payment initiation with whitelabel
1 min
whitelabel
Use /payment-links endpoint in white label mode to return a token, a starting paymentURL and a initiation Id.
POST
https://api-sandbox.klavi.ai/payment/customer/v1/instant/payment-links
Body Parameters
- accessKeystringrequiredDescription
- secretKeystringrequiredDescription
- paymentObjectrequiredDescription
- clientRequestIdstringrequiredDescription
- customerobjectDescription
- identifierTypestringrequiredDescription
- identifierstringrequiredDescription
- namestringDescription
- phonestringDescription
- emailstringDescription
- loggedUserCpfstringDescription
- ibgeTownCodestringDescription
- proxystringDescription
- qrCodestringDescription
- initTypestringrequiredDescription
- amountstringrequiredDescription
- currencystringrequiredDescription
- redirectURLstringDescription
- remittanceInformationstringDescription
- debtorAccountobjectDescription
- ispbstringrequiredDescription
- issuerstringDescription
- numberstringrequiredDescription
- accountTypestringrequiredDescription
- creditorAccountobjectDescription
- ispbstringDescription
- issuerstringDescription
- numberstringrequiredDescription
- accountTypestringrequiredDescription
- holderobjectrequiredDescription
- identifierTypestringrequiredDescription
- identifierstringrequiredDescription
- namestringrequiredDescription
- externalInfoobjectDescription
- appLinkstringDescription
- appRedirectURLKeystringDescription
- linkOptionobjectDescription
- jsrFlowActivebooleanDescription
Response
- idstringDescription
- paymentURLstringDescription
curl
curl --location 'https://api-sandbox.klavi.ai/payment/customer/v1/instant/payment-links' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"accessKey": "String",
"secretKey": "String",
"payment": {
"clientRequestId": "String",
"customer": {
"identifierType": "String",
"identifier": "String",
"name": "String",
"phone": "String",
"email": "String"
},
"loggedUserCpf": "String",
"ibgeTownCode": "String",
"proxy": "String",
"qrCode": "String",
"initType": "String",
"amount": "String",
"currency": "String",
"redirectURL": "String",
"remittanceInformation": "String",
"institutionId": "String",
"debtorAccount": {
"ispb": "String",
"issuer": "String",
"number": "String",
"accountType": "String"
},
"creditorAccount": {
"ispb": "String",
"issuer": "String",
"number": "String",
"accountType": "String",
"holder": {
"identifierType": "String",
"identifier": "String",
"name": "String"
}
},
"externalInfo": "Object"
}
}'nodejs
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api-sandbox.klavi.ai/payment/customer/v1/instant/payment-links',
'headers': {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"accessKey": "String",
"secretKey": "String",
"payment": {
"clientRequestId": "String",
"customer": {
"identifierType": "String",
"identifier": "String",
"name": "String",
"phone": "String",
"email": "String"
},
"loggedUserCpf": "String",
"ibgeTownCode": "String",
"proxy": "String",
"qrCode": "String",
"initType": "String",
"amount": "String",
"currency": "String",
"redirectURL": "String",
"remittanceInformation": "String",
"institutionId": "String",
"debtorAccount": {
"ispb": "String",
"issuer": "String",
"number": "String",
"accountType": "String"
},
"creditorAccount": {
"ispb": "String",
"issuer": "String",
"number": "String",
"accountType": "String",
"holder": {
"identifierType": "String",
"identifier": "String",
"name": "String"
}
},
"externalInfo": "Object"
}
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
javascript
var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"accessKey": "String",
"secretKey": "String",
"payment": {
"clientRequestId": "String",
"customer": {
"identifierType": "String",
"identifier": "String",
"name": "String",
"phone": "String",
"email": "String"
},
"loggedUserCpf": "String",
"ibgeTownCode": "String",
"proxy": "String",
"qrCode": "String",
"initType": "String",
"amount": "String",
"currency": "String",
"redirectURL": "String",
"remittanceInformation": "String",
"institutionId": "String",
"debtorAccount": {
"ispb": "String",
"issuer": "String",
"number": "String",
"accountType": "String"
},
"creditorAccount": {
"ispb": "String",
"issuer": "String",
"number": "String",
"accountType": "String",
"holder": {
"identifierType": "String",
"identifier": "String",
"name": "String"
}
},
"externalInfo": "Object"
}
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api-sandbox.klavi.ai/payment/customer/v1/instant/payment-links", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));python
import requests
import json
url = "https://api-sandbox.klavi.ai/payment/customer/v1/instant/payment-links"
payload = json.dumps({
"accessKey": "String",
"secretKey": "String",
"payment": {
"clientRequestId": "String",
"customer": {
"identifierType": "String",
"identifier": "String",
"name": "String",
"phone": "String",
"email": "String"
},
"loggedUserCpf": "String",
"ibgeTownCode": "String",
"proxy": "String",
"qrCode": "String",
"initType": "String",
"amount": "String",
"currency": "String",
"redirectURL": "String",
"remittanceInformation": "String",
"institutionId": "String",
"debtorAccount": {
"ispb": "String",
"issuer": "String",
"number": "String",
"accountType": "String"
},
"creditorAccount": {
"ispb": "String",
"issuer": "String",
"number": "String",
"accountType": "String",
"holder": {
"identifierType": "String",
"identifier": "String",
"name": "String"
}
},
"externalInfo": "Object"
}
})
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api-sandbox.klavi.ai/payment/customer/v1/instant/payment-links")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = "application/json"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"accessKey": "String",
"secretKey": "String",
"payment": {
"clientRequestId": "String",
"customer": {
"identifierType": "String",
"identifier": "String",
"name": "String",
"phone": "String",
"email": "String"
},
"loggedUserCpf": "String",
"ibgeTownCode": "String",
"proxy": "String",
"qrCode": "String",
"initType": "String",
"amount": "String",
"currency": "String",
"redirectURL": "String",
"remittanceInformation": "String",
"institutionId": "String",
"debtorAccount": {
"ispb": "String",
"issuer": "String",
"number": "String",
"accountType": "String"
},
"creditorAccount": {
"ispb": "String",
"issuer": "String",
"number": "String",
"accountType": "String",
"holder": {
"identifierType": "String",
"identifier": "String",
"name": "String"
}
},
"externalInfo": "Object"
}
})
response = https.request(request)
puts response.read_body
200
{
"id": "fcb72e3a-b346-4f71-b044-971dc23232c9",
"paymentURL":"https://payment-test.klavi.ai/?v=rvgvVVDDOYIR81gywJx9h1kBK55",
}