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
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