Variants

Add, edit, and delete anything related to product variants.

Variant

variant_id
integer

The variant set ID for WP EasyCart. Leave blank for new or updates.

variant_name
string

The internal name for this variant set

variant_label
string

The customer facing label for this variant set.

variant_type
string

The variant type and can be basic-swatch or basic-combo

Array of objects (VariantItemArray)
is_required
boolean

Is this variant set required

error_message
string

The message shown to the customer when the variant is not yet selected.

square_id
string

The SquareUp internal ID that this option connects to, if applicable.

{
  • "variant_id": 0,
  • "variant_name": "string",
  • "variant_label": "string",
  • "variant_type": "string",
  • "variant_items": [
    ],
  • "is_required": true,
  • "error_message": "string",
  • "square_id": "string"
}

VariantItem

optionitem_id
integer

The unique ID for this variant item in the WP EasyCart system.

option_id
integer

The unique ID for the variant set this item connects.

item_name
string

The label for this item.

sort_order
integer

The sort order for this variant item.

sku_extension
string

This will extend the product SKU when variant item is selected.

price_adjustment
number

Adds or subtracts from the product price when selected.

weight_adjustment
number

Adds or subtracts from the product weight when selected.

enable_custom_price_label
boolean

True will enable the custom_price_label to show in place of the price adjustment

custom_price_label
string

The custom price label used if enabled.

square_id
string

The unique SquareUp ID used when connecting your store to Square.

stripe_plan_id
string

The unique ID for Stripe when you use this with a subscription.

{
  • "optionitem_id": 0,
  • "option_id": 0,
  • "item_name": "string",
  • "sort_order": 0,
  • "sku_extension": "string",
  • "price_adjustment": 0,
  • "weight_adjustment": 0,
  • "enable_custom_price_label": true,
  • "custom_price_label": "string",
  • "square_id": "string",
  • "stripe_plan_id": "string"
}

Gets a list of variants

This allows you to get a list of variants

SecuritybearerAuth or basicAuth
Request
query Parameters
page
integer <int64>

Page number starting at 1

perpage
integer <int64>

Number of items per page

sortby
string

Sort results by term

sortdir
string

Sort results ASC or DESC

search
string

Filter variants by a search term

Responses
200

Successful operation

400

Unauthorized

get/variants
Request samples
Response samples
application/json
[
  • {
    }
]

Add a variant

This allows you to add a new variant

SecuritybearerAuth
Request
Request Body schema: application/json
required

Submit any or all elements to add a new variant.

variant_id
integer

The variant set ID for WP EasyCart. Leave blank for new or updates.

variant_name
required
string

The internal name for this variant set

variant_label
string

The customer facing label for this variant set.

variant_type
required
string

The variant type and can be basic-swatch or basic-combo

Array of objects (VariantItemArray)
is_required
boolean

Is this variant set required

error_message
string

The message shown to the customer when the variant is not yet selected.

square_id
string

The SquareUp internal ID that this option connects to, if applicable.

Responses
200

Successful operation

400

Unauthorized

post/variants
Request samples
application/json
{
  • "variant_id": 0,
  • "variant_name": "string",
  • "variant_label": "string",
  • "variant_type": "string",
  • "variant_items": [
    ],
  • "is_required": true,
  • "error_message": "string",
  • "square_id": "string"
}
Response samples
application/json
{
  • "variant_id": 0,
  • "variant_name": "string",
  • "variant_label": "string",
  • "variant_type": "string",
  • "variant_items": [
    ],
  • "is_required": true,
  • "error_message": "string",
  • "square_id": "string"
}

Gets a variant by ID

This allows you to get a variant from your store by variant ID

SecuritybearerAuth or basicAuth
Request
path Parameters
variant_id
required
integer <int64>

Variant ID

Responses
200

Successful operation

400

Unauthorized

get/variants/{variant_id}
Request samples
Response samples
application/json
{
  • "variant_id": 0,
  • "variant_name": "string",
  • "variant_label": "string",
  • "variant_type": "string",
  • "variant_items": [
    ],
  • "is_required": true,
  • "error_message": "string",
  • "square_id": "string"
}

Updates a variant by ID

This allows you to update a variant

SecuritybearerAuth
Request
path Parameters
variant_id
required
integer <int64>

Variant ID

Request Body schema: application/json
required

Submit any or all elements to update the variant.

variant_id
integer

The variant set ID for WP EasyCart. Leave blank for new or updates.

variant_name
string

The internal name for this variant set

variant_label
string

The customer facing label for this variant set.

variant_type
string

The variant type and can be basic-swatch or basic-combo

Array of objects (VariantItemArray)
is_required
boolean

Is this variant set required

error_message
string

The message shown to the customer when the variant is not yet selected.

square_id
string

The SquareUp internal ID that this option connects to, if applicable.

Responses
200

Successful operation

400

Unauthorized

