Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEWS] Reguły cenowe - określ, czy od danej ceny mamy odjąć lub dodać określoną kwotę / Pricing rules - add or subtract a specific amount to the given price #10789

Open
PrzemyslawLukanowski opened this issue Jan 30, 2025 · 0 comments
Assignees
Labels

Comments

@PrzemyslawLukanowski
Copy link
Collaborator

Reguły cenowe to funkcjonalności, które pozwalają Ci zarządzać ceną oferty bez edytowania jej ręcznie. Możesz samodzielnie ustawić sposób, w jaki ceny będą się zmieniać.

Więcej informacji na temat, jakie typy reguł możesz tworzyć i jak je przypisać do ofert, znajdziesz w naszym poradniku.

Co dodaliśmy?

W zasobach do zarządzania regułami cenowymi:

  • /sale/price-automation/rules
  • /sale/price-automation/rules/{ruleId}

dodaliśmy nowe pole changeByAmount w obiekcie configuration.

Do tej pory dawaliśmy możliwość podwyższenia lub obniżenia przeliczanej ceny o wybrany procent. Od teraz, gdy tworzysz lub edytujesz regułę cenową, możesz wybrać, czy od danej ceny mamy dodać lub odjąć określony procent (changeByPercentage) czy konkretną kwotę (changeByAmount).

Pod uwagę weźmiemy zawsze walutę dla danego rynku, dla którego chcesz zastosować regułę cenową. Jeśli nie zdefiniujesz wartości dla takiej waluty w swojej regule cenowej, to reguła nie zadziała na wskazanym rynku np. jeśli chcesz przypisać daną regułę do allegro-cz, musisz w niej posiadać zdefiniowaną wartość w CZK.

Przykład dla reguły typu “FOLLOW_BY_ALLEGRO_MIN_PRICE”:

  1. Dla oferty z ceną 200 zł ustawiasz własną regułę cenową, która porównuje Twoją cenę z najniższą ceną na Allegro: dodaje 0,50 zł i zmienia cenę tylko w zakresie od 150 do 250 zł.
  2. Aktualna najniższa cena danego produktu to 160 zł.
  3. Zgodnie z Twoją regułą, dodajemy do tej kwoty 0,50 zł - będzie to 160,50 zł.
  4. Sprawdzamy, czy nowa cena mieści się w zakresie od 150 do 250 zł. W tym przykładzie – tak.
  5. Aktualizujemy cenę oferty na 160,50 zł.

Przykład dla reguły typu “EXCHANGE_RATE”:

  1. Wystawiasz ofertę z ceną 15 zł i udostępniasz ją na allegro.cz.
  2. Dla rynku allegro.cz ustawiasz regułę cenową, która:
    • korzysta z Przelicznika cen, aby przeliczyć tę kwotę na korony czeskie po aktualnym kursie.
    • dodaje do ceny 20 Kč
  3. Kurs walut, który jest aktualny dla Przelicznika cen w tym dniu, to 1 PLN = 5.95 CZK. Po przeliczeniu cena Twojej oferty na allegro.cz będzie równa 89.32 Kč + 20 Kč, czyli po zakrągleniu w ofercie uwględnimy 109 Kč .
  4. Kilka dni później w tej samej ofercie obniżasz cenę w złotówkach do 14 zł.
  5. Zastosujemy wtedy Twoją regułę, aby zaktualizować cenę w koronach czeskich. Po przeliczeniu po aktualnym kursie (1 PLN = 5.96 CZK) i dodaniu 20 Kč otrzymamy 103,44 Kč więc w ofercie, po zaokrągleniu, uwzględnimy cenę 103 Kč na rynku allegro-cz.

Przykładowy request tworzenia reguły cenowej:

curl  -X  POST  \
'https://api.allegro.pl/sale/price-automation/rules' \
-H 'Accept: application/vnd.allegro.public.v1+json' \
-H 'Content-Type: application/vnd.allegro.public.v1+json' \
-H 'Authorization: Bearer {token}' \
-d 
{
  "name": "My price on Allegro + 10PLN, +15CZK",
  "type": "FOLLOW_BY_ALLEGRO_MIN_PRICE",
  "configuration": {
    "changeByAmount": {
      "operation": "ADD",
      "values": [
        {
          "currency": "PLN",
          "amount": "10.00"
        },
        {
          "currency": "CZK",
          "amount": "15.00"
        }
      ]
    }
  }
}

Pricing rules are functionalities that help you manage the offer price without editing it manually. You can set the way the prices will change on your own.

You can find more information about pricing rules in our tutorial - what types of rules you can create and how to assign them to your offers.

What have we added?

In the resources responsible for managing pricing rules:

  • /sale/price-automation/rules
  • /sale/price-automation/rules/{ruleId}

we have added a new field changeByAmount in the object configuration.

So far, we provided the option to increase or decrease the calculated price with a specific percentage. From now on, when you create or modify the pricing rule, you can choose, whether we should add or subtract the given percentage (changeByPercentage) or amount (changeByAmount).

We will always take into account the currency of the particular marketplace for which you want to apply a pricing rule. If you do not define a value for such currency in your pricing rule, the rule will not work on the indicated marketplace, e.g. if you want to assign a rule to allegro-cz, you must have a value defined in CZK.

Sample of “FOLLOW_BY_ALLEGRO_MIN_PRICE” type of pricing rule:

  1. For an offer with the price of 200 PLN, you set a rule that compares your price with the lowest price on Allegro: it adds 0,50 PLN and change the price only within the range of 150 to 250 PLN.
  2. Currently, the lowest price of a given product on Allegro is 160 zł.
  3. According to your rule, we add 0,50 PLN to this amount, resulting in a total of 160,50 PLN.
  4. We check if the new price is between 150 and 250 PLN.
  5. Since it is, we set the offer price to 160.50 PLN.

Sample of “EXCHANGE_RATE” type of pricing rule:

  1. You list an offer for 15 PLN and share it on allegro.cz.
  2. For the allegro.cz marketplace, you set the pricing rule that:
    • uses the Price Converter to convert the price to CZK at the current exchange rate,
    • adds 20 Kč to the price.
  3. The exchange rate applicable for the Price Converter on that day is 1 PLN = 5.95 CZK. After conversion, the price of your offer on Allegro.cz will be 89.32 CZK + 20 CZK, which, after rounding, will be displayed in the offer as 109 CZK.
  4. A few days later, you reduce the price in PLN in the same offer to 14 PLN.
  5. After conversion at the current exchange rate (1 PLN = 5.96 CZK) and adding 20 CZK, we get a total of 103.44 CZK. Therefore, after rounding, the price listed on Allegro.cz will be 103 CZK.

Sample request of creating the pricing rule:

curl  -X  POST  \
'https://api.allegro.pl/sale/price-automation/rules' \
-H 'Accept: application/vnd.allegro.public.v1+json' \
-H 'Content-Type: application/vnd.allegro.public.v1+json' \
-H 'Authorization: Bearer {token}' \
-d 
{
  "name": "My price on Allegro + 10PLN, +15CZK",
  "type": "FOLLOW_BY_ALLEGRO_MIN_PRICE",
  "configuration": {
    "changeByAmount": {
      "operation": "ADD",
      "values": [
        {
          "currency": "PLN",
          "amount": "10.00"
        },
        {
          "currency": "CZK",
          "amount": "15.00"
        }
      ]
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant