ProductPrice
HTTP | Operation | Type | Object | DTO Why-DTOs? |
---|---|---|---|---|
(Query) | productPriceById |
ProductPriceGLDtoInput |
Description
This pricing and discounting information is calculated based on a variety of rules and parameters, ensuring the most accurate and tailored result for your specific needs.
The service returns both the calculated discount and price for the product.
Pricing and Discount Calculations
The service takes into account:
- Base Price and Discount: These are the default price and discount set directly on the product.
- Tariff Management Rules: Includes the rules defined in the tariff management system which may apply additional costs or discounts.
- Discount Management Rules: Includes rules set in the discount management system which may apply extra discounts.
Required Parameters
To utilize this service, you need to provide the following parameters:
- Product ID: The unique identifier of the product for which the price and discounts are being calculated.
Once the product is specified, you will need to provide the following additional parameters:
- Customer ID: The unique identifier of the customer for whom the price is being calculated.
- Customer Tariff ID: Optionally, the ID that represents the pricing tariff applicable to the customer.
This field is optional; if left empty, the system will automatically use the tariff specified in the customer’s ‘Sales terms and conditions’ tab. - Customer Discount ID: Optionally, the ID for the discount group applicable to the customer.
This field is optional; if left empty, the system will automatically use the discount specified in the customer’s ‘Sales terms and conditions’ tab. - Document Date: The date of the document for time-sensitive pricing and discount rules.
- Quantity: The number of items for which the price is being calculated.
- Document Type ID: Defines the type of identification document associated with the lead’s country, used only if the quote is not linked to a customer but is a quote for a lead without Customer Id.
Providing the Customer Tariff ID and / or Customer Discount ID allows for the manual overriding of the automatic rates set in the customer’s ‘Sales terms and conditions’ tab, thus enabling different rates to be applied within the context of the document.
Response
The service returns a comprehensive set of data fields that include the final calculated price, applicable discounts, and tax details.
This takes into consideration all the rules and parameters you have supplied.
Header
Key | Value |
---|---|
Authorization |
Bearer Current access Token How to find? |
X-TenantId |
Current tenant id How to find? |
X-OrganizationId |
Current organization Id How to find? |
x-api-key |
Primary or secondary subscription key of your app How to find? |
How to use the ProductPrice service for a customer ?
graphQL Query
query($id: ID!, $productPrice: ProductPriceGLDtoInput!) {
productPriceById(id: $id, productPrice: $productPrice) {
equivalenceSurchargePercentage
firstDiscount {
code
name
source
value
}
price {
code
name
source
value
}
taxGroupId
taxId
taxPercentage
taxTreatmentId
}
}
graphQL Variables
{
"id": "{productId}",
"productPrice": {
"customerId": "{customerId}",
"salesTariffId": "{salesTariffId}",
"salesDiscountGroupId": "{salesDiscountGroupId}",
"documentDate": "2023-12-05",
"quantity": 5
}
}
Example Response
{
"data": {
"productPriceById": {
"price": {
"code": "UNKNOWN",
"name": "UNKNOWN",
"source": "UNKNOWN",
"value": 100
},
"firstDiscount": {
"code": "UNKNOWN",
"name": "UNKNOWN",
"source": "UNKNOWN",
"value": 0
},
"taxGroupId": "285afa97-bdf1-45c2-b258-924fd7410082",
"taxId": "808f93b0-b7a2-472d-a0e6-686a4b892778",
"equivalenceSurchargePercentage": 0,
"taxPercentage": 20,
"taxTreatmentId": "7a58c924-c7b1-4027-9685-e7935e107a85"
}
}
}
productPriceById Input parameters
Fields | Type | Description | Length |
---|---|---|---|
id | UUID | Product ID | |
customerId | UUID | Customer ID |
|
salesTariffId | UUID | Sales Tariff ID |
|
salesDiscountGroupId | UUID | Sales Discount Group ID |
|
documentDate | DateTime |
Document Date | |
quantity | Int | Quantity | |
documentTypeId | UUID | DocumentType Id |
Info
- customerId: The unique identifier (UUID) for the customer for whom the product price and discount are calculated.
- salesTariffId: Optionally, the ID that represents the pricing tariff applicable to the customer.
This field is optional; if left empty, the system will automatically use the tariff specified in the customer’s ‘Sales terms and conditions’ tab. - salesDiscountGroupId: Optionally, the ID for the discount group applicable to the customer.
This field is optional; if left empty, the system will automatically use the discount specified in the customer’s ‘Sales terms and conditions’ tab. - documentTypeId: Defines the type of identification document associated with the lead’s country, used only if the quote is not linked to a customer but is a quote for a lead.
- Do not provide if customerId is specified.
- Optional if customerId is not specified and the lead’s country is the same as the current legislation.
If nevertheless provided, it must match thedocumentTypeId
whose code is01
. - Required if customerId is not specified and the lead’s country is part of the VIES system.
It must match thedocumentTypeId
whose code is02
. - Required if customerId is not specified and the lead’s country is not part of the VIES system, and is different from the current legislation.
It must match thedocumentTypeId
whose code is06
.
Retrieve the desired ID from document type.
productPriceById Response
Fields | Type | Description | Length |
---|---|---|---|
firstDiscount | Object | Discount Details | |
|
String | Discount Code |
2 |
|
String | Discount Name | 50 |
|
String | Discount Source |
10 |
|
Float | Discount Value | |
price | Object | Price Details | |
|
String | Price Code | 2 |
|
String | Price Name | 50 |
|
String | Price Source |
10 |
|
Float | Price Value | |
taxGroupId | UUID | Tax Group ID |
|
taxId | UUID | Tax ID | |
taxTreatmentId | UUID | Tax Treatment ID |
|
taxPercentage | Float | Tax Percentage |
|
equivalenceSurchargePercentage | Float | Percentage of the equivalence surcharge |
Info
- code: Represents a short code uniquely identifying the discount.
- source: Describes the origin of the discount. For example, it could be from a promotional campaign or a loyalty program.
- price source: The source or method from which the price value is derived or calculated.
- taxGroupId: A unique identifier (UUID) for the tax group associated with the product price.
- taxTreatmentId: Identifies the treatment of tax for the product, such as whether it’s inclusive or exclusive.
- taxPercentage: Represents the percentage of tax applied to the product price.
- equivalenceSurchargePercentage :
Always 0 as it is unused for the French market
Returns the percentage of the equivalence surcharge if the customer has the option hasEquivalenceSurcharge set to true else returns 0.
The equivalence surcharge, as applied in Spain, is a form of simplified VAT for retail traders who cannot recover VAT.
The rates of the equivalence surcharge vary according to the VAT rate applicable to the products, with surcharge rates of 5.2% for products with a general VAT of 21%, 1.4% for products with a reduced VAT of 10%, and other rates for different products or categories.Always 0 as it is unused for the German market