Contents
On this page

Create Group - Plugixa Extra Product Options

POST /plugixa-epo/v1/groups

Create a group. It is always a draft: nothing shows on the store until you publish it.

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.

Request

POST https://your-store.example/wp-json/plugixa-epo/v1/groups

Request body

Content type: application/json

Field Type Required Description
title string Yes The group’s name. Only staff see it.
priority integer No Lower comes first when several groups show on one product. Defaults to 10.
doc object No The group document: fields and targets, as in Get Group. Left out: a group with no fields and no targets.

The document is cleaned before it is saved: unknown field types are dropped, unknown price types become none, texts are sanitized, and missing or repeated ids get new ones. Read the response to see what was kept.

{
  "title": "Gift options",
  "priority": 10,
  "doc": {
    "fields": [
      {
        "id": "fk3q8x2ma",
        "type": "radio",
        "label": "Gift wrap",
        "required": true,
        "options": [
          {
            "id": "ow1n5d2kq",
            "label": "No wrapping"
          },
          {
            "id": "op7r2v9tc",
            "label": "Gift wrap",
            "price_type": "flat",
            "price": 4
          }
        ]
      },
      {
        "id": "fd2h6t1ys",
        "type": "date",
        "label": "Deliver on"
      }
    ],
    "targets": {
      "categories": [21]
    }
  }
}

Responses

201 Created. data is the new group.

{
  "success": true,
  "data": {
    "id": 9,
    "title": "Gift options",
    "status": "draft",
    "priority": 10,
    "draft": {
      "version": 1,
      "fields": ["…"],
      "targets": {
        "all": false,
        "products": [],
        "categories": [21]
      }
    },
    "published": null,
    "dirty": true,
    "published_at": null,
    "created_at": "2026-11-21T10:20:11",
    "modified_at": "2026-11-21T10:20:11"
  }
}

Fields as in Get Group. The fields list is shortened here.

Errors

Status Code When
401 / 403 plugixa_epo_forbidden The caller lacks the capability: You are not allowed to do that.
400 plugixa_epo_title_required title is empty: Give the group a name.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-store.example/wp-json/plugixa-epo/v1/groups" \
  -u "$WP_USER:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"title":"Gift options","priority":10,"doc":{"fields":[{"id":"fk3q8x2ma","type":"radio","label":"Gift wrap","required":true,"options":[{"id":"ow1n5d2kq","label":"No wrapping"},{"id":"op7r2v9tc","label":"Gift wrap","price_type":"flat","price":4}]},{"id":"fd2h6t1ys","type":"date","label":"Deliver on"}],"targets":{"categories":[21]}}}'
<?php
$ch = curl_init('https://your-store.example/wp-json/plugixa-epo/v1/groups');
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([
        'title'    => 'Gift options',
        'priority' => 10,
        'doc'      => [
            'fields'  => [
                [
                    'id'       => 'fk3q8x2ma',
                    'type'     => 'radio',
                    'label'    => 'Gift wrap',
                    'required' => true,
                    'options'  => [
                        [
                            'id'    => 'ow1n5d2kq',
                            'label' => 'No wrapping',
                        ],
                        [
                            'id'         => 'op7r2v9tc',
                            'label'      => 'Gift wrap',
                            'price_type' => 'flat',
                            'price'      => 4,
                        ],
                    ],
                ],
                [
                    'id'    => 'fd2h6t1ys',
                    'type'  => 'date',
                    'label' => 'Deliver on',
                ],
            ],
            'targets' => [
                'categories' => [21],
            ],
        ],
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-store.example/wp-json/plugixa-epo/v1/groups', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ title: 'Gift options', priority: 10, doc: { fields: [{ id: 'fk3q8x2ma', type: 'radio', label: 'Gift wrap', required: true, options: [{ id: 'ow1n5d2kq', label: 'No wrapping' }, { id: 'op7r2v9tc', label: 'Gift wrap', price_type: 'flat', price: 4 }] }, { id: 'fd2h6t1ys', type: 'date', label: 'Deliver on' }], targets: { categories: [21] } } }),
});
const { data } = await response.json();

Quick Links

Share