{
  "openapi": "3.0.0",
  "info": {
    "version": "1.0.0",
    "title": "Fulfilment Marketplace",
    "description": "FM API"
  },
  "servers": [
    {
      "url": "https://api-fm.extensiv.com"
    }
  ],
  "tags": [],
  "components": {
    "schemas": {
      "IFaq": {
        "type": "object",
        "required": [
          "question",
          "answer",
          "isCustom",
          "index"
        ],
        "properties": {
          "question": {
            "type": "string"
          },
          "answer": {
            "type": "string"
          },
          "isCustom": {
            "type": "boolean"
          },
          "index": {
            "type": "number"
          }
        }
      },
      "IWarehouseInfo": {
        "type": "object",
        "required": [
          "id",
          "name",
          "editStatus"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "editStatus": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "address": {
            "type": "object"
          },
          "contact": {
            "type": "object"
          },
          "videoUrl": {
            "type": "string"
          },
          "videoDescription": {
            "type": "string"
          },
          "images": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "hoursOfOperation": {
            "type": "object"
          },
          "storage": {
            "type": "object"
          },
          "operations": {
            "type": "object"
          },
          "hubspotRowId": {
            "type": "string"
          }
        }
      },
      "String": {
        "type": "object",
        "properties": {}
      },
      "IOrgProfile": {
        "type": "object",
        "required": [
          "id",
          "orgKey",
          "status",
          "editStatus",
          "name",
          "website",
          "foundedIn",
          "logo"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "orgKey": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "editStatus": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "website": {
            "type": "string"
          },
          "foundedIn": {
            "type": "number"
          },
          "joinedExtensivIn": {
            "type": "number"
          },
          "logo": {
            "type": "string"
          },
          "contact": {
            "type": "object"
          },
          "salesforceContactId": {
            "type": "string"
          },
          "salesforceAccountId": {
            "type": "string"
          },
          "hubspotRowId": {
            "type": "string"
          },
          "address": {
            "type": "object"
          },
          "companySummary": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "faqs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IFaq"
            }
          },
          "warehouseInfo": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IWarehouseInfo"
            }
          },
          "expertise": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/String"
            }
          },
          "lastUpdatedDate": {
            "type": "number"
          },
          "sortOrder": {
            "type": "number"
          },
          "preferredRegion": {
            "type": "string"
          },
          "featured": {
            "type": "boolean"
          },
          "defaultRecommendation": {
            "type": "boolean"
          },
          "pagePath": {
            "type": "string"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "IWarehouseInfoUpdate": {
        "type": "object",
        "required": [
          "id",
          "name",
          "editStatus",
          "hubspotRowId"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "editStatus": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "address": {
            "type": "object"
          },
          "contact": {
            "type": "object"
          },
          "videoUrl": {
            "type": "string"
          },
          "videoDescription": {
            "type": "string"
          },
          "images": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "hoursOfOperation": {
            "type": "object"
          },
          "storage": {
            "type": "object"
          },
          "operations": {
            "type": "object"
          },
          "hubspotRowId": {
            "type": "string"
          }
        }
      },
      "IOrgProfileUpdate": {
        "type": "object",
        "required": [
          "id",
          "orgKey",
          "status",
          "editStatus",
          "name",
          "website",
          "foundedIn",
          "joinedExtensivIn",
          "logo",
          "salesforceAccountId",
          "hubspotRowId"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "orgKey": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "editStatus": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "website": {
            "type": "string"
          },
          "foundedIn": {
            "type": "number"
          },
          "joinedExtensivIn": {
            "type": "number"
          },
          "logo": {
            "type": "string"
          },
          "contact": {
            "type": "object"
          },
          "salesforceContactId": {
            "type": "string"
          },
          "salesforceAccountId": {
            "type": "string"
          },
          "hubspotRowId": {
            "type": "string"
          },
          "address": {
            "type": "object"
          },
          "companySummary": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "faqs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IFaq"
            }
          },
          "warehouseInfo": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IWarehouseInfoUpdate"
            }
          },
          "expertise": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/String"
            }
          },
          "lastUpdatedDate": {
            "type": "number"
          },
          "sortOrder": {
            "type": "number"
          },
          "preferredRegion": {
            "type": "string"
          },
          "featured": {
            "type": "boolean"
          },
          "defaultRecommendation": {
            "type": "boolean"
          },
          "pagePath": {
            "type": "string"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "IOrgProfileFilter": {
        "type": "object",
        "properties": {
          "status": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "region": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "expertise": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "featured": {
            "type": "boolean"
          },
          "defaultRecommendation": {
            "type": "boolean"
          },
          "certifications": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "warehouseSize": {
            "type": "number"
          },
          "numberOfPallets": {
            "type": "number"
          },
          "includeDefaultPartners": {
            "type": "boolean"
          }
        }
      },
      "GenericError": {
        "type": "object",
        "required": [
          "name",
          "message",
          "stack"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "stack": {
            "type": "string"
          },
          "code": {
            "type": "string"
          }
        }
      },
      "EventError": {
        "description": "Error thrown by function ValidateEvent on class EventValidator",
        "type": "object",
        "required": [
          "errorCode"
        ],
        "properties": {
          "errorCode": {
            "type": "number",
            "description": "The number of the EvErrorCode"
          },
          "paramName": {
            "type": "string",
            "description": "The parameter that triggered the error throw"
          },
          "paramType": {
            "type": "string",
            "description": "The type of the parameter"
          }
        }
      },
      "QueryParameterError": {
        "description": "Error thrown by function ValidatePathParameter on class EventValidator",
        "type": "object",
        "required": [
          "names",
          "errorCode"
        ],
        "properties": {
          "names": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Array containing the string names of the parameters that triggered the error throw"
          },
          "errorCode": {
            "type": "number",
            "description": "The number of the QpErrorCode"
          }
        }
      },
      "OperationError": {
        "description": "Error thrown when an invalid operation is performed",
        "type": "object",
        "required": [
          "errorCode"
        ],
        "properties": {
          "errorCode": {
            "type": "number",
            "description": "The number of the OperationErrorCode"
          },
          "paramName": {
            "type": "string",
            "description": "The name of the parameter that triggered the error throw"
          }
        }
      },
      "ModelValidationError": {
        "description": "Error thrown when an invalid value is submited to a Model",
        "type": "object",
        "properties": {}
      },
      "MismatchedContextOrgError": {
        "description": "Error thrown by a handler when request org and context org are mismatched",
        "type": "object",
        "required": [
          "contextOrgKey",
          "orgKey"
        ],
        "properties": {
          "contextOrgKey": {
            "type": "string",
            "description": "The string key of the context Org",
            "format": "uuid"
          },
          "orgKey": {
            "type": "string",
            "description": "The string key of the request Org",
            "format": "uuid"
          }
        }
      },
      "ValidationIssue": {
        "type": "object",
        "required": [
          "path",
          "modelType",
          "errorCode",
          "value"
        ],
        "properties": {
          "path": {
            "type": "string",
            "description": "The JSON path of the incorrect parameter"
          },
          "modelType": {
            "type": "string",
            "description": "The Model of the schema"
          },
          "errorCode": {
            "type": "number",
            "enum": [
              "invalidValue",
              "requiredValue",
              "invalidType",
              "notAllowed",
              "unknownIssueType",
              0,
              1,
              2,
              3,
              4
            ],
            "description": "The number of the ValidationErrorCode"
          },
          "fieldName": {
            "type": "string",
            "description": "The name of the field that triggered the error throw"
          },
          "value": {
            "description": "The value of the field that triggered the error throw"
          },
          "issueType": {
            "description": "The issueType returned by Joi"
          }
        }
      },
      "ValidationError": {
        "description": "Error thrown by a Validator when the body data is incorrectly structured",
        "type": "object",
        "required": [
          "validationIssues"
        ],
        "properties": {
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationIssue"
            },
            "description": "Array containing all ValidationIssue instances identified by the schema"
          }
        }
      },
      "RecordOutOfDateError": {
        "description": "Error thrown by an Accessor when a record is out of date",
        "type": "object",
        "properties": {}
      },
      "TooManyResultsError": {
        "description": "Error thrown when the number of records retrieved from the database exceeds the maximum number of Records per query",
        "type": "object",
        "required": [
          "actualRecordsNum",
          "threasholdNum"
        ],
        "properties": {
          "actualRecordsNum": {
            "type": "number",
            "description": "The actual number of records retrieved from the database"
          },
          "threasholdNum": {
            "type": "number",
            "description": "The threshold number of records that was exceeded"
          }
        }
      },
      "PermissionError": {
        "description": "Error thrown by function ValidatePermissions on class EventValidator",
        "type": "object",
        "properties": {}
      },
      "AppAccessError": {
        "description": "Error thrown by function ValidateAppAccess on class EventValidator",
        "type": "object",
        "required": [
          "app"
        ],
        "properties": {
          "app": {
            "type": "string",
            "description": "The string of the App flag"
          }
        }
      },
      "IReferralAgreement": {
        "type": "object",
        "required": [
          "id",
          "orgKey",
          "firstName",
          "lastName",
          "email",
          "version"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "orgKey": {
            "type": "string",
            "format": "uuid"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "version": {
            "type": "string"
          },
          "lastUpdatedDate": {
            "type": "number"
          }
        }
      }
    },
    "securitySchemes": {
      "cognitoJwtAuthorizer": {
        "description": "cognitoJwtAuthorizer",
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "paths": {
    "/orgprofile/": {
      "post": {
        "summary": "createOrgProfile",
        "security": [
          {
            "cognitoJwtAuthorizer": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/IOrgProfile"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Resource does not exist<br>Invalid request<br>Validation error<br>Database constraint error"
          },
          "403": {
            "description": "Insufficient permissions"
          }
        },
        "description": "Creates an OrgProfile",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IOrgProfile"
              }
            }
          }
        },
        "tags": []
      },
      "get": {
        "summary": "getOrgProfileList",
        "security": [
          {
            "cognitoJwtAuthorizer": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/IOrgProfile"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Resource does not exist<br>Invalid request<br>Validation error<br>Database constraint error"
          },
          "403": {
            "description": "Insufficient permissions"
          }
        },
        "description": "Get list of approved OrgProfiles",
        "parameters": [
          {
            "name": "allListings",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "tags": []
      },
      "put": {
        "summary": "getFilteredOrgProfileList",
        "security": [
          {
            "cognitoJwtAuthorizer": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/IOrgProfile"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Resource does not exist<br>Invalid request<br>Validation error<br>Database constraint error"
          },
          "403": {
            "description": "Insufficient permissions"
          }
        },
        "description": "Get filtered list of OrgProfiles",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IOrgProfileFilter"
              }
            }
          }
        },
        "tags": []
      }
    },
    "/orgprofile/{orgKey}": {
      "get": {
        "summary": "getOrgProfile",
        "security": [
          {
            "cognitoJwtAuthorizer": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/IOrgProfile"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Resource does not exist<br>Invalid request<br>Validation error<br>Database constraint error"
          },
          "403": {
            "description": "Insufficient permissions"
          }
        },
        "description": "Get an OrgProfile",
        "parameters": [
          {
            "in": "path",
            "name": "orgKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": []
      },
      "put": {
        "summary": "updateOrgProfile",
        "security": [
          {
            "cognitoJwtAuthorizer": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/IOrgProfileUpdate"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Resource does not exist<br>Invalid request<br>Validation error<br>Database constraint error"
          },
          "403": {
            "description": "Insufficient permissions"
          }
        },
        "description": "Update an OrgProfile",
        "parameters": [
          {
            "in": "path",
            "name": "orgKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IOrgProfileUpdate"
              }
            }
          }
        },
        "tags": []
      },
      "delete": {
        "summary": "deleteOrgProfile",
        "security": [
          {
            "cognitoJwtAuthorizer": []
          }
        ],
        "responses": {
          "204": {
            "description": "The OrgProfile has been removed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "400": {
            "description": "Resource does not exist<br>Invalid request<br>Validation error<br>Database constraint error"
          },
          "403": {
            "description": "Insufficient permissions"
          }
        },
        "description": "Delete an OrgProfile",
        "parameters": [
          {
            "in": "path",
            "name": "orgKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": []
      }
    },
    "/orgprofile/{orgKey}/status": {
      "get": {
        "summary": "getOrgProfileStatus",
        "security": [
          {
            "cognitoJwtAuthorizer": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/String"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Resource does not exist<br>Invalid request<br>Validation error<br>Database constraint error"
          },
          "403": {
            "description": "Insufficient permissions"
          }
        },
        "description": "Get an OrgProfile status",
        "parameters": [
          {
            "in": "path",
            "name": "orgKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": []
      },
      "put": {
        "summary": "updateOrgProfileStatus",
        "security": [
          {
            "cognitoJwtAuthorizer": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/IOrgProfile"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Resource does not exist<br>Invalid request<br>Validation error<br>Database constraint error"
          },
          "403": {
            "description": "Insufficient permissions"
          }
        },
        "description": "Update OrgProfile status",
        "parameters": [
          {
            "in": "path",
            "name": "orgKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": []
      }
    },
    "/referralagreement/": {
      "post": {
        "summary": "createReferralAgreement",
        "security": [
          {
            "cognitoJwtAuthorizer": []
          }
        ],
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/IReferralAgreement"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Resource does not exist<br>Invalid request<br>Validation error<br>Database constraint error"
          },
          "403": {
            "description": "Insufficient permissions"
          }
        },
        "description": "Creates an ReferralAgreement",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IReferralAgreement"
              }
            }
          }
        },
        "tags": []
      }
    },
    "/referralagreement/{orgkey}": {
      "get": {
        "summary": "getReferralAgreement",
        "security": [
          {
            "cognitoJwtAuthorizer": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/IReferralAgreement"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Resource does not exist<br>Invalid request<br>Validation error<br>Database constraint error"
          },
          "403": {
            "description": "Insufficient permissions"
          }
        },
        "description": "Get an ReferralAgreement",
        "parameters": [
          {
            "name": "orgkey",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "email",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "tags": []
      },
      "delete": {
        "summary": "deleteReferralAgreement",
        "security": [
          {
            "cognitoJwtAuthorizer": []
          }
        ],
        "responses": {
          "204": {
            "description": "The ReferralAgreement has been removed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "400": {
            "description": "Resource does not exist<br>Invalid request<br>Validation error<br>Database constraint error"
          },
          "403": {
            "description": "Insufficient permissions"
          }
        },
        "description": "Delete an ReferralAgreement",
        "parameters": [
          {
            "name": "orgkey",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "email",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "tags": []
      },
      "put": {
        "summary": "updateReferralAgreement",
        "security": [
          {
            "cognitoJwtAuthorizer": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/IReferralAgreement"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Resource does not exist<br>Invalid request<br>Validation error<br>Database constraint error"
          },
          "403": {
            "description": "Insufficient permissions"
          }
        },
        "description": "Update a ReferralAgreement",
        "parameters": [
          {
            "name": "orgkey",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IReferralAgreement"
              }
            }
          }
        },
        "tags": []
      }
    }
  }
}