All URIs are relative to https://partner-api.stg-myteksi.com/grabfood-sandbox
Method | HTTP request | Description |
---|---|---|
cancelOrder | PUT /partner/v1/order/cancel | Cancel an order |
CancelOrderResponse cancelOrder(contentType, authorization, cancelOrderRequest)
Cancel an order
// Import classes:
import com.grab.grabfood.client.ApiClient;
import com.grab.grabfood.client.ApiException;
import com.grab.grabfood.client.Configuration;
import com.grab.grabfood.client.models.*;
import com.grab.grabfood.client.api.CancelOrderApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://partner-api.stg-myteksi.com/grabfood-sandbox");
CancelOrderApi apiInstance = new CancelOrderApi(defaultClient);
String contentType = "application/json"; // String | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats.
String authorization = "Bearer <ACCESS_TOKEN_HERE>"; // String | Specify the generated authorization token of the bearer type.
CancelOrderRequest cancelOrderRequest = new CancelOrderRequest(); // CancelOrderRequest |
try {
CancelOrderResponse result = apiInstance.cancelOrder(contentType, authorization, cancelOrderRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CancelOrderApi#cancelOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
contentType | String | 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 | String | Specify the generated authorization token of the bearer type. | |
cancelOrderRequest | 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 |