Contents
On this page

Create Fiscal Archive - Plugixa POS for WooCommerce

POST /plugixa-pos/v1/fiscal/archives

Build a signed ZIP of a closed period’s journal for one register.

Needs a user with the plugixa_pos_fiscal_audit capability (signed in with an Application Password, or the login cookie with an X-WP-Nonce header). Administrators hold it; other roles only when you grant it.

Request

POST https://your-site.example/wp-json/plugixa-pos/v1/fiscal/archives

Request body

Content type: application/json

Field Type Required Description
register_id integer Yes The register.
period string Yes month or year.
period_key string Yes YYYY-MM for a month, YYYY for a year.
{
  "register_id": 3,
  "period": "month",
  "period_key": "2026-10"
}

Responses

201 Created. data is the archive, as in List Fiscal Archives.

{
  "success": true,
  "data": {
    "id": 5,
    "register_id": 3,
    "period": "month",
    "period_key": "2026-10",
    "file": "R3-month-2026-10-a1B2c3D4.zip",
    "size": 38211,
    "sha256": "352bc110403d218b1da1e1d07c6bba82688da700cc50d5d837b127a0df97b917",
    "manifest_sha256": "7b1aeea96a8ba63a9186e417614c929326f22ae10a01b8c31b2ccddbd51f0bd1",
    "journal_rows": 64,
    "created_at": "2026-11-19 16:50:00",
    "download_url": "https://your-site.example/wp-admin/admin-post.php?action=plugixa_pos_fiscal_archive&id=3&_wpnonce=adc2794d57"
  }
}

Errors

Status Code When
404 plugixa_pos_no_register No register with that id.
422 plugixa_pos_archive_period Not a month or a fiscal year.
409 plugixa_pos_archive_not_closed The period is not closed yet.
500 plugixa_pos_archive_unavailable No signing key, or the PHP zip extension is missing.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-pos/v1/fiscal/archives" \
  -u "$WP_USER:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"register_id":3,"period":"month","period_key":"2026-10"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/fiscal/archives');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'register_id' => 3,
        'period'      => 'month',
        'period_key'  => '2026-10',
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-pos/v1/fiscal/archives', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ register_id: 3, period: 'month', period_key: '2026-10' }),
});
const { data } = await response.json();

Quick Links

Share