allegro / allegro-api

Issue tracker and wiki for Allegro REST API
https://developer.allegro.pl/
217 stars 39 forks source link

question about the discount in sandbox #9790

Open yangcen6 opened 2 months ago

yangcen6 commented 2 months ago

I created a 10pln coupon in the sandbox environment store and placed a test order, but why is there no discount details in the respond from /order/checkout-forms ? 20240902-114434 20240902-114545

PrzemyslawLukanowski commented 2 months ago

Hello, information about coupons from campaigns is not returned in the discounts section at this moment. This value ("COUPON") was initially intended for other kind of coupons than the one in your example. Currently, you will recognize the use of a coupon by the difference in price in the originalPrice.amount and price.amount fields.

yangcen6 commented 2 months ago
  1. So this means that there is no discount type that can identify coupons(like picture),right? 20240902-193611
  2. What activity does this field coupon represent? 20240902-193806
PrzemyslawLukanowski commented 2 months ago
  1. Yes, right.
  2. At this moment, this value will not be returned in any case. It was used in the past for different coupon operations.
yangcen6 commented 2 months ago
  1. So what campaigns or discounts can return the value of the discount types? like allegro price, bundle? 20240902-195626
  2. If we need to calculate the amount of the discount by ourselves through these two fields originalPrice.amount and price.amount, how can we distinguish if an order includes both the discount borne by the merchant and the discount borne by allegro?
PrzemyslawLukanowski commented 2 months ago
  1. "CROSSMULTIPACK" will be returned when some of the items in the order have been purchased with quantitative discounts in different offers, "MULTIPACK" will be returned when at least one item was purchased with the quantitative discount, "BUNDLE" when items were bought in the bundle and "ALLEGRO_PRICES" when some items are included in the Allegro Prices program.

Quantitative discounts can be created via this tab and bundles via this one.

  1. In case of the discount by Allegro, you will receive "ALLEGRO_PRICES" in the "discount" section. Also, there will be other information included in the order details about which you can read more in this article.
yangcen6 commented 2 months ago
  1. In other words, among the discount types, only the allegro price is the discount borne by allegro?

  2. I saw this field lineItems.reconciliation mentioned in this articlehttps://developer.allegro.pl/news/allegro-prices-we-will-add-new-objects-and-field-types-to-handle-orders-b21WRjqobTG. If the original price of a product is 100, and after allegro price is added, the discounted price is 80, then the value of payment.paidAmount and summary.totalToPay is 80,originalPrice.amount is 100,price.amount is 80 , lineItems.reconciliation is 20. Right? 20240902-214228

  3. Is lineItems.vouchers also bored by allegro?

PrzemyslawLukanowski commented 2 months ago
  1. Exactly.
  2. Exactly.
  3. No, it is caused by the buyer's action, but right now no voucher will be returned in this section. It was introduced because of this program and in the future may be extended to another.
yangcen6 commented 2 months ago

What does this mean? 20240903-174558

PrzemyslawLukanowski commented 2 months ago

You do not need to pay attention to this, this was connected to the government program from the previous year. The marked sentence means that some applications needed to introduce the requirement changes, otherwise they could not properly handle this program.

yangcen6 commented 2 months ago

OK,There is another question about surcharges. When the order fulfillment status changes to ready for shipment, can the buyer pay surcharge fee for an order that has already been paid? If surcharge fee are incurred, how can we perceive them?

PrzemyslawLukanowski commented 2 months ago

If the order is already paid, there cannot be another payment that will generate a surcharge.

yangcen6 commented 2 months ago
  1. it means that for lineItems.vouchers, there is no value now. But in the future it will have another program and it will use this field, right?
  2. If the buyer uses this voucher when purchasing two product A, the original price of the product is 100, the value of this voucher is 10, and the buyer actually pays 190. For this order ,summary.totalToPay.amount=payment.paidAmount.amount=190, lineItems.originalPrice.amount=100, lineItems.reconciliation.value.amount=0,right? But what is the value of lineItems.price.amount and lineItems.vouchers.value.amount this time?
  3. If the buyer purchases two product A which has joined allegro price, the original price of the product is 100, the discounted price is 80, and the buyer actually pays 160. For this order ,summary.totalToPay.amount=payment.paidAmount.amount=160, lineItems.originalPrice.amount=100, ,right? But what is the value of lineItems.price.amount and lineItems.reconciliation.value.amount this time?
PrzemyslawLukanowski commented 2 months ago
  1. Yes, in the future there may be other scenarios of the usage of this field.
  2. Right now this field is not used, so I cannot guarantee how it's gonna work in the future for new scenarios. If we decide to add new values that can be returned here, we will add news on our website.
  3. lineItems.price.amount will be the price visible in the offer, the price with discount, lineItems.originalPrice.amount also will be the discounted price, so sorry for the mistake here:

