本教學課程概略說明支援的各種費用用途,並詳細說明如何在動態饋給中指定動作連結的費用。
費用類型
應用程式支援 DELIVERY
和 SERVICE
費用類型。
外送
{ "fee": { "fee_id": "12345/delivery_fee", "fee_type": "DELIVERY", "fixed_amount": { "currency_code": "USD", "units": 10, "nanos": 0 }, "service_ids": ["service/entity002"] } }
服務
{ "fee": { "fee_id": "12345/service_fee", "fee_type": "SERVICE", "fixed_amount": { "currency_code": "USD", "units": 10, "nanos": 0 }, "service_ids": ["service/entity002"] } }
費用動態饋給
以下概述支援的各種用途並提供範例。- 固定費用:系統會針對服務收取固定費用,以
fixed_amount
定義。 - 費用百分比:在購物車總額的特定百分比中收取服務費。此外,除了
cart_percentage
費用外,您還可以指定base_value
。 - 費用範圍:在定義為
range_amount
範圍內的費用範圍。
恆亮
{ "fee": { "fee_id": "12345/delivery_fee", "fee_type": "DELIVERY", "fixed_amount": { "currency_code": "USD", "units": 10, "nanos": 0 }, "service_ids": ["service/entity002"] } }
購物車百分比
{ "fee": { "fee_id": "12345/delivery_fee", "fee_type": "DELIVERY", "cart_percentage": { "base_value": { "currency_code": "USD", "units": 3, "nanos": 500000000 }, "percentage_of_cart_value": 10 }, "service_ids": [ "service/entity002" ] } }
範圍
{ "fee": { "fee_id": "12345/delivery_fee", "fee_type": "DELIVERY", "range_amount": { "min_amount": { "currency_code": "USD", "units": 3, "nanos": 500000000 }, "max_amount": { "currency_code": "USD", "units": 5, "nanos": 600000000 } }, "service_ids": [ "service/entity002" ] } }