Contents
On this page

Archive PDF Design - Plugixa PDF Vouchers for WooCommerce

DELETE /plugixa-pdf-vouchers/v1/templates/{id}

Archive a design: it leaves the list and the product choices, but stays stored, so vouchers already printed with it are unaffected. Archiving the store default makes the next active design the default.

Needs a user with the plugixa_pdfv_delete capability (signed in with an Application Password, or the login cookie with an X-WP-Nonce header). Administrators and shop managers get it when the plugin is activated; see Staff access.

Request

DELETE https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/templates/4

Path parameters

Name Type Description
id integer The design’s id

Responses

200 OK.

{
  "success": true,
  "data": {
    "archived": true
  }
}

Errors

Status Code When
401 / 403 plugixa_pdfv_forbidden The caller lacks the capability.
404 plugixa_pdfv_not_found No design with that id: Design not found.
422 plugixa_pdfv_last_template It is the last active design: Keep at least one design: vouchers need something to print with.

Plus the errors every endpoint can return.

Examples

curl -s -X DELETE "https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/templates/4" \
  -u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/templates/4');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/templates/4', {
  method: 'DELETE',
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
  },
});
const { data } = await response.json();

Quick Links

Share