.. _returnsendotc-label: POST /v3/returns/otc/end/details -------------------------------- **Description** - When the Generate End OTC is clicked, the summary of the scanned shipments with statistics, as well as the End OTC, is shown. The same information can be fetched using the End OTC API as well. After the End OTC has been verified by the FE, the returnCompleted order event notification will get pushed by the Order Management Notification Service. **Purpose:** End the OTC session and get a summary of scanned shipments with statistics. .. warning:: **Critical Requirements:** - All shipments must be synced before ending End OTC - FE must be on the End OTC page (not actively scanning) - FE cannot go back from End OTC to Scanning again Request and Response Parameters ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. container:: toggle .. container:: header **☰ SHOW | HIDE** **URL:** ``https://api.flipkart.net/sellers/v3/returns/otc/end/details`` **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 | +======================+=============+==============+======================================+ |``feId`` |String |Mandatory |Field Executive identifier | +----------------------+-------------+--------------+--------------------------------------+ |``taskId`` |String |Mandatory |Task identifier | +----------------------+-------------+--------------+--------------------------------------+ |``taskType`` |String |Mandatory |Task type. Must be ``RETURN`` | +----------------------+-------------+--------------+--------------------------------------+ **Sample Request** .. code-block:: json { "feId": "fe12303", "taskId": "123", "taskType": "RETURN" } **Response Body Parameters (Success - 200 OK)** +-------------------------------------+--------+---------------------------------------------+ | Parameter/Attribute | Type | Description | +=====================================+========+=============================================+ | ``otc`` | String | One-time code for End OTC | +-------------------------------------+--------+---------------------------------------------+ | ``totalScanned`` | Integer| Total number of shipments scanned | +-------------------------------------+--------+---------------------------------------------+ | ``obdEligible`` | Integer| Number of OBD eligible shipments | +-------------------------------------+--------+---------------------------------------------+ | ``obdFailed`` | Integer| Number of OBD failed shipments | +-------------------------------------+--------+---------------------------------------------+ | ``flyerEligible`` | Integer| Number of flyer eligible shipments | +-------------------------------------+--------+---------------------------------------------+ | ``flyerFailed`` | Integer| Number of flyer failed shipments | +-------------------------------------+--------+---------------------------------------------+ **Sample Response (Success - 200 OK)** .. code-block:: json { "otc": "123456", "totalScanned": 120, "obdEligible": 15, "obdFailed": 2, "flyerEligible": 12, "flyerFailed": 1 } **Possible Error Response Codes** ======================================= ========================= Error Codes Reason for Error ======================================= ========================= ``SHIPMENT_SYNC_ERROR`` Not all shipments are synced ``NOT_ON_END_OTC_PAGE_ERROR`` Not on End OTC Page, still scanning ``TRIPSHEET_TASK_NOT_FOUND`` No RETURN task found for seller ``INVALID_TASK_TYPE_ERROR`` Task type is not Return ``FE_OTC_BAD_REQUEST_ERROR`` FE ID is incorrect or doesn't exist ``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 ======================================= ========================= | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |