Skip to content

Latest commit

 

History

History
147 lines (115 loc) · 14.9 KB

File metadata and controls

147 lines (115 loc) · 14.9 KB

EditOrderApi

All URIs are relative to https://partner-api.grab.com/grabfood-sandbox

Method HTTP request Description
editOrderV1 PUT /partner/v1/orders/{orderID} Edit Order V1
editOrderV2 PUT /partner/v2/orders/{orderID} Edit Order V2

editOrderV1

editOrderV1(contentType, authorization, orderID, editOrderRequest)

Edit Order V1

Example

// 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.EditOrderApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://partner-api.grab.com/grabfood-sandbox");

    EditOrderApi apiInstance = new EditOrderApi(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.
    String orderID = "orderID_example"; // String | 
    EditOrderRequest editOrderRequest = new EditOrderRequest(); // EditOrderRequest | 
    try {
      apiInstance.editOrderV1(contentType, authorization, orderID, editOrderRequest);
    } catch (ApiException e) {
      System.err.println("Exception when calling EditOrderApi#editOrderV1");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

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.
orderID String
editOrderRequest EditOrderRequest

Return type

null (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 Successful. No content returned. -
400 invalid_argument Code
403 forbidden Code
404 not_found Code

editOrderV2

EditOrderV2Response editOrderV2(contentType, authorization, orderID, editOrderRequest)

Edit Order V2

Example

// 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.EditOrderApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://partner-api.grab.com/grabfood-sandbox");

    EditOrderApi apiInstance = new EditOrderApi(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.
    String orderID = "orderID_example"; // String | 
    EditOrderRequest editOrderRequest = new EditOrderRequest(); // EditOrderRequest | 
    try {
      EditOrderV2Response result = apiInstance.editOrderV2(contentType, authorization, orderID, editOrderRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling EditOrderApi#editOrderV2");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

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.
orderID String
editOrderRequest EditOrderRequest

Return type

EditOrderV2Response

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The API request is successfully processed. -
400 invalid_argument Code
403 forbidden Code
404 not_found Code