Skip to main content
POST
/
v1
/
payments
Initiate a payment
curl --request POST \
  --url https://payments.sandbox.lerian.net/v1/payments \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --header 'X-Organization-Id: <x-organization-id>' \
  --data '
{
  "description": "<string>",
  "digitableLine": "<string>",
  "midazAccountId": "<string>",
  "payeeName": "<string>",
  "payeeTaxId": "<string>",
  "scheduledDate": "<string>"
}
'
import requests

url = "https://payments.sandbox.lerian.net/v1/payments"

payload = {
"description": "<string>",
"digitableLine": "<string>",
"midazAccountId": "<string>",
"payeeName": "<string>",
"payeeTaxId": "<string>",
"scheduledDate": "<string>"
}
headers = {
"X-Organization-Id": "<x-organization-id>",
"Idempotency-Key": "<idempotency-key>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
'X-Organization-Id': '<x-organization-id>',
'Idempotency-Key': '<idempotency-key>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
description: '<string>',
digitableLine: '<string>',
midazAccountId: '<string>',
payeeName: '<string>',
payeeTaxId: '<string>',
scheduledDate: '<string>'
})
};

fetch('https://payments.sandbox.lerian.net/v1/payments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://payments.sandbox.lerian.net/v1/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'digitableLine' => '<string>',
'midazAccountId' => '<string>',
'payeeName' => '<string>',
'payeeTaxId' => '<string>',
'scheduledDate' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-Organization-Id: <x-organization-id>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://payments.sandbox.lerian.net/v1/payments"

payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"digitableLine\": \"<string>\",\n \"midazAccountId\": \"<string>\",\n \"payeeName\": \"<string>\",\n \"payeeTaxId\": \"<string>\",\n \"scheduledDate\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-Organization-Id", "<x-organization-id>")
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://payments.sandbox.lerian.net/v1/payments")
.header("X-Organization-Id", "<x-organization-id>")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"digitableLine\": \"<string>\",\n \"midazAccountId\": \"<string>\",\n \"payeeName\": \"<string>\",\n \"payeeTaxId\": \"<string>\",\n \"scheduledDate\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://payments.sandbox.lerian.net/v1/payments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Organization-Id"] = '<x-organization-id>'
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"digitableLine\": \"<string>\",\n \"midazAccountId\": \"<string>\",\n \"payeeName\": \"<string>\",\n \"payeeTaxId\": \"<string>\",\n \"scheduledDate\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "amount": "<string>",
  "createdAt": "<string>",
  "digitableLine": "<string>",
  "dueDate": "<string>",
  "id": "<string>",
  "providerId": "<string>",
  "scheduledDate": "<string>",
  "status": "<string>",
  "type": "<string>"
}
{
"code": "PBP-0001",
"details": {},
"message": "dueDate must be in YYYY-MM-DD format",
"title": "Bad Request"
}
{
"code": "PBP-0001",
"details": {},
"message": "dueDate must be in YYYY-MM-DD format",
"title": "Bad Request"
}
{
"code": "PBP-0001",
"details": {},
"message": "dueDate must be in YYYY-MM-DD format",
"title": "Bad Request"
}
{
"code": "PBP-0001",
"details": {},
"message": "dueDate must be in YYYY-MM-DD format",
"title": "Bad Request"
}
{
"code": "PBP-0001",
"details": {},
"message": "dueDate must be in YYYY-MM-DD format",
"title": "Bad Request"
}
{
"code": "PBP-0001",
"details": {},
"message": "dueDate must be in YYYY-MM-DD format",
"title": "Bad Request"
}

Authorizations

Authorization
string
header
required

Bearer token authentication (format: "Bearer {token}")

Headers

X-Organization-Id
string
required

Tenant organization ID

Idempotency-Key
string
required

Idempotency key (UUID v4 or v7)

Body

application/json

Payment initiation payload

description
string
digitableLine
string
midazAccountId
string
payeeName
string

PayeeName/PayeeTaxID identify the recipient for BANKSLIP and UTILITIES. Both are optional; absent or empty fields are stored as NULL. DARF payments use a separate /v1/payments/darf endpoint with darf_* fields.

payeeTaxId
string
scheduledDate
string

Response

Created

amount
string
createdAt
string
digitableLine
string
dueDate
string
id
string
providerId
string
scheduledDate
string
status
string
type
string