Create a payable from a file
curl --request POST \
--url https://api.dots.dev/api/v2/accounts-payable/payables/upload-from-file \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: multipart/form-data' \
--form acting_user_id=123 \
--form file='@example-file'import requests
url = "https://api.dots.dev/api/v2/accounts-payable/payables/upload-from-file"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "acting_user_id": "123" }
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('acting_user_id', '123');
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Basic <encoded-value>'}};
options.body = form;
fetch('https://api.dots.dev/api/v2/accounts-payable/payables/upload-from-file', 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.dots.dev/api/v2/accounts-payable/payables/upload-from-file",
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=\"acting_user_id\"\r\n\r\n123\r\n-----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: Basic <encoded-value>",
"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.dots.dev/api/v2/accounts-payable/payables/upload-from-file"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"acting_user_id\"\r\n\r\n123\r\n-----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", "Basic <encoded-value>")
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.dots.dev/api/v2/accounts-payable/payables/upload-from-file")
.header("Authorization", "Basic <encoded-value>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"acting_user_id\"\r\n\r\n123\r\n-----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.dots.dev/api/v2/accounts-payable/payables/upload-from-file")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"acting_user_id\"\r\n\r\n123\r\n-----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{
"action_history": [
{
"comment": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"user_id": 123,
"user_name": "<string>"
}
],
"amount": 123,
"ap_payment_method_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ap_payment_method_name": "<string>",
"ap_vendor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ap_vendor_name": "<string>",
"api_app_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"approval_steps": [
{
"completed": true,
"completed_timestamp": "2023-11-07T05:31:56Z",
"num_approvals_required": 123,
"user_approvals": [
{
"approval_comment": "<string>",
"approval_given": true,
"approval_timestamp": "2023-11-07T05:31:56Z",
"name": "<string>",
"user_id": 123
}
]
}
],
"created": "2023-11-07T05:31:56Z",
"currency": "<string>",
"description": "<string>",
"external_id": "<string>",
"file_url": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"items": [
{
"amount": 2,
"description": "<string>",
"name": "<string>",
"quantity": 2,
"unit_price": 2
}
],
"number": "<string>",
"status": "<string>",
"status_history": [
{
"timestamp": "2023-11-07T05:31:56Z"
}
],
"transfer_history": [
{
"created_timestamp": "2023-11-07T05:31:56Z",
"idempotency_key": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"transfer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"transfer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updated": "2023-11-07T05:31:56Z"
}accounts-payable
Create a payable from a file
Create a payable from a file. The contents of the file will be processed and the payable will be created.
POST
/
v2
/
accounts-payable
/
payables
/
upload-from-file
Create a payable from a file
curl --request POST \
--url https://api.dots.dev/api/v2/accounts-payable/payables/upload-from-file \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: multipart/form-data' \
--form acting_user_id=123 \
--form file='@example-file'import requests
url = "https://api.dots.dev/api/v2/accounts-payable/payables/upload-from-file"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "acting_user_id": "123" }
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('acting_user_id', '123');
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Basic <encoded-value>'}};
options.body = form;
fetch('https://api.dots.dev/api/v2/accounts-payable/payables/upload-from-file', 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.dots.dev/api/v2/accounts-payable/payables/upload-from-file",
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=\"acting_user_id\"\r\n\r\n123\r\n-----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: Basic <encoded-value>",
"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.dots.dev/api/v2/accounts-payable/payables/upload-from-file"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"acting_user_id\"\r\n\r\n123\r\n-----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", "Basic <encoded-value>")
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.dots.dev/api/v2/accounts-payable/payables/upload-from-file")
.header("Authorization", "Basic <encoded-value>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"acting_user_id\"\r\n\r\n123\r\n-----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.dots.dev/api/v2/accounts-payable/payables/upload-from-file")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"acting_user_id\"\r\n\r\n123\r\n-----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{
"action_history": [
{
"comment": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"user_id": 123,
"user_name": "<string>"
}
],
"amount": 123,
"ap_payment_method_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ap_payment_method_name": "<string>",
"ap_vendor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ap_vendor_name": "<string>",
"api_app_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"approval_steps": [
{
"completed": true,
"completed_timestamp": "2023-11-07T05:31:56Z",
"num_approvals_required": 123,
"user_approvals": [
{
"approval_comment": "<string>",
"approval_given": true,
"approval_timestamp": "2023-11-07T05:31:56Z",
"name": "<string>",
"user_id": 123
}
]
}
],
"created": "2023-11-07T05:31:56Z",
"currency": "<string>",
"description": "<string>",
"external_id": "<string>",
"file_url": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"items": [
{
"amount": 2,
"description": "<string>",
"name": "<string>",
"quantity": 2,
"unit_price": 2
}
],
"number": "<string>",
"status": "<string>",
"status_history": [
{
"timestamp": "2023-11-07T05:31:56Z"
}
],
"transfer_history": [
{
"created_timestamp": "2023-11-07T05:31:56Z",
"idempotency_key": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"transfer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"transfer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updated": "2023-11-07T05:31:56Z"
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
multipart/form-data
Response
200 - application/json
OK
Show child attributes
Show child attributes
Total payable amount in cents.
Available options:
dots_balance, ach Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I

