Learn how to batch request from getting products to adding them to the cart
wp-json/cocart/batch
instead.
<cart_key>
that identifies the guest customers cart before sending the request:
GET
, POST
, PUT
, PATCH
, DELETE
GET
requests were never enabled for batching previously, but it works fine.
The main risk with batching GET
endpoints is that it can be expensive to run if too many are called, so use it wisely.cocart_api_batch_request_methods
. An example of disabling GET
requests if you don’t plan on using them in batch requests.