POST /v3/returns/tasks/initial-load

Description - The Initial Page Load API is specifically designed to execute only when the system detects shipments scheduled for delivery today. This API serves a foundational purpose by fetching essential core identifiers, such as feId and taskId, along with other necessary details. Crucially, the API also retrieves configuration data that is subsequently utilised in the workflow to determine if the Generate Start OTC button should be visible or hidden on the dashboard, based on the enabled configuration settings.

Purpose: Get the initial state of return tasks for a seller location.

Important

This API only returns FEs that are currently on the Start OTC page, End OTC page, or Scanning. It does NOT return FEs that haven’t arrived yet or have completed their task.

Request and Response Parameters

☰ SHOW | HIDE

URL: https://api.flipkart.net/sellers/v3/returns/tasks/initial-load

Request Header Parameters

Parameter Type Requirement Description
Content-Type String Mandatory Must be application/json
Authorization String Mandatory Bearer token for authentication

Request Body Parameters

Parameter Type Requirement Description
sellerLocationId String Mandatory Seller location identifier
taskType String Mandatory Task type. Must be RETURN

Sample Request

{
  "sellerLocationId": "LOC1",
  "taskType": "RETURN"
}

Response Body Parameters (Success - 200 OK)

Parameter/Attribute Type Description
sellerConfig Object Seller configuration details
sellerConfig.enabledFor String OTC flow configuration. Possible values: OldStatic, NewStatic, DynamicStartEnd, DynamicEnd
feDetails Object Field Executive details
feDetails.{feId}.feName String Field Executive name
feDetails.{feId}.logisticPartner String Logistics partner (e.g., eKart)
feDetails.{feId}.lob String Line of Business. Values: LARGE or NONLARGE
feDetails.{feId}.task Object Task details
feDetails.{feId}.task.id String Task identifier
feDetails.{feId}.task.status String Task status (e.g., Scanning). Refer to Returns API - Seller integration document
feDetails.{feId}.task.createdAt Long Task creation timestamp (Unix timestamp)

Sample Response (Success - 200 OK)

{
  "sellerConfig": {
    "enabledFor": "OldStatic | NewStatic | DynamicStartEnd | DynamicEnd"
  },
  "feDetails": {
    "fe12303": {
      "feName": "Ram",
      "logisticPartner": "eKart",
      "lob": "LARGE | NONLARGE",
      "task": {
        "id": "123",
        "status": "Scanning",
        "createdAt": 1873193801
      }
    }
  }
}

Possible Error Response Codes

Error Codes Reason for Error
TRIPSHEET_TASK_NOT_FOUND No RETURN task found for seller
INVALID_TASK_TYPE_ERROR Task type is not RETURN
UNAUTHORIZED_ERROR Authentication failed
INTERNAL_SERVER_ERROR Internal server error
BAD_GATEWAY_ERROR Bad gateway error
SERVICE_UNAVAILABLE_ERROR Service unavailable
GATEWAY_TIMEOUT_ERROR Gateway timeout