Preview a bulk collection
curl --request POST \
--url https://app.flextell.ai/api/v1/customers/{id}/transactions/bulk-collection/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"transaction_ids": [
123
],
"amount": 1.01
}
'import requests
url = "https://app.flextell.ai/api/v1/customers/{id}/transactions/bulk-collection/preview"
payload = {
"transaction_ids": [123],
"amount": 1.01
}
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({transaction_ids: [123], amount: 1.01})
};
fetch('https://app.flextell.ai/api/v1/customers/{id}/transactions/bulk-collection/preview', 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://app.flextell.ai/api/v1/customers/{id}/transactions/bulk-collection/preview",
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([
'transaction_ids' => [
123
],
'amount' => 1.01
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Tenant: <x-tenant>"
],
]);
$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://app.flextell.ai/api/v1/customers/{id}/transactions/bulk-collection/preview"
payload := strings.NewReader("{\n \"transaction_ids\": [\n 123\n ],\n \"amount\": 1.01\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Tenant", "<x-tenant>")
req.Header.Add("Authorization", "Bearer <token>")
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://app.flextell.ai/api/v1/customers/{id}/transactions/bulk-collection/preview")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transaction_ids\": [\n 123\n ],\n \"amount\": 1.01\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/customers/{id}/transactions/bulk-collection/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transaction_ids\": [\n 123\n ],\n \"amount\": 1.01\n}"
response = http.request(request)
puts response.read_body{}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": false,
"error_code": "CUSTOMER_ERASED",
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error_code": "SETUP_REQUIRED",
"message": "Complete the required setup steps to continue.",
"data": {
"next_step": "clinic_info"
}
}CustomerTransaction
Preview a bulk collection
Reports what a bulk collection over the selected transactions would do, without recording anything: their shared currency, the outstanding_total (the sum of their remaining_debit, which is the default and the upper bound of the amount) and, when amount is given, how it would be split over the rows oldest first. It applies the same checks as the bulk collection itself and fails with the same error codes, including BULK_COLLECTION_AMOUNT_EXCEEDS_OUTSTANDING when the amount is above the outstanding total.
POST
/
v1
/
customers
/
{id}
/
transactions
/
bulk-collection
/
preview
Preview a bulk collection
curl --request POST \
--url https://app.flextell.ai/api/v1/customers/{id}/transactions/bulk-collection/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"transaction_ids": [
123
],
"amount": 1.01
}
'import requests
url = "https://app.flextell.ai/api/v1/customers/{id}/transactions/bulk-collection/preview"
payload = {
"transaction_ids": [123],
"amount": 1.01
}
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({transaction_ids: [123], amount: 1.01})
};
fetch('https://app.flextell.ai/api/v1/customers/{id}/transactions/bulk-collection/preview', 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://app.flextell.ai/api/v1/customers/{id}/transactions/bulk-collection/preview",
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([
'transaction_ids' => [
123
],
'amount' => 1.01
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Tenant: <x-tenant>"
],
]);
$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://app.flextell.ai/api/v1/customers/{id}/transactions/bulk-collection/preview"
payload := strings.NewReader("{\n \"transaction_ids\": [\n 123\n ],\n \"amount\": 1.01\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Tenant", "<x-tenant>")
req.Header.Add("Authorization", "Bearer <token>")
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://app.flextell.ai/api/v1/customers/{id}/transactions/bulk-collection/preview")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transaction_ids\": [\n 123\n ],\n \"amount\": 1.01\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/customers/{id}/transactions/bulk-collection/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transaction_ids\": [\n 123\n ],\n \"amount\": 1.01\n}"
response = http.request(request)
puts response.read_body{}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": false,
"error_code": "CUSTOMER_ERASED",
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error_code": "SETUP_REQUIRED",
"message": "Complete the required setup steps to continue.",
"data": {
"next_step": "clinic_info"
}
}Yetkilendirmeler
oauth2bearer
Başlıklar
Gövde
application/json
Yanıt
The response is of type object.