Fitness with Payments integration examples

The payment processor used in this example is Stripe.

Merchants

{
  "metadata": {
    "processing_instruction": "PROCESS_AS_COMPLETE",
    "shard_number": 0,
    "total_shards": 1,
    "nonce": "12484223",
    "generation_timestamp": 1522991406
  },
  "merchant": [
    {
      "category": "Salon",
      "merchant_id": "100001",
      "name": "Chic Haircuts",
      "telephone": "+01 123-456-7895",
      "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",
    "shard_number": 0,
    "total_shards": 1,
    "nonce": "12484223",
    "generation_timestamp": 1522991406
  },
  "service": [
    {
      "merchant_id": "100001",
      "service_id": "123456",
      "name": "Cycling Class",
      "description": "Join a small group of 15 students for cyclling class. All levels welcome.",
      "price": {
        "price_micros": 40000000,
        "currency_code": "USD"
      },
      "rules": {
        "min_advance_booking": 0,
        "min_advance_online_canceling": 86400
      },
      "form": [
        {
          "field": [
            {
              "type": "SHORT_ANSWER",
              "label": "# of People in Household",
              "is_required": true
            },
            {
              "type": "SHORT_ANSWER",
              "label": "Phone number",
              "is_required": true
            },
            {
              "type": "SHORT_ANSWER",
              "label": "Notes",
              "is_required": false
            }
          ],
          "first_time_customers": true,
          "returning_customers": true
        }
      ],
      "prepayment_type": "REQUIRED",
      "tax_rate": {
        "micro_percent": 7750000
      },
      "require_credit_card": "REQUIRE_CREDIT_CARD_ALWAYS"
    },
    {
      "merchant_id": "100002",
      "service_id": "238472",
      "name": "Barre Class",
      "description": "Join in on the Barre craze. Our studio fits 30 students and all levels are welcome.",
      "price": {
        "price_micros": 75000000,
        "currency_code": "USD"
      },
      "rules": {
        "min_advance_booking": 0,
        "min_advance_online_canceling": 86400
      },
      "form": [
        {
          "field": [
            {
              "type": "SHORT_ANSWER",
              "label": "# of People in Household",
              "is_required": true
            },
            {
              "type": "SHORT_ANSWER",
              "label": "Phone number",
              "is_required": true
            },
            {
              "type": "SHORT_ANSWER",
              "label": "Notes",
              "is_required": false
            }
          ],
          "first_time_customers": true,
          "returning_customers": true
        }
      ],
      "prepayment_type": "REQUIRED",
      "tax_rate": {
        "micro_percent": 7750000
      },
      "require_credit_card": "REQUIRE_CREDIT_CARD_ALWAYS"
    },
    {
      "merchant_id": "100003",
      "service_id": "019283",
      "name": "Pure Strength Class",
      "description": "Build muscle with our award winning instructors. Advanced level recommended.",
      "price": {
        "price_micros": 155000000,
        "currency_code": "USD"
      },
      "rules": {
        "min_advance_booking": 0,
        "min_advance_online_canceling": 86400
      },
      "form": [
        {
          "field": [
            {
              "type": "SHORT_ANSWER",
              "label": "# of People in Household",
              "is_required": true
            },
            {
              "type": "SHORT_ANSWER",
              "label": "Phone number",
              "is_required": true
            },
            {
              "type": "SHORT_ANSWER",
              "label": "Notes",
              "is_required": false
            }
          ],
          "first_time_customers": true,
          "returning_customers": true
        }
      ],
      "prepayment_type": "REQUIRED",
      "tax_rate": {
        "micro_percent": 7750000
      },
      "require_credit_card": "REQUIRE_CREDIT_CARD_ALWAYS"
    }
  ]
}

Availability

{
  "metadata": {
    "processing_instruction": "PROCESS_AS_COMPLETE",
    "shard_number": 0,
    "total_shards": 1,
    "nonce": "12384212",
    "generation_timestamp": 1462926569
  },
  "service_availability": [
    {
      "availability": [
        {
          "duration_sec": 1800,
          "merchant_id": "100001",
          "payment_option_id": [
            "merch-100001-staff-Alice"
          ],
          "resources": {
            "room_id": "room_0",
            "room_name": "Room-A",
            "staff_id": "staff_0",
            "staff_name": "Alice"
          },
          "service_id": "123456",
          "spots_open": 1,
          "spots_total": 1,
          "start_sec": 1468080000
        },
        {
          "duration_sec": 1800,
          "merchant_id": "100002",
          "payment_option_id": [
            "merch-100002-staff-Bob"
          ],
          "resources": {
            "room_id": "room_1",
            "room_name": "Room-B",
            "staff_id": "staff_1",
            "staff_name": "Bob"
          },
          "service_id": "238472",
          "spots_open": 1,
          "spots_total": 1,
          "start_sec": 1468080000
        },
        {
          "duration_sec": 1800,
          "merchant_id": "100003",
          "payment_option_id": [
            "merch-100003-staff-Chris"
          ],
          "resources": {
            "room_id": "room_2",
            "room_name": "Room-C",
            "staff_id": "staff_2",
            "staff_name": "Chris"
          },
          "service_id": "019283",
          "spots_open": 1,
          "spots_total": 1,
          "start_sec": 1468080000
        },
        {
          "duration_sec": 1800,
          "merchant_id": "100003",
          "payment_option_id": [
            "merch-100003-staff-Alice"
          ],
          "resources": {
            "room_id": "room_0",
            "room_name": "Room-A",
            "staff_id": "staff_0",
            "staff_name": "Alice"
          },
          "service_id": "019283",
          "spots_open": 1,
          "spots_total": 1,
          "start_sec": 1468081800
        }
      ]
    }
  ]
}