patch/variants/{variant_id}
Request samples
application/json
{
  • "variant_id": 0,
  • "variant_name": "string",
  • "variant_label": "string",
  • "variant_type": "string",
  • "variant_items": [
    ],
  • "is_required": true,
  • "error_message": "string",
  • "square_id": "string"
}
Response samples
application/json
{
  • "variant_id": 0,
  • "variant_name": "string",
  • "variant_label": "string",
  • "variant_type": "string",
  • "variant_items": [
    ],
  • "is_required": true,
  • "error_message": "string",
  • "square_id": "string"
}

Deletes a variant by ID

This allows you to delete a variant from your store

SecuritybearerAuth
Request
path Parameters
variant_id
required
integer <int64>

Variant ID

Responses
200

Successful operation

400

Unauthorized

delete/variants/{variant_id}
Request samples
Response samples
application/json
{
  • "variant_id": 0,
  • "variant_name": "string",
  • "variant_label": "string",
  • "variant_type": "string",
  • "variant_items": [
    ],
  • "is_required": true,
  • "error_message": "string",
  • "square_id": "string"
}

Gets list of variant items by variant ID

This allows you to get a list of variant items from your store by variant ID

SecuritybearerAuth or basicAuth
Request
path Parameters
variant_id
required
integer <int64>

Variant ID

Responses
200

Successful operation

400

Unauthorized

get/variants/{variant_id}/items
Request samples
Response samples
application/json
[
  • {
    }
]

Gets a variant item

This allows you to get a variant item by ID

SecuritybearerAuth or basicAuth
Request
path Parameters
variant_id
required
integer <int64>

Variant ID

variant_item_id
required
integer <int64>

Variant Item ID

Responses
200

Successful operation

400

Unauthorized

get/variants/{variant_id}/items/{variant_item_id}
Request samples
Response samples
application/json
{
  • "optionitem_id": 0,
  • "option_id": 0,
  • "item_name": "string",
  • "sort_order": 0,
  • "sku_extension": "string",
  • "price_adjustment": 0,
  • "weight_adjustment": 0,
  • "enable_custom_price_label": true,
  • "custom_price_label": "string",
  • "square_id": "string",
  • "stripe_plan_id": "string"
}

Updates a variant item by ID

This allows you to update variant items

SecuritybearerAuth
Request
path Parameters
variant_id
required
integer <int64>

Variant ID

variant_item_id
required
integer <int64>

Variant Item ID

Request Body schema: application/json
required

Submit any or all elements to update the variant item.

optionitem_id
integer

The unique ID for this variant item in the WP EasyCart system.

option_id
integer

The unique ID for the variant set this item connects.

item_name
string

The label for this item.

sort_order
integer

The sort order for this variant item.

sku_extension
string

This will extend the product SKU when variant item is selected.

price_adjustment
number

Adds or subtracts from the product price when selected.

weight_adjustment
number

Adds or subtracts from the product weight when selected.

enable_custom_price_label
boolean

True will enable the custom_price_label to show in place of the price adjustment

custom_price_label
string

The custom price label used if enabled.

square_id
string

The unique SquareUp ID used when connecting your store to Square.

stripe_plan_id
string

The unique ID for Stripe when you use this with a subscription.

Responses
200

Successful operation

400

Unauthorized

patch/variants/{variant_id}/items/{variant_item_id}
Request samples
application/json
{
  • "optionitem_id": 0,
  • "option_id": 0,
  • "item_name": "string",
  • "sort_order": 0,
  • "sku_extension": "string",
  • "price_adjustment": 0,
  • "weight_adjustment": 0,
  • "enable_custom_price_label": true,
  • "custom_price_label": "string",
  • "square_id": "string",
  • "stripe_plan_id": "string"
}
Response samples
application/json
{
  • "optionitem_id": 0,
  • "option_id": 0,
  • "item_name": "string",
  • "sort_order": 0,
  • "sku_extension": "string",
  • "price_adjustment": 0,
  • "weight_adjustment": 0,
  • "enable_custom_price_label": true,
  • "custom_price_label": "string",
  • "square_id": "string",
  • "stripe_plan_id": "string"
}

Deletes a variant item by ID

This allows you to delete a variant item from your store

SecuritybearerAuth
Request
path Parameters
variant_id
required
integer <int64>

Variant ID

variant_item_id
required
integer <int64>

Variant Item ID

Responses
200

Successful operation

400

Unauthorized

delete/variants/{variant_id}/items/{variant_item_id}
Request samples
Response samples
application/json
{
  • "optionitem_id": 0,
  • "option_id": 0,
  • "item_name": "string",
  • "sort_order": 0,
  • "sku_extension": "string",
  • "price_adjustment": 0,
  • "weight_adjustment": 0,
  • "enable_custom_price_label": true,
  • "custom_price_label": "string",
  • "square_id": "string",
  • "stripe_plan_id": "string"
}