{
  "openapi": "3.1.1",
  "info": {
    "title": "ManagerServer | post-receipt-rule-batch",
    "version": "1.0.0+c6d1f1e3306702a9f3c52e59bee7a51638b30e7c"
  },
  "paths": {
    "/api4/receipt-rule-batch": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostReceiptRuleBatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AmountType": {
        "type": "integer"
      },
      "Condition": {
        "type": "object",
        "properties": {
          "andDescriptionContains": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DiscountType": {
        "type": "integer"
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "Line": {
        "type": "object",
        "properties": {
          "item": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "account": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "interAccountTransferAccount": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "accountsReceivableCustomer": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "billableExpenseCustomer": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "accountsPayableSupplier": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "withholdingTaxPayableSupplier": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "capitalAccount": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "subAccount": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "employee": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "specialAccount": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "fixedAsset": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "intangibleAsset": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "expenseClaimsPayer": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "investment": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "lineDescription": {
            "type": [
              "null",
              "string"
            ]
          },
          "qty": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "amount": {
            "$ref": "#/components/schemas/DiscountType"
          },
          "exactAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "percentage": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "taxCode": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "division": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          }
        }
      },
      "PayerPayeeType": {
        "type": "integer"
      },
      "PostReceiptRuleBatch": {
        "type": "object",
        "properties": {
          "values": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ReceiptRule"
            }
          },
          "business": {
            "type": [
              "null",
              "string"
            ],
            "description": "Name of business. If you are calling API from an extension running within IFRAME, then business does not have to be provided. Manager will automatically inject current business. This is useful when extension doesn't know business name which is typically the case."
          }
        }
      },
      "ReceiptRule": {
        "type": "object",
        "properties": {
          "ifBankAccountIs": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "andAmountIs": {
            "$ref": "#/components/schemas/AmountType"
          },
          "andAmountIsAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "conditions": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/Condition"
            }
          },
          "paidBy": {
            "$ref": "#/components/schemas/PayerPayeeType"
          },
          "customer": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "supplier": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "otherContact": {
            "type": [
              "null",
              "string"
            ]
          },
          "lines": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/Line"
            }
          },
          "descriptionColumn": {
            "type": "boolean"
          },
          "quantityColumn": {
            "type": "boolean"
          },
          "obsolete_AndDescriptionContains": {
            "type": [
              "null",
              "string"
            ]
          },
          "key": {
            "type": "string",
            "format": "uuid"
          },
          "timestamp": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          }
        }
      }
    }
  }
}