The REST API Reference is targeted at WooCommerce Bookings 1.14.0+ only and written for developers looking to extend or customize WooCommerce Bookings. It requires an advanced understanding of PHP and WordPress development.
Booking Slots
↑ Volver al principio
Slots Properties
Attribute | Type | Description |
---|---|---|
product_ids |
string |
Product IDs for slots you want to query. (Comma-separated IDs) |
category_ids |
string |
Category IDs for slots you want to query. (Comma-separated IDs) |
resource_ids |
string |
Resource IDs for slots you want to query. (Comma-separated IDs) |
intervals |
string |
The interval of days to query. (Comma-separated IDs) |
timezone_offset |
string |
The timezone offset to query against. |
min_date |
string |
The minimum date range for slots you want to query. |
max_date |
string |
The maximum date range for slots you want to query. |
page |
integer |
The page you want to query. |
Retrieve a slot
GET /wp-json/wc-bookings/v1/products/slots
JSON response example:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"records": [ | |
{ | |
"date": "2019-03-19T00:00:00-0700", | |
"duration": 1, | |
"duration_unit": "day", | |
"booked": 0, | |
"available": 1, | |
"resources": { | |
"0": 1 | |
}, | |
"product_id": 171578, | |
"title": "Candy Land", | |
"cost": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">$</span>0.00</span>" | |
}, | |
{ | |
"date": "2019-03-20T00:00:00-0700", | |
"duration": 1, | |
"duration_unit": "day", | |
"booked": 0, | |
"available": 1, | |
"resources": { | |
"0": 1 | |
}, | |
"product_id": 171578, | |
"title": "Candy Land", | |
"cost": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">$</span>0.00</span>" | |
} | |
], | |
"count": 2 | |
} |
Booking Categories
↑ Volver al principioCategory Properties
GET /wp-json/wc-bookings/v1/products/categories
JSON response example:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": 484, | |
"name": "Accessories", | |
"slug": "accessories", | |
"parent": 0, | |
"description": "", | |
"display": "default", | |
"image": null, | |
"menu_order": 0, | |
"count": 8, | |
"_links": { | |
"self": [ | |
{ | |
"href": "https://yoursite.test/wp-json/wc-bookings/v1/products/categories/484" | |
} | |
], | |
"collection": [ | |
{ | |
"href": "https://yoursite.test/wp-json/wc-bookings/v1/products/categories" | |
} | |
] | |
} | |
}, | |
{ | |
"id": 2567, | |
"name": "Uncategorized", | |
"slug": "uncategorized", | |
"parent": 0, | |
"description": "", | |
"display": "default", | |
"image": null, | |
"menu_order": 0, | |
"count": 17, | |
"_links": { | |
"self": [ | |
{ | |
"href": "https://yoursite.test/wp-json/wc-bookings/v1/products/categories/2567" | |
} | |
], | |
"collection": [ | |
{ | |
"href": "https://yoursite.test/wp-json/wc-bookings/v1/products/categories" | |
} | |
] | |
} | |
}, | |
{ | |
"id": 2570, | |
"name": "2015", | |
"slug": "2015", | |
"parent": 0, | |
"description": "", | |
"display": "default", | |
"image": null, | |
"menu_order": 0, | |
"count": 1, | |
"_links": { | |
"self": [ | |
{ | |
"href": "https://yoursite.test/wp-json/wc-bookings/v1/products/categories/2570" | |
} | |
], | |
"collection": [ | |
{ | |
"href": "https://yoursite.test/wp-json/wc-bookings/v1/products/categories" | |
} | |
] | |
} | |
} | |
] |
Booking Resources
↑ Volver al principioResources Properties
GET /wp-json/wc-bookings/v1/resources
JSON response example:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": 145546, | |
"availability": [], | |
"base_cost": 0, | |
"block_cost": 0, | |
"name": "The Vault", | |
"parent_id": 0, | |
"qty": "5", | |
"sort_order": 0, | |
"_links": { | |
"self": [ | |
{ | |
"href": "https://yoursite.test/wp-json/wc-bookings/v1/resources/145546" | |
} | |
], | |
"collection": [ | |
{ | |
"href": "https://yoursite.test/wp-json/wc-bookings/v1/resources" | |
} | |
] | |
} | |
}, | |
{ | |
"id": 121229, | |
"availability": [], | |
"base_cost": 0, | |
"block_cost": 0, | |
"name": "Paradise Escape", | |
"parent_id": 0, | |
"qty": "5", | |
"sort_order": 0, | |
"_links": { | |
"self": [ | |
{ | |
"href": "https://yoursite.test/wp-json/wc-bookings/v1/resources/121229" | |
} | |
], | |
"collection": [ | |
{ | |
"href": "https://yoursite.test/wp-json/wc-bookings/v1/resources" | |
} | |
] | |
} | |
} | |
] |
Booking Products
↑ Volver al principioProducts Properties
GET /wp-json/wc-bookings/v1/products
JSON response example:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": 171578, | |
"name": "Candy Land", | |
"slug": "candy-land", | |
"permalink": "https://yoursite.test/product/candy-land/", | |
"date_created": "2019-03-19T10:54:48", | |
"date_created_gmt": "2019-03-19T17:54:48", | |
"date_modified": "2019-03-19T15:37:38", | |
"date_modified_gmt": "2019-03-19T22:37:38", | |
"type": "booking", | |
"status": "publish", | |
"featured": false, | |
"catalog_visibility": "visible", | |
"description": "", | |
"short_description": "", | |
"sku": "", | |
"price": "50", | |
"regular_price": "", | |
"sale_price": "", | |
"date_on_sale_from": null, | |
"date_on_sale_from_gmt": null, | |
"date_on_sale_to": null, | |
"date_on_sale_to_gmt": null, | |
"price_html": "From: <span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">$</span>50.00</span>", | |
"on_sale": false, | |
"purchasable": true, | |
"total_sales": 0, | |
"virtual": false, | |
"downloadable": false, | |
"downloads": [], | |
"download_limit": -1, | |
"download_expiry": -1, | |
"external_url": "", | |
"button_text": "", | |
"tax_status": "taxable", | |
"tax_class": "", | |
"manage_stock": false, | |
"stock_quantity": null, | |
"stock_status": "instock", | |
"backorders": "no", | |
"backorders_allowed": false, | |
"backordered": false, | |
"sold_individually": true, | |
"weight": "", | |
"dimensions": { | |
"length": "", | |
"width": "", | |
"height": "" | |
}, | |
"shipping_required": true, | |
"shipping_taxable": true, | |
"shipping_class": "", | |
"shipping_class_id": 0, | |
"reviews_allowed": true, | |
"average_rating": "0.00", | |
"rating_count": 0, | |
"related_ids": [], | |
"upsell_ids": [], | |
"cross_sell_ids": [], | |
"parent_id": 0, | |
"purchase_note": "", | |
"categories": [ | |
{ | |
"id": 2570, | |
"name": "2015", | |
"slug": "2015" | |
} | |
], | |
"tags": [], | |
"images": [], | |
"attributes": [], | |
"default_attributes": [], | |
"variations": [], | |
"grouped_products": [], | |
"menu_order": 0, | |
"meta_data": [], | |
"apply_adjacent_buffer": false, | |
"availability": [], | |
"block_cost": 50, | |
"buffer_period": 0, | |
"calendar_display_mode": "always_visible", | |
"cancel_limit_unit": "month", | |
"cancel_limit": 1, | |
"check_start_block_only": false, | |
"cost": 0, | |
"default_date_availability": "available", | |
"display_cost": "", | |
"duration_type": "fixed", | |
"duration_unit": "day", | |
"duration": 1, | |
"enable_range_picker": false, | |
"first_block_time": "", | |
"has_person_cost_multiplier": false, | |
"has_person_qty_multiplier": false, | |
"has_person_types": true, | |
"has_persons": true, | |
"has_resources": false, | |
"has_restricted_days": "", | |
"max_date": { | |
"value": 12, | |
"unit": "month" | |
}, | |
"max_date_value": 12, | |
"max_date_unit": "month", | |
"max_duration": 1, | |
"max_persons": 1, | |
"min_date": { | |
"value": 0, | |
"unit": "day" | |
}, | |
"min_date_value": 0, | |
"min_date_unit": "day", | |
"min_duration": 1, | |
"min_persons": 1, | |
"person_types": { | |
"171581": {}, | |
"171582": {} | |
}, | |
"pricing": [], | |
"qty": 1, | |
"requires_confirmation": false, | |
"resource_label": "", | |
"resource_base_costs": [], | |
"resource_block_costs": [], | |
"resource_ids": [], | |
"resources_assignment": "customer", | |
"restricted_days": "", | |
"can_be_cancelled": false, | |
"_links": { | |
"self": [ | |
{ | |
"href": "https://yoursite.test/wp-json/wc-bookings/v1/products/171578" | |
} | |
], | |
"collection": [ | |
{ | |
"href": "https://yoursite.test/wp-json/wc-bookings/v1/products" | |
} | |
] | |
} | |
}, | |
{ | |
"id": 42403, | |
"name": "Escape Room", | |
"slug": "escape-room", | |
"permalink": "https://yoursite.test/product/escape-room/", | |
"date_created": "2018-04-04T13:19:24", | |
"date_created_gmt": "2018-04-04T20:19:24", | |
"date_modified": "2019-03-19T15:37:50", | |
"date_modified_gmt": "2019-03-19T22:37:50", | |
"type": "booking", | |
"status": "publish", | |
"featured": false, | |
"catalog_visibility": "visible", | |
"description": "", | |
"short_description": "", | |
"sku": "", | |
"price": "10", | |
"regular_price": "", | |
"sale_price": "", | |
"date_on_sale_from": null, | |
"date_on_sale_from_gmt": null, | |
"date_on_sale_to": null, | |
"date_on_sale_to_gmt": null, | |
"price_html": "From: <span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">$</span>10.00</span>", | |
"on_sale": false, | |
"purchasable": true, | |
"total_sales": 34, | |
"virtual": true, | |
"downloadable": false, | |
"downloads": [], | |
"download_limit": -1, | |
"download_expiry": -1, | |
"external_url": "", | |
"button_text": "", | |
"tax_status": "taxable", | |
"tax_class": "", | |
"manage_stock": false, | |
"stock_quantity": null, | |
"stock_status": "instock", | |
"backorders": "no", | |
"backorders_allowed": false, | |
"backordered": false, | |
"sold_individually": true, | |
"weight": "", | |
"dimensions": { | |
"length": "", | |
"width": "", | |
"height": "" | |
}, | |
"shipping_required": false, | |
"shipping_taxable": false, | |
"shipping_class": "", | |
"shipping_class_id": 0, | |
"reviews_allowed": true, | |
"average_rating": "0.00", | |
"rating_count": 0, | |
"related_ids": [ | |
65, | |
37, | |
39, | |
70, | |
35 | |
], | |
"upsell_ids": [], | |
"cross_sell_ids": [], | |
"parent_id": 0, | |
"purchase_note": "", | |
"categories": [ | |
{ | |
"id": 484, | |
"name": "Accessories", | |
"slug": "accessories" | |
} | |
], | |
"tags": [], | |
"images": [], | |
"attributes": [], | |
"default_attributes": [], | |
"variations": [], | |
"grouped_products": [], | |
"menu_order": 0, | |
"meta_data": [ | |
{ | |
"id": 794133, | |
"key": "_wc_pre_orders_enabled", | |
"value": "no" | |
}, | |
{ | |
"id": 794134, | |
"key": "_wc_pre_orders_fee", | |
"value": "" | |
}, | |
{ | |
"id": 795245, | |
"key": "_warranty_type", | |
"value": "no_warranty" | |
}, | |
{ | |
"id": 795246, | |
"key": "_warranty_duration", | |
"value": "0" | |
}, | |
{ | |
"id": 795247, | |
"key": "_warranty_unit", | |
"value": "day" | |
}, | |
{ | |
"id": 795252, | |
"key": "_wcpv_product_commission", | |
"value": "" | |
}, | |
{ | |
"id": 795253, | |
"key": "_wcpv_product_default_pass_shipping_tax", | |
"value": "yes" | |
}, | |
{ | |
"id": 1276787, | |
"key": "_wcsquare_disable_sync", | |
"value": "no" | |
}, | |
{ | |
"id": 1282822, | |
"key": "_product_addons", | |
"value": [] | |
}, | |
{ | |
"id": 1282823, | |
"key": "_product_addons_exclude_global", | |
"value": "1" | |
}, | |
{ | |
"id": 1282826, | |
"key": "_wc_booking_resouce_label", | |
"value": "" | |
}, | |
{ | |
"id": 1282827, | |
"key": "_wc_booking_base_cost", | |
"value": "23.17" | |
}, | |
{ | |
"id": 1282828, | |
"key": "_wc_booking_display_cost", | |
"value": "" | |
}, | |
{ | |
"id": 1282830, | |
"key": "_product_addons_old", | |
"value": [ | |
{ | |
"name": "dsfas", | |
"title_format": "label", | |
"description_enable": 0, | |
"description": "", | |
"type": "multiple_choice", | |
"display": "select", | |
"position": 0, | |
"options": [ | |
{ | |
"label": "adsfds", | |
"price": "", | |
"image": "", | |
"price_type": "flat_fee" | |
} | |
], | |
"required": 0, | |
"restrictions": 0, | |
"restrictions_type": "any_text", | |
"adjust_price": 0, | |
"price_type": "flat_fee", | |
"price": 0, | |
"min": 0, | |
"max": 0, | |
"wc_booking_person_qty_multiplier": 0, | |
"wc_booking_block_qty_multiplier": 1, | |
"wc_accommodation_booking_block_qty_multiplier": 1 | |
} | |
] | |
}, | |
{ | |
"id": 1282831, | |
"key": "_product_addons_converted", | |
"value": "yes" | |
}, | |
{ | |
"id": 1331041, | |
"key": "_wc_memberships_use_custom_product_viewing_restricted_message", | |
"value": "no" | |
}, | |
{ | |
"id": 1331042, | |
"key": "_wc_memberships_use_custom_product_purchasing_restricted_message", | |
"value": "no" | |
}, | |
{ | |
"id": 1331043, | |
"key": "_wc_memberships_force_public", | |
"value": "no" | |
}, | |
{ | |
"id": 1331044, | |
"key": "_wc_memberships_exclude_discounts", | |
"value": "no" | |
} | |
], | |
"apply_adjacent_buffer": false, | |
"availability": [], | |
"block_cost": 5, | |
"buffer_period": 0, | |
"calendar_display_mode": "always_visible", | |
"cancel_limit_unit": "month", | |
"cancel_limit": 1, | |
"check_start_block_only": false, | |
"cost": 0, | |
"default_date_availability": "available", | |
"display_cost": "", | |
"duration_type": "customer", | |
"duration_unit": "hour", | |
"duration": 1, | |
"enable_range_picker": false, | |
"first_block_time": "", | |
"has_person_cost_multiplier": true, | |
"has_person_qty_multiplier": true, | |
"has_person_types": true, | |
"has_persons": false, | |
"has_resources": true, | |
"has_restricted_days": "", | |
"max_date": { | |
"value": 12, | |
"unit": "month" | |
}, | |
"max_date_value": 12, | |
"max_date_unit": "month", | |
"max_duration": 1, | |
"max_persons": 6, | |
"min_date": { | |
"value": 1, | |
"unit": "day" | |
}, | |
"min_date_value": 1, | |
"min_date_unit": "day", | |
"min_duration": 1, | |
"min_persons": 0, | |
"person_types": [], | |
"pricing": [], | |
"qty": 1, | |
"requires_confirmation": false, | |
"resource_label": "Rooms", | |
"resource_base_costs": { | |
"121229": "", | |
"145546": "" | |
}, | |
"resource_block_costs": { | |
"121229": "5", | |
"145546": "5" | |
}, | |
"resource_ids": [ | |
121229, | |
145546 | |
], | |
"resources_assignment": "customer", | |
"restricted_days": { | |
"2": "2", | |
"4": "4" | |
}, | |
"can_be_cancelled": false, | |
"_links": { | |
"self": [ | |
{ | |
"href": "https://yoursite.test/wp-json/wc-bookings/v1/products/42403" | |
} | |
], | |
"collection": [ | |
{ | |
"href": "https://yoursite.test/wp-json/wc-bookings/v1/products" | |
} | |
] | |
} | |
} | |
] |
Bookings
↑ Volver al principioBookings Properties
GET /wp-json/wc-bookings/v1/bookings
JSON response example:
https://gist.github.com/woogists/9bd427bdf92e966d7f368355f97e17b2