{
  "openapi": "3.1.0",
  "info": {
    "title": "Actions APIs",
    "description": "Registrar asynchronous actions: list current and archived actions, cancel actions,\nand check whether an action can be cancelled.\n",
    "version": "2.0.0"
  },
  "servers": [
    {
      "url": "https://api.sandbox.resellerclub.com/v2",
      "description": "Sandbox"
    },
    {
      "url": "https://api.resellerclub.com/v2",
      "description": "Live"
    }
  ],
  "security": [
    {
      "apiKeyAuth": [],
      "userIdHeader": []
    }
  ],
  "paths": {
    "/actions/cancel-action": {
      "post": {
        "tags": [
          "APIs"
        ],
        "summary": "Cancel an action",
        "description": "/cancel-action",
        "operationId": "cancellableAction",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancellableActionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CancellableActionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          }
        },
        "x-v2-response-schema": "CancellableActionResponse"
      }
    },
    "/actions/search-current": {
      "get": {
        "tags": [
          "APIs"
        ],
        "summary": "Search current actions",
        "description": "Gets the Current Actions based on the criteria specified.\n\nReturns the operation result.",
        "operationId": "listCurrentActions",
        "parameters": [
          {
            "name": "size",
            "in": "query",
            "description": "Number of records to be returned",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number for which records are required",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "eaqId",
            "in": "query",
            "description": "The Entity Action Queue Ids of the corresponding actions",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "integer",
                "format": "int32"
              }
            }
          },
          {
            "name": "orderId",
            "in": "query",
            "description": "The Order Ids for which you want to search actions",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "integer",
                "format": "int32"
              }
            }
          },
          {
            "name": "entityTypeId",
            "in": "query",
            "description": "The Entity Type Ids for which you want to search actions.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "integer",
                "format": "int32"
              }
            }
          },
          {
            "name": "actionStatus",
            "in": "query",
            "description": "The action statuses for which you want to search actions.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "actionType",
            "in": "query",
            "description": "The action types for which you want to search actions",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "actionCompletedDateStart",
            "in": "query",
            "description": "",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actionCompletedDateEnd",
            "in": "query",
            "description": "",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ListCurrentActionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          }
        },
        "x-v2-response-schema": "ListCurrentActionsResponse"
      }
    },
    "/actions/search-archived": {
      "get": {
        "tags": [
          "APIs"
        ],
        "summary": "Search archived actions",
        "description": "Searches the Archived Actions based on the criteria specified.\n\nReturns the operation result.",
        "operationId": "listArchivedActions",
        "parameters": [
          {
            "name": "size",
            "in": "query",
            "description": "Number of records to be returned",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number for which records are required",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "eaqId",
            "in": "query",
            "description": "The Entity Action Queue Ids of the corresponding actions",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "integer",
                "format": "int32"
              }
            }
          },
          {
            "name": "orderId",
            "in": "query",
            "description": "The Order Ids for which you want to search actions",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "integer",
                "format": "int32"
              }
            }
          },
          {
            "name": "entityTypeId",
            "in": "query",
            "description": "The Entity Type Ids for which you want to search actions",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "integer",
                "format": "int32"
              }
            }
          },
          {
            "name": "actionStatus",
            "in": "query",
            "description": "The action statuses for which you want to search actions",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "actionType",
            "in": "query",
            "description": "The action types for which you want to search actions",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "actionCompletedDateStart",
            "in": "query",
            "description": "",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actionCompletedDateEnd",
            "in": "query",
            "description": "",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ListArchivedActionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          }
        },
        "x-v2-response-schema": "ListArchivedActionsResponse"
      }
    },
    "/actions/is-cancellable": {
      "get": {
        "tags": [
          "APIs"
        ],
        "summary": "Check whether an action is cancellable",
        "description": "/is-cancellable",
        "operationId": "isCancellableAction",
        "parameters": [
          {
            "name": "orderId",
            "in": "query",
            "description": "(required).",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "eaqId",
            "in": "query",
            "description": "(required).",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/IsCancellableActionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          }
        },
        "x-v2-response-schema": "IsCancellableActionResponse"
      }
    }
  },
  "components": {
    "schemas": {
      "GenericResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "customLogMessage": {}
        }
      },
      "CancellableActionRequest": {
        "type": "object",
        "description": "Cancels an action for the given order and entity action queue id.",
        "properties": {
          "orderId": {
            "type": "integer",
            "format": "int32",
            "description": "(required)."
          },
          "eaqId": {
            "type": "integer",
            "format": "int32",
            "description": "(required)."
          }
        },
        "required": [
          "eaqId",
          "orderId"
        ]
      },
      "CancellableActionResponse": {
        "type": "object",
        "description": "Response for cancellableAction.",
        "properties": {
          "value": {
            "type": "boolean",
            "description": "Boolean result from the operation."
          },
          "status": {
            "type": "string",
            "description": "Overall status of the request."
          },
          "message": {
            "type": "string",
            "description": "Error details when the request fails."
          }
        }
      },
      "ActionDto": {
        "type": "object",
        "description": "Nested action entry in search responses (KB 908/909).",
        "properties": {
          "orderId": {
            "type": "string",
            "description": "Order Id."
          },
          "entityTypeId": {
            "type": "string",
            "description": "Entity Type Id."
          },
          "eaqId": {
            "type": "string",
            "description": "Entity Action Queue Id."
          },
          "actionType": {
            "type": "string",
            "description": "Action Type."
          },
          "actionTypeDesc": {
            "type": "string",
            "description": "Description of the Action."
          },
          "actionAdded": {
            "type": "string",
            "description": "Timestamp when the Action was added."
          },
          "actionStarted": {
            "type": "string",
            "description": "Timestamp when the Action started."
          },
          "actionCompleted": {
            "type": "string",
            "description": "Timestamp when the Action got completed."
          },
          "actionStatus": {
            "type": "string",
            "description": "Action Status."
          },
          "actionStatusDesc": {
            "type": "string",
            "description": "Description of the Action Status."
          },
          "priority": {
            "type": "string",
            "description": "Action priority."
          }
        }
      },
      "ListCurrentActionsResponse": {
        "type": "object",
        "description": "Response for listCurrentActions.",
        "properties": {
          "totalItems": {
            "type": "integer",
            "format": "int32",
            "description": "Total items in the result set."
          },
          "itemsOnPage": {
            "type": "integer",
            "format": "int32",
            "description": "Items returned on this page."
          },
          "actions": {
            "type": "array",
            "description": "List of actions matching the search criteria.",
            "items": {
              "$ref": "#/components/schemas/ActionDto"
            }
          }
        }
      },
      "ListArchivedActionsResponse": {
        "type": "object",
        "description": "Response for listArchivedActions.",
        "properties": {
          "totalItems": {
            "type": "integer",
            "format": "int32",
            "description": "Total items in the result set."
          },
          "itemsOnPage": {
            "type": "integer",
            "format": "int32",
            "description": "Items returned on this page."
          },
          "actions": {
            "type": "array",
            "description": "List of actions matching the search criteria.",
            "items": {
              "$ref": "#/components/schemas/ActionDto"
            }
          }
        }
      },
      "IsCancellableActionResponse": {
        "type": "object",
        "description": "Response for isCancellableAction.",
        "properties": {
          "value": {
            "type": "boolean",
            "description": "Boolean result from the operation."
          },
          "status": {
            "type": "string",
            "description": "Overall status of the request."
          },
          "message": {
            "type": "string",
            "description": "Error details when the request fails."
          }
        }
      }
    },
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "apiKey",
        "description": "Reseller API key. In your own requests, send the full header value: Authorization: ApiKey YOUR_API_KEY",
        "name": "Authorization",
        "in": "header"
      },
      "userIdHeader": {
        "type": "apiKey",
        "description": "Reseller user ID",
        "name": "X-User-Id",
        "in": "header"
      }
    }
  },
  "tags": [
    {
      "name": "APIs"
    }
  ]
}