HTTP Operation Type Object DTO Why-DTOs?
(Query) productPriceById ProductPriceGLDtoInput

Description

The ProductPrice service is designed to provide detailed pricing and discount information for a product.
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.

img

Pricing and Discount Calculations

The service takes into account:

Required Parameters

To utilize this service, you need to provide the following parameters:

Once the product is specified, you will need to provide the following additional parameters:

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.

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?
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
{
  "equivalenceSurchargePercentage": 0,
  "firstDiscount": {
      "code": "STANDARD",
      "name": "STANDARD",
      "source": "DISCOUNT",
      "value": 94
  },
  "price": {
        "code": "STANDARD",
        "indicator": "PRICE",
        "name": "STANDARD",
        "source": "TARIFF",
        "value": 951
  },
  "taxGroupId": "803ac141-c4ce-41cd-ad16-edb40817b304",
  "taxId": "a6c71489-84c6-4f86-9cc1-dec5c7a85ee1",
  "taxPercentage": 0,
  "taxTreatmentId": "e45d8bab-235d-44e2-a44d-c915a343b974"
}

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 the documentTypeId whose code is 01.
    • Required if customerId is not specified and the lead’s country is part of the VIES system.
      It must match the documentTypeId whose code is 02.
    • 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 the documentTypeId whose code is 06.

    Retrieve the desired ID from document type.

productPriceById Response

Fields Type Description Length
firstDiscount Object Discount Details  
  • code
String Discount Code 2
  • name
String Discount Name 50
  • source
String Discount Source 10
  • value
Float Discount Value  
       
price Object Price Details  
  • code
String Price Code 2
  • name
String Price Name 50
  • source
String Price Source 10
  • value
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