O tutorial a seguir explica como implementar seus feeds para diferenciar os preços de um serviço com base no funcionário associado ou no horário e/ou dia da semana.
Preço por funcionário/hora
Há quatro coisas a serem definidas:
No feed do comerciante, defina um
Merchant.payment_option
para cada opção de preço- Defina o
price
desejado como o preço do serviço para o tempo/funcionário específico. payment_option_id
precisa ser exclusivo em toda a integração, já que os valores depayment_option_id
são compartilhados entre todos os comerciantes do mesmo agregador. Para evitar confusão e simplificar a solução de problemas e o gerenciamento, recomendamos que você redefina todos os valores depayment_option
que o comerciante usa com umpayment_option_id
exclusivo (mesmo que umpayment_option
idêntico seja usado por outro comerciante).- Para o preço por funcionário, recomendamos que você gere o
payment_option_id
como uma combinação domerchant_id
, doservice_id
e dostaff_id
para facilitar o acompanhamento e garantir que opayment_option_id
seja exclusivo em toda a integração. - Para o preço por tempo, recomendamos gerar o
payment_option_id
como uma combinação domerchant_id
, doservice_id
e de uma string que represente esse tempo (evening
,weekends
,sundayafternoon
...) para facilitar o acompanhamento e garantir que opayment_option_id
seja exclusivo em toda a integração.
- Quando usados para preços no nível de disponibilidade (o caso de uso deste tutorial), o nome e a descrição são usados principalmente para fins de depuração.
- Não defina mais de 100 valores de
payment_option
para um único merchant. Se você espera alcançar mais de 100 valorespayment_option
, execute essa implementação pelo seu contato do Google. - Todos os outros campos
payment_option
podem ser ignorados para este caso de uso
- Para o preço por funcionário, recomendamos que você gere o
- Defina o
No feed de disponibilidade, defina
Availability.payment_option_id
como uma matriz de único item com opayment_option_id
dopayment_option
que você definiu no nívelMerchant
.No feed de serviços, defina o
Service.price
como o valor mais baixo do intervalo de preço para esse serviço e definaService.price_interpretation
comoSTARTS_AT
.
Exemplo de preço por funcionário
Neste exemplo, Robert (ID: 1) é um cabeleireiro com mais experiência do que Jane (ID: 2). Portanto, o proprietário do salão decidiu aumentar o valor da reserva de Robert em US $5. O custo de um corte de cabelo curto é de US $20 por padrão, e o custo de um corte de cabelo longo é de US $30 por padrão. Se o usuário selecionar Robert, o corte vai custar US $25 ou US $35, respectivamente.
Nome do funcionário | Corte de cabelo curto | Corte de cabelo longo |
---|---|---|
Jane | US$ 20* | US$ 30* |
Robert | US$ 25 | $35 |
*preço padrão do serviço
Comerciantes
{ "metadata": { "processing_instruction": "PROCESS_AS_COMPLETE", "generation_timestamp": 1503638100, "total_shards": 1 }, "merchant": [ { "category": "beauty_salon", "merchant_id": "beauty-per-staff-price", "name": "Beauty Salon", "url": "www.merchantspublicsite.com", "telephone": "+1 123-456-7890", "geo": { "latitude": 37.422113, "longitude": -122.084041, "address": { "locality": "Mountain View", "country": "US", "region": "CA", "street_address": "1600 Amphitheatre Pkwy", "postal_code": "94043" } }, "payment_option": [ { "payment_option_id": "beauty-per-staff-price-haircut-short-1", "name": "Short haircut (Robert)", "description": "Short hair haircut price for Robert", "price": { "currency_code": "USD", "price_micros": 25000000 } }, { "payment_option_id": "beauty-per-staff-price-haircut-short-default", "name": "Short haircut (Default)", "description": "Normal short hair haircut price", "price": { "currency_code": "USD", "price_micros": 20000000 } }, { "payment_option_id": "beauty-per-staff-price-haircut-long-1", "name": "Long haircut (Robert)", "description": "Long hair haircut price for Robert", "price": { "currency_code": "USD", "price_micros": 35000000 } }, { "payment_option_id": "beauty-per-staff-price-haircut-long-default", "name": "Long haircut (Default)", "description": "Normal long hair haircut price", "price": { "currency_code": "USD", "price_micros": 30000000 } } ] } ] }
Serviços
{ "metadata": { "processing_instruction": "PROCESS_AS_COMPLETE", "generation_timestamp": 1535437200, "total_shards": 1 }, "service": [ { "service_id": "haircut-short", "prepayment_type": "NOT_SUPPORTED", "merchant_id": "beauty-per-staff-price", "price": { "currency_code": "USD", "price_micros": 20000000 }, "localized_service_name": { "value": "Haircut (shorter than shoulder)", "localized_value": [ { "locale": "en", "value": "Haircut (shorter than shoulder)" } ] }, "localized_description": { "value": "Awesome haircut for short hair", "localized_value": [ { "locale": "en", "value": "Awesome haircut for short hair" } ] } }, { "service_id": "haircut-long", "prepayment_type": "NOT_SUPPORTED", "merchant_id": "beauty-per-staff-price", "price": { "currency_code": "USD", "price_micros": 30000000 }, "localized_service_name": { "value": "Haircut (longer than shoulder)", "localized_value": [ { "locale": "en", "value": "Haircut (longer than shoulder)" } ] }, "localized_description": { "value": "Awesome haircut for long hair", "localized_value": [ { "locale": "en", "value": "Awesome haircut for long hair" } ] } } ] }
Disponibilidade
{ "metadata": { "processing_instruction": "PROCESS_AS_COMPLETE", "generation_timestamp": 1535178900, "total_shards": 1 }, "service_availability": [ { "availability": [ { "spots_total": 1, "start_sec": 1535806800, "spots_open": 1, "duration_sec": 3600, "recurrence": { "repeat_until_sec": 1535846340, "repeat_every_sec": 3600 }, "service_id": "haircut-short", "merchant_id": "beauty-per-staff-price", "resources": { "staff_name": "Robert", "staff_id": "1" }, "payment_option_id": ["beauty-per-staff-price-haircut-short-1"] }, { "spots_total": 1, "start_sec": 1535806800, "spots_open": 1, "duration_sec": 3600, "recurrence": { "repeat_until_sec": 1535846340, "repeat_every_sec": 3600 }, "service_id": "haircut-long", "merchant_id": "beauty-per-staff-price", "resources": { "staff_name": "Robert", "staff_id": "1" }, "payment_option_id": ["beauty-per-staff-price-haircut-long-1"] }, { "spots_total": 1, "start_sec": 1535806800, "spots_open": 1, "duration_sec": 3600, "recurrence": { "repeat_until_sec": 1535846340, "repeat_every_sec": 3600 }, "service_id": "haircut-short", "merchant_id": "beauty-per-staff-price", "resources": { "staff_name": "Jane", "staff_id": "2" }, "payment_option_id": ["beauty-per-staff-price-haircut-short-default"] }, { "spots_total": 1, "start_sec": 1535806800, "spots_open": 1, "duration_sec": 3600, "recurrence": { "repeat_until_sec": 1535846340, "repeat_every_sec": 3600 }, "service_id": "haircut-long", "merchant_id": "beauty-per-staff-price", "resources": { "staff_name": "Jane", "staff_id": "2" }, "payment_option_id": ["beauty-per-staff-price-haircut-long-default"] } ] } ] }
Exemplo de preço por tempo
Neste exemplo, o salão fica aberto das 10h às 20h. O proprietário do salão decidiu adicionar um custo extra de US $5 para agendamentos após as 18h.
O exemplo de disponibilidade é definido para sábado, 1º de setembro de 2018, no fuso horário de Portugal. 1535821200 é 10:00 naquele dia, 1535850000 é 18:00 naquele dia e 1535857200 é 20:00.
Hora do dia | Corte de cabelo curto | Corte de cabelo longo |
---|---|---|
10h00 ~ 11h00 | US$ 20 | US$ 30 |
11h ~ 12h | US$ 20 | US$ 30 |
12h00 ~ 13h00 | US$ 20 | US$ 30 |
13h00 ~ 14h00 | US$ 20 | US$ 30 |
14:00 ~ 15:00 | US$ 20 | US$ 30 |
15h00 ~ 16h00 | US$ 20 | US$ 30 |
16h ~ 17h | US$ 20 | US$ 30 |
17h ~ 18h | US$ 20 | US$ 30 |
18h a 19h | US$ 25 | $35 |
19h00 a 20h00 | US$ 25 | $35 |
Comerciantes
{ "metadata": { "processing_instruction": "PROCESS_AS_COMPLETE", "generation_timestamp": 1503638100, "total_shards": 1 }, "merchant": [ { "category": "beauty_salon", "merchant_id": "beauty-per-time-price", "name": "Beauty Salon", "url": "www.merchantspublicsite.com", "telephone": "+1 123-456-7890", "geo": { "latitude": 37.422113, "longitude": -122.084041, "address": { "locality": "Mountain View", "country": "US", "region": "CA", "street_address": "1600 Amphitheatre Pkwy", "postal_code": "94043" } }, "payment_option": [ { "payment_option_id": "beauty-per-time-price-haircut-short-evening", "name": "Short haircut (Evening)", "description": "Short hair haircut price for the evening", "price": { "currency_code": "USD", "price_micros": 25000000 } }, { "payment_option_id": "beauty-per-time-price-haircut-short-default", "name": "Short haircut (Normal)", "description": "Short hair haircut price for the rest of the day", "price": { "currency_code": "USD", "price_micros": 21000000 } }, { "payment_option_id": "beauty-per-time-price-haircut-long-evening", "name": "Long haircut (Evening)", "description": "Long hair haircut price for the evening", "price": { "currency_code": "USD", "price_micros": 35000000 } }, { "payment_option_id": "beauty-per-time-price-haircut-long-default", "name": "Long haircut (Normal)", "description": "Long hair haircut price for the rest of the day", "price": { "currency_code": "USD", "price_micros": 31000000 } } ] } ] }
Serviços
{ "metadata": { "processing_instruction": "PROCESS_AS_COMPLETE", "generation_timestamp": 1535437200, "total_shards": 1 }, "service": [ { "service_id": "haircut-short", "prepayment_type": "NOT_SUPPORTED", "merchant_id": "beauty-per-time-price", "price": { "currency_code": "USD", "price_micros": 2100000 }, "localized_service_name": { "value": "Haircut (shorter than shoulder)", "localized_value": [ { "locale": "en", "value": "Haircut (shorter than shoulder)" } ] }, "localized_description": { "value": "Awesome haircut for short hair", "localized_value": [ { "locale": "en", "value": "Awesome haircut for short hair" } ] } }, { "service_id": "haircut-long", "prepayment_type": "NOT_SUPPORTED", "merchant_id": "beauty-per-time-price", "price": { "currency_code": "USD", "price_micros": 31000000 }, "localized_service_name": { "value": "Haircut (longer than shoulder)", "localized_value": [ { "locale": "en", "value": "Haircut (longer than shoulder)" } ] }, "localized_description": { "value": "Awesome haircut for long hair", "localized_value": [ { "locale": "en", "value": "Awesome haircut for long hair" } ] } } ] }
Disponibilidade
{ "metadata": { "processing_instruction": "PROCESS_AS_COMPLETE", "generation_timestamp": 1535178900, "total_shards": 1 }, "service_availability": [ { "availability": [ { "spots_total": 1, "start_sec": 1535821200, "spots_open": 1, "duration_sec": 3600, "recurrence": { "repeat_until_sec": 1535849940, "repeat_every_sec": 3600 }, "service_id": "haircut-short", "merchant_id": "beauty-per-time-price", "payment_option_id": ["beauty-per-time-price-haircut-short-default"] }, { "spots_total": 1, "start_sec": 1535821200, "spots_open": 1, "duration_sec": 3600, "recurrence": { "repeat_until_sec": 1535849940, "repeat_every_sec": 3600 }, "service_id": "haircut-long", "merchant_id": "beauty-per-time-price", "payment_option_id": ["beauty-per-time-price-haircut-long-default"] }, { "spots_total": 1, "start_sec": 1535850000, "spots_open": 1, "duration_sec": 3600, "recurrence": { "repeat_until_sec": 1535857140, "repeat_every_sec": 3600 }, "service_id": "haircut-short", "merchant_id": "beauty-per-time-price", "payment_option_id": ["beauty-per-time-price-haircut-short-evening"] }, { "spots_total": 1, "start_sec": 1535850000, "spots_open": 1, "duration_sec": 3600, "recurrence": { "repeat_until_sec": 1535857140, "repeat_every_sec": 3600 }, "service_id": "haircut-long", "merchant_id": "beauty-per-time-price", "payment_option_id": ["beauty-per-time-price-haircut-long-evening"] } ] } ] }