Here we have the option to add a product to the offer on Backoffice
Table of contents
Glossary
Name | Explanation |
offerId | identifier of offer |
configurableProducts | Multiple configurable products can be added at once to speed up communication. |
configurableProducts β children
allowQuantityChange
allowQuantitySplitting
productId
removable
externalId | Children lines are shown below parent line. It can by an empty list.
If set to false quantity editing is blocked for this line. True by default.
Set to false will prevent this line from being split to different shipments. For example if splitting by availability either whole line will end up 'available products' shipment, or whole line will end up in 'not available products' shipment, without possibility of it ending up partially in both. True by default
Id (sku) of product in this line
If set to false, this line won't be removable from cart. This is safe to set for children to prevent changing composition of the group of products - if main line is removed children are removed along with it anyway. True by default
externalId will allow updating this product using it. Currently it is ignored. |
children β quantity
type |
Possible to choose: " CONTENT_QUANTITY " "ORDER_QUANTITY β. For example - CONTENT_QUANTITY is a pack of nails, ORDER_QUANTITY is single nail |
children β main
allowQuantityChange
allowQuantitySplitting
productId
removable |
If set to false quantity editing is blocked for this line. True by default.
Set to false will prevent this line from being split to different shipments. For example if splitting by availability either whole line will end up 'available products' shipment, or whole line will end up in 'not available products' shipment, without possibility of it ending up partially in both. True by default
Id (sku) of product in this line
If set to false, this line won't be removable from cart. This is safe to set for children to prevent changing composition of the group of products - if main line is removed children are removed along with it anyway. True by default |
operatorId | Id of backoffice operator on behalf who the products are added. |
prices β property name (additional property) | |
property name (additional property) β purchasePrice
value |
number of value |
property name (additional property) β salePrice
value |
number of value |
property name (additional property) β change
field
value |
possible to choose: FIXED_DISCOUNT " "PERCENT_DISCOUNT " "FIXED_MARGIN " "PERCENT_MARGIN " "FIXED_PRICE " "PURCHASE_PRICE β
number of value |
PUT - add configurable product to offer
In order to add configurable product to offer use PUT
/api/v1/orderpath/integrations/auth-required/offers/{offerId}/add-configurable-products
using cart identifier.The sequence diagram below shows the process: Use the parameter in query below to add configurable product to offer:
offerId
Example request:
jsoncurl -X PUT "https://api-preprod.one.unity.pl/api/v1/orderpath/integrations/auth-required/offers/ae19fdd8-dae5-4e23-b78d-8f4faef2b79e/add-configurable-products" -H "accept: */*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}" -d " { "configurableProducts": [ { "children": [ { "allowQuantityChange": true, "allowQuantitySplitting": true, "productId": "8", -- required "quantity": { -- required "type": "CONTENT_QUANTITY", -- required "value": 4 -- required }, "removable": false }, { "allowQuantityChange": true, "allowQuantitySplitting": true, "productId": "7", "quantity": { "type": "CONTENT_QUANTITY", "value": 4 }, "removable": false } ], "externalId": "123123", "main": { -- required "allowQuantityChange": true, "allowQuantitySplitting": true, "productId": "9", -- required "quantity": { -- required "type": "CONTENT_QUANTITY", -- required "value": 2 -- required }, "removable": false } } ], "operatorId": "a11efeb9-4e8b-4430-aca0-e361f5c63e43" }
POST - change product lines prices
In order to change product lines prices use POST
/api/v1/orderpath/integrations/auth-required/offers/{offerId}/products/change-price
. The diagram below shows the dependency of communicating with the API:Example request:
jsoncurl -X POST "https://api-preprod.one.unity.pl/api/v1/orderpath/integrations/auth-required/offers/0ddc5a8f-e736-4e7e-a90b-c1a3d0b1ec33/products/change-price" -H "accept: */*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}" -H "Content-Type: application/json" -d " { "prices": { -- required "63e70763-4e6d-40b3-bb7a-ae0e71be33e6": { -- additional property "purchasePrice": 80, -- required if use additional property "salePrice": 200, -- required if use additional property "change": { "field": "FIXED_DISCOUNT", -- required if use change "value": 50 -- required if use change } } }, "operatorId": "a11efeb9-4e8b-4430-aca0-e361f5c63e43"-- required if use change }