Contents
On this page

Update Form Placement - Plugixa Extra Product Options

PUT /plugixa-epo/v1/placement

Change the position or quick view. Send only what changes. PATCH and POST work the same.

Needs a user with the plugixa_epo_manage capability (signed in with an Application Password, or the login cookie with an X-WP-Nonce header). Administrators and shop managers hold it; see Permissions. Pro only: on the free plugin this route answers 404 rest_no_route.

Request

PUT https://your-store.example/wp-json/plugixa-epo/v1/placement

Request body

Content type: application/json

Field Type Required Description
position string No before_button, after_button, before_form or after_form.
quick boolean No Quick view on shop pages.
{
  "position": "after_form"
}

Responses

200 OK. data is both settings, as stored.

{
  "success": true,
  "data": {
    "position": "after_form",
    "quick": true
  }
}

Errors

Status Code When
401 / 403 plugixa_epo_forbidden The caller lacks the capability: You are not allowed to do that.
400 rest_invalid_param position is not one of the four values.

Plus the errors every endpoint can return.

Examples

curl -s -X PUT "https://your-store.example/wp-json/plugixa-epo/v1/placement" \
  -u "$WP_USER:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"position":"after_form"}'
<?php
$ch = curl_init('https://your-store.example/wp-json/plugixa-epo/v1/placement');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'PUT',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'position' => 'after_form',
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-store.example/wp-json/plugixa-epo/v1/placement', {
  method: 'PUT',
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ position: 'after_form' }),
});
const { data } = await response.json();

Quick Links

Share