# Product fees management

## Retrieving all fees with given productId

> Retrieve all fees with given productId.<br>

```json
{"openapi":"3.0.0","info":{"title":"Fee Service","version":"v1"},"tags":[{"name":"Product fees management"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":[]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"fee.fee_create":"Needed to create a fee.","fee.fee_update":"Needed to update a fee.","fee.fee_delete":"Needed to delete a fee.","fee.item_create":"Needed to create an item fee.","fee.item_update":"Needed to update an item fee.","fee.item_delete":"Needed to delete an item fee."}}}}},"schemas":{"Fees":{"type":"array","items":{"$ref":"#/components/schemas/Fee"}},"Fee":{"type":"object","properties":{"id":{"description":"Unique identifier of the fee.","type":"string"},"name":{"description":"The localized fee name.","$ref":"#/components/schemas/Localized"},"description":{"description":"The localized fee description.","$ref":"#/components/schemas/Localized"},"code":{"maxLength":100,"description":"The code-name, unique for the tenant.","type":"string"},"feeType":{"description":"'PERCENT' for relative values, 'ABSOLUTE' for float values or 'ABSOLUTE_MULTIPLY_ITEMQUANTITY' for float values to be multiplied by the quantity of the item.","enum":["PERCENT","ABSOLUTE","ABSOLUTE_MULTIPLY_ITEMQUANTITY"],"type":"string"},"feePercentage":{"minimum":0,"description":"The fee rate in percentage. Required if feeType is 'PERCENT'.","type":"number"},"feeAbsolute":{"description":"The fee as an absolute amount. Required if type is 'ABSOLUTE'.","$ref":"#/components/schemas/monetaryAmount"},"itemType":{"description":"The itemtype the fee can belong to. It could be a product or\npaymenttype. ","enum":["PRODUCT","PAYMENTTYPE"],"type":"string"},"siteCode":{"description":"The SiteCode the fee belongs to.","type":"string"},"active":{"description":"Flag indicating whether the fee is currently active or not.","type":"boolean"},"taxable":{"description":"Flag indicating whether the fee is taxable or not.","type":"boolean"},"taxCode":{"description":"The tax code. When 'taxable' is set to true, the taxCode is mandatory","type":"string"},"activeTimespan":{"$ref":"#/components/schemas/timespan"},"yrn":{"$ref":"#/components/schemas/YRN"}},"required":["name","code","feeType","active","siteCode"]},"Localized":{"description":"The localized value in the form of map (language, value) or string.","oneOf":[{"type":"string","description":"string in the specified language."},{"type":"object","description":"Map of translations in form of language:translation pairs.\nThe keys (languages) should be ISO language codes.\nThe values (in specific languages) should be strings in specified language.","additionalProperties":{"type":"string"}}]},"monetaryAmount":{"title":"Monetary Amount","description":"Schema defining monetary amount in given currency.","type":"object","properties":{"amount":{"description":"The amount in the specified currency","type":"number"},"currency":{"pattern":"^[a-zA-Z]{3}$","description":"ISO 4217 currency code, e.g.: USD, EUR, CHF","type":"string"}},"required":["amount","currency"]},"timespan":{"description":"Restricts the active fees to be only applied in the specified\ntimespan.","title":"Timespan","type":"object","properties":{"startDate":{"format":"date-time","type":"string"},"endDate":{"format":"date-time","type":"string"}},"required":["startDate","endDate"]},"YRN":{"type":"string","title":"YRN","description":"A unique identifier of a global resource, which stores information about the resource, such as its type, ID or name of the tenant.","minLength":1},"FeeIds":{"type":"array","items":{"type":"string"}}},"responses":{"trait_localizedRetrieval_400":{"description":"Request syntactically incorrect. Details of the error are included in the response payload.","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_unauthorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired.\n\nDetails will be provided in the response payload.","content":{"application/json":{"schema":{"properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"trait_yaasAware_403":{"description":"Access token does not contain necessary scopes or tenant in path does not match tenant from token.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}}},"parameters":{"trait_localizedRetrieval_Accept-Language":{"description":"The value of the locale identifier of the language in which the attribute should be returned.\nProvide several values separated by comma, in order to specify fallback languages.\n","in":"header","name":"Accept-Language","schema":{"type":"string","default":"*","minimum":1}},"SiteCode":{"description":"A list of site codes.","in":"query","name":"siteCode","schema":{"default":"main","type":"string"}},"Expand":{"description":"Whether only the fee-id is in the response or the full fees.","in":"query","name":"expand","schema":{"type":"boolean","default":false}}}},"paths":{"/fee/{tenant}/productFees/{productId}/fees":{"get":{"description":"Retrieve all fees with given productId.\n","tags":["Product fees management"],"summary":"Retrieving all fees with given productId","operationId":"GET-fee-list-product-fees","responses":{"200":{"description":"","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Fees"},{"$ref":"#/components/schemas/FeeIds"}]}}}},"400":{"$ref":"#/components/responses/trait_localizedRetrieval_400"},"401":{"$ref":"#/components/responses/trait_unauthorized_401"},"403":{"$ref":"#/components/responses/trait_yaasAware_403"}},"parameters":[{"$ref":"#/components/parameters/trait_localizedRetrieval_Accept-Language"},{"$ref":"#/components/parameters/SiteCode"},{"$ref":"#/components/parameters/Expand"}]}}}}
```

## Adding a list of fees to a product

> Adds a list of feeIds to the itemYRN.<br>

```json
{"openapi":"3.0.0","info":{"title":"Fee Service","version":"v1"},"tags":[{"name":"Product fees management"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["fee.item_update"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"fee.fee_create":"Needed to create a fee.","fee.fee_update":"Needed to update a fee.","fee.fee_delete":"Needed to delete a fee.","fee.item_create":"Needed to create an item fee.","fee.item_update":"Needed to update an item fee.","fee.item_delete":"Needed to delete an item fee."}}}}},"schemas":{"FeeIdsUpdate":{"type":"object","properties":{"feeIds":{"type":"array","items":{"type":"string"}}},"required":["feeIds"]}},"responses":{"trait_feeId_not_found_400":{"description":"Request was syntactically incorrect. Details of the error are included in the response payload.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific","type":"string"},"type":{"description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_unauthorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired.\n\nDetails will be provided in the response payload.","content":{"application/json":{"schema":{"properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"trait_yaasAware_403":{"description":"Access token does not contain necessary scopes or tenant in path does not match tenant from token.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}}},"parameters":{"SiteCode":{"description":"A list of site codes.","in":"query","name":"siteCode","schema":{"default":"main","type":"string"}},"Partial":{"description":"Boolean parameter that defines the update type. By default, its value is false. For partial updates, the value is true.","in":"query","name":"partial","schema":{"type":"boolean","default":false}}}},"paths":{"/fee/{tenant}/productFees/{productId}/fees":{"put":{"description":"Adds a list of feeIds to the itemYRN.\n","tags":["Product fees management"],"summary":"Adding a list of fees to a product","operationId":"PUT-fee-add-product-fees","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeeIdsUpdate"}}}},"responses":{"200":{"description":"Resource updated successfully."},"400":{"$ref":"#/components/responses/trait_feeId_not_found_400"},"401":{"$ref":"#/components/responses/trait_unauthorized_401"},"403":{"$ref":"#/components/responses/trait_yaasAware_403"}},"parameters":[{"$ref":"#/components/parameters/SiteCode"},{"$ref":"#/components/parameters/Partial"}]}}}}
```

## Deleting all fees of an itemYRN

> Deletes item fee with specified productId in the itemYRN.\
> \*\*\*\
> \
> \### Additional scopes information\
> Use one or both of the following scopes to authorize the request:\
> &#x20; \* \`fee.fee\_delete\` \
> &#x20; \* \`fee.item\_delete\`<br>

