{
  "openapi": "3.0.4",
  "info": {
    "title": "Abcorp API Fulfillment Documentation",
    "version": "v1"
  },
  "paths": {
    "/api/perso/order/details": {
      "post": {
        "tags": [
          "Order Details"
        ],
        "summary": "Get order item details",
        "description": "Use any number of fields under the searchFields object to find the intended card information of one or more cards at a time. Your customer unique ID will be custom to you.",
        "operationId": "Perso_OrderDetails",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { },
              "example": {
                "searchFields": {
                  "cardholder": "Annette Smith",
                  "pan": "9876",
                  "work order": "WO99MOCK35BS",
                  "input file name": "datafile20250829.txt",
                  "CUSTOMER UNIQUE ID": "ZZ112233"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                },
                "example": {
                  "data": [
                    {
                      "cardholder": "Annette Smith",
                      "pan": "9876",
                      "work Order": "WO99MOCK35BS",
                      "status": "Pending",
                      "pull Reference No": "P7GQNIO979JJ",
                      "pull Type": "PullAndForward",
                      "pull Status": "Pending",
                      "pull Comments": "User submitted remark",
                      "pull Details": {
                        "expectedDateTime": "2025-08-29T04:00:00Z",
                        "rushForwardRequested": false,
                        "shippingDetail": {
                          "companyName": "ABCorp",
                          "attentionTo": "Annette Smith",
                          "address1": "225 Rivermoor St",
                          "address2": "",
                          "address3": "",
                          "locality": "Boston",
                          "region": "MA",
                          "postcode": "2132",
                          "countryCode": "US",
                          "email": "annette.smith@abcorp.com",
                          "phone": "4013334444"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                },
                "example": {
                  "message": "Authorization has been denied for this request"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "message": "Forbidden"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                },
                "example": {
                  "message": "No orders were found using the given filters"
                }
              }
            }
          }
        }
      }
    },
    "/api/perso/order/actions/cancel/{refNo}": {
      "post": {
        "tags": [
          "Order Actions"
        ],
        "summary": "Cancel a pull request.",
        "description": "Cancels a pull request with the reference number given. If no active pull request is found, returns error 400. Subject to time restraints.",
        "operationId": "Perso_CancelRecord",
        "parameters": [
          {
            "name": "refNo",
            "in": "path",
            "description": "Perso reference number to cancel",
            "required": true,
            "schema": {
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cancel request proxied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                },
                "example": {
                  "status": "accepted",
                  "refNo": "2031258576043",
                  "message": "Cancel request forwarded to Perso"
                }
              }
            }
          },
          "401": {
            "description": "JWT missing/invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "message": "Authorization has been denied for this request"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "message": "Forbidden"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "example": {
                  "message": "No pull requests were found with the given reference ID"
                }
              }
            }
          }
        }
      }
    },
    "/api/perso/order/actions/pull-single": {
      "post": {
        "tags": [
          "Order Actions"
        ],
        "summary": "Create a pull request for a single card, found through filters.",
        "description": "Use the search fields provided (see /api/perso/order/details) to find a single card to create a pull request. Pulls can either be PullAndDestroy, PullAndForward, or PullAndRush. If more than one card order is found, the request will be rejected until more filters are used to specify a single item. If no items are found with the given filters, or the item that exists already has an active pull request, returns error 400. Subject to time restraints.",
        "operationId": "Perso_PullSingle",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { },
              "example": {
                "searchFields": {
                  "cardholder": "Annette Smith",
                  "pan": "9876"
                },
                "actionCode": "PullAndDestroy",
                "remark": "User submitted remark",
                "actionData": ""
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                },
                "example": {
                  "message": "No pull requests were found with the given reference ID"
                }
              }
            }
          },
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                },
                "example": {
                  "data": [
                    {
                      "cardholder": "Annette Smith",
                      "pan": "9876",
                      "work Order": "WO99MOCK35BS",
                      "status": "Pending",
                      "pull Reference No": "P7GQNIO979JJ",
                      "pull Type": "PullAndForward",
                      "pull Status": "Pending",
                      "pull Comments": "User submitted remark",
                      "pull Details": {
                        "expectedDateTime": "2025-08-29T04:00:00Z",
                        "rushForwardRequested": false,
                        "shippingDetail": {
                          "companyName": "ABCorp",
                          "attentionTo": "Annette Smith",
                          "address1": "225 Rivermoor St",
                          "address2": "",
                          "address3": "",
                          "locality": "Boston",
                          "region": "MA",
                          "postcode": "2132",
                          "countryCode": "US",
                          "email": "annette.smith@abcorp.com",
                          "phone": "4013334444"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "JWT missing/invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "message": "Authorization has been denied for this request"
                }
              }
            }
          },
          "403": {
            "description": "Missing claim(s) or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "message": "Forbidden"
                }
              }
            }
          }
        }
      }
    },
    "/api/perso/order/actions/pull-wo": {
      "post": {
        "tags": [
          "Order Actions"
        ],
        "summary": "Create a pull request for an entire work order.",
        "description": "Specify a work order ID to create a pull for the entire work order. If a pull request already exists on any item in the order, the pull will silently ignore them and affect all other items. If there are no items to affect or no work order with given ID is found, returns error 400. Subject to time restraints..",
        "operationId": "Perso_PullByWorkOrder",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { },
              "example": {
                "workOrder": "WO99MOCK35BS",
                "actionCode": "PullAndForward",
                "remark": "User submitted remark",
                "actionData": {
                  "companyName": "ABCorp",
                  "attentionTo": "Annette Smith",
                  "address1": "225 Rivermoor St",
                  "address2": "",
                  "address3": "",
                  "locality": "Boston",
                  "region": "MA",
                  "postcode": "2132",
                  "countryCode": "US",
                  "email": "annette.smith@abcorp.com",
                  "phone": "4013334444"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                },
                "example": {
                  "data": [
                    {
                      "cardholder": "Annette Smith",
                      "pan": "9876",
                      "work Order": "WO99MOCK35BS",
                      "status": "Pending",
                      "pull Reference No": "P7GQNIO979JJ",
                      "pull Type": "PullAndForward",
                      "pull Status": "Pending",
                      "pull Comments": "User submitted remark",
                      "pull Details": {
                        "expectedDateTime": "2025-08-29T04:00:00Z",
                        "rushForwardRequested": false,
                        "shippingDetail": {
                          "companyName": "ABCorp",
                          "attentionTo": "Annette Smith",
                          "address1": "225 Rivermoor St",
                          "address2": "",
                          "address3": "",
                          "locality": "Boston",
                          "region": "MA",
                          "postcode": "2132",
                          "countryCode": "US",
                          "email": "annette.smith@abcorp.com",
                          "phone": "4013334444"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "JWT missing/invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "message": "Authorization has been denied for this request"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed / bad input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "message": "Forbidden"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "example": {
                  "message": "No pull requests were found with the given reference ID"
                }
              }
            }
          }
        }
      }
    },
    "/api/visual/inventory/{fg}": {
      "get": {
        "tags": [
          "Visual"
        ],
        "summary": "Check inventory by part ID.",
        "description": "",
        "operationId": "Visual_Inv",
        "parameters": [
          {
            "name": "fg",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                },
                "example": {
                  "partId": "FG5001111",
                  "count": "733",
                  "updated": "2025-08-29 10:54:48"
                }
              }
            }
          },
          "401": {
            "description": "JWT missing/invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                },
                "example": {
                  "message": "Authorization has been denied for this request"
                }
              }
            }
          },
          "403": {
            "description": "Missing claim(s) or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "message": "Forbidden"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                },
                "example": {
                  "message": "No pull requests were found with the given reference ID"
                }
              }
            }
          }
        }
      }
    },
    "/api/visual/order/shipdate/{customerId}": {
      "get": {
        "tags": [
          "Visual"
        ],
        "summary": "Check order ship dates by customer ID.",
        "description": "",
        "operationId": "Visual_ShipDateOrder",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "JWT missing/invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Missing claim(s) or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": { }
      }
    }
  }
}