allegro / allegro/allegro-api

[NEWS] PATCH /sale/product-offers/{offer-id} - nowa metoda edycji oferty / PATCH/sales/product-offers/{offer-id} - new resource for offer edition

未關閉
#3,764 20 則留言 1 個 reaction 已指派 1 人 已被 @AureliuszBrussy 認領 在 GitHub 檢視
News
主要語言
沒有語言資料
星號
244
分支
40
PR 合併指標
30 天內沒有已合併 PR

描述

W dniu dzisiejszym, obok wcześniej zaprezentowanego przez nas zasobu [POST /sale/product-offers](https://developer.allegro.pl/documentation/#operation/createProductOffers), udostępniliśmy nowy zasób [PATCH /sale/product-offers/{offer-id}](https://developer.allegro.pl/documentation/#operation/editProductOffers), dzięki któremu edytujesz swoją ofertę w prosty sposób - zmienisz dowolne pole oferty, a jednocześnie nie musisz przekazywać całego jej modelu.

Jeżeli skorzystasz z [PATCH /sale/product-offers/{offer-id}](https://developer.allegro.pl/documentation/#operation/editProductOffers) i nie podasz wartości pola - w ofercie pozostawimy dotychczasową jego wartość i zmienimy tylko te, w których przekażesz wartość inną niż dotychczas. Z kolei, gdy przekażesz wartość **null** - usuniemy z oferty wartość pola, o ile pole nie jest wymagane.

Dzięki takiemu podejściu edytujesz niezależnie dowolne pole w ofercie, m.in:

- zdjęcia,
- parametry,
- lokalizację,
- cenę,
- opis oferty.

Przy edycji chcieliśmy zapewnić te same udogodnienia, które przy tworzeniu ofert daje [POST /sale/product-offers](https://developer.allegro.pl/documentation/#operation/createProductOffers), dlatego dzięki [PATCH /sale/product-offers/{offer-id}](https://developer.allegro.pl/documentation/#operation/editProductOffers) m.in. możesz zmienić status oferty bez konieczności wywołania osobnej komendy publikacji, czy też dodać do oferty zdjęcia bezpośrednio z zewnętrznych serwerów.

Więcej informacji na temat [PATCH /sale/product-offers/{offer-id}](https://developer.allegro.pl/documentation/#operation/editProductOffers) znajdziesz w [naszym poradniku](https://developer.allegro.pl/product_offers/#jak-edytowa%C4%87-ofert%C4%99).

------

Today, in addition to the [POST /sale/product-offers](https://developer.allegro.pl/en/documentation/#operation/createProductOffers) resource previously provided by us, we have introduced a new resource [PATCH /sale/product-offers/{offer-id}](https://developer.allegro.pl/en/documentation/#operation/editProductOffers). Owing to it, you can easily edit your offer - you can change any field of the offer, and at the same time, you don't have to pass its entire structure.

If you use [PATCH /sale/product-offers/{offer-id}](https://developer.allegro.pl/en/documentation/#operation/editProductOffers) and do not provide a field value - we will keep the current value of this field in the offer and change only those in which you provide a value different than before. On the other hand, when you pass a **null** value - we will remove the current value of the field from the offer, unless the field is required.

Thanks to this approach, you can independently edit any field in the offer, including:

- photos,
- parameters,
- location,
- price,
- description of the offer.

We wanted to provide the same facilities as when creating offers by [POST /sale/product-offers](https://developer.allegro.pl/en/documentation/#operation/createProductOffers), resource, therefore [PATCH /sale/product-offers/{offer-id}](https://developer.allegro.pl/en/documentation/#operation/editProductOffers) for example, allows you to change the offer status without having to use a separate publication command, or to add images to the offer directly from external server.

You can find more information about [PATCH /sale/product-offers/{offer-id}](https://developer.allegro.pl/en/documentation/#operation/editProductOffers) in [our guide](https://developer.allegro.pl/en/product_offers/#how-to-edit-an-offer).

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。