allegro / allegro/allegro-api

[NEWS] Udostępniliśmy nową wersję zasobu /sale/tax-settings / We have released a new version of the /sale/tax-settings resource

Aberta
#7,846 0 comentários 0 reações 1 responsável Reivindicada por @Lukasz-Zurek Ver no GitHub
News
Linguagem predominante
Sem dados de linguagem
Estrelas
244
Forks
40
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

Od dziś możesz skorzystać z wersji **beta.v1** zasobu [/sale/tax-settings](https://developer.allegro.pl/documentation#operation/getTaxSettingsForCategory), dzięki czemu łatwiej uzyskasz informacje potrzebne do zdefiniowania stawki VAT w ofercie.

**Jakie zmiany wdrożyliśmy w wersji beta.v1?**

W wersji **beta.v1** wdrożyliśmy nową strukturę, w której zwrócimy listę następujących obiektów:

- **“subjects”** - tablica zawierająca listę przedmiotów opodatkowania,
- **“rates”** - lista stawek VAT (**“rates[].rate”**) dla poszczególnych krajów (**“rates[].countryCode”**) Pola **“subjects”** i **“exemptions”** są wspólne dla wszystkich krajów, które znajdują się na liście w **“rates”**,
- **“exemptions”** - lista podstaw wyłączenia z VAT.

Aby dostosować się do zmian, wystarczy, że zmienisz wartość w nagłówku **Accept** z “application/vnd.allegro.public.v1+json” na **“application/vnd.allegro.beta.v1+json”**.

**Przykładowy request:**

```
curl -X GET \
'https://api.allegro.pl/sale/tax-settings?category.id=315261&countryCode=CZ’ \
-H 'Authorization: Bearer {token}' \
-H 'Accept: application/vnd.allegro.beta.v1+json' \
Przykładowy response:

{
"subjects": [ - lista przedmiotów opodatkowania
{
"label": "Towar",
"value": "GOODS"
},
{
"label": "Wybierz",
"value": null
}
],
"rates": [ - lista stawek VAT
{
"countryCode": "PL",
"values": [
{
"label": "23%",
"value": "23.00",
"exemptionRequired": false
},
{
"label": "Poza VAT / NP",
"value": "OUT_OF_SCOPE_OF_VAT",
"exemptionRequired": true
},
{
"label": "Wybierz",
"value": null,
"exemptionRequired": false
}
]
},
{
"countryCode": "CZ",
"values": [...]
}
],
"exemptions": [ - podstawy wyłączenia z VAT
{
"label": "Wyroby akcyzowe",
"value": "EXCISE_GOODS"
},
{
"label": "Procedura marży",
"value": "MARGIN_SCHEME"
},
{
"label": "Wybierz",
"value": null
}
]
}
```
**Dlaczego wprowadzamy tę zmianę?**

Zasób [/sale/tax-settings](https://developer.allegro.pl/documentation#operation/getTaxSettingsForCategory) funkcjonuje obecnie w wersji **public.v1**, jednak struktura odpowiedzi nie jest dostosowana do obiektu **“taxSettings”**, który wdrożyliśmy [12 kwietnia 2023 roku](https://developer.allegro.pl/news/wprowadzamy-zmiany-w-deklarowaniu-stawki-vat-w-ofercie-D7lnKDXDOCE) na zasobach:

- [GET /sale/product-offers/{offerID}](https://developer.allegro.pl/documentation#operation/getProductOffer),
- [PATCH /sale/product-offers/{offerID}](https://developer.allegro.pl/documentation#operation/editProductOffers),
- [POST /sale/product-offers](https://developer.allegro.pl/documentation#operation/createProductOffers),
- [GET /sale/offers/{offerID}](https://developer.allegro.pl/documentation#operation/getOfferUsingGET),
- [PUT /sale/offers/{offerID}](https://developer.allegro.pl/documentation#operation/updateOfferUsingPUT),
- [POST /sale/offers](https://developer.allegro.pl/documentation#operation/createOfferUsingPOST),

gdzie zastąpiliśmy jednocześnie pole **“tax”,** które oznaczyliśmy jako **Deprecated**.

**Jakie są kolejne kroki?**

W przyszłości planujemy przenieść strukturę zasobu w wersji **beta.v1** na wersję **public.v1**, poinformujemy o tym z odpowiednim wyprzedzeniem.

---------

From now on, you can use the **beta.v1** version of the [/sale/tax-settings](https://developer.allegro.pl/documentation#operation/getTaxSettingsForCategory) resource, which will make it easier for you to obtain the information needed to define the VAT rate in your offer.

**What changes have we implemented in beta.v1?**

In **beta.v1** we have implemented a new structure in which we will return a list of the following objects:

- **“subjects”** - an array containing a list of taxable items,
- **“rates”** - list of VAT rates (**“rates[].rate”**) for individual countries (**“rates[].countryCode”**) The **“subjects”** and **“exemptions”** fields are common to all countries that are on the list in **“rates"**,
- **“exemptions”** - list of grounds for exclusion from VAT.

To adapt to the changes, simply change the value in the Accept header from “application/vnd.allegro.public.v1+json” to **“application/vnd.allegro.beta.v1+json”**.

**Sample request:**

```
curl -X GET \
'https://api.allegro.pl/sale/tax-settings?category.id=315261&countryCode=CZ’ \
-H 'Authorization: Bearer {token}' \
-H 'Accept: application/vnd.allegro.beta.v1+json' \
Sample response:

{
"subjects": [ - a list of tax subjects
{
"label": "Goods",
"value": "GOODS"
},
{
"label": "Select",
"value": null
}
],
"rates": [ - a list of tax rates
{
"countryCode": "PL",
"values": [
{
"label": "23%",
"value": "23.00",
"exemptionRequired": false
},
{
"label": "Out of scope of VAT",
"value": "OUT_OF_SCOPE_OF_VAT",
"exemptionRequired": true
},
{
"label": "Select",
"value": null,
"exemptionRequired": false
}
]
},
{
"countryCode": "CZ",
"values": [...]
}
],
"exemptions": [ - a list of tax exemptions
{
"label": "Excise goods",
"value": "EXCISE_GOODS"
},
{
"label": "Margin scheme",
"value": "MARGIN_SCHEME"
},
{
"label": "Select",
"value": null
}
]
}
```

**Why are we making this change?**

The [/sale/tax-settings](https://developer.allegro.pl/documentation#operation/getTaxSettingsForCategory) resource currently operates in the **public.v1** version, but the response structure is not adapted to the **"taxSettings"** object, which we implemented on [April 12, 2023](https://developer.allegro.pl/news/wprowadzamy-zmiany-w-deklarowaniu-stawki-vat-w-ofercie-D7lnKDXDOCE) on the resources:

- [GET /sale/product-offers/{offerID}](https://developer.allegro.pl/documentation#operation/getProductOffer),
- [PATCH /sale/product-offers/{offerID}](https://developer.allegro.pl/documentation#operation/editProductOffers),
- [POST /sale/product-offers](https://developer.allegro.pl/documentation#operation/createProductOffers),
- [GET /sale/offers/{offerID}](https://developer.allegro.pl/documentation#operation/getOfferUsingGET),
- [PUT /sale/offers/{offerID}](https://developer.allegro.pl/documentation#operation/updateOfferUsingPUT),
- [POST /sale/offers](https://developer.allegro.pl/documentation#operation/createOfferUsingPOST),

where we also replaced the **“tax”** field, which we marked as **Deprecated**.

**What are the next steps?**

In the future, we plan to transfer the resource structure in the **beta.v1** version to the **public.v1** version, we will inform you about it in advance.

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.