Skip to content

Latest commit

 

History

History
777 lines (564 loc) · 25.7 KB

SelfServeApi.md

File metadata and controls

777 lines (564 loc) · 25.7 KB

SelfServeApi

All URIs are relative to https://sandbox-api.flipkart.net/sellers , https://api.flipkart.net/sellers

Method HTTP request Description
changeDispatchSlots POST /orders/sandbox/update_dispatch_slot Change `dispatch_by_date` and `dispatch_after_date`
createReturn POST /returns/sandbox/create_returns Create courier or customer return
createService POST /v2/shipments/sandbox/create_service/ Create forward or reverse services for drop ship orders
createTestOrders POST /orders/sandbox/test_orders Create test orders
makeOrderUnHold PUT /orders/sandbox/un_hold Mark order un hold
markOrderItemDelivered POST /orders/sandbox/delivered Mark order item as delivered
markOrderItemPickupComplete POST /orders/sandbox/pick_up_complete Mark order item as pick up complete
markOrderItemShipped POST /orders/sandbox/shipped Mark order item as shipped
processReturnEvents POST /returns/sandbox/return_events Process return events
putOrderOnHold PUT /orders/sandbox/on_hold Put order on hold

changeDispatchSlots

CreateCourierReturnResponse changeDispatchSlots(body)

Change `dispatch_by_date` and `dispatch_after_date`

This operation changes dispatch_by_date and dispatch_after_date for a specified order item. Please note dispatch dates should be in IST format. For ex 'dispatch_after_date':'YYYY-MM-DDTHH:MM:SS+05:30'

Example

// Import classes:
package com.flipkart.api.seller.client.client_application;
import com.flipkart.api.seller.client.ApiClient;
import com.flipkart.api.seller.client.ApiException;
import com.flipkart.api.seller.client.Environment;
import com.flipkart.api.seller.client.UrlConfiguration;
import com.flipkart.api.seller.client.access_token_generation.AccessTokenGenerator;
import com.flipkart.api.seller.client.api.SelfServeApi;
import com.flipkart.api.seller.client.model.CreateCourierReturnResponse;
import com.flipkart.api.seller.client.model.CreateTestOrdersRequest;

public class MyFlipkartApplication {

  public static void main(String[] args) {

    //Access Token Generation
    AccessTokenGenerator accessTokenGenerator = new AccessTokenGenerator();

    //choose environment SANDBOX or PROD
    String env = String.valueOf(Environment.SANDBOX);
    UrlConfiguration urlConfiguration = new UrlConfiguration(env);

    //Replace the below values with your client id and client secret here
    accessTokenGenerator.clientCredentials("__client_id__",
        "__client_secret__");
    String accessToken = AccessTokenGenerator.getClientCredentialsAccessToken();
    System.out.println("Your Access Token: " + accessToken);

    //client call
    ApiClient apiClient = new ApiClient();
    apiClient.setAccessToken(accessToken);

    SelfServeApi apiInstance = new SelfServeApi(apiClient);
    CreateTestOrdersRequest body = new CreateTestOrdersRequest(); // CreateTestOrdersRequest |
    try {
      CreateCourierReturnResponse result = apiInstance.changeDispatchSlots(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SelfServeApi#changeDispatchSlots");
      e.printStackTrace();
    }


  }
}

Parameters

Name Type Description Notes
body CreateTestOrdersRequest

Return type

CreateCourierReturnResponse

Authorization

Oauth2SelfAccess

HTTP request headers

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

createReturn

CreateCourierReturnResponse createReturn(body)

Create courier or customer return

This operation creates return for order in post dispatch state. The return type can be courier or customer

Example

// Import classes:
package com.flipkart.api.seller.client.client_application;
import com.flipkart.api.seller.client.ApiClient;
import com.flipkart.api.seller.client.ApiException;
import com.flipkart.api.seller.client.Environment;
import com.flipkart.api.seller.client.UrlConfiguration;
import com.flipkart.api.seller.client.access_token_generation.AccessTokenGenerator;
import com.flipkart.api.seller.client.api.SelfServeApi;
import com.flipkart.api.seller.client.model.CreateCourierReturnRequest;
import com.flipkart.api.seller.client.model.CreateCourierReturnResponse;

public class MyFlipkartApplication {

