curl --request POST \
--url https://api.exowpee.com/v1/accounting/organization/books/{book}/vat-declarations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fiscal_period_id": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/accounting/organization/books/{book}/vat-declarations"
payload = { "fiscal_period_id": "<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({fiscal_period_id: '<string>'})
};
fetch('https://api.exowpee.com/v1/accounting/organization/books/{book}/vat-declarations', 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/accounting/organization/books/{book}/vat-declarations",
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([
'fiscal_period_id' => '<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/accounting/organization/books/{book}/vat-declarations"
payload := strings.NewReader("{\n \"fiscal_period_id\": \"<string>\"\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/accounting/organization/books/{book}/vat-declarations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fiscal_period_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/accounting/organization/books/{book}/vat-declarations")
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 \"fiscal_period_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"owner_type": "<string>",
"fiscal_period_id": "<string>",
"fiscal_period": {},
"output_vat_total": 123,
"input_vat_total": 123,
"prior_credit_applied": 123,
"net_due": 123,
"net_credit": 123,
"journal_entry_id": "<string>",
"journal_entry": {},
"currency_code": "<string>",
"currency_exponent": 123,
"declared_at": "2023-11-07T05:31:56Z",
"declared_by": "<string>",
"declared_by_type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Declare VAT for a period (organization)
Records the VAT declaration of a period and posts the matching accounting entry (organization space).
curl --request POST \
--url https://api.exowpee.com/v1/accounting/organization/books/{book}/vat-declarations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fiscal_period_id": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/accounting/organization/books/{book}/vat-declarations"
payload = { "fiscal_period_id": "<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({fiscal_period_id: '<string>'})
};
fetch('https://api.exowpee.com/v1/accounting/organization/books/{book}/vat-declarations', 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/accounting/organization/books/{book}/vat-declarations",
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([
'fiscal_period_id' => '<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/accounting/organization/books/{book}/vat-declarations"
payload := strings.NewReader("{\n \"fiscal_period_id\": \"<string>\"\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/accounting/organization/books/{book}/vat-declarations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fiscal_period_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/accounting/organization/books/{book}/vat-declarations")
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 \"fiscal_period_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"owner_type": "<string>",
"fiscal_period_id": "<string>",
"fiscal_period": {},
"output_vat_total": 123,
"input_vat_total": 123,
"prior_credit_applied": 123,
"net_due": 123,
"net_credit": 123,
"journal_entry_id": "<string>",
"journal_entry": {},
"currency_code": "<string>",
"currency_exponent": 123,
"declared_at": "2023-11-07T05:31:56Z",
"declared_by": "<string>",
"declared_by_type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}vat_declarations.create
Conditions
- The accounting module must be part of the organization’s plan.
- In the organization space, the caller must have access to the book.
- The book must have accounting set up (at least one journal).
- fiscal_period_id is required and must be a fiscal period of the book.
- The fiscal year of the period must be open.
- The period must have ended.
- The period must not already be declared (one declaration per book and period).
- Declarations run oldest first: an earlier undeclared period of the book, counted from the book’s first declared period or the start of the period’s own year if earlier, or an already declared later period, refuses the call.
- Creates the declaration with the totals computed from the 443 (output) and 445 (input) accounts over the period.
- When the period has VAT movements, posts a miscellaneous-operations journal entry dated at the end of the period that clears the 443 and 445 balances; the net amount due goes to the VAT payable account (4441 in the default chart) and a net credit to the VAT credit carry-forward account (4449 in the default chart), and any credit carried from earlier periods is consumed. The entry is linked to the declaration (journal_entry_id).
- When the period has no VAT movement, no entry is posted, journal_entry_id stays null and any earlier credit stays on 4449.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the accounting book (27-character KSUID string) whose records are worked on.
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, owner_type, fiscal_period_id, output_vat_total, input_vat_total, prior_credit_applied, net_due, net_credit, journal_entry_id, currency_code, currency_exponent, declared_at, declared_by, declared_by_type, 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: fiscalPeriod, journalEntry, journalEntry.lines, journalEntry.attachments.
Body
Shared by preview and store.
Identifier of the fiscal period the VAT declaration covers (27-character KSUID string), a period of the selected book. Required. Used both for the preview and for creating the declaration.
Response
Resource (only with response=resource).
Identifier of the declaration (27-character KSUID string).
Kind of owner of the book (for example organization or client account); set by the server.
Identifier of the declared fiscal period (27-character KSUID string); one declaration per period.
The fiscal period, present only when requested with ?include=fiscalPeriod and the caller has fiscal_periods.retrieve.
Output VAT of the period, integer in minor units (divide by 10 to the power currency_exponent).
Input VAT of the period, integer in minor units.
VAT credit carried from earlier periods (the VAT credit carry-forward account, 4449 in the default chart) before the period starts, integer in minor units. It is used against this period's VAT; when the period has no VAT movement it stays on that account and net_credit repeats it.
VAT to pay for the period, integer in minor units; 0 when there is none.
VAT credit carried forward to the next period, integer in minor units; 0 when there is none.
Identifier of the VAT settlement journal entry; null when the period had no VAT movement to settle.
The settlement journal entry, present only when requested with ?include=journalEntry and the caller has journal_entries.retrieve.
ISO 4217 currency code of the fiscal year, for example XOF.
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.
When the declaration was recorded, ISO 8601; set by the server.
Identifier of the member or agent account that declared; null when the actor could not be validated.
Kind of actor in declared_by; null when declared_by is null.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).