```json
{"openapi":"3.0.0","info":{"title":"Fee Service","version":"v1"},"tags":[{"name":"Product fees management"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["fee.fee_delete","fee.item_delete"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"fee.fee_create":"Needed to create a fee.","fee.fee_update":"Needed to update a fee.","fee.fee_delete":"Needed to delete a fee.","fee.item_create":"Needed to create an item fee.","fee.item_update":"Needed to update an item fee.","fee.item_delete":"Needed to delete an item fee."}}}}},"responses":{"trait_unauthorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired.\n\nDetails will be provided in the response payload.","content":{"application/json":{"schema":{"properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"trait_yaasAware_403":{"description":"Access token does not contain necessary scopes or tenant in path does not match tenant from token.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}}}},"paths":{"/fee/{tenant}/productFees/{productId}/fees":{"delete":{"description":"Deletes item fee with specified productId in the itemYRN.\n***\n\n### Additional scopes information\nUse one or both of the following scopes to authorize the request:\n  * `fee.fee_delete` \n  * `fee.item_delete`\n","tags":["Product fees management"],"summary":"Deleting all fees of an itemYRN","operationId":"DELETE-fee-remove-all-product-fees","responses":{"204":{"description":"Resource deleted successfully."},"401":{"$ref":"#/components/responses/trait_unauthorized_401"},"403":{"$ref":"#/components/responses/trait_yaasAware_403"}}}}}}
```

## Deleting a fee from the itemYRN

> Deletes a fee for the specified productId and optionally deletes item fee if does not contain any more fee ids.\
> \*\*\*\
> \
> \### Additional scopes information\
> Use one or both of the following scopes to authorize the request:\
> &#x20; \* \`fee.fee\_delete\` \
> &#x20; \* \`fee.item\_delete\`<br>

```json
{"openapi":"3.0.0","info":{"title":"Fee Service","version":"v1"},"tags":[{"name":"Product fees management"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["fee.fee_delete","fee.item_delete"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"fee.fee_create":"Needed to create a fee.","fee.fee_update":"Needed to update a fee.","fee.fee_delete":"Needed to delete a fee.","fee.item_create":"Needed to create an item fee.","fee.item_update":"Needed to update an item fee.","fee.item_delete":"Needed to delete an item fee."}}}}},"responses":{"trait_unauthorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired.\n\nDetails will be provided in the response payload.","content":{"application/json":{"schema":{"properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"trait_yaasAware_403":{"description":"Access token does not contain necessary scopes or tenant in path does not match tenant from token.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}},"trait_yaasAware_404":{"description":"The requested resource does not exist.\n","content":{"application/json":{"schema":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"message":{"description":"descriptive error message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support"},"details":{"description":"list of problems causing this error","type":"array","items":{"title":"errorDetail","description":"schema for specific error cause","type":"object","properties":{"field":{"description":"a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.","type":"string"},"message":{"description":"descriptive error detail message for debugging","type":"string"},"moreInfo":{"type":"string","description":"link to documentation to investigate further and finding support for error detail"}},"required":["type"]}}},"required":["status","type"]}}}}}},"paths":{"/fee/{tenant}/productFees/{productId}/fees/{feeId}":{"delete":{"description":"Deletes a fee for the specified productId and optionally deletes item fee if does not contain any more fee ids.\n***\n\n### Additional scopes information\nUse one or both of the following scopes to authorize the request:\n  * `fee.fee_delete` \n  * `fee.item_delete`\n","tags":["Product fees management"],"summary":"Deleting a fee from the itemYRN","operationId":"DELETE-fee-remove-product-fee","responses":{"204":{"description":"Resource deleted successfully."},"401":{"$ref":"#/components/responses/trait_unauthorized_401"},"403":{"$ref":"#/components/responses/trait_yaasAware_403"},"404":{"$ref":"#/components/responses/trait_yaasAware_404"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.emporix.io/api-references-1/readme/api-reference-16/product-fees-management.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
