1. Home
  2. Order Delivery Date Pro For WooCommerce
  3. REST API Documentation

REST API Documentation

In the upcoming version 9.27.0 of Order delivery date, we have added new REST API endpoints. We have used REST API in place of ajax calls in the plugin.

These endpoints can also be used for custom changes in the plugin or for use in external apps. The endpoints created are used to access some data from the plugin. These endpoints can be used to fetch the settings, available time slots and number of dates.

API Endpoints:

1. /wp-json/orddd/v1/delivery_schedule/<setting id>:

This endpoint is used to fetch the general or custom settings. The setting id is the custom settings row id (this is the row_id parameter on the edit custom settings page ) and 0 for general settings.  It will return all the settings related to that setting id.

For example – to fetch the custom settings with id 33 we would use – http://tychesoftwares.local/wp-json/orddd/v1/delivery_schedule/33

 

2. /wp-json/orddd/v1/delivery_schedule/?mode=shipping_method&shipping_method=<method id>:

This endpoint will return all the custom settings for the given shipping method. The method id will be the name of shipping method and instance id from the shipping zone. If the method id is not mentioned then all the settings related to shipping methods will be returned. For example – if the custom settings is created for Free shipping, then we will use –

/wp-json/orddd/v1/delivery_schedule/?mode=shipping_method&shipping_method=free_shipping:21

 

3. /wp-json/orddd/v1/delivery_schedule/?mode=category&category=<category slug>:

This endpoint will return all the custom settings for the given product category with the given category slug. If there are multiple settings for a category then all of them will be returned.

For example: To get the custom settings for category Accessories, we will use /wp-json/orddd/v1/delivery_schedule/?mode=category&category=accessories

where ‘accessories’ is the category slug.

 

4. /wp-json/orddd/v1/delivery_schedule/?mode=category&category=<category slug>&shipping_method=<method id>:

This endpoint will return all the custom settings related to a category & shipping method. Fox example, to get the settings for the Accessories category & Free shipping method, we will use /wp-json/orddd/v1/delivery_schedule/?mode=category&category=accessories&shipping_method=<method id>

 

5. /wp-json/orddd/v1/delivery_schedule/?mode=pickup_location&pickup_location=<location id>:

This endpoint will return all the custom settings related to a pickup location with the given Pickup Location ID. If the location id is not mentioned, then all the settings related to the pickup locations will be returned.

 

6. /wp-json/orddd/v1/delivery_schedule/?mode=pickup_location&pickup_location=<location id>&category=<category slug>:

This endpoint will return all the custom settings related to a pickup location with the given Pickup Location ID and the category.

 

7. /wp-json/orddd/v1/delivery_schedule/<setting id>?date=YYYY-MM-DD

This endpoint will return all the available time slots for the custom setting related to the setting ID.  For example. if we want all the available time slots for 8th July 2021 for the custom setting 33, then we will use – /wp-json/orddd/v1/delivery_schedule/33?date=2021-07-08

 

8. /wp-json/orddd/v1/delivery_schedule/<setting id>?number_of_dates=<number>:

This endpoint will return the next X number of available dates. If we want the next 10 available dates, then use – /wp-json/orddd/v1/delivery_schedule/33?number_of_dates=10

 

9. /wp-json/orddd/v1/delivery_schedule/?date=<YYYY-MM-DD>&ids=<settings id 1>,<setting id 2>:

This endpoint will return common timeslots from the multiple setting ids provided. This is used specifically when common settings are applied with 2 or more categories or shipping classes.

 

 

 

 

 

 

 

 

Was this article helpful to you? Yes No

How can we help?