Contents
On this page

Import Groups - Plugixa Extra Product Options

POST /plugixa-epo/v1/import

Create groups from an export file. Every group arrives as a draft. Targets are kept only when the file comes from this same site: product, category and tag ids mean nothing on another store.

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

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

Request body

Content type: application/json

Field Type Required Description
file object Yes The export file, as Export Groups returns it.
{
  "file": {
    "format": "plugixa-epo-groups",
    "version": 1,
    "site": "https://your-store.example",
    "exported_at": "2026-11-21T10:52:30+00:00",
    "groups": [
      {
        "title": "Gift options",
        "priority": 10,
        "doc": {
          "version": 1,
          "fields": ["…"],
          "targets": {
            "all": false,
            "products": [],
            "categories": [21]
          },
          "layout": "list"
        }
      }
    ]
  }
}

Responses

201 Created.

{
  "success": true,
  "data": {
    "created": [
      {
        "id": 11,
        "title": "Gift options"
      }
    ],
    "targets_kept": true
  }
}
Field Type Meaning
created array The new groups, each { id, title }
targets_kept boolean true when the file came from this site and the groups kept their targets

Errors

Status Code When
401 / 403 plugixa_epo_forbidden The caller lacks the capability: You are not allowed to do that.
400 plugixa_epo_bad_file file is not an export: This is not a Product Options export file.
400 plugixa_epo_newer_file This file was made by a newer version of the plugin. Update the plugin, then import it again.
400 plugixa_epo_empty_file The file has no groups in it.
400 plugixa_epo_file_too_big Too many groups in one file: A file can hold at most 50 groups.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-store.example/wp-json/plugixa-epo/v1/import" \
  -u "$WP_USER:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"file":{"format":"plugixa-epo-groups","version":1,"site":"https://your-store.example","exported_at":"2026-11-21T10:52:30+00:00","groups":[{"title":"Gift options","priority":10,"doc":{"version":1,"fields":["…"],"targets":{"all":false,"products":[],"categories":[21]},"layout":"list"}}]}}'
<?php
$ch = curl_init('https://your-store.example/wp-json/plugixa-epo/v1/import');
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([
        'file' => [
            'format'      => 'plugixa-epo-groups',
            'version'     => 1,
            'site'        => 'https://your-store.example',
            'exported_at' => '2026-11-21T10:52:30+00:00',
            'groups'      => [
                [
                    'title'    => 'Gift options',
                    'priority' => 10,
                    'doc'      => [
                        'version' => 1,
                        'fields'  => ['…'],
                        'targets' => [
                            'all'        => false,
                            'products'   => [],
                            'categories' => [21],
                        ],
                        'layout'  => 'list',
                    ],
                ],
            ],
        ],
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-store.example/wp-json/plugixa-epo/v1/import', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ file: { format: 'plugixa-epo-groups', version: 1, site: 'https://your-store.example', exported_at: '2026-11-21T10:52:30+00:00', groups: [{ title: 'Gift options', priority: 10, doc: { version: 1, fields: ['…'], targets: { all: false, products: [], categories: [21] }, layout: 'list' } }] } }),
});
const { data } = await response.json();

Quick Links

Share