Skip to content

PPOM API Documentation

Enable the REST API

Go to WooCommerce > Settings > PPOM Settings > Integrations and enable PPOM REST API.

The Integrations tab shows the REST API Base URL for your store, a masked Secret Key field, copy buttons for the URL and key, and an Available Endpoints panel. Use the displayed base URL as the prefix for the operations listed below.

Endpoint

Base URL: siteurl/wp-json/ppom/v1

Operation paths are appended to the base URL. For example, the product fields endpoint becomes siteurl/wp-json/ppom/v1/get/product/?product_id=238&secret_key=11122.

⚠️ Important: POST operations that create, update, or delete data require the configured Secret Key. Keep this key private and share it only with trusted integrations.

Products - Operations

1 - Get all PPOM fields attached with product

**1.1 Operation **get/product/?product_id=238&secret_key=11122
1.2 MethodGET
1.3 ParametersKeyTypeDetail
product_idintegermandatory
secret_keystringmandatory

2 - Set/Update PPOM Fields

If requested fields are exists, it will update otherwise add them to product. If no PPOM meta is attached to product then it will create a new meta group with same name as of Product title in WooCommerce and add these fields.

**2.1 Operation **set/product/
2.2 MethodPOST
2.3 ParametersKeyTypeDetail
product_idintegermandatory
secret_keystringmandatory
fieldsArray (see section 3.0) (json_encode)mandatory

3 - Delete Fields

3.1 Operationdelete/product/
3.2 MethodPOST
3.3 ParametersKeyTypeDetail
product_idintegermandatory
secret_keystringmandatory
fieldsArray (only data_name)mandatory

Order - Operations

1 - Get all meta data information attached with Order

1.1 Operationget/order/?order_id=2141&secret_key=11122
1.2 MethodGET
1.3 ParametersKeyTypeDetail
order_idintegermandatory
secret_keystringmandatory

2 - Set/Update Meta/Fields against order

If requested fields are exists, it will update otherwise add them to order.

Return: All meta fields attached to order

2.1 Operationset/order/
2.2 MethodPOST
2.3 ParametersKeyTypeDetail
order_idintegermandatory
secret_keystringmandatory
fieldsArray (see section 2.4)(json_encode)
Example:
{product_id:{ppom_field_1:new_value_1, ppom_field_2:new_value_2}}
mandatory

3 - Delete Meta/Fields in Order

Return: All meta fields attached to order

2.1 Operationdelete/order/
2.2 MethodPOST
2.3 ParametersKeyTypeDetail
order_idintegermandatory
secret_keystringmandatory
fieldsArray (see section 2.4) (json_encode)mandatory

3 - Field Types Table

Fieldtypedata_nametitledescriptionrequiredoptions
TexttextuniqueANYANYtrue:1,false: 0N/A
EmailemailuniqueANYANYtrue:1,false: 0N/A
DatedateuniqueANYANYtrue:1,false: 0N/A
NumbernumberuniqueANYANYtrue:1,false: 0N/A
TextareatextareauniqueANYANYtrue:1,false: 0N/A
Date RangedaterangeuniqueANYANYtrue:1,false: 0N/A
TimezonetimezoneuniqueANYANYtrue:1,false: 0N/A
Color PickercoloruniqueANYANYtrue:1,false: 0N/A
SelectselectuniqueANYANYtrue:1,false: 0See section 3.1
RadioradiouniqueANYANYtrue:1,false: 0See section 3.1
CheckboxcheckboxuniqueANYANYtrue:1,false: 0See section 3.1

3.1 - Options

Options is an array with following keys:

'options' => array(
 array('option'=>"Basic",'price'=>''),
 array('option'=>"Student",'price'=>'5.20'),
 array('option'=>"Super",'price'=>'5%'),