Create a consent-links
1 min
/consent-links
Create a consent-links(For whitelabel)
POST
https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consent-links
Body Parameters
- accessKeystringrequiredDescription
- secretKeystringrequiredDescription
- consentobjectrequiredDescription
- clientRequestIdstringrequiredDescription
- institutionIdstringDescription
- customerobject
- identifierTypestringrequiredDescription
- identifierstringrequiredDescription
- namestringrequiredDescription
- phonestringDescription
- emailstringDescription
- loggedUserCpfstringDescription
- redirectURLstringDescription
- additionalInformationstringDescription
- debtorAccountobjectDescription
- ispbstringrequiredDescription
- issuerstringDescription
- numberstringrequiredDescription
- accountTypestringrequiredDescription
- creditorAccountobjectDescription
- ispbstringrequiredDescription
- issuerstringDescription
- numberstringrequiredDescription
- accountTypestringrequiredDescription
- holderobjectDescription
- identifierstringrequiredDescription
- namestringrequiredDescription
- identifierTypestringrequiredDescription
- paymentMethodConfigobjectrequiredDescription
- contractIdstringrequiredDescription
- fixedAmountnumberDescription
- minimumVariableAmountnumberDescription
- maximumVariableAmountnumberDescription
- currencystringrequiredDescription
- intervalstringrequiredDescription
- referenceStartDatestringrequiredDescription
- contractDebtorobjectrequiredDescription
- identifierTypestringrequiredDescription
- identifierstringrequiredDescription
- namestringrequiredDescription
- isRetryAcceptedbooleanrequiredDescription
- firstPaymentobjectDescription
- remittanceInformationstringDescription
- datestringDescription
- amountstringrequiredDescription
- currencystringrequiredDescription
- externalInfoobjectDescription
- appLinkstringDescription
- appRedirectURLKeystringDescription
- expirationDateTimestringDescription
- linkOptionobjectDescription
- showLandingbooleanDescription
- skipResultPagebooleanDescription
Response
- idstringDescription
- consentURLstringDescription
curl
curl --location 'https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consent-links' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"accessKey":"string","secretKey":"string","consent":{"customer":{},"debtorAccount":{},"creditorAccount":{"holder":{}},"paymentMethodConfig":{"contractDebtor":{},"firstPayment":{}},"externalInfo":{}}}'nodejs
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consent-links',
'headers': {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"accessKey": "string",
"secretKey": "string",
"consent": {
"customer": {},
"debtorAccount": {},
"creditorAccount": {
"holder": {}
},
"paymentMethodConfig": {
"contractDebtor": {},
"firstPayment": {}
},
"externalInfo": {}
}
})
};
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",
"consent": {
"customer": {},
"debtorAccount": {},
"creditorAccount": {
"holder": {}
},
"paymentMethodConfig": {
"contractDebtor": {},
"firstPayment": {}
},
"externalInfo": {}
}
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consent-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/automatic/consent-links"
payload = json.dumps({
"accessKey": "string",
"secretKey": "string",
"consent": {
"customer": {},
"debtorAccount": {},
"creditorAccount": {
"holder": {}
},
"paymentMethodConfig": {
"contractDebtor": {},
"firstPayment": {}
},
"externalInfo": {}
}
})
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/automatic/consent-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",
"consent": {
"customer": {},
"debtorAccount": {},
"creditorAccount": {
"holder": {}
},
"paymentMethodConfig": {
"contractDebtor": {},
"firstPayment": {}
},
"externalInfo": {}
}
})
response = https.request(request)
puts response.read_body
201
{
"id": "cfa45795-fe16-48e2-a372-130e30a72606",
"consentURL": "https://link.example.com?v=dmskdclckkclxkcox&c=xxxxyyyyzzz"
}