{
  "openapi": "3.0.1",
  "info": {
    "title": "Append API",
    "version": "v1"
  },
  "paths": {
    "/api/attributes": {
      "get": {
        "tags": [
          "Attribute"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Attribute"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Attribute"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Attribute"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attribute"
                }
              }
            }
          }
        }
      }
    },
    "/api/attributes/{id}": {
      "get": {
        "tags": [
          "Attribute"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attribute"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Attribute"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success"
          }
        }
      }
    },
    "/api/config": {
      "get": {
        "tags": [
          "Config"
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/inquiry": {
      "post": {
        "tags": [
          "Inquiry"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupplierInquiryRequest"
              },
              "example": {
  "supplierPartyId": 7999,
  "startTime": "2026-11-01T00:00:00",
  "endTime": "2026-11-30T00:00:00",
  "timeZone": "Eastern Standard Time"
}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SupplierInquiryRecord"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/leads/lookup": {
      "post": {
        "tags": [
          "Lead"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppendRequest"
              },
              "example": {
  "firstName": "John",
  "lastName": "Doe",
  "address1": "120 West Gate Ave",
  "address2": "",
  "city": "",
  "state": "",
  "zip": "62881",
  "mart": "automart",
  "attributes": [
    "fico"
  ],
  "suppliers": [
    "equifax",
    "experian",
    "transunion"
  ],
  "criteria": {
    "fico": [
      725,
      775
    ]
  }
}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppendResult"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/AppendResult"
                }
              }
            }
          }
        }
      }
    },
    "/api/marts/{id}": {
      "get": {
        "tags": [
          "Mart"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Mart"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Mart"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success"
          }
        }
      }
    },
    "/api/marts/{id}/attributes/{attrId}": {
      "put": {
        "tags": [
          "Mart"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "attrId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/MartAttributeRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MartAttributeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/MartAttributeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MartAttributeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      },
      "delete": {
        "tags": [
          "Mart"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "attrId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success"
          }
        }
      }
    },
    "/api/marts/{id}/suppliers/{supplierId}": {
      "put": {
        "tags": [
          "Mart"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "supplierId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "string"
              }
            },
            "application/json": {
              "schema": {
                "type": "string"
              }
            },
            "text/json": {
              "schema": {
                "type": "string"
              }
            },
            "application/*+json": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      },
      "delete": {
        "tags": [
          "Mart"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "supplierId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success"
          }
        }
      }
    },
    "/api/marts": {
      "get": {
        "tags": [
          "Mart"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Mart"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Mart"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Mart"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Mart"
                }
              }
            }
          }
        }
      }
    },
    "/api/royalty": {
      "post": {
        "tags": [
          "Royalty"
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/RoyaltyRequest"
              },
              "example": {
  "supplierPartyId": 7999,
  "month": 11,
  "year": 2026
}
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoyaltyRequest"
              },
              "example": {
  "supplierPartyId": 7999,
  "month": 11,
  "year": 2026
}
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RoyaltyRequest"
              },
              "example": {
  "supplierPartyId": 7999,
  "month": 11,
  "year": 2026
}
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RoyaltyRequest"
              },
              "example": {
  "supplierPartyId": 7999,
  "month": 11,
  "year": 2026
}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RoyaltyRecord"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/suppliers": {
      "get": {
        "tags": [
          "Supplier"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Supplier"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Supplier"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Supplier"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Supplier"
                }
              }
            }
          }
        }
      }
    },
    "/api/suppliers/{id}": {
      "get": {
        "tags": [
          "Supplier"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Supplier"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Supplier"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success"
          }
        }
      }
    },
    "/api/users/{id}/mart-attributes/{martAttributeId}": {
      "put": {
        "tags": [
          "User"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "martAttributeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      },
      "delete": {
        "tags": [
          "User"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "martAttributeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success"
          }
        }
      }
    },
    "/api/users/{id}/mart-suppliers/{martSupplierId}": {
      "put": {
        "tags": [
          "User"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "martSupplierId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      },
      "delete": {
        "tags": [
          "User"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "martSupplierId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success"
          }
        }
      }
    },
    "/api/users": {
      "get": {
        "tags": [
          "User"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/User"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "User"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/User"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          }
        }
      }
    },
    "/api/users/{id}": {
      "get": {
        "tags": [
          "User"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "User"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success"
          }
        }
      }
    },
    "/api/version": {
      "get": {
        "tags": [
          "Version"
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AttributeType": {
        "enum": [
          1
        ],
        "type": "integer",
        "format": "int32"
      },
      "Attribute": {
        "type": "object",
        "properties": {
          "alias": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AttributeType"
              }
            ]
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "SupplierInquiryRequest": {
        "type": "object",
        "properties": {
          "supplierPartyId": {
            "type": "integer",
            "format": "int32"
          },
          "startTime": {
            "type": "string",
            "format": "date-time"
          },
          "endTime": {
            "type": "string",
            "format": "date-time"
          },
          "timeZone": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Supplier": {
        "type": "object",
        "properties": {
          "alias": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "MartSupplier": {
        "type": "object",
        "properties": {
          "mart": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Mart"
              }
            ],
            "nullable": true
          },
          "supplier": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Supplier"
              }
            ],
            "nullable": true
          },
          "tableName": {
            "type": "string",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "Mart": {
        "type": "object",
        "properties": {
          "alias": {
            "type": "string",
            "nullable": true
          },
          "server": {
            "type": "string",
            "nullable": true
          },
          "database": {
            "type": "string",
            "nullable": true
          },
          "username": {
            "type": "string",
            "nullable": true
          },
          "password": {
            "type": "string",
            "nullable": true
          },
          "searchTypeId": {
            "type": "integer",
            "format": "int32"
          },
          "audit": {
            "type": "boolean"
          },
          "martAttributes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MartAttribute"
            },
            "nullable": true
          },
          "martSuppliers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MartSupplier"
            },
            "nullable": true
          },
          "attributes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "readOnly": true
          },
          "suppliers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "readOnly": true
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "MartAttribute": {
        "type": "object",
        "properties": {
          "mart": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Mart"
              }
            ],
            "nullable": true
          },
          "attribute": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Attribute"
              }
            ],
            "nullable": true
          },
          "columnName": {
            "type": "string",
            "nullable": true
          },
          "dataDictionaryItemId": {
            "type": "integer",
            "format": "int32"
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "SupplierInquiryMartAttribute": {
        "type": "object",
        "properties": {
          "supplierInquiry": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SupplierInquiryRecord"
              }
            ],
            "nullable": true
          },
          "martAttribute": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MartAttribute"
              }
            ],
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "SupplierInquiryRecord": {
        "type": "object",
        "properties": {
          "marketerPartyId": {
            "type": "integer",
            "format": "int32"
          },
          "supplierPartyId": {
            "type": "integer",
            "format": "int32"
          },
          "subCode": {
            "type": "string",
            "nullable": true
          },
          "billingReference": {
            "type": "string",
            "nullable": true
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "attributeRelationships": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SupplierInquiryMartAttribute"
            },
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "AppendRequest": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "address1": {
            "type": "string",
            "nullable": true
          },
          "address2": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "state": {
            "type": "string",
            "nullable": true
          },
          "zip": {
            "type": "string",
            "nullable": true
          },
          "mart": {
            "type": "string",
            "nullable": true
          },
          "attributes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "suppliers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "criteria": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": false
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AppendType": {
        "enum": [
          0,
          1,
          2
        ],
        "type": "integer",
        "format": "int32"
      },
      "AppendResult": {
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          },
          "matchType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AppendType"
              }
            ],
            "readOnly": true
          },
          "recordFound": {
            "type": "boolean",
            "readOnly": true
          },
          "status": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          },
          "attributes": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": false
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "MartAttributeRequest": {
        "type": "object",
        "properties": {
          "column": {
            "type": "string",
            "nullable": true
          },
          "dataDictionaryItemId": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "RoyaltyRequest": {
        "type": "object",
        "properties": {
          "supplierPartyId": {
            "type": "integer",
            "format": "int32"
          },
          "month": {
            "type": "integer",
            "format": "int32"
          },
          "year": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "RoyaltyRecord": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "transactionDate": {
            "type": "string",
            "format": "date-time"
          },
          "marketerId": {
            "type": "integer",
            "format": "int32"
          },
          "subCode": {
            "type": "string",
            "nullable": true
          },
          "dataDictionaryIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "nullable": true
          },
          "billingReferenceCode": {
            "type": "string",
            "nullable": true
          },
          "searchTypeId": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "UserSecurityToken": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "token": {
            "type": "string",
            "format": "uuid"
          },
          "isAdmin": {
            "type": "boolean"
          },
          "user": {
            "allOf": [
              {
                "$ref": "#/components/schemas/User"
              }
            ],
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UserMartAttribute": {
        "type": "object",
        "properties": {
          "user": {
            "allOf": [
              {
                "$ref": "#/components/schemas/User"
              }
            ],
            "nullable": true
          },
          "martAttribute": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MartAttribute"
              }
            ],
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "UserMartSupplier": {
        "type": "object",
        "properties": {
          "user": {
            "allOf": [
              {
                "$ref": "#/components/schemas/User"
              }
            ],
            "nullable": true
          },
          "martSupplier": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MartSupplier"
              }
            ],
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "User": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "nullable": true
          },
          "tokens": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserSecurityToken"
            },
            "nullable": true
          },
          "userMartAttributes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserMartAttribute"
            },
            "nullable": true
          },
          "userMartSuppliers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserMartSupplier"
            },
            "nullable": true
          },
          "availableMarts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Mart"
            },
            "nullable": true,
            "readOnly": true
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "token": {
        "type": "apiKey",
        "description": "Put your api token here to authorize all requests",
        "name": "X-Deluxe-Auth",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "token": [ ]
    }
  ]
}