This tutorial provides an overview of the different fee use cases that are supported, along with detailed instructions on how to specify fees for action links within your feeds.
Fee type
Application supports the DELIVERY
and SERVICE
fee types.
Delivery
{ "fee": { "fee_id": "12345/delivery_fee", "fee_type": "DELIVERY", "fixed_amount": { "currency_code": "USD", "units": 10, "nanos": 0 }, "service_ids": ["service/entity002"] } }
Service
{ "fee": { "fee_id": "12345/service_fee", "fee_type": "SERVICE", "fixed_amount": { "currency_code": "USD", "units": 10, "nanos": 0 }, "service_ids": ["service/entity002"] } }
Fee feeds
The following outlines the various use-cases supported, along with sample examples.- Fixed fees: A fixed fee, defined as a
fixed_amount
, is charged for the service. - Percentage fee: A percentage of the cart total is charged
as a service fee. Additionally, you can specify a
base_value
in addition to thecart_percentage
fee. - Fee ranges: Fees within the range defined as
range_amount
for minimum and maximum.
Fixed
{ "fee": { "fee_id": "12345/delivery_fee", "fee_type": "DELIVERY", "fixed_amount": { "currency_code": "USD", "units": 10, "nanos": 0 }, "service_ids": ["service/entity002"] } }
Cart percentage
{ "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" ] } }
Range
{ "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" ] } }