originalPrice.amount is 100,price.amount is 80 , lineItems.reconciliation is 20. Right?

these prices will be the same, discounted.

In the lineItems.reconciliation.value.amount we will return the gross amount returned by Allegro.

yangcen6 commented 2 months ago

If the buyer of this single item in the example purchased two, originalPrice.amount = price.amount = 236.55, the quantity is 2, then ineItems.reconciliation.value.amount is 30.2 ,right?

PrzemyslawLukanowski commented 2 months ago

I removed the previous example, but please check the following. The offer provided by the seller is 67.96, the Allegro Price is 59.99, so in the lineItems.reconciliation.value.amount we return 7.97 and the information about the quantity is returned in the reconciliation.quantity- it indicates the quantity of reconciled items:


   "lineItems": [
        {
            "id": ---
            "offer": {
                "id": ---,
                "name": ----,
                "external": null,
                "productSet": null
            },
            "quantity": 2,
            "originalPrice": {
                "amount": "59.99",
                "currency": "PLN"
            },
            "price": {
                "amount": "59.99",
                "currency": "PLN"
            },
            "reconciliation": {
                "value": {
                    "amount": "7.97",
                    "currency": "PLN"
                },
                "type": "BILLING",
                "quantity": 2
            },
yangcen6 commented 2 months ago

OK,thanks. Thank you for sharing. Now I have 3 formulas for calculating the amount. Please help me confirm it.

  1. The actual amount paid by the buyer for this order:*summary.totalToPay.amount=payment.paidAmount.amount=lineItems.price.amountlineItems.quantity+delivery.cost.amount**
  2. The amount generated by this order should be borne by allegro:*lineItems.reconciliation.value.amountlineItems.quantity**
  3. The amount generated by this order should be borne by seller:*(lineItems.originalPrice.amount-lineItmes.price.amount)lineItems.quantity**
PrzemyslawLukanowski commented 2 months ago
  1. Yes, exactly.
  2. Yes, this is the amount that will be reconciled by Allegro (the price in the offer details - summary.totalToPa). For example, offer price is 100, summary.totalToPay is 90, so in the lineItems.reconciliation.value.amount you will receive 10 and in the lineItems.quantity you will receive number of reconciled items. I3. ’m not sure if I interpret this correctly, amount paid by the buyer will be the same as in the first example. Could you give me more context about this example and formula?
yangcen6 commented 2 months ago

{'id': 'abce3180-63a7-11ef-97df-7166871624c9', 'messageToSeller': None, 'buyer': {'id': 'xx', 'email': '[lfdug2lke8+6794a5c07@user.allegrogroup.pl](mailto:lfdug2lke8+6794a5c07@user.allegrogroup.pl)', 'login': 'Client:xx', 'firstName': 'jan', 'lastName': 'kowalski', 'companyName': None, 'guest': False, 'personalIdentity': None, 'phoneNumber': '+xx', 'preferences': {'language': 'pl-PL'}, 'address': {'street': 'xxx', 'city': 'Warszawa', 'postCode': '02-677', 'countryCode': 'PL'}}, 'payment': {'id': 'ac252bc7-63a7-11ef-b0df-d966e239ed53', 'type': 'ONLINE', 'provider': 'PAYU', 'finishedAt': '2024-08-26T12:36:39.927Z', 'paidAmount': {'amount': '89.98', 'currency': 'PLN'}, 'reconciliation': None, 'features': []}, 'status': 'READY_FOR_PROCESSING', 'fulfillment': {'status': 'READY_FOR_SHIPMENT', 'shipmentSummary': {'lineItemsSent': 'NONE'}}, 'delivery': {'address': {'firstName': 'jan', 'lastName': 'kowalski', 'street': 'xxx', 'city': 'Warszawa', 'zipCode': '02-677', 'countryCode': 'PL', 'companyName': None, 'phoneNumber': '+xx', 'modifiedAt': None}, 'method': {'id': '0aafb43c-e66a-46ec-9cc4-29bb39ebb483', 'name': 'Allegro One Box, UPS'}, 'pickupPoint': {'id': 'AL015WE1', 'name': 'Allegro One Box, zielony automat', 'description': None, 'address': {'street': 'xx', 'zipCode': '02-677', 'city': 'Warszawa', 'countryCode': 'PL'}}, 'cost': {'amount': '19.98', 'currency': 'PLN'}, 'smart': False, 'time': {'from': '2024-09-09T22:00:00Z', 'to': '2024-09-10T21:59:59.999Z', 'guaranteed': None, 'dispatch': {'from': '2024-09-08T22:00:00Z', 'to': '2024-09-09T21:59:59.999Z'}}, 'calculatedNumberOfPackages': 2}, 'invoice': {'required': False, 'address': None, 'dueDate': None}, 'lineItems': [{'id': 'abc70590-63a7-11ef-97df-7166871624c9', 'offer': {'id': '7775573348', 'name': 'Magic Shield Case for Xiaomi Redmi Note 12 Pro 5G - Red', 'external': {'id': '953528668'}, 'productSet': None}, 'quantity': 1, 'originalPrice': {'amount': '50.00', 'currency': 'PLN'}, 'price': {'amount': '45.00', 'currency': 'PLN'}, 'reconciliation': None, 'selectedAdditionalServices': [], 'vouchers': [], 'tax': None, 'boughtAt': '2024-08-26T12:36:27.812Z'}, {'id': 'abc70591-63a7-11ef-97df-7166871624c9', 'offer': {'id': '7775450320', 'name': 'test 2', 'external': {'id': '14274'}, 'productSet': None}, 'quantity': 1, 'originalPrice': {'amount': '30.00', 'currency': 'PLN'}, 'price': {'amount': '25.00', 'currency': 'PLN'}, 'reconciliation': None, 'selectedAdditionalServices': [], 'vouchers': [], 'tax': None, 'boughtAt': '2024-08-26T12:36:27.812Z'}], 'surcharges': [], 'discounts': [], 'note': None, 'marketplace': {'id': 'allegro-pl'}, 'summary': {'totalToPay': {'amount': '89.98', 'currency': 'PLN'}}, 'updatedAt': '2024-08-26T12:36:39.927Z', 'revision': '819b5836'}

For this order, I buy 2 product. A costs 50, B costs 30. And I also use 10PLN coupon which is covered by seller(like the picture) 20240904-180354 20240904-180245

PrzemyslawLukanowski commented 2 months ago

But what exactly are you trying to achieve in this example? What value?

yangcen6 commented 2 months ago

The amount generated by this order should be borne by seller. like the 10PLN

PrzemyslawLukanowski commented 2 months ago

Do you mean the amount of the coupon from the campaign? You will receive it by subtraction lineItems.originalPrice.amount-lineItemes.price.amount and adding each result for every line item there is in the order: (50-45)+(30-25)=10. So the number of () should be based on the number of elements in the lineItems section.

yangcen6 commented 2 months ago

But if an order contains two items, the original price is 100, and then a 10 PLN coupon is used. The buyer actually pays 190, so the lineItems.originalPrice.amount=100,lineItemes.price.amount=95. (100-95)*2. So we need to multiply the number. right?

PrzemyslawLukanowski commented 1 month ago

Yes, you’re right.

yangcen6 commented 1 month ago

OK,thanks. Can we test allegro price in our sandbox store?

PrzemyslawLukanowski commented 1 month ago

Yes, but it needs to be done on our side. Can you send me sample offers that you want to include in the program?

yangcen6 commented 1 month ago

https://allegro.pl.allegrosandbox.pl/oferta/test-1-7775449586 this one. Thanks!

PrzemyslawLukanowski commented 1 month ago

I forwarded your request to the team responsible for Allegro Prices. I will be back with information when it's done.

yangcen6 commented 1 month ago

Ok,thanks.And for this offer, can it also join the allegro smart?

PrzemyslawLukanowski commented 1 month ago

The offer is now included in the Allegro Prices program.

Ok,thanks.And for this offer, can it also join the allegro smart?

Unfortunately no, because and the Sandbox environment you need to meet the same requirements for Smart as in the production.

The only discrepancy when it comes to the "Sales requirements" fragment is that you have at least 5 positive ratings (the need to be unique ones, from different sellers) from the last 12 months, and your average sales rating is at the level of at least 98%,". The other two are not possible to achieve on Sandbox.

yangcen6 commented 1 month ago

OK,get it. I will try it

yangcen6 commented 1 month ago

Can I only buy one? I want to test buy more than 1 20240905-202947

PrzemyslawLukanowski commented 1 month ago

Yes, we removed this limit.

stale[bot] commented 1 month ago

W tym wątku nie pojawiła się żadna nowa odpowiedź w ciągu 7 dni, dlatego automatycznie oznaczamy go jako przeterminowany. Jeśli w ciągu kolejnych 7 dni nie pojawi się żadna odpowiedź, wątek zostanie zamknięty. Dziękujemy za zaangażowanie w dyskusję i zachęcamy Cię do wypełnienia ankiety dotyczącej naszego wsparcia na forum.


There was no new reply in this thread within 7 days, therefore, we automatically marked it as expired. If no response is received within the next 7 days, this thread will be closed. Thank you for engaging in the discussion. We encourage you to complete our forum support survey.