addInventoryPriceGroup
The method allows to create a price group in BaseLinker storage. Providing a price group ID will update the existing price group. Such price groups may be later assigned in addInventory method. Supports defining price calculation options including group type, source price group, multiplier, and price addition.
Input parameters
| price_group_id | int | Price group identifier. If provided and > 0, the existing price group will be updated. If 0 or omitted, a new price group is created. |
| name | varchar(100) | Name of the price group |
| description | text | Price group description |
| currency | char(3) | 3-letter currency symbol e.g. USD, EUR |
| price_group_type | text | Type of the price group. "standard" - prices are set manually per product, "dependent_on_price_group" - prices are calculated from a source price group, "dependent_on_average_cost" - prices are calculated from average purchase cost. Defaults to "standard". |
| source_price_group_id | int | ID of the source price group from which prices are derived. Required when price_group_type is "dependent_on_price_group". |
| price_multiplier | float | Multiplier applied to the source price (e.g. 1.2 means +20%). Defaults to 1. |
| price_addition | float | Fixed value added to the price after multiplier. Can be negative. Defaults to 0. |
| is_bundle_price_calculated | bool | Whether bundle product prices should be automatically calculated from their component products. |
| bundle_price_multiplier | float | Multiplier applied to the calculated bundle price. Defaults to 1. |
| bundle_price_addition | float | Fixed value added to the calculated bundle price. Defaults to 0. |
Output data
The method returns the data in JSON format.
| status | varchar(30) | SUCCESS - request executed correctly ERROR - an error occurred during an API request. Error details will be described in 2 additional returned fields: error_message and error_code |
| price_group_id | int | The ID number of added or updated price group. |
Sample
Input data:Output data:
A sample request in PHP: