Skip to content

Check sales flow rules

Before making a purchase we can check if any of the rules that we have seen in Sales Flow Rules are going to be applied without having any consequences for practical purposes.

Once the query is launched, sufficient data will be returned, for information purposes, to know how the purchase would look if it was finished.

POST activity/saleflowrules

  • AccessDateTime: (date). Access date. ISO 8601 format (yyyy-MM-dd).
  • Products: (list). Products that make up the sale.
    • AccessDateTime: (date) Optional. Access date. If defined at product level, it takes precedence over the date defined globally. ISO 8601 format (yyyy-MM-dd).
    • ProductId: (string). Product identifier.
    • Quantity: (int) Optional. Quantity. By default its value is 1.
  • DynamicProviders: (list). Dynamic providers that make up the sale.
    • AccessDateTime: (date) Optional. Access date. If defined at product level, it takes precedence over the date defined globally. ISO 8601 format (yyyy-MM-dd).
    • ProviderId: (string). Dynamic provider identifier.
    • Quantity: (int) Optional. Quantity. By default its value is 1.
  • LanguageCode: (string) Optional. Defines the language in which the texts will be displayed. By default, the language configured for the partner will be returned. ISO 639-1 format.
{
"AccessDateTime": "2022-06-02",
"Products":
[
{
"ProductId": "hwuk9huaqopwo",
"Quantity": 4
}
]
}
  • NotModifiedProducts: (list). Array containing products that have not been modified.
    • ProductId: (string). Product identifier.
    • AccessDateTime: (date). Product access date. ISO 8601 format (yyyy-MM-dd).
    • OriginalPrice: (decimal). Unchanged price of the product.
    • Price: (decimal). Final product price.
  • ModifiedProducts: (list). Array containing modified products that were already included in the sale.
    • ProductId: (string). Product identifier.
    • AccessDateTime: (date). Product access date. ISO 8601 format (yyyy-MM-dd).
    • OriginalPrice: (decimal). Unchanged price of the product.
    • Price: (decimal). Final product price.
    • SaleFlowRuleId: (string). Rule identifier.
    • SaleFlowRuleCommercialName: (string). Descriptive name given to the rule so it can be displayed to the user.
    • SaleFlowRuleDescription: (string). Description of the applied rule.
    • SaleFlowRuleName: (string). Name of the applied rule.
  • AddedProducts: (list). Array containing added products that were not included in the sale.
    • ProductId: (string). Product identifier.
    • AccessDateTime: (date). Product access date. ISO 8601 format (yyyy-MM-dd).
    • OriginalPrice: (decimal). Unchanged price of the product.
    • Price: (decimal). Final product price.
    • SaleFlowRuleId: (string). Rule identifier.
    • SaleFlowRuleCommercialName: (string). Descriptive name given to the rule so it can be displayed to the user.
    • SaleFlowRuleDescription: (string). Description of the applied rule.
    • SaleFlowRuleName: (string). Name of the applied rule.
  • Success (boolean): value that indicates whether the call was processed correctly or not.
  • Timestamp (dateTime): time at which the request was processed. ISO 8601 format (yyyy-MM-ddThh:mm:ss.fffffff).
  • ErrorMessage (string): error message explaining why the request was not successful. If it was correct, it will return null.
  • ErrorCodes (string[]): list of codes that identify the errors that occurred in the call.
  • ErrorEntityBreakDown (list): list that contains objects with the name and ID in case of error.
    • Id (string): identifier
    • Name (string): related name of the identifier.
{
"NotModifiedProducts":
[
{
"ProductId": "hwuk9huaqopwo",
"AccessDateTime": "2022-06-02",
"OriginalPrice": 10.2,
"Price": 10.2
},
{
"ProductId": "hwuk9huaqopwo",
"AccessDateTime": "2022-06-02",
"OriginalPrice": 10.2,
"Price": 10.2
},
{
"ProductId": "hwuk9huaqopwo",
"AccessDateTime": "2022-06-02",
"OriginalPrice": 10.2,
"Price": 10.2
},
{
"ProductId": "hwuk9huaqopwo",
"AccessDateTime": "2022-06-02",
"OriginalPrice": 10.2,
"Price": 10.2
}
],
"ModifiedProducts": [],
"AddedProducts":
[
{
"ProductId": "twy5yhbishk91",
"AccessDateTime": "2022-06-02",
"OriginalPrice": 46.69,
"Price": 0,
"SaleFlowRuleId": "hy8fnju42ycf4"
},
{
"ProductId": "twy5yhbishk91",
"AccessDateTime": "2022-06-02",
"OriginalPrice": 46.69,
"Price": 0,
"SaleFlowRuleId": "hy8fnju42ycf4"
}
],
"Success": true,
"Timestamp": "2022-02-18T17:02:27.8165916"
}

The sales flow rules are used to automatically modify or add products to the sale according to a series of conditions that are met depending on the selected products.

GET activity/saleflowrules

  • Rules: array of rules.

    • Id: rule identifier.
    • Name: rule name.
    • Order: rule priority. This field indicates the order in which the rules will be applied, since more than one rule cannot be applied to the same product.
    • Inputs: array of products to which the rules apply.
      • ProductId: product identifier.
    • Processors: array of processors that is responsible for applying the conditions for the products of the Inputs field.
      • Value: number of products that must be added to the sale for this processor to be applied.

      • OutputIfExistsApplicability: value indicating how the outputs produced by this processor will be processed.

      • Outputs: are the outputs produced by the processor application.

        • ProductId: product identifier that produces this output.

        • Order: output priority. Applies if there are multiple outputs and the value of the OutputIfExistsApplicability field of the processor is equal to 1.

        • Quantity: number of products produced by this output.

        • ApplicationType: indicates if this output refers to a product that already existed in the purchase or a new one has been added.

        • PriceModifierType: indicates which price modifier is applied to the product.

        • PriceModifierValue: indicates what price value applies to the product.

  • Success (boolean): value that indicates whether the call was processed correctly or not.

  • Timestamp (dateTime): time at which the request was processed. ISO 8601 format (yyyy-MM-ddThh:mm:ss.fffffff).

  • ErrorMessage (string): error message explaining why the request was not successful. If it was correct, it will return null.

  • ErrorCodes (string[]): list of codes that identify the errors that occurred in the call.

  • ErrorEntityBreakDown (list): list that contains objects with the name and ID in case of error.

    • Id (string): identifier
    • Name (string): related name of the identifier.
{
"Rules":
[
{
"Id" : "zz4fnju76ysb1",
"Name": "Regla descuento",
"Order": 1,
"Inputs":
[
{
"ProductId": "twy5yhbishk91"
},
{
"ProductId": "uspeg7nr5st96"
}
],
"Processors":
[
{
"Value": 1,
"OutputIfExistsApplicability": 0,
"Outputs":
[
{
"ProductId": "twy5yhbishk91",
"Order": 1,
"Quantity": 1,
"ApplicationType": 2,
"PriceModifierType": 3,
"PriceModifierValue": 5.000000000000
}
]
}
]
},
{
"Id" : "hy8fnju42ycf4",
"Name": "Regla producto gratis 3x2",
"Order": 2,
"Inputs":
[
{
"ProductId": "hwuk9huaqopwo"
}
],
"Processors":
[
{
"Value": 2,
"OutputIfExistsApplicability": 0,
"Outputs":
[
{
"ProductId": "twy5yhbishk91",
"Order": 1,
"Quantity": 1,
"ApplicationType": 1,
"PriceModifierType": 1,
"PriceModifierValue": 100.000000000000
}
]
}
]
}
],
"Success": true,
"Timestamp": "2021-02-18T17:02:27.8165916"
}