  public static void main(String[] args) {

    //Access Token Generation
    AccessTokenGenerator accessTokenGenerator = new AccessTokenGenerator();

    //choose environment SANDBOX or PROD
    String env = String.valueOf(Environment.SANDBOX);
    UrlConfiguration urlConfiguration = new UrlConfiguration(env);

    //Replace the below values with your client id and client secret here
    accessTokenGenerator.clientCredentials("__client_id__",
        "__client_secret__");
    String accessToken = AccessTokenGenerator.getClientCredentialsAccessToken();
    System.out.println("Your Access Token: " + accessToken);

    //client call
    ApiClient apiClient = new ApiClient();
    apiClient.setAccessToken(accessToken);

    SelfServeApi apiInstance = new SelfServeApi(apiClient);
    CreateCourierReturnRequest body = new CreateCourierReturnRequest(); // CreateCourierReturnRequest |
    try {
      CreateCourierReturnResponse result = apiInstance.createReturn(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SelfServeApi#createReturn");
      e.printStackTrace();
    }


  }
}

Parameters

Name Type Description Notes
body CreateCourierReturnRequest

Return type

CreateCourierReturnResponse

Authorization

Oauth2SelfAccess

HTTP request headers

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

createService

CreateCourierReturnResponse createService(body)

Create forward or reverse services for drop ship orders

This operation creates forward or reverse services for self ship order items. PS: Order items should be of type self ship. serviceType field should be either 'FORWARD' or 'REVERSE'

Example

// Import classes:
package com.flipkart.api.seller.client.client_application;
import com.flipkart.api.seller.client.ApiClient;
import com.flipkart.api.seller.client.ApiException;
import com.flipkart.api.seller.client.Environment;
import com.flipkart.api.seller.client.UrlConfiguration;
import com.flipkart.api.seller.client.access_token_generation.AccessTokenGenerator;
import com.flipkart.api.seller.client.api.SelfServeApi;
import com.flipkart.api.seller.client.model.CreateCourierReturnResponse;
import com.flipkart.api.seller.client.model.CreateService;

public class MyFlipkartApplication {

  public static void main(String[] args) {

    //Access Token Generation
    AccessTokenGenerator accessTokenGenerator = new AccessTokenGenerator();

    //choose environment SANDBOX or PROD
    String env = String.valueOf(Environment.SANDBOX);
    UrlConfiguration urlConfiguration = new UrlConfiguration(env);

    //Replace the below values with your client id and client secret here
    accessTokenGenerator.clientCredentials("__client_id__",
        "__client_secret__");
    String accessToken = AccessTokenGenerator.getClientCredentialsAccessToken();
    System.out.println("Your Access Token: " + accessToken);

    //client call
    ApiClient apiClient = new ApiClient();
    apiClient.setAccessToken(accessToken);

    SelfServeApi apiInstance = new SelfServeApi(apiClient);
    CreateService body = new CreateService(); // CreateService |
    try {
      CreateCourierReturnResponse result = apiInstance.createService(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SelfServeApi#createService");
      e.printStackTrace();
    }


  }
}

Parameters

Name Type Description Notes
body CreateService

Return type

CreateCourierReturnResponse

Authorization

Oauth2SelfAccess

HTTP request headers

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

createTestOrders

CreateTestOrdersResponse createTestOrders(body)

Create test orders

This operation creates test orders in sandbox

Example

// Import classes:
package com.flipkart.api.seller.client.client_application;
import com.flipkart.api.seller.client.ApiClient;
import com.flipkart.api.seller.client.ApiException;
import com.flipkart.api.seller.client.Environment;
import com.flipkart.api.seller.client.UrlConfiguration;
import com.flipkart.api.seller.client.access_token_generation.AccessTokenGenerator;
import com.flipkart.api.seller.client.api.SelfServeApi;
import com.flipkart.api.seller.client.model.CreateTestOrdersRequest;
import com.flipkart.api.seller.client.model.CreateTestOrdersResponse;

public class MyFlipkartApplication {

  public static void main(String[] args) {

    //Access Token Generation
    AccessTokenGenerator accessTokenGenerator = new AccessTokenGenerator();

    //choose environment SANDBOX or PROD
    String env = String.valueOf(Environment.SANDBOX);
    UrlConfiguration urlConfiguration = new UrlConfiguration(env);

    //Replace the below values with your client id and client secret here
    accessTokenGenerator.clientCredentials("__client_id__",
        "__client_secret__");
    String accessToken = AccessTokenGenerator.getClientCredentialsAccessToken();
    System.out.println("Your Access Token: " + accessToken);

    //client call
    ApiClient apiClient = new ApiClient();
    apiClient.setAccessToken(accessToken);

    SelfServeApi apiInstance = new SelfServeApi(apiClient);
    CreateTestOrdersRequest body = new CreateTestOrdersRequest(); // CreateTestOrdersRequest | 
    try {
      CreateTestOrdersResponse result = apiInstance.createTestOrders(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SelfServeApi#createTestOrders");
      e.printStackTrace();
    }



  }
}

Parameters

Name Type Description Notes
body CreateTestOrdersRequest

Return type

CreateTestOrdersResponse

Authorization

Oauth2SelfAccess

HTTP request headers

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

makeOrderUnHold

CreateCourierReturnResponse makeOrderUnHold(body)

Mark order un hold

This operation makes specified order item un hold from on hold

Example

// Import classes:
package com.flipkart.api.seller.client.client_application;
import com.flipkart.api.seller.client.ApiClient;
import com.flipkart.api.seller.client.ApiException;
import com.flipkart.api.seller.client.Environment;
import com.flipkart.api.seller.client.UrlConfiguration;
import com.flipkart.api.seller.client.access_token_generation.AccessTokenGenerator;
import com.flipkart.api.seller.client.api.SelfServeApi;
import com.flipkart.api.seller.client.model.CreateCourierReturnResponse;
import com.flipkart.api.seller.client.model.MakeOrderUnHold;

public class MyFlipkartApplication {

  public static void main(String[] args) {

    //Access Token Generation
    AccessTokenGenerator accessTokenGenerator = new AccessTokenGenerator();

    //choose environment SANDBOX or PROD
    String env = String.valueOf(Environment.SANDBOX);
    UrlConfiguration urlConfiguration = new UrlConfiguration(env);

    //Replace the below values with your client id and client secret here
    accessTokenGenerator.clientCredentials("__client_id__",
        "__client_secret__");
    String accessToken = AccessTokenGenerator.getClientCredentialsAccessToken();
    System.out.println("Your Access Token: " + accessToken);

    //client call
    ApiClient apiClient = new ApiClient();
    apiClient.setAccessToken(accessToken);

    SelfServeApi apiInstance = new SelfServeApi(apiClient);
    MakeOrderUnHold body = new MakeOrderUnHold(); // MakeOrderUnHold |
    try {
      CreateCourierReturnResponse result = apiInstance.makeOrderUnHold(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SelfServeApi#makeOrderUnHold");
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
body MakeOrderUnHold

Return type

CreateCourierReturnResponse

Authorization

Oauth2SelfAccess

HTTP request headers

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

markOrderItemDelivered

CreateCourierReturnResponse markOrderItemDelivered(body)

Mark order item as delivered

This operation marks specified order item delivered and sends notification for the same

Example

// Import classes:
package com.flipkart.api.seller.client.client_application;
import com.flipkart.api.seller.client.ApiClient;
import com.flipkart.api.seller.client.ApiException;
import com.flipkart.api.seller.client.Environment;
import com.flipkart.api.seller.client.UrlConfiguration;
import com.flipkart.api.seller.client.access_token_generation.AccessTokenGenerator;
import com.flipkart.api.seller.client.api.SelfServeApi;
import com.flipkart.api.seller.client.model.CreateCourierReturnResponse;
import com.flipkart.api.seller.client.model.MarkOrderItemDelivered;

public class MyFlipkartApplication {

  public static void main(String[] args) {

    //Access Token Generation
    AccessTokenGenerator accessTokenGenerator = new AccessTokenGenerator();

    //choose environment SANDBOX or PROD
    String env = String.valueOf(Environment.SANDBOX);
    UrlConfiguration urlConfiguration = new UrlConfiguration(env);

    //Replace the below values with your client id and client secret here
    accessTokenGenerator.clientCredentials("__client_id__",
        "__client_secret__");
    String accessToken = AccessTokenGenerator.getClientCredentialsAccessToken();
    System.out.println("Your Access Token: " + accessToken);

    //client call
    ApiClient apiClient = new ApiClient();
    apiClient.setAccessToken(accessToken);

    SelfServeApi apiInstance = new SelfServeApi(apiClient);
    MarkOrderItemDelivered body = new MarkOrderItemDelivered(); // MarkOrderItemDelivered |
    try {
      CreateCourierReturnResponse result = apiInstance.markOrderItemDelivered(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SelfServeApi#markOrderItemDelivered");
      e.printStackTrace();
    }

  }
}

Parameters

Name Type Description Notes
body MarkOrderItemDelivered

Return type

CreateCourierReturnResponse

Authorization

Oauth2SelfAccess

HTTP request headers

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

markOrderItemPickupComplete

CreateCourierReturnResponse markOrderItemPickupComplete(body)

Mark order item as pick up complete

This operation marks specified order item pick up complete and sends notification for the same

Example

// Import classes:
package com.flipkart.api.seller.client.client_application;
import com.flipkart.api.seller.client.ApiClient;
import com.flipkart.api.seller.client.ApiException;
import com.flipkart.api.seller.client.Environment;
import com.flipkart.api.seller.client.UrlConfiguration;
import com.flipkart.api.seller.client.access_token_generation.AccessTokenGenerator;
import com.flipkart.api.seller.client.api.SelfServeApi;
import com.flipkart.api.seller.client.model.CreateCourierReturnResponse;
import com.flipkart.api.seller.client.model.MarkOrderItemPickupComplete;

public class MyFlipkartApplication {

  public static void main(String[] args) {

    //Access Token Generation
    AccessTokenGenerator accessTokenGenerator = new AccessTokenGenerator();

    //choose environment SANDBOX or PROD
    String env = String.valueOf(Environment.SANDBOX);
    UrlConfiguration urlConfiguration = new UrlConfiguration(env);

    //Replace the below values with your client id and client secret here
    accessTokenGenerator.clientCredentials("__client_id__",
        "__client_secret__");
    String accessToken = AccessTokenGenerator.getClientCredentialsAccessToken();
    System.out.println("Your Access Token: " + accessToken);

    //client call
    ApiClient apiClient = new ApiClient();
    apiClient.setAccessToken(accessToken);

    SelfServeApi apiInstance = new SelfServeApi(apiClient);
    MarkOrderItemPickupComplete body = new MarkOrderItemPickupComplete(); // MarkOrderItemPickupComplete |
    try {
      CreateCourierReturnResponse result = apiInstance.markOrderItemPickupComplete(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SelfServeApi#markOrderItemPickupComplete");
      e.printStackTrace();
    }

  }
}

Parameters

Name Type Description Notes
body MarkOrderItemPickupComplete

Return type

CreateCourierReturnResponse

Authorization

Oauth2SelfAccess

HTTP request headers

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

markOrderItemShipped

CreateCourierReturnResponse markOrderItemShipped(body)

Mark order item as shipped

This operation marks specified order item shipped and sends notification for the same

Example

// Import classes:
package com.flipkart.api.seller.client.client_application;
import com.flipkart.api.seller.client.ApiClient;
import com.flipkart.api.seller.client.ApiException;
import com.flipkart.api.seller.client.Environment;
import com.flipkart.api.seller.client.UrlConfiguration;
import com.flipkart.api.seller.client.access_token_generation.AccessTokenGenerator;
import com.flipkart.api.seller.client.api.SelfServeApi;
import com.flipkart.api.seller.client.model.CreateCourierReturnResponse;
import com.flipkart.api.seller.client.model.MarkOrderItemShipped;

public class MyFlipkartApplication {

  public static void main(String[] args) {

    //Access Token Generation
    AccessTokenGenerator accessTokenGenerator = new AccessTokenGenerator();

    //choose environment SANDBOX or PROD
    String env = String.valueOf(Environment.SANDBOX);
    UrlConfiguration urlConfiguration = new UrlConfiguration(env);

    //Replace the below values with your client id and client secret here
    accessTokenGenerator.clientCredentials("__client_id__",
        "__client_secret__");
    String accessToken = AccessTokenGenerator.getClientCredentialsAccessToken();
    System.out.println("Your Access Token: " + accessToken);

    //client call
    ApiClient apiClient = new ApiClient();
    apiClient.setAccessToken(accessToken);

    SelfServeApi apiInstance = new SelfServeApi(apiClient);
    MarkOrderItemShipped body = new MarkOrderItemShipped(); // MarkOrderItemShipped |
    try {
      CreateCourierReturnResponse result = apiInstance.markOrderItemShipped(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SelfServeApi#markOrderItemShipped");
      e.printStackTrace();
    }

  }
}

Parameters

Name Type Description Notes
body MarkOrderItemShipped

Return type

CreateCourierReturnResponse

Authorization

Oauth2SelfAccess

HTTP request headers

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

processReturnEvents

CreateCourierReturnResponse processReturnEvents(body)

Process return events

This operation marks return completed or cancelled and sends notification for the same

Example

// Import classes:
package com.flipkart.api.seller.client.client_application;
import com.flipkart.api.seller.client.ApiClient;
import com.flipkart.api.seller.client.ApiException;
import com.flipkart.api.seller.client.Environment;
import com.flipkart.api.seller.client.UrlConfiguration;
import com.flipkart.api.seller.client.access_token_generation.AccessTokenGenerator;
import com.flipkart.api.seller.client.api.SelfServeApi;
import com.flipkart.api.seller.client.model.CreateCourierReturnResponse;
import com.flipkart.api.seller.client.model.ProcessReturnEvents;

public class MyFlipkartApplication {

  public static void main(String[] args) {

    //Access Token Generation
    AccessTokenGenerator accessTokenGenerator = new AccessTokenGenerator();

    //choose environment SANDBOX or PROD
    String env = String.valueOf(Environment.SANDBOX);
    UrlConfiguration urlConfiguration = new UrlConfiguration(env);

    //Replace the below values with your client id and client secret here
    accessTokenGenerator.clientCredentials("__client_id__",
        "__client_secret__");
    String accessToken = AccessTokenGenerator.getClientCredentialsAccessToken();
    System.out.println("Your Access Token: " + accessToken);

    //client call
    ApiClient apiClient = new ApiClient();
    apiClient.setAccessToken(accessToken);

    SelfServeApi apiInstance = new SelfServeApi(apiClient);
    ProcessReturnEvents body = new ProcessReturnEvents(); // ProcessReturnEvents |
    try {
      CreateCourierReturnResponse result = apiInstance.processReturnEvents(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SelfServeApi#processReturnEvents");
      e.printStackTrace();
    }

  }
}

Parameters

Name Type Description Notes
body ProcessReturnEvents

Return type

CreateCourierReturnResponse

Authorization

Oauth2SelfAccess

HTTP request headers

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

putOrderOnHold

CreateCourierReturnResponse putOrderOnHold(body)

Put order on hold

This operation puts specified order item on hold and sends notification for the same

Example

// Import classes:
package com.flipkart.api.seller.client.client_application;
import com.flipkart.api.seller.client.ApiClient;
import com.flipkart.api.seller.client.ApiException;
import com.flipkart.api.seller.client.Environment;
import com.flipkart.api.seller.client.UrlConfiguration;
import com.flipkart.api.seller.client.access_token_generation.AccessTokenGenerator;
import com.flipkart.api.seller.client.api.SelfServeApi;
import com.flipkart.api.seller.client.model.CreateCourierReturnResponse;
import com.flipkart.api.seller.client.model.PutOrderOnHold;

public class MyFlipkartApplication {

  public static void main(String[] args) {

    //Access Token Generation
    AccessTokenGenerator accessTokenGenerator = new AccessTokenGenerator();

    //choose environment SANDBOX or PROD
    String env = String.valueOf(Environment.SANDBOX);
    UrlConfiguration urlConfiguration = new UrlConfiguration(env);

    //Replace the below values with your client id and client secret here
    accessTokenGenerator.clientCredentials("__client_id__",
        "__client_secret__");
    String accessToken = AccessTokenGenerator.getClientCredentialsAccessToken();
    System.out.println("Your Access Token: " + accessToken);

    //client call
    ApiClient apiClient = new ApiClient();
    apiClient.setAccessToken(accessToken);

    SelfServeApi apiInstance = new SelfServeApi(apiClient);
    PutOrderOnHold body = new PutOrderOnHold(); // PutOrderOnHold |
    try {
      CreateCourierReturnResponse result = apiInstance.putOrderOnHold(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SelfServeApi#putOrderOnHold");
      e.printStackTrace();
    }

  }
}

Parameters

Name Type Description Notes
body PutOrderOnHold

Return type

CreateCourierReturnResponse

Authorization

Oauth2SelfAccess

HTTP request headers

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