Bulk upload clients from CSV file
curl --request POST \
--url https://api.payable.run/api/v1/clients/bulk-upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileimport requests
url = "https://api.payable.run/api/v1/clients/bulk-upload"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.payable.run/api/v1/clients/bulk-upload', 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://api.payable.run/api/v1/clients/bulk-upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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://api.payable.run/api/v1/clients/bulk-upload"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.payable.run/api/v1/clients/bulk-upload")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.payable.run/api/v1/clients/bulk-upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"success": true,
"created": 12,
"clients": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"firstName": "João",
"lastName": "Silva",
"phone": "11999999999",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "OVERDUE",
"createdAt": {},
"updatedAt": {},
"cpf": "12345678901",
"email": "[email protected]",
"occupation": {},
"observation": {},
"cep": {},
"city": {},
"neighborhood": {},
"street": {},
"address": {},
"streetNumber": {},
"state": "SP",
"isSandbox": true,
"debtCount": 123,
"totalDebtAmount": 123,
"outstandingAmount": 123,
"openDebtCount": 123,
"overdueDebtCount": 123,
"paidDebtCount": 123,
"nextDueDate": {},
"channelPreferences": {
"whatsapp": {
"status": "open",
"mutedUntil": {},
"optedOutAt": {},
"source": {},
"reason": "already_paid",
"reasonDetail": {}
},
"email": {
"status": "open",
"mutedUntil": {},
"optedOutAt": {},
"source": {},
"reason": "already_paid",
"reasonDetail": {}
},
"sms": {
"status": "open",
"mutedUntil": {},
"optedOutAt": {},
"source": {},
"reason": "already_paid",
"reasonDetail": {}
}
},
"overIndebtednessReportedAt": "2023-11-07T05:31:56Z",
"overIndebtednessSource": "agent"
}
]
}{
"type": "https://docs.payable.run/errors/validation_error",
"title": "Bad Request",
"status": 400,
"detail": "One or more request fields are invalid.",
"instance": "/api/v1/clients",
"code": "VALIDATION_ERROR",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"message": "<string>",
"field": "<string>"
}
]
}{
"type": "https://docs.payable.run/errors/validation_error",
"title": "Bad Request",
"status": 400,
"detail": "One or more request fields are invalid.",
"instance": "/api/v1/clients",
"code": "VALIDATION_ERROR",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"message": "<string>",
"field": "<string>"
}
]
}Clients
Bulk upload clients from CSV file
POST
/
api
/
v1
/
clients
/
bulk-upload
Bulk upload clients from CSV file
curl --request POST \
--url https://api.payable.run/api/v1/clients/bulk-upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileimport requests
url = "https://api.payable.run/api/v1/clients/bulk-upload"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.payable.run/api/v1/clients/bulk-upload', 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://api.payable.run/api/v1/clients/bulk-upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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://api.payable.run/api/v1/clients/bulk-upload"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.payable.run/api/v1/clients/bulk-upload")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.payable.run/api/v1/clients/bulk-upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"success": true,
"created": 12,
"clients": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"firstName": "João",
"lastName": "Silva",
"phone": "11999999999",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "OVERDUE",
"createdAt": {},
"updatedAt": {},
"cpf": "12345678901",
"email": "[email protected]",
"occupation": {},
"observation": {},
"cep": {},
"city": {},
"neighborhood": {},
"street": {},
"address": {},
"streetNumber": {},
"state": "SP",
"isSandbox": true,
"debtCount": 123,
"totalDebtAmount": 123,
"outstandingAmount": 123,
"openDebtCount": 123,
"overdueDebtCount": 123,
"paidDebtCount": 123,
"nextDueDate": {},
"channelPreferences": {
"whatsapp": {
"status": "open",
"mutedUntil": {},
"optedOutAt": {},
"source": {},
"reason": "already_paid",
"reasonDetail": {}
},
"email": {
"status": "open",
"mutedUntil": {},
"optedOutAt": {},
"source": {},
"reason": "already_paid",
"reasonDetail": {}
},
"sms": {
"status": "open",
"mutedUntil": {},
"optedOutAt": {},
"source": {},
"reason": "already_paid",
"reasonDetail": {}
}
},
"overIndebtednessReportedAt": "2023-11-07T05:31:56Z",
"overIndebtednessSource": "agent"
}
]
}{
"type": "https://docs.payable.run/errors/validation_error",
"title": "Bad Request",
"status": 400,
"detail": "One or more request fields are invalid.",
"instance": "/api/v1/clients",
"code": "VALIDATION_ERROR",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"message": "<string>",
"field": "<string>"
}
]
}{
"type": "https://docs.payable.run/errors/validation_error",
"title": "Bad Request",
"status": 400,
"detail": "One or more request fields are invalid.",
"instance": "/api/v1/clients",
"code": "VALIDATION_ERROR",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"message": "<string>",
"field": "<string>"
}
]
}Authorizations
Use Authorization: Bearer esk_live_... or esk_test_... for API access
Body
multipart/form-data
CSV file (max 5MB) with client columns.