allegro / allegro/allegro-api

[NEWS] Rabat na duże zamówienie dla transakcji B2B / Large order discount for B2B transactions

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

描述

Od dziś dodasz rabat na duże zamówienie do swoich ofert. Dzięki niemu zaoferujesz kupującym rabat podczas transakcji B2B (firma - firma). Aby dodać rabat, skorzystaj z [POST /sale/loyalty/promotions](https://developer.allegro.pl/documentation/#operation/createPromotionUsingPOST_1) i określ progi wartościowe pojedynczego zamówienia oraz przypadający dla nich rabat procentowy. Rabatem zostaną objęte wszystkie twoje oferty.

**Przykładowy request:**
```
curl -X POST
'https://api.allegro.pl/sale/loyalty/promotions' \
-H 'Accept: application/vnd.allegro.public.v1+json' \
-H 'Content-Type: application/vnd.allegro.public.v1+json' \
-H 'Authorization: Bearer {token}' \
-d '{
"benefits": [
{
"specification": {
"type": "LARGE_ORDER_DISCOUNT", -- typ promocji (lista dostępnych wartości
znajduje się w dokumentacji zasobu)
"thresholds": [ -- progi rabatowe
{
"orderValue": {
"lowerBound": {
"amount": "1000.00", -- wartość zamówienia
"currency": "PLN"
}
},
"discount": {
"percentage": "5" -- wysokość rabatu (%)
}
},
{
"orderValue": {
"lowerBound": {
"amount": "1500.00",
"currency": "PLN"
}
},
"discount": {
"percentage": "8"
}
}
]
}
}
],
"offerCriteria": [
{
"type": "ALL_OFFERS" -- rabatem zostaną
} objęte wszystkie oferty
]
}'
```

W odpowiedzi otrzymasz identyfikator utworzonego rabatu.

**Przykładowy response:**
```
{
"id": "ba01f101-c9ef-4e5d-a88f-efb721bdbb9a", -- identyfikator rabatu
"createdAt": "2020-10-27T06:31:29.36Z", -- data utworzenia
"benefits": [
{
"specification": {
"thresholds": [
{
"orderValue": {
"lowerBound": {
"amount": "1000.00",
"currency": "PLN"
}
},
"discount": {
"percentage": "5"
}
},
{
"orderValue": {
"lowerBound": {
"amount": "1500.00",
"currency": "PLN"
}
},
"discount": {
"percentage": "8"
}
}
],
"type": "LARGE_ORDER_DISCOUNT"
}
}
],
"offerCriteria": [
{
"type": "ALL_OFFERS"
}
]
"status": "ACTIVE"
}
```

Więcej informacji o rabacie na duże zamówienie i zasobach do zarządzania nim znajdziesz w [naszym poradniku](https://developer.allegro.pl/offer_bundles/#40).

-----
From today you can add a large order discount to your offers. Thanks to it, you will offer a discount for buyers during B2B transactions (company - company). To create a large order discount, please use [POST /sale/loyalty/promotions](https://developer.allegro.pl/documentation/#operation/createPromotionUsingPOST_1) and define the single order value thresholds and percentage discount for them. Large order discount will be applied to all of your offers.

**Sample request:**
```
curl -X POST
'https://api.allegro.pl/sale/loyalty/promotions' \
-H 'Accept: application/vnd.allegro.public.v1+json' \
-H 'Content-Type: application/vnd.allegro.public.v1+json' \
-H 'Authorization: Bearer {token}' \
-d '{
"benefits": [
{
"specification": {
"type": "LARGE_ORDER_DISCOUNT", -- promotion type (list of available values
can be found in resource documentation)
"thresholds": [ -- discount thresholds
{
"orderValue": {
"lowerBound": {
"amount": "1000.00", -- order value
"currency": "PLN"
}
},
"discount": {
"percentage": "5" -- discount percentage (%)
}
},
{
"orderValue": {
"lowerBound": {
"amount": "1500.00",
"currency": "PLN"
}
},
"discount": {
"percentage": "8"
}
}
]
}
}
],
"offerCriteria": [
{
"type": "ALL_OFFERS" -- discount will be applied
} to all of your offers
]
}'
```

In response, you will receive the ID of the created large order discount.

**Sample response:**
```
{
"id": "ba01f101-c9ef-4e5d-a88f-efb721bdbb9a", -- large order discount id
"createdAt": "2020-10-27T06:31:29.36Z", -- creation date
"benefits": [
{
"specification": {
"thresholds": [
{
"orderValue": {
"lowerBound": {
"amount": "1000.00",
"currency": "PLN"
}
},
"discount": {
"percentage": "5"
}
},
{
"orderValue": {
"lowerBound": {
"amount": "1500.00",
"currency": "PLN"
}
},
"discount": {
"percentage": "8"
}
}
],
"type": "LARGE_ORDER_DISCOUNT"
}
}
],
"offerCriteria": [
{
"type": "ALL_OFFERS"
}
],
"status": "ACTIVE"
}
```

You will find more information about large order discount and resources to manage it in [our tutorial](https://developer.allegro.pl/en/offer_bundles/#40).

貢獻指南

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

評估

這個 Issue 還沒有評估資料。

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

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