Beauty with Payments integration examples

The payment processor used in this example is Stripe.

Merchants

{
  "metadata": {
    "processing_instruction": "PROCESS_AS_COMPLETE",
    "generation_timestamp": 1503638100,
    "nonce": "1298711",
    "total_shards": 1,
    "shard_number": 0
  },
  "merchant": [
    {
      "category": "Salon",
      "merchant_id": "100001",
      "name": "Chic Haircuts",
      "telephone": "+01 123-456-2390",
      "url": "",
      "tax_rate": {
        "micro_percent": 0
      },
      "tokenization_config": {
        "tokenization_parameter": {
          "stripe:publishableKey": "merch_live_5203JSDFKLCX09234XCLK",
          "gateway": "stripe",
          "stripe:version": "2018-08-18"
        }
      },
      "geo": {
        "latitude": 37.422113,
        "longitude": -122.084041,
        "address": {
          "country": "United States",
          "region": "CA",
          "postal_code": "94043",
          "street_address": "1600 Amphitheatre Pkwy",
          "locality": "Mountain View"
        }
      },
      "num_bookings_30d": 45,
      "payment_option": [
        {
          "payment_option_id": "ABCD-12345-12983-19283",
          "price": {
            "price_micros": 45000000,
            "currency_code": "USD"
          },
          "session_count": 1,
          "description": "",
          "name": "Men's Haircut",
          "valid_interval": {
            "begin_sec": 1503639426,
            "end_sec": 1506317826
          },
          "payment_option_type": "PAYMENT_OPTION_SINGLE_USE",
          "purchase_interval": {
            "begin_sec": 1503639426,
            "end_sec": 1506317826
          },
          "tax_rate": {
            "micro_percent": 6750000
          }
        },
        {
          "payment_option_id": "EFJS-12345-12983-19283",
          "price": {
            "price_micros": 45000000,
            "currency_code": "USD"
          },
          "session_count": 1,
          "description": "",
          "name": "Women's Haircut",
          "valid_interval": {
            "begin_sec": 1503639426,
            "end_sec": 1506317826
          },
          "payment_option_type": "PAYMENT_OPTION_SINGLE_USE",
          "purchase_interval": {
            "begin_sec": 1503639426,
            "end_sec": 1506317826
          },
          "tax_rate": {
            "micro_percent": 6750000
          }
        },
        {
          "payment_option_id": "SDOK-12345-12983-19283",
          "price": {
            "price_micros": 55000000,
            "currency_code": "USD"
          },
          "session_count": 1,
          "description": "",
          "name": "Extensions",
          "valid_interval": {
            "begin_sec": 1503639426,
            "end_sec": 1506317826
          },
          "payment_option_type": "PAYMENT_OPTION_SINGLE_USE",
          "purchase_interval": {
            "begin_sec": 1503639426,
            "end_sec": 1506317826
          },
          "tax_rate": {
            "micro_percent": 6750000
          }
        }
      ]
    }
  ]
}

Services

{
  "metadata": {
    "processing_instruction": "PROCESS_AS_COMPLETE",
    "generation_timestamp": 1535437200,
    "nonce": "12484213",
    "total_shards": 1,
    "shard_number": 0
  },
  "service": [
    {
      "merchant_id": "100001",
      "service_id": "209012",
      "description": "",
      "name": "Men's Haircut",
      "prepayment_type": "REQUIRED",
      "rules": {
        "min_advance_booking": 0,
        "min_advance_online_canceling": 86400
      },
      "tax_rate": {
        "micro_percent": 5000000
      },
      "require_credit_card": "REQUIRE_CREDIT_CARD_ALWAYS"
    },
    {
      "service_id": "209013",
      "description": "",
      "name": "Women's Haircut",
      "prepayment_type": "REQUIRED",
      "merchant_id": "100001",
      "rules": {
        "min_advance_booking": 0,
        "min_advance_online_canceling": 86400
      },
      "tax_rate": {
        "micro_percent": 5000000
      },
      "require_credit_card": "REQUIRE_CREDIT_CARD_ALWAYS"
    },
    {
      "service_id": "209014",
      "name": "Extensions",
      "description": "",
      "prepayment_type": "REQUIRED",
      "merchant_id": "100001",
      "rules": {
        "min_advance_booking": 0,
        "min_advance_online_canceling": 86400
      },
      "tax_rate": {
        "micro_percent": 5000000
      },
      "require_credit_card": "REQUIRE_CREDIT_CARD_ALWAYS"
    }
  ]
}

Availability

{
  "metadata": {
    "processing_instruction": "PROCESS_AS_COMPLETE",
    "generation_timestamp": 1535178900,
    "nonce": "192839",
    "total_shards": 1,
    "shard_number": 0
  },
  "service_availability": [
    {
      "availability": [
        {
          "merchant_id": "100001",
          "service_id": "209012",
          "resources": {
            "staff_name": "Jane Doe",
            "staff_id": "12345"
          },
          "payment_option_id": [
            "ABCD-12345-12983-19283"
          ],
          "duration_sec": 1800,
          "start_sec": 1493888400,
          "spots_open": 1,
          "spots_total": 1,
          "recurrence": {
            "repeat_every_sec": 1800,
            "repeat_until_sec": 1493915400
          },
          "schedule_exception": [
            {
              "time_range": {
                "begin_sec": 1493901000,
                "end_sec": 1493902800
              }
            }
          ]
        },
        {
          "merchant_id": "100001",
          "service_id": "209013",
          "resources": {
            "staff_name": "John Doe",
            "staff_id": "89120"
          },
          "payment_option_id": [
            "ABCD-12345-12983-19283"
          ],
          "duration_sec": 1800,
          "start_sec": 1493888400,
          "spots_open": 1,
          "spots_total": 1,
          "recurrence": {
            "repeat_every_sec": 1800,
            "repeat_until_sec": 1493915400
          },
          "schedule_exception": [
            {
              "time_range": {
                "begin_sec": 1493901000,
                "end_sec": 1493902800
              }
            }
          ]
        },
        {
          "merchant_id": "100001",
          "service_id": "209014",
          "resources": {
            "staff_name": "Susie Chung",
            "staff_id": "12347"
          },
          "payment_option_id": [
            "SDOK-12345-12983-19283"
          ],
          "duration_sec": 3600,
          "start_sec": 1493888400,
          "spots_open": 1,
          "spots_total": 1,
          "recurrence": {
            "repeat_every_sec": 3600,
            "repeat_until_sec": 1493915400
          }
        }
      ]
    }
  ]
}