Définir un prix spécifique au personnel ou à un horaire spécifique

Le tutoriel suivant explique comment mettre en œuvre vos flux pour différencier la tarification d'un service en fonction du membre du personnel associé ou de l'heure de la journée et/ou du jour de la semaine.

Prix par membre du personnel/temps

Quatre paramètres doivent être définis:

  • Dans le flux des marchands, définissez un Merchant.payment_option pour chaque option de prix.

    • Définissez l'élément price souhaité sur le prix du service pour une heure ou un membre du personnel spécifiques.
    • payment_option_id doit être unique dans votre intégration, car les valeurs payment_option_id sont partagées entre tous les marchands du même agrégateur. Pour éviter toute confusion et simplifier le dépannage et la gestion, nous vous recommandons, pour chaque marchand, de (re)définir toutes les valeurs payment_option qu'il utilise avec un payment_option_id unique (même si un payment_option identique est utilisé par un autre marchand).

      • Concernant le prix par personnel, nous vous recommandons de générer le payment_option_id en combinant merchant_id, service_id et staff_id pour faciliter le suivi et vous assurer que le payment_option_id est unique dans l'ensemble de votre intégration.
      • Pour le prix par heure, nous vous recommandons de générer la payment_option_id en combinant merchant_id, service_id et une chaîne représentant cette heure (evening, weekends, sundayafternoon, etc.) afin de faciliter le suivi et de vous assurer que payment_option_id est unique dans l'ensemble de votre intégration.
      • Lorsqu'ils sont utilisés pour la tarification au niveau de disponibilité (cas d'utilisation de ce tutoriel), le nom et la description sont principalement utilisés à des fins de débogage.
      • Ne définissez pas plus de 100 valeurs payment_option pour un seul marchand. Si vous prévoyez d'atteindre plus de 100 valeurs payment_option, veuillez exécuter cette implémentation par votre contact Google.
      • Tous les autres champs payment_option peuvent être ignorés pour ce cas d'utilisation
  • Dans le flux disponibilité, définissez Availability.payment_option_id sur un tableau à un seul article avec l'attribut payment_option_id de l'attribut payment_option que vous avez défini au niveau Merchant.

  • Dans le flux du service, définissez Service.price sur la valeur la plus basse de la gamme de prix pour ce service et définissez Service.price_interpretation sur STARTS_AT

Exemple de prix par membre du personnel

Dans cet exemple, Robert (id: 1) est un coiffeur plus expérimenté que Jane (id:2). Le propriétaire du salon a donc décidé de réserver une chambre pour Robert 5 $plus chère. Le tarif par défaut est de 20 $pour une coupe courte et de 30 $pour une coupe longue. Si l'utilisateur sélectionne Robert, la coupe coûte respectivement 25 $et 35 $.

Nom du personnel Cheveux courts Cheveux longs
Jane $20* $30*
Robert $25 $35

*Prix par défaut du service

Marchands

{
  "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
          }
        }
      ]
    }
  ]
}

Services

{
  "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"
          }
        ]
      }
    }
  ]
}

Garantie de disponibilité

{
  "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"]
        }
      ]
    }
  ]
}

Exemple de prix par heure

Dans cet exemple, le salon est ouvert de 10h00 à 20h00. Le propriétaire du salon de beauté a décidé d’ajouter un coût supplémentaire de 5 $pour les réservations après 18h.

L'exemple de disponibilité est défini pour le samedi 1er septembre 2018 dans le fuseau horaire PT. 1535821200 correspond à 10h ce jour-là, 1535850000 à 18h et 1535857200 correspond à 20h.

Heure de la journée Cheveux courts Cheveux longs
10:00 ~ 11:00 $20 $30
11 h 00 - 12 h 00 $20 $30
12:00 ~ 13:00 $20 $30
13:00 ~ 14:00 $20 $30
14:00 ~ 15:00 $20 $30
15:00 ~ 16:00 $20 $30
16:00 ~ 17:00 $20 $30
17:00 ~ 18:00 $20 $30
18 h 00 - 19 h 00 $25 $35
19:00-20:00 $25 $35

Marchands

{
  "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
          }
        }
      ]
    }
  ]
}

Services

{
  "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"
          }
        ]
      }
    }
  ]
}

Garantie de disponibilité

{
  "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"]
        }
      ]
    }
  ]
}