All URIs are relative to https://partner-api.grab.com/grabfood-sandbox
Method | HTTP request | Description |
---|---|---|
cancel_order | PUT /partner/v1/order/cancel | Cancel an order |
CancelOrderResponse cancel_order(content_type, authorization, cancel_order_request)
Cancel an order
import grabfood
from grabfood.models.cancel_order_request import CancelOrderRequest
from grabfood.models.cancel_order_response import CancelOrderResponse
from grabfood.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://partner-api.grab.com/grabfood-sandbox
# See configuration.py for a list of all supported configuration parameters.
configuration = grabfood.Configuration(
host = "https://partner-api.grab.com/grabfood-sandbox"
)
# Enter a context with an instance of the API client
with grabfood.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = grabfood.CancelOrderApi(api_client)
content_type = 'application/json' # str | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats.
authorization = 'Bearer <ACCESS_TOKEN_HERE>' # str | Specify the generated authorization token of the bearer type.
cancel_order_request = grabfood.CancelOrderRequest() # CancelOrderRequest |
try:
# Cancel an order
api_response = api_instance.cancel_order(content_type, authorization, cancel_order_request)
print("The response of CancelOrderApi->cancel_order:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling CancelOrderApi->cancel_order: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
content_type | str | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. | |
authorization | str | Specify the generated authorization token of the bearer type. | |
cancel_order_request | CancelOrderRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | The API request is successfully processed. | - |
400 | invalid_argument | - |
403 | This request is forbidden. For each 403 HTTP response, a detailed reason will be returned. | Type |
404 | not_found | - |
409 | conflict | - |
500 | 5XX error codes are rare and indicate that GrabFood is facing an internal server error. This type of error is applicable to all HTTP response codes in the 500 range, e.g. 500, 504. Retry the operation at a later time with a unique ID. Use an exponential backoff retry mechanism to resend the requests at an increasingly slower interval. It is also a good practice to use a randomized delay (jitter) in your retry schedule. | Type |
[Back to top] [Back to API list] [Back to Model list] [Back to README]