curl --request POST \
--url https://api.exowpee.com/v1/catalog/vendors/{id}/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"payment_method": "cash",
"cash_register_id": "<string>",
"currency_code": "<string>",
"paid_at": "<string>",
"payment_date": "<string>",
"money_account_id": "<string>",
"reference": "<string>",
"notes": "<string>",
"purchase_order_ids": [
"<string>"
]
}
'import requests
url = "https://api.exowpee.com/v1/catalog/vendors/{id}/payments"
payload = {
"amount": 123,
"payment_method": "cash",
"cash_register_id": "<string>",
"currency_code": "<string>",
"paid_at": "<string>",
"payment_date": "<string>",
"money_account_id": "<string>",
"reference": "<string>",
"notes": "<string>",
"purchase_order_ids": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 123,
payment_method: 'cash',
cash_register_id: '<string>',
currency_code: '<string>',
paid_at: '<string>',
payment_date: '<string>',
money_account_id: '<string>',
reference: '<string>',
notes: '<string>',
purchase_order_ids: ['<string>']
})
};
fetch('https://api.exowpee.com/v1/catalog/vendors/{id}/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://api.exowpee.com/v1/catalog/vendors/{id}/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([
'amount' => 123,
'payment_method' => 'cash',
'cash_register_id' => '<string>',
'currency_code' => '<string>',
'paid_at' => '<string>',
'payment_date' => '<string>',
'money_account_id' => '<string>',
'reference' => '<string>',
'notes' => '<string>',
'purchase_order_ids' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.exowpee.com/v1/catalog/vendors/{id}/payments"
payload := strings.NewReader("{\n \"amount\": 123,\n \"payment_method\": \"cash\",\n \"cash_register_id\": \"<string>\",\n \"currency_code\": \"<string>\",\n \"paid_at\": \"<string>\",\n \"payment_date\": \"<string>\",\n \"money_account_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"notes\": \"<string>\",\n \"purchase_order_ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.exowpee.com/v1/catalog/vendors/{id}/payments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"payment_method\": \"cash\",\n \"cash_register_id\": \"<string>\",\n \"currency_code\": \"<string>\",\n \"paid_at\": \"<string>\",\n \"payment_date\": \"<string>\",\n \"money_account_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"notes\": \"<string>\",\n \"purchase_order_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/vendors/{id}/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"payment_method\": \"cash\",\n \"cash_register_id\": \"<string>\",\n \"currency_code\": \"<string>\",\n \"paid_at\": \"<string>\",\n \"payment_date\": \"<string>\",\n \"money_account_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"notes\": \"<string>\",\n \"purchase_order_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"vendor_id": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_exponent": 123,
"paid_at": "2023-11-07T05:31:56Z",
"payment_method": "<string>",
"cash_register_id": "<string>",
"money_account_id": "<string>",
"reference": "<string>",
"notes": "<string>",
"purchase_payments": "<array>",
"purchases": "<array>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}Pay a vendor
Records a cash payment to a supplier from a cash register and applies it to the supplier’s unpaid credit purchases, soonest due date first or only to the purchases you pick.
curl --request POST \
--url https://api.exowpee.com/v1/catalog/vendors/{id}/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"payment_method": "cash",
"cash_register_id": "<string>",
"currency_code": "<string>",
"paid_at": "<string>",
"payment_date": "<string>",
"money_account_id": "<string>",
"reference": "<string>",
"notes": "<string>",
"purchase_order_ids": [
"<string>"
]
}
'import requests
url = "https://api.exowpee.com/v1/catalog/vendors/{id}/payments"
payload = {
"amount": 123,
"payment_method": "cash",
"cash_register_id": "<string>",
"currency_code": "<string>",
"paid_at": "<string>",
"payment_date": "<string>",
"money_account_id": "<string>",
"reference": "<string>",
"notes": "<string>",
"purchase_order_ids": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 123,
payment_method: 'cash',
cash_register_id: '<string>',
currency_code: '<string>',
paid_at: '<string>',
payment_date: '<string>',
money_account_id: '<string>',
reference: '<string>',
notes: '<string>',
purchase_order_ids: ['<string>']
})
};
fetch('https://api.exowpee.com/v1/catalog/vendors/{id}/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://api.exowpee.com/v1/catalog/vendors/{id}/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([
'amount' => 123,
'payment_method' => 'cash',
'cash_register_id' => '<string>',
'currency_code' => '<string>',
'paid_at' => '<string>',
'payment_date' => '<string>',
'money_account_id' => '<string>',
'reference' => '<string>',
'notes' => '<string>',
'purchase_order_ids' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.exowpee.com/v1/catalog/vendors/{id}/payments"
payload := strings.NewReader("{\n \"amount\": 123,\n \"payment_method\": \"cash\",\n \"cash_register_id\": \"<string>\",\n \"currency_code\": \"<string>\",\n \"paid_at\": \"<string>\",\n \"payment_date\": \"<string>\",\n \"money_account_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"notes\": \"<string>\",\n \"purchase_order_ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.exowpee.com/v1/catalog/vendors/{id}/payments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"payment_method\": \"cash\",\n \"cash_register_id\": \"<string>\",\n \"currency_code\": \"<string>\",\n \"paid_at\": \"<string>\",\n \"payment_date\": \"<string>\",\n \"money_account_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"notes\": \"<string>\",\n \"purchase_order_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/vendors/{id}/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"payment_method\": \"cash\",\n \"cash_register_id\": \"<string>\",\n \"currency_code\": \"<string>\",\n \"paid_at\": \"<string>\",\n \"payment_date\": \"<string>\",\n \"money_account_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"notes\": \"<string>\",\n \"purchase_order_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"vendor_id": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_exponent": 123,
"paid_at": "2023-11-07T05:31:56Z",
"payment_method": "<string>",
"cash_register_id": "<string>",
"money_account_id": "<string>",
"reference": "<string>",
"notes": "<string>",
"purchase_payments": "<array>",
"purchases": "<array>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}vendors.retrieve, vendor_credit_payments.create
Conditions
- payment_method must be cash. money_account_id, currency_code, paid_at and payment_date are refused: the currency is the company’s and the date is the time of the call.
- cash_register_id is required and must be a register of the company that has a cash account linked. Exowpee does not check that the register is open.
- When purchase_order_ids is sent, each id must be unique and must be an invoiced credit purchase of this supplier in the company.
- The whole amount must be applied: if it exceeds what is still owed on the targeted purchases, the call is refused and nothing is recorded.
- Creates the supplier payment, then allocates it purchase by purchase to credit purchases of the supplier that still have a remaining amount, ordered by due date, then creation date. A purchase’s share is capped at what it still owes.
- Creates one purchase payment per purchase it settles, linked to the supplier payment and copying its method, register and reference.
- Recalculates the amount paid, remaining amount and payment status of each purchase it settles.
- No accounting entry is posted by this action.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the vendor (27-character KSUID).
Query Parameters
Response mode. Default none; none answers 204 No Content.
none, resource Comma-separated JSON keys of the root resource (id is always rendered). Available: id, vendor_id, amount, currency_code, currency_exponent, paid_at, payment_method, cash_register_id, money_account_id, reference, notes, created_at, updated_at.
Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: purchasePayments, purchasePayments.purchase, purchases, purchases.items, purchases.debtAdjustments, purchases.returns, purchases.pickups, purchases.deliveries, purchases.vendor.
Body
Amount paid to the supplier, in major units, above zero. It is spread over the supplier's unpaid credit purchases and cannot exceed what they still owe.
Payment method to the supplier. Required; only cash is accepted for now, paid from the cash register named in cash_register_id.
cash Identifier of the cash register paying (27-character KSUID string). Required; it must be a register of the current company with a cash account linked.
27Not accepted: the currency is the company's.
Not accepted: the payment time is set by the server.
Not accepted: the payment time is set by the server.
Not accepted: only cash payments from a cash register are enabled for now.
Free reference for the payment, for example a receipt number. Up to 255 characters.
255Free notes about the payment.
Identifiers of the credit purchases to settle. Each must be an invoiced credit purchase of this supplier, listed once. When omitted, the payment goes to all the supplier's credit purchases that still owe money, soonest due date first.
Response
Resource (only with response=resource).
Identifier of the supplier payment (27-character KSUID string).
Identifier of the supplier paid.
Total amount paid in major units (the minor-unit amount divided by 10 to the power currency_exponent), using the payment's own currency_exponent.
Three-letter currency code (the company currency).
Number of decimal places of the currency (0 for XOF). An amount in minor units divided by 10 to this power gives the amount in the currency.
Date and time of the payment (ISO 8601). Set by the server.
How the payment was made. Only cash is accepted today.
Identifier of the cash register the money came from.
Identifier of the money account used. Always null for payments made through the API today.
Free reference supplied with the payment.
Free notes supplied with the payment.
The payments created on each purchase this payment settled. Present only when requested with include=purchasePayments.
The purchases this payment settled. Present only when requested with include=purchases.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).