{ "openapi": "3.1.0", "info": { "title": "Surface Web API", "version": "20260702.113547", "description": "BFF APIs for dashfi-ui" }, "components": { "schemas": {} }, "paths": { "/v1/web/accounting-integration-account": { "post": { "summary": "Create and map an Accounting Platform Account", "tags": [ "Accounting Integration Account" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "name", "type" ], "properties": { "name": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "accounts_payable" ] }, { "type": "string", "enum": [ "accounts_receivable" ] }, { "type": "string", "enum": [ "bank" ] }, { "type": "string", "enum": [ "fixed_asset" ] }, { "type": "string", "enum": [ "other_asset" ] }, { "type": "string", "enum": [ "other_current_asset" ] }, { "type": "string", "enum": [ "liability" ] }, { "type": "string", "enum": [ "equity" ] }, { "type": "string", "enum": [ "expense" ] }, { "type": "string", "enum": [ "other_expense" ] }, { "type": "string", "enum": [ "income" ] }, { "type": "string", "enum": [ "other_income" ] }, { "type": "string", "enum": [ "credit_card" ] }, { "type": "string", "enum": [ "cost_of_goods_sold" ] }, { "type": "string", "enum": [ "other_current_liability" ] }, { "type": "string", "enum": [ "long_term_liability" ] }, { "type": "string", "enum": [ "non_posting" ] }, { "type": "string", "enum": [ "unknown" ] } ] } } }, { "type": "object", "required": [ "currencyCode", "mappingIntent" ], "properties": { "currencyCode": { "anyOf": [ { "type": "string", "enum": [ "AED" ] }, { "type": "string", "enum": [ "AFN" ] }, { "type": "string", "enum": [ "ALL" ] }, { "type": "string", "enum": [ "AMD" ] }, { "type": "string", "enum": [ "ANG" ] }, { "type": "string", "enum": [ "AOA" ] }, { "type": "string", "enum": [ "ARS" ] }, { "type": "string", "enum": [ "AUD" ] }, { "type": "string", "enum": [ "AWG" ] }, { "type": "string", "enum": [ "AZN" ] }, { "type": "string", "enum": [ "BAM" ] }, { "type": "string", "enum": [ "BBD" ] }, { "type": "string", "enum": [ "BDT" ] }, { "type": "string", "enum": [ "BGN" ] }, { "type": "string", "enum": [ "BHD" ] }, { "type": "string", "enum": [ "BIF" ] }, { "type": "string", "enum": [ "BMD" ] }, { "type": "string", "enum": [ "BND" ] }, { "type": "string", "enum": [ "BOB" ] }, { "type": "string", "enum": [ "BOV" ] }, { "type": "string", "enum": [ "BRL" ] }, { "type": "string", "enum": [ "BSD" ] }, { "type": "string", "enum": [ "BTN" ] }, { "type": "string", "enum": [ "BWP" ] }, { "type": "string", "enum": [ "BYR" ] }, { "type": "string", "enum": [ "BZD" ] }, { "type": "string", "enum": [ "CAD" ] }, { "type": "string", "enum": [ "CDF" ] }, { "type": "string", "enum": [ "CHE" ] }, { "type": "string", "enum": [ "CHF" ] }, { "type": "string", "enum": [ "CHW" ] }, { "type": "string", "enum": [ "CLF" ] }, { "type": "string", "enum": [ "CLP" ] }, { "type": "string", "enum": [ "CNY" ] }, { "type": "string", "enum": [ "COP" ] }, { "type": "string", "enum": [ "COU" ] }, { "type": "string", "enum": [ "CRC" ] }, { "type": "string", "enum": [ "CUC" ] }, { "type": "string", "enum": [ "CUP" ] }, { "type": "string", "enum": [ "CVE" ] }, { "type": "string", "enum": [ "CZK" ] }, { "type": "string", "enum": [ "DJF" ] }, { "type": "string", "enum": [ "DKK" ] }, { "type": "string", "enum": [ "DOP" ] }, { "type": "string", "enum": [ "DZD" ] }, { "type": "string", "enum": [ "EGP" ] }, { "type": "string", "enum": [ "ERN" ] }, { "type": "string", "enum": [ "ETB" ] }, { "type": "string", "enum": [ "EUR" ] }, { "type": "string", "enum": [ "FJD" ] }, { "type": "string", "enum": [ "FKP" ] }, { "type": "string", "enum": [ "GBP" ] }, { "type": "string", "enum": [ "GEL" ] }, { "type": "string", "enum": [ "GHS" ] }, { "type": "string", "enum": [ "GIP" ] }, { "type": "string", "enum": [ "GMD" ] }, { "type": "string", "enum": [ "GNF" ] }, { "type": "string", "enum": [ "GTQ" ] }, { "type": "string", "enum": [ "GYD" ] }, { "type": "string", "enum": [ "HKD" ] }, { "type": "string", "enum": [ "HNL" ] }, { "type": "string", "enum": [ "HRK" ] }, { "type": "string", "enum": [ "HTG" ] }, { "type": "string", "enum": [ "HUF" ] }, { "type": "string", "enum": [ "IDR" ] }, { "type": "string", "enum": [ "ILS" ] }, { "type": "string", "enum": [ "INR" ] }, { "type": "string", "enum": [ "IQD" ] }, { "type": "string", "enum": [ "IRR" ] }, { "type": "string", "enum": [ "ISK" ] }, { "type": "string", "enum": [ "JMD" ] }, { "type": "string", "enum": [ "JOD" ] }, { "type": "string", "enum": [ "JPY" ] }, { "type": "string", "enum": [ "KES" ] }, { "type": "string", "enum": [ "KGS" ] }, { "type": "string", "enum": [ "KHR" ] }, { "type": "string", "enum": [ "KMF" ] }, { "type": "string", "enum": [ "KPW" ] }, { "type": "string", "enum": [ "KRW" ] }, { "type": "string", "enum": [ "KWD" ] }, { "type": "string", "enum": [ "KYD" ] }, { "type": "string", "enum": [ "KZT" ] }, { "type": "string", "enum": [ "LAK" ] }, { "type": "string", "enum": [ "LBP" ] }, { "type": "string", "enum": [ "LKR" ] }, { "type": "string", "enum": [ "LRD" ] }, { "type": "string", "enum": [ "LSL" ] }, { "type": "string", "enum": [ "LTL" ] }, { "type": "string", "enum": [ "LVL" ] }, { "type": "string", "enum": [ "LYD" ] }, { "type": "string", "enum": [ "MAD" ] }, { "type": "string", "enum": [ "MDL" ] }, { "type": "string", "enum": [ "MGA" ] }, { "type": "string", "enum": [ "MKD" ] }, { "type": "string", "enum": [ "MMK" ] }, { "type": "string", "enum": [ "MNT" ] }, { "type": "string", "enum": [ "MOP" ] }, { "type": "string", "enum": [ "MRO" ] }, { "type": "string", "enum": [ "MUR" ] }, { "type": "string", "enum": [ "MVR" ] }, { "type": "string", "enum": [ "MWK" ] }, { "type": "string", "enum": [ "MXN" ] }, { "type": "string", "enum": [ "MXV" ] }, { "type": "string", "enum": [ "MYR" ] }, { "type": "string", "enum": [ "MZN" ] }, { "type": "string", "enum": [ "NAD" ] }, { "type": "string", "enum": [ "NGN" ] }, { "type": "string", "enum": [ "NIO" ] }, { "type": "string", "enum": [ "NOK" ] }, { "type": "string", "enum": [ "NPR" ] }, { "type": "string", "enum": [ "NZD" ] }, { "type": "string", "enum": [ "OMR" ] }, { "type": "string", "enum": [ "PAB" ] }, { "type": "string", "enum": [ "PEN" ] }, { "type": "string", "enum": [ "PGK" ] }, { "type": "string", "enum": [ "PHP" ] }, { "type": "string", "enum": [ "PKR" ] }, { "type": "string", "enum": [ "PLN" ] }, { "type": "string", "enum": [ "PYG" ] }, { "type": "string", "enum": [ "QAR" ] }, { "type": "string", "enum": [ "RON" ] }, { "type": "string", "enum": [ "RSD" ] }, { "type": "string", "enum": [ "RUB" ] }, { "type": "string", "enum": [ "RWF" ] }, { "type": "string", "enum": [ "SAR" ] }, { "type": "string", "enum": [ "SBD" ] }, { "type": "string", "enum": [ "SCR" ] }, { "type": "string", "enum": [ "SDG" ] }, { "type": "string", "enum": [ "SEK" ] }, { "type": "string", "enum": [ "SGD" ] }, { "type": "string", "enum": [ "SHP" ] }, { "type": "string", "enum": [ "SLL" ] }, { "type": "string", "enum": [ "SOS" ] }, { "type": "string", "enum": [ "SRD" ] }, { "type": "string", "enum": [ "SSP" ] }, { "type": "string", "enum": [ "STD" ] }, { "type": "string", "enum": [ "SVC" ] }, { "type": "string", "enum": [ "SYP" ] }, { "type": "string", "enum": [ "SZL" ] }, { "type": "string", "enum": [ "THB" ] }, { "type": "string", "enum": [ "TJS" ] }, { "type": "string", "enum": [ "TMT" ] }, { "type": "string", "enum": [ "TND" ] }, { "type": "string", "enum": [ "TOP" ] }, { "type": "string", "enum": [ "TRY" ] }, { "type": "string", "enum": [ "TTD" ] }, { "type": "string", "enum": [ "TWD" ] }, { "type": "string", "enum": [ "TZS" ] }, { "type": "string", "enum": [ "UAH" ] }, { "type": "string", "enum": [ "UGX" ] }, { "type": "string", "enum": [ "USD" ] }, { "type": "string", "enum": [ "USN" ] }, { "type": "string", "enum": [ "USS" ] }, { "type": "string", "enum": [ "UYI" ] }, { "type": "string", "enum": [ "UYU" ] }, { "type": "string", "enum": [ "UYW" ] }, { "type": "string", "enum": [ "UZS" ] }, { "type": "string", "enum": [ "VEF" ] }, { "type": "string", "enum": [ "VND" ] }, { "type": "string", "enum": [ "VUV" ] }, { "type": "string", "enum": [ "WST" ] }, { "type": "string", "enum": [ "XAF" ] }, { "type": "string", "enum": [ "XAG" ] }, { "type": "string", "enum": [ "XAU" ] }, { "type": "string", "enum": [ "XBA" ] }, { "type": "string", "enum": [ "XBB" ] }, { "type": "string", "enum": [ "XBC" ] }, { "type": "string", "enum": [ "XBD" ] }, { "type": "string", "enum": [ "XCD" ] }, { "type": "string", "enum": [ "XDR" ] }, { "type": "string", "enum": [ "XFU" ] }, { "type": "string", "enum": [ "XOF" ] }, { "type": "string", "enum": [ "XPD" ] }, { "type": "string", "enum": [ "XPF" ] }, { "type": "string", "enum": [ "XPT" ] }, { "type": "string", "enum": [ "XTS" ] }, { "type": "string", "enum": [ "XXX" ] }, { "type": "string", "enum": [ "YER" ] }, { "type": "string", "enum": [ "ZAR" ] }, { "type": "string", "enum": [ "ZMW" ] }, { "type": "string", "enum": [ "ETH" ] }, { "type": "string", "enum": [ "BTC" ] } ] }, "subsidiaryId": { "type": "string" }, "nominalCode": { "type": "string" }, "cardLastFourDigits": { "type": "string", "minLength": 4, "maxLength": 4, "pattern": "^\\d{4}$" }, "locationId": { "type": "string" }, "mappingIntent": { "type": "object", "required": [ "entityType", "entityId", "entityName" ], "properties": { "entityType": { "type": "string", "enum": [ "account:creditCard" ] }, "entityId": { "type": "string" }, "entityName": { "type": "string" }, "journalType": { "type": "string" } } } } } ] } } } }, "responses": { "202": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "entityType", "entityId" ], "properties": { "entityType": { "type": "string", "enum": [ "account:creditCard" ] }, "entityId": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "connectionError" ] }, "message": { "type": "string" } }, "title": "connectionError", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Search in-flight Accounting Platform Account creates", "tags": [ "Accounting Integration Account" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "entityIds", "required": false, "description": "comma-separated list" } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "entityType", "entityId" ], "properties": { "entityType": { "type": "string", "enum": [ "account:creditCard" ] }, "entityId": { "type": "string" } } } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "connectionError" ] }, "message": { "type": "string" } }, "title": "connectionError", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/accounting-integration-account/accounting-platform/accounts": { "get": { "summary": "Search Accounting Platform Accounts", "tags": [ "Accounting Integration Account" ], "parameters": [ { "schema": { "anyOf": [ { "type": "string", "enum": [ "quickbooks" ] }, { "type": "string", "enum": [ "quickbooks_desktop" ] }, { "type": "string", "enum": [ "netsuite" ] }, { "type": "string", "enum": [ "xero" ] }, { "type": "string", "enum": [ "sage_intacct" ] } ] }, "in": "query", "name": "platform", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "nameLike", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "types", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "cursor", "required": false, "description": "Cursor for pagination" }, { "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "rutterAccountId", "status", "subsidiaries", "name", "type", "category", "currencyCode", "nominalCode", "createdAt", "updatedAt" ], "properties": { "rutterAccountId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "inactive" ] }, { "type": "string", "enum": [ "pending" ] } ] }, "subsidiaries": { "type": "array", "items": { "type": "object", "required": [ "id", "status" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "inactive" ] } ] } } } }, "name": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "accounts_payable" ] }, { "type": "string", "enum": [ "accounts_receivable" ] }, { "type": "string", "enum": [ "bank" ] }, { "type": "string", "enum": [ "fixed_asset" ] }, { "type": "string", "enum": [ "other_asset" ] }, { "type": "string", "enum": [ "other_current_asset" ] }, { "type": "string", "enum": [ "liability" ] }, { "type": "string", "enum": [ "equity" ] }, { "type": "string", "enum": [ "expense" ] }, { "type": "string", "enum": [ "other_expense" ] }, { "type": "string", "enum": [ "income" ] }, { "type": "string", "enum": [ "other_income" ] }, { "type": "string", "enum": [ "credit_card" ] }, { "type": "string", "enum": [ "cost_of_goods_sold" ] }, { "type": "string", "enum": [ "other_current_liability" ] }, { "type": "string", "enum": [ "long_term_liability" ] }, { "type": "string", "enum": [ "non_posting" ] }, { "type": "string", "enum": [ "unknown" ] } ] }, "category": { "anyOf": [ { "type": "string", "enum": [ "asset" ] }, { "type": "string", "enum": [ "expense" ] }, { "type": "string", "enum": [ "equity" ] }, { "type": "string", "enum": [ "liability" ] }, { "type": "string", "enum": [ "income" ] }, { "type": "string", "enum": [ "nonposting" ] }, { "type": "string", "enum": [ "unknown" ] } ] }, "currencyCode": { "anyOf": [ { "type": "string", "enum": [ "AED" ] }, { "type": "string", "enum": [ "AFN" ] }, { "type": "string", "enum": [ "ALL" ] }, { "type": "string", "enum": [ "AMD" ] }, { "type": "string", "enum": [ "ANG" ] }, { "type": "string", "enum": [ "AOA" ] }, { "type": "string", "enum": [ "ARS" ] }, { "type": "string", "enum": [ "AUD" ] }, { "type": "string", "enum": [ "AWG" ] }, { "type": "string", "enum": [ "AZN" ] }, { "type": "string", "enum": [ "BAM" ] }, { "type": "string", "enum": [ "BBD" ] }, { "type": "string", "enum": [ "BDT" ] }, { "type": "string", "enum": [ "BGN" ] }, { "type": "string", "enum": [ "BHD" ] }, { "type": "string", "enum": [ "BIF" ] }, { "type": "string", "enum": [ "BMD" ] }, { "type": "string", "enum": [ "BND" ] }, { "type": "string", "enum": [ "BOB" ] }, { "type": "string", "enum": [ "BOV" ] }, { "type": "string", "enum": [ "BRL" ] }, { "type": "string", "enum": [ "BSD" ] }, { "type": "string", "enum": [ "BTN" ] }, { "type": "string", "enum": [ "BWP" ] }, { "type": "string", "enum": [ "BYR" ] }, { "type": "string", "enum": [ "BZD" ] }, { "type": "string", "enum": [ "CAD" ] }, { "type": "string", "enum": [ "CDF" ] }, { "type": "string", "enum": [ "CHE" ] }, { "type": "string", "enum": [ "CHF" ] }, { "type": "string", "enum": [ "CHW" ] }, { "type": "string", "enum": [ "CLF" ] }, { "type": "string", "enum": [ "CLP" ] }, { "type": "string", "enum": [ "CNY" ] }, { "type": "string", "enum": [ "COP" ] }, { "type": "string", "enum": [ "COU" ] }, { "type": "string", "enum": [ "CRC" ] }, { "type": "string", "enum": [ "CUC" ] }, { "type": "string", "enum": [ "CUP" ] }, { "type": "string", "enum": [ "CVE" ] }, { "type": "string", "enum": [ "CZK" ] }, { "type": "string", "enum": [ "DJF" ] }, { "type": "string", "enum": [ "DKK" ] }, { "type": "string", "enum": [ "DOP" ] }, { "type": "string", "enum": [ "DZD" ] }, { "type": "string", "enum": [ "EGP" ] }, { "type": "string", "enum": [ "ERN" ] }, { "type": "string", "enum": [ "ETB" ] }, { "type": "string", "enum": [ "EUR" ] }, { "type": "string", "enum": [ "FJD" ] }, { "type": "string", "enum": [ "FKP" ] }, { "type": "string", "enum": [ "GBP" ] }, { "type": "string", "enum": [ "GEL" ] }, { "type": "string", "enum": [ "GHS" ] }, { "type": "string", "enum": [ "GIP" ] }, { "type": "string", "enum": [ "GMD" ] }, { "type": "string", "enum": [ "GNF" ] }, { "type": "string", "enum": [ "GTQ" ] }, { "type": "string", "enum": [ "GYD" ] }, { "type": "string", "enum": [ "HKD" ] }, { "type": "string", "enum": [ "HNL" ] }, { "type": "string", "enum": [ "HRK" ] }, { "type": "string", "enum": [ "HTG" ] }, { "type": "string", "enum": [ "HUF" ] }, { "type": "string", "enum": [ "IDR" ] }, { "type": "string", "enum": [ "ILS" ] }, { "type": "string", "enum": [ "INR" ] }, { "type": "string", "enum": [ "IQD" ] }, { "type": "string", "enum": [ "IRR" ] }, { "type": "string", "enum": [ "ISK" ] }, { "type": "string", "enum": [ "JMD" ] }, { "type": "string", "enum": [ "JOD" ] }, { "type": "string", "enum": [ "JPY" ] }, { "type": "string", "enum": [ "KES" ] }, { "type": "string", "enum": [ "KGS" ] }, { "type": "string", "enum": [ "KHR" ] }, { "type": "string", "enum": [ "KMF" ] }, { "type": "string", "enum": [ "KPW" ] }, { "type": "string", "enum": [ "KRW" ] }, { "type": "string", "enum": [ "KWD" ] }, { "type": "string", "enum": [ "KYD" ] }, { "type": "string", "enum": [ "KZT" ] }, { "type": "string", "enum": [ "LAK" ] }, { "type": "string", "enum": [ "LBP" ] }, { "type": "string", "enum": [ "LKR" ] }, { "type": "string", "enum": [ "LRD" ] }, { "type": "string", "enum": [ "LSL" ] }, { "type": "string", "enum": [ "LTL" ] }, { "type": "string", "enum": [ "LVL" ] }, { "type": "string", "enum": [ "LYD" ] }, { "type": "string", "enum": [ "MAD" ] }, { "type": "string", "enum": [ "MDL" ] }, { "type": "string", "enum": [ "MGA" ] }, { "type": "string", "enum": [ "MKD" ] }, { "type": "string", "enum": [ "MMK" ] }, { "type": "string", "enum": [ "MNT" ] }, { "type": "string", "enum": [ "MOP" ] }, { "type": "string", "enum": [ "MRO" ] }, { "type": "string", "enum": [ "MUR" ] }, { "type": "string", "enum": [ "MVR" ] }, { "type": "string", "enum": [ "MWK" ] }, { "type": "string", "enum": [ "MXN" ] }, { "type": "string", "enum": [ "MXV" ] }, { "type": "string", "enum": [ "MYR" ] }, { "type": "string", "enum": [ "MZN" ] }, { "type": "string", "enum": [ "NAD" ] }, { "type": "string", "enum": [ "NGN" ] }, { "type": "string", "enum": [ "NIO" ] }, { "type": "string", "enum": [ "NOK" ] }, { "type": "string", "enum": [ "NPR" ] }, { "type": "string", "enum": [ "NZD" ] }, { "type": "string", "enum": [ "OMR" ] }, { "type": "string", "enum": [ "PAB" ] }, { "type": "string", "enum": [ "PEN" ] }, { "type": "string", "enum": [ "PGK" ] }, { "type": "string", "enum": [ "PHP" ] }, { "type": "string", "enum": [ "PKR" ] }, { "type": "string", "enum": [ "PLN" ] }, { "type": "string", "enum": [ "PYG" ] }, { "type": "string", "enum": [ "QAR" ] }, { "type": "string", "enum": [ "RON" ] }, { "type": "string", "enum": [ "RSD" ] }, { "type": "string", "enum": [ "RUB" ] }, { "type": "string", "enum": [ "RWF" ] }, { "type": "string", "enum": [ "SAR" ] }, { "type": "string", "enum": [ "SBD" ] }, { "type": "string", "enum": [ "SCR" ] }, { "type": "string", "enum": [ "SDG" ] }, { "type": "string", "enum": [ "SEK" ] }, { "type": "string", "enum": [ "SGD" ] }, { "type": "string", "enum": [ "SHP" ] }, { "type": "string", "enum": [ "SLL" ] }, { "type": "string", "enum": [ "SOS" ] }, { "type": "string", "enum": [ "SRD" ] }, { "type": "string", "enum": [ "SSP" ] }, { "type": "string", "enum": [ "STD" ] }, { "type": "string", "enum": [ "SVC" ] }, { "type": "string", "enum": [ "SYP" ] }, { "type": "string", "enum": [ "SZL" ] }, { "type": "string", "enum": [ "THB" ] }, { "type": "string", "enum": [ "TJS" ] }, { "type": "string", "enum": [ "TMT" ] }, { "type": "string", "enum": [ "TND" ] }, { "type": "string", "enum": [ "TOP" ] }, { "type": "string", "enum": [ "TRY" ] }, { "type": "string", "enum": [ "TTD" ] }, { "type": "string", "enum": [ "TWD" ] }, { "type": "string", "enum": [ "TZS" ] }, { "type": "string", "enum": [ "UAH" ] }, { "type": "string", "enum": [ "UGX" ] }, { "type": "string", "enum": [ "USD" ] }, { "type": "string", "enum": [ "USN" ] }, { "type": "string", "enum": [ "USS" ] }, { "type": "string", "enum": [ "UYI" ] }, { "type": "string", "enum": [ "UYU" ] }, { "type": "string", "enum": [ "UYW" ] }, { "type": "string", "enum": [ "UZS" ] }, { "type": "string", "enum": [ "VEF" ] }, { "type": "string", "enum": [ "VND" ] }, { "type": "string", "enum": [ "VUV" ] }, { "type": "string", "enum": [ "WST" ] }, { "type": "string", "enum": [ "XAF" ] }, { "type": "string", "enum": [ "XAG" ] }, { "type": "string", "enum": [ "XAU" ] }, { "type": "string", "enum": [ "XBA" ] }, { "type": "string", "enum": [ "XBB" ] }, { "type": "string", "enum": [ "XBC" ] }, { "type": "string", "enum": [ "XBD" ] }, { "type": "string", "enum": [ "XCD" ] }, { "type": "string", "enum": [ "XDR" ] }, { "type": "string", "enum": [ "XFU" ] }, { "type": "string", "enum": [ "XOF" ] }, { "type": "string", "enum": [ "XPD" ] }, { "type": "string", "enum": [ "XPF" ] }, { "type": "string", "enum": [ "XPT" ] }, { "type": "string", "enum": [ "XTS" ] }, { "type": "string", "enum": [ "XXX" ] }, { "type": "string", "enum": [ "YER" ] }, { "type": "string", "enum": [ "ZAR" ] }, { "type": "string", "enum": [ "ZMW" ] }, { "type": "string", "enum": [ "ETH" ] }, { "type": "string", "enum": [ "BTC" ] }, { "type": "string", "enum": [ "null" ] }, { "type": "null" } ] }, "nominalCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "createdAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "updatedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] } } } }, "nextCursor": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "connectionError" ] }, "message": { "type": "string" } }, "title": "connectionError", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/accounting-integration-connection": { "post": { "summary": "Create an Accounting Platform Connection", "tags": [ "Accounting Integration Connection" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "platform", "redirectUrl" ], "properties": { "platform": { "anyOf": [ { "type": "string", "enum": [ "quickbooks" ] }, { "type": "string", "enum": [ "quickbooks_desktop" ] }, { "type": "string", "enum": [ "netsuite" ] }, { "type": "string", "enum": [ "xero" ] }, { "type": "string", "enum": [ "sage_intacct" ] } ] }, "redirectUrl": { "type": "string", "format": "uri" } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "platform", "rutterLinkUrl", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "created" ] }, { "type": "string", "enum": [ "awaiting_authorization" ] }, { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "unhealthy" ] }, { "type": "string", "enum": [ "disconnected" ] } ] }, "platform": { "anyOf": [ { "type": "string", "enum": [ "quickbooks" ] }, { "type": "string", "enum": [ "quickbooks_desktop" ] }, { "type": "string", "enum": [ "netsuite" ] }, { "type": "string", "enum": [ "xero" ] }, { "type": "string", "enum": [ "sage_intacct" ] } ] }, "rutterLinkUrl": { "type": "string", "format": "uri" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "existingConnection" ] }, "message": { "type": "string" } }, "title": "existingConnection", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "disconnectedConnectionExists" ] }, "message": { "type": "string" } }, "title": "disconnectedConnectionExists", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Get accounting integration connection", "tags": [ "Accounting Integration Connection" ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "platform", "rutterLinkUrl", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "created" ] }, { "type": "string", "enum": [ "awaiting_authorization" ] }, { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "unhealthy" ] }, { "type": "string", "enum": [ "disconnected" ] } ] }, "platform": { "anyOf": [ { "type": "string", "enum": [ "quickbooks" ] }, { "type": "string", "enum": [ "quickbooks_desktop" ] }, { "type": "string", "enum": [ "netsuite" ] }, { "type": "string", "enum": [ "xero" ] }, { "type": "string", "enum": [ "sage_intacct" ] } ] }, "rutterLinkUrl": { "type": "string", "format": "uri" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/accounting-integration-connection/{id}": { "delete": { "summary": "Delete Accounting Integration Connection", "tags": [ "Accounting Integration Connection" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "204": { "description": "Default Response", "content": { "application/json": { "schema": {} } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/accounting-integration-connection/{id}/disconnect": { "post": { "summary": "Disconnect Accounting Integration Connection", "tags": [ "Accounting Integration Connection" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "platform", "rutterLinkUrl", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "created" ] }, { "type": "string", "enum": [ "awaiting_authorization" ] }, { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "unhealthy" ] }, { "type": "string", "enum": [ "disconnected" ] } ] }, "platform": { "anyOf": [ { "type": "string", "enum": [ "quickbooks" ] }, { "type": "string", "enum": [ "quickbooks_desktop" ] }, { "type": "string", "enum": [ "netsuite" ] }, { "type": "string", "enum": [ "xero" ] }, { "type": "string", "enum": [ "sage_intacct" ] } ] }, "rutterLinkUrl": { "type": "string", "format": "uri" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/accounting-integration-connection/{id}/reconnect": { "post": { "summary": "Reconnect Accounting Integration Connection", "tags": [ "Accounting Integration Connection" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "platform", "rutterLinkUrl", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "created" ] }, { "type": "string", "enum": [ "awaiting_authorization" ] }, { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "unhealthy" ] }, { "type": "string", "enum": [ "disconnected" ] } ] }, "platform": { "anyOf": [ { "type": "string", "enum": [ "quickbooks" ] }, { "type": "string", "enum": [ "quickbooks_desktop" ] }, { "type": "string", "enum": [ "netsuite" ] }, { "type": "string", "enum": [ "xero" ] }, { "type": "string", "enum": [ "sage_intacct" ] } ] }, "rutterLinkUrl": { "type": "string", "format": "uri" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "existingConnection" ] }, "message": { "type": "string" } }, "title": "existingConnection", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/accounting-integration-customer": { "get": { "summary": "Search Accounting Platform Customers", "tags": [ "Accounting Integration Customer" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "nameLike", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "cursor", "required": false, "description": "Cursor for pagination" }, { "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "rutterCustomerId", "status", "addresses" ], "properties": { "rutterCustomerId": { "type": "string" }, "customerName": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "archived" ] }, { "type": "string", "enum": [ "unknown" ] } ] }, "email": { "type": "string" }, "phone": { "type": "string" }, "contactName": { "type": "string" }, "currencyCode": { "type": "string" }, "addresses": { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "billing" ] }, { "type": "string", "enum": [ "shipping" ] }, { "type": "string", "enum": [ "po_box" ] }, { "type": "string", "enum": [ "ship_from" ] }, { "type": "string", "enum": [ "unknown" ] } ] }, "address1": { "type": "string" }, "address2": { "type": "string" }, "city": { "type": "string" }, "country": { "type": "string" }, "postalCode": { "type": "string" }, "region": { "type": "string" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "nextCursor": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "connectionError" ] }, "message": { "type": "string" } }, "title": "connectionError", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/accounting-integration-department": { "get": { "summary": "Search Accounting Platform Departments", "tags": [ "Accounting Integration Department" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "nameLike", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "cursor", "required": false, "description": "Cursor for pagination" }, { "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "rutterDepartmentId", "rutterParentDepartmentId", "name", "status", "createdAt", "updatedAt" ], "properties": { "rutterDepartmentId": { "type": "string" }, "rutterParentDepartmentId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "archived" ] } ] }, "createdAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "updatedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] } } } }, "nextCursor": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "connectionError" ] }, "message": { "type": "string" } }, "title": "connectionError", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "platformNotSupported" ] }, "message": { "type": "string" } }, "title": "platformNotSupported", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/accounting-integration-entity-mapping": { "post": { "summary": "Create/Update Accounting Integration Entity Mapping", "tags": [ "Accounting Integration Entity Mapping" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "entityType", "entityId", "entityName", "rutterEntityId", "rutterEntityName" ], "properties": { "entityType": { "anyOf": [ { "type": "string", "enum": [ "category" ] }, { "type": "string", "enum": [ "vendor" ] }, { "type": "string", "enum": [ "account:creditCard" ] }, { "type": "string", "enum": [ "account:bankAccount" ] }, { "type": "string", "enum": [ "account:cashAdvance" ] } ] }, "entityId": { "type": "string" }, "rutterSubsidiaryId": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "rutterJournalType": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "entityName": { "type": "string" }, "rutterEntityId": { "type": "string" }, "rutterEntityName": { "type": "string" } } }, { "type": "object", "properties": { "platform": { "type": "string", "description": "DEPRECATED" } } } ] } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "entityType", "platform", "entityId", "entityName", "rutterEntityId", "rutterEntityName", "createdAt", "updatedAt" ], "properties": { "entityType": { "anyOf": [ { "type": "string", "enum": [ "category" ] }, { "type": "string", "enum": [ "vendor" ] }, { "type": "string", "enum": [ "account:creditCard" ] }, { "type": "string", "enum": [ "account:bankAccount" ] }, { "type": "string", "enum": [ "account:cashAdvance" ] } ] }, "platform": { "anyOf": [ { "type": "string", "enum": [ "quickbooks" ] }, { "type": "string", "enum": [ "quickbooks_desktop" ] }, { "type": "string", "enum": [ "netsuite" ] }, { "type": "string", "enum": [ "xero" ] }, { "type": "string", "enum": [ "sage_intacct" ] } ] }, "entityId": { "type": "string" }, "rutterSubsidiaryId": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "rutterJournalType": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "entityName": { "type": "string" }, "rutterEntityId": { "type": "string" }, "rutterEntityName": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "noActiveConnection" ] }, "message": { "type": "string" } }, "title": "noActiveConnection", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Search Accounting Integration Entity Mapping", "tags": [ "Accounting Integration Entity Mapping" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "entityIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "entityTypes", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "platforms", "required": false, "description": "[DEPRECATED] comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "number" }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "number" }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "entityType", "platform", "entityId", "entityName", "rutterEntityId", "rutterEntityName", "createdAt", "updatedAt" ], "properties": { "entityType": { "anyOf": [ { "type": "string", "enum": [ "category" ] }, { "type": "string", "enum": [ "vendor" ] }, { "type": "string", "enum": [ "account:creditCard" ] }, { "type": "string", "enum": [ "account:bankAccount" ] }, { "type": "string", "enum": [ "account:cashAdvance" ] } ] }, "platform": { "anyOf": [ { "type": "string", "enum": [ "quickbooks" ] }, { "type": "string", "enum": [ "quickbooks_desktop" ] }, { "type": "string", "enum": [ "netsuite" ] }, { "type": "string", "enum": [ "xero" ] }, { "type": "string", "enum": [ "sage_intacct" ] } ] }, "entityId": { "type": "string" }, "rutterSubsidiaryId": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "rutterJournalType": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "entityName": { "type": "string" }, "rutterEntityId": { "type": "string" }, "rutterEntityName": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "hasNext": { "type": "boolean" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "delete": { "summary": "Delete Accounting Integration Entity Mapping", "tags": [ "Accounting Integration Entity Mapping" ], "parameters": [ { "schema": { "anyOf": [ { "type": "string", "enum": [ "category" ] }, { "type": "string", "enum": [ "vendor" ] }, { "type": "string", "enum": [ "account:creditCard" ] }, { "type": "string", "enum": [ "account:bankAccount" ] }, { "type": "string", "enum": [ "account:cashAdvance" ] } ] }, "in": "query", "name": "entityType", "required": true }, { "schema": { "type": "string" }, "in": "query", "name": "entityId", "required": true }, { "schema": { "type": "string" }, "in": "query", "name": "platform", "required": false, "description": "DEPRECATED" } ], "responses": { "204": { "description": "Default Response", "content": { "application/json": { "schema": {} } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/accounting-integration-entity-mapping-suggestions": { "get": { "summary": "List AI-generated entity mapping suggestions for the authenticated customer", "tags": [ "Accounting Integration Entity Mapping" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "entityTypes", "required": false, "description": "Comma-separated entity types" }, { "schema": { "type": "string" }, "in": "query", "name": "entityIds", "required": false, "description": "Comma-separated entity IDs" } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "entityType", "entityId", "entityName", "suggestedRutterEntityId", "suggestedRutterEntityName", "confidence", "reasoning", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "entityType": { "anyOf": [ { "type": "string", "enum": [ "category" ] } ] }, "entityId": { "type": "string" }, "entityName": { "type": "string" }, "suggestedRutterEntityId": { "type": "string" }, "suggestedRutterEntityName": { "type": "string" }, "confidence": { "anyOf": [ { "type": "string", "enum": [ "high" ] }, { "type": "string", "enum": [ "medium" ] }, { "type": "string", "enum": [ "low" ] } ] }, "reasoning": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/accounting-integration-location": { "get": { "summary": "Search Accounting Platform Locations", "tags": [ "Accounting Integration Location" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "nameLike", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "cursor", "required": false, "description": "Cursor for pagination" }, { "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "rutterLocationId", "rutterParentLocationId", "name", "status", "subsidiaryIds", "createdAt", "updatedAt" ], "properties": { "rutterLocationId": { "type": "string" }, "rutterParentLocationId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "archived" ] } ] }, "subsidiaryIds": { "type": "array", "items": { "type": "string" } }, "createdAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "updatedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] } } } }, "nextCursor": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "connectionError" ] }, "message": { "type": "string" } }, "title": "connectionError", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "platformNotSupported" ] }, "message": { "type": "string" } }, "title": "platformNotSupported", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/accounting-integration-purchase-order": { "get": { "summary": "Search Accounting Platform Purchase Orders", "tags": [ "Accounting Integration Purchase Order" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "vendorRutterIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "cursor", "required": false, "description": "Cursor for pagination" }, { "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "rutterPurchaseOrderId", "platformId", "status", "issueDate" ], "properties": { "rutterPurchaseOrderId": { "type": "string" }, "platformId": { "type": "string" }, "vendorRutterId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "open" ] }, { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "closed" ] }, { "type": "string", "enum": [ "pending_bill" ] }, { "type": "string", "enum": [ "unknown" ] } ] }, "issueDate": { "type": "string", "format": "date-time" }, "currencyCode": { "type": "string" }, "documentNumber": { "type": "string" }, "memo": { "type": "string" }, "totalAmount": { "type": "string", "description": "number string" }, "totalQuantity": { "type": "number" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "nextCursor": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "connectionError" ] }, "message": { "type": "string" } }, "title": "connectionError", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/accounting-integration-purchase-order/{id}": { "get": { "summary": "Get an Accounting Platform Purchase Order", "tags": [ "Accounting Integration Purchase Order" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "rutterPurchaseOrderId", "platformId", "status", "issueDate" ], "properties": { "rutterPurchaseOrderId": { "type": "string" }, "platformId": { "type": "string" }, "vendorRutterId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "open" ] }, { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "closed" ] }, { "type": "string", "enum": [ "pending_bill" ] }, { "type": "string", "enum": [ "unknown" ] } ] }, "issueDate": { "type": "string", "format": "date-time" }, "currencyCode": { "type": "string" }, "documentNumber": { "type": "string" }, "memo": { "type": "string" }, "totalAmount": { "type": "string", "description": "number string" }, "totalQuantity": { "type": "number" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "connectionError" ] }, "message": { "type": "string" } }, "title": "connectionError", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/accounting-integration-subsidiary": { "get": { "summary": "Search Accounting Platform Subsidiaries", "tags": [ "Accounting Integration Subsidiary" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "nameLike", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "cursor", "required": false, "description": "Cursor for pagination" }, { "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "rutterSubsidiaryId", "rutterParentSubsidiaryId", "name", "country", "status", "elimination", "currencyCode", "createdAt", "updatedAt" ], "properties": { "rutterSubsidiaryId": { "type": "string" }, "rutterParentSubsidiaryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "name": { "type": "string" }, "country": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "inactive" ] } ] }, "elimination": { "type": "boolean" }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "createdAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "updatedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] } } } }, "nextCursor": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "connectionError" ] }, "message": { "type": "string" } }, "title": "connectionError", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "platformNotSupported" ] }, "message": { "type": "string" } }, "title": "platformNotSupported", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/accounting-integration-vendor": { "get": { "summary": "Search Accounting Platform Vendors", "tags": [ "Accounting Integration Vendor" ], "description": "Pages may be under-filled if `linked` parameter is used.", "parameters": [ { "schema": { "anyOf": [ { "type": "string", "enum": [ "quickbooks" ] }, { "type": "string", "enum": [ "quickbooks_desktop" ] }, { "type": "string", "enum": [ "netsuite" ] }, { "type": "string", "enum": [ "xero" ] }, { "type": "string", "enum": [ "sage_intacct" ] } ] }, "in": "query", "name": "platform", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list" }, { "schema": { "type": "boolean" }, "in": "query", "name": "linked", "required": false, "description": "Whether to return vendors that are linked to our vendors or those that are not linked. Omit to return both." }, { "schema": { "type": "string" }, "in": "query", "name": "nameLike", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "cursor", "required": false, "description": "Cursor for pagination" }, { "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "rutterVendorId", "status", "currencyCodes", "addresses" ], "properties": { "rutterVendorId": { "type": "string" }, "name": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "archived" ] }, { "type": "string", "enum": [ "unknown" ] } ] }, "email": { "type": "string" }, "phone": { "type": "string" }, "contactName": { "type": "string" }, "website": { "type": "string" }, "currencyCodes": { "type": "array", "items": { "type": "string" } }, "addresses": { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "billing" ] }, { "type": "string", "enum": [ "shipping" ] }, { "type": "string", "enum": [ "po_box" ] }, { "type": "string", "enum": [ "ship_from" ] }, { "type": "string", "enum": [ "unknown" ] } ] }, "address1": { "type": "string" }, "address2": { "type": "string" }, "city": { "type": "string" }, "country": { "type": "string" }, "postalCode": { "type": "string" }, "region": { "type": "string" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "nextCursor": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "connectionError" ] }, "message": { "type": "string" } }, "title": "connectionError", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/accounting-integration-vendor/{id}": { "get": { "summary": "Fetch an Accounting Platform Vendor by its rutter vendor id", "tags": [ "Accounting Integration Vendor" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "rutterVendorId", "status", "currencyCodes", "addresses" ], "properties": { "rutterVendorId": { "type": "string" }, "name": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "archived" ] }, { "type": "string", "enum": [ "unknown" ] } ] }, "email": { "type": "string" }, "phone": { "type": "string" }, "contactName": { "type": "string" }, "website": { "type": "string" }, "currencyCodes": { "type": "array", "items": { "type": "string" } }, "addresses": { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "billing" ] }, { "type": "string", "enum": [ "shipping" ] }, { "type": "string", "enum": [ "po_box" ] }, { "type": "string", "enum": [ "ship_from" ] }, { "type": "string", "enum": [ "unknown" ] } ] }, "address1": { "type": "string" }, "address2": { "type": "string" }, "city": { "type": "string" }, "country": { "type": "string" }, "postalCode": { "type": "string" }, "region": { "type": "string" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "connectionError" ] }, "message": { "type": "string" } }, "title": "connectionError", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/approval-request": { "get": { "summary": "Search Approval Requests", "tags": [ "Approval Request" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "ids", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "externalIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "objectIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "types", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "requesterUserIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "deciderUserIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "submittedAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "decidedAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "fulfilledAt", "required": false, "description": "::,..." }, { "schema": { "type": "integer", "minimum": 1, "default": 1 }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "integer", "minimum": 1, "default": 50, "maximum": 200 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext", "totalCount" ], "properties": { "items": { "type": "array", "items": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createCard", "enum": [ "createCard" ] }, "request": { "type": "object", "required": [ "name", "frequencyType", "cardholderId", "userId", "accountId" ], "properties": { "name": { "type": "string" }, "frequencyType": { "anyOf": [ { "type": "string", "enum": [ "recurring" ] }, { "type": "string", "enum": [ "single" ] } ] }, "cardholderId": { "type": "string" }, "userId": { "type": "string" }, "accountId": { "type": "number" }, "cardProfileId": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "expiry": { "type": "string" }, "categoryIds": { "type": "array", "items": { "type": "string" } }, "allowedCountries": { "type": "array", "items": { "type": "string" } }, "spendFrequency": { "anyOf": [ { "type": "string", "enum": [ "purchase_1d" ] }, { "type": "string", "enum": [ "purchase_7d" ] }, { "type": "string", "enum": [ "purchase_30d" ] }, { "type": "string", "enum": [ "purchase_1y" ] }, { "type": "string", "enum": [ "card_debit_lifetime" ] } ] }, "spendLimit": { "type": "number" }, "userGroupId": { "type": "string" } } } } } ], "title": "createCard" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "payBill", "enum": [ "payBill" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "payBill" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "submitExpense", "enum": [ "submitExpense" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "submitExpense" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendor", "enum": [ "createVendor" ] }, "request": { "allOf": [ { "type": "object", "required": [ "name", "owners", "currencyCode", "country" ], "properties": { "externalId": { "type": "string" }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } } } }, { "type": "object", "required": [ "rutterId", "currencyCode", "contacts" ], "properties": { "rutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Rutter vendor ID. If null, the vendor will be created in the accounting platform." }, "currencyCode": { "type": "string", "description": "ISO 4217 currency code" }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "name", "default", "email" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } } ] } } } ], "title": "createVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "updateVendor", "enum": [ "updateVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "address": { "anyOf": [ { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, { "type": "null" } ] }, "taxId": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "legalName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "logoUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantCategory": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantIds": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] } } } } } ], "title": "updateVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendorPaymentMethod", "enum": [ "createVendorPaymentMethod" ] }, "request": { "anyOf": [ { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH business payment method" }, { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH individual payment method" } ] } } } ], "title": "createVendorPaymentMethod" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "deleteVendorPaymentMethod", "enum": [ "deleteVendorPaymentMethod" ] }, "request": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } } } } ], "title": "deleteVendorPaymentMethod" } ], "description": "Approval request, discriminated by `type`" } }, "hasNext": { "type": "boolean" }, "totalCount": { "type": "integer" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/approval-request/for-decider": { "get": { "summary": "Search Approval Requests that require your decision", "tags": [ "Approval Request" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "ids", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "types", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "requesterUserIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createCard", "enum": [ "createCard" ] }, "request": { "type": "object", "required": [ "name", "frequencyType", "cardholderId", "userId", "accountId" ], "properties": { "name": { "type": "string" }, "frequencyType": { "anyOf": [ { "type": "string", "enum": [ "recurring" ] }, { "type": "string", "enum": [ "single" ] } ] }, "cardholderId": { "type": "string" }, "userId": { "type": "string" }, "accountId": { "type": "number" }, "cardProfileId": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "expiry": { "type": "string" }, "categoryIds": { "type": "array", "items": { "type": "string" } }, "allowedCountries": { "type": "array", "items": { "type": "string" } }, "spendFrequency": { "anyOf": [ { "type": "string", "enum": [ "purchase_1d" ] }, { "type": "string", "enum": [ "purchase_7d" ] }, { "type": "string", "enum": [ "purchase_30d" ] }, { "type": "string", "enum": [ "purchase_1y" ] }, { "type": "string", "enum": [ "card_debit_lifetime" ] } ] }, "spendLimit": { "type": "number" }, "userGroupId": { "type": "string" } } } } } ], "title": "createCard" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "payBill", "enum": [ "payBill" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "payBill" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "submitExpense", "enum": [ "submitExpense" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "submitExpense" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendor", "enum": [ "createVendor" ] }, "request": { "allOf": [ { "type": "object", "required": [ "name", "owners", "currencyCode", "country" ], "properties": { "externalId": { "type": "string" }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } } } }, { "type": "object", "required": [ "rutterId", "currencyCode", "contacts" ], "properties": { "rutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Rutter vendor ID. If null, the vendor will be created in the accounting platform." }, "currencyCode": { "type": "string", "description": "ISO 4217 currency code" }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "name", "default", "email" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } } ] } } } ], "title": "createVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "updateVendor", "enum": [ "updateVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "address": { "anyOf": [ { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, { "type": "null" } ] }, "taxId": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "legalName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "logoUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantCategory": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantIds": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] } } } } } ], "title": "updateVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendorPaymentMethod", "enum": [ "createVendorPaymentMethod" ] }, "request": { "anyOf": [ { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH business payment method" }, { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH individual payment method" } ] } } } ], "title": "createVendorPaymentMethod" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "deleteVendorPaymentMethod", "enum": [ "deleteVendorPaymentMethod" ] }, "request": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } } } } ], "title": "deleteVendorPaymentMethod" } ], "description": "Approval request, discriminated by `type`" } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/approval-request/{id}": { "patch": { "summary": "Update an Approval Request", "tags": [ "Approval Request" ], "description": "Update general approval request attributes only. For updating the underlying `request`, see `PATCH /v1/web/approval-request/{id}/request`", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "externalId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Approval request, discriminated by `type`", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createCard", "enum": [ "createCard" ] }, "request": { "type": "object", "required": [ "name", "frequencyType", "cardholderId", "userId", "accountId" ], "properties": { "name": { "type": "string" }, "frequencyType": { "anyOf": [ { "type": "string", "enum": [ "recurring" ] }, { "type": "string", "enum": [ "single" ] } ] }, "cardholderId": { "type": "string" }, "userId": { "type": "string" }, "accountId": { "type": "number" }, "cardProfileId": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "expiry": { "type": "string" }, "categoryIds": { "type": "array", "items": { "type": "string" } }, "allowedCountries": { "type": "array", "items": { "type": "string" } }, "spendFrequency": { "anyOf": [ { "type": "string", "enum": [ "purchase_1d" ] }, { "type": "string", "enum": [ "purchase_7d" ] }, { "type": "string", "enum": [ "purchase_30d" ] }, { "type": "string", "enum": [ "purchase_1y" ] }, { "type": "string", "enum": [ "card_debit_lifetime" ] } ] }, "spendLimit": { "type": "number" }, "userGroupId": { "type": "string" } } } } } ], "title": "createCard" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "payBill", "enum": [ "payBill" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "payBill" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "submitExpense", "enum": [ "submitExpense" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "submitExpense" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendor", "enum": [ "createVendor" ] }, "request": { "allOf": [ { "type": "object", "required": [ "name", "owners", "currencyCode", "country" ], "properties": { "externalId": { "type": "string" }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } } } }, { "type": "object", "required": [ "rutterId", "currencyCode", "contacts" ], "properties": { "rutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Rutter vendor ID. If null, the vendor will be created in the accounting platform." }, "currencyCode": { "type": "string", "description": "ISO 4217 currency code" }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "name", "default", "email" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } } ] } } } ], "title": "createVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "updateVendor", "enum": [ "updateVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "address": { "anyOf": [ { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, { "type": "null" } ] }, "taxId": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "legalName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "logoUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantCategory": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantIds": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] } } } } } ], "title": "updateVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendorPaymentMethod", "enum": [ "createVendorPaymentMethod" ] }, "request": { "anyOf": [ { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH business payment method" }, { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH individual payment method" } ] } } } ], "title": "createVendorPaymentMethod" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "deleteVendorPaymentMethod", "enum": [ "deleteVendorPaymentMethod" ] }, "request": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } } } } ], "title": "deleteVendorPaymentMethod" } ], "description": "Approval request, discriminated by `type`" } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Get an Approval Request", "tags": [ "Approval Request" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createCard", "enum": [ "createCard" ] }, "request": { "type": "object", "required": [ "name", "frequencyType", "cardholderId", "userId", "accountId" ], "properties": { "name": { "type": "string" }, "frequencyType": { "anyOf": [ { "type": "string", "enum": [ "recurring" ] }, { "type": "string", "enum": [ "single" ] } ] }, "cardholderId": { "type": "string" }, "userId": { "type": "string" }, "accountId": { "type": "number" }, "cardProfileId": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "expiry": { "type": "string" }, "categoryIds": { "type": "array", "items": { "type": "string" } }, "allowedCountries": { "type": "array", "items": { "type": "string" } }, "spendFrequency": { "anyOf": [ { "type": "string", "enum": [ "purchase_1d" ] }, { "type": "string", "enum": [ "purchase_7d" ] }, { "type": "string", "enum": [ "purchase_30d" ] }, { "type": "string", "enum": [ "purchase_1y" ] }, { "type": "string", "enum": [ "card_debit_lifetime" ] } ] }, "spendLimit": { "type": "number" }, "userGroupId": { "type": "string" } } } } } ], "title": "createCard" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "payBill", "enum": [ "payBill" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "payBill" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "submitExpense", "enum": [ "submitExpense" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "submitExpense" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendor", "enum": [ "createVendor" ] }, "request": { "allOf": [ { "type": "object", "required": [ "name", "owners", "currencyCode", "country" ], "properties": { "externalId": { "type": "string" }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } } } }, { "type": "object", "required": [ "rutterId", "currencyCode", "contacts" ], "properties": { "rutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Rutter vendor ID. If null, the vendor will be created in the accounting platform." }, "currencyCode": { "type": "string", "description": "ISO 4217 currency code" }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "name", "default", "email" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } } ] } } } ], "title": "createVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "updateVendor", "enum": [ "updateVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "address": { "anyOf": [ { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, { "type": "null" } ] }, "taxId": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "legalName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "logoUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantCategory": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantIds": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] } } } } } ], "title": "updateVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendorPaymentMethod", "enum": [ "createVendorPaymentMethod" ] }, "request": { "anyOf": [ { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH business payment method" }, { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH individual payment method" } ] } } } ], "title": "createVendorPaymentMethod" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "deleteVendorPaymentMethod", "enum": [ "deleteVendorPaymentMethod" ] }, "request": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } } } } ], "title": "deleteVendorPaymentMethod" } ], "description": "Approval request, discriminated by `type`" }, { "type": "object", "required": [ "requesterUser", "deciderUsers", "observerUsers" ], "properties": { "requesterUser": { "type": "object", "required": [ "id", "status", "name", "email", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "invited" ] }, { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, "deciderUsers": { "type": "array", "items": { "type": "object", "required": [ "id", "status", "name", "email", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "invited" ] }, { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "observerUsers": { "type": "array", "items": { "type": "object", "required": [ "id", "status", "name", "email", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "invited" ] }, { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "delete": { "summary": "Delete an Approval Request", "tags": [ "Approval Request" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Approval request, discriminated by `type`", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createCard", "enum": [ "createCard" ] }, "request": { "type": "object", "required": [ "name", "frequencyType", "cardholderId", "userId", "accountId" ], "properties": { "name": { "type": "string" }, "frequencyType": { "anyOf": [ { "type": "string", "enum": [ "recurring" ] }, { "type": "string", "enum": [ "single" ] } ] }, "cardholderId": { "type": "string" }, "userId": { "type": "string" }, "accountId": { "type": "number" }, "cardProfileId": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "expiry": { "type": "string" }, "categoryIds": { "type": "array", "items": { "type": "string" } }, "allowedCountries": { "type": "array", "items": { "type": "string" } }, "spendFrequency": { "anyOf": [ { "type": "string", "enum": [ "purchase_1d" ] }, { "type": "string", "enum": [ "purchase_7d" ] }, { "type": "string", "enum": [ "purchase_30d" ] }, { "type": "string", "enum": [ "purchase_1y" ] }, { "type": "string", "enum": [ "card_debit_lifetime" ] } ] }, "spendLimit": { "type": "number" }, "userGroupId": { "type": "string" } } } } } ], "title": "createCard" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "payBill", "enum": [ "payBill" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "payBill" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "submitExpense", "enum": [ "submitExpense" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "submitExpense" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendor", "enum": [ "createVendor" ] }, "request": { "allOf": [ { "type": "object", "required": [ "name", "owners", "currencyCode", "country" ], "properties": { "externalId": { "type": "string" }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } } } }, { "type": "object", "required": [ "rutterId", "currencyCode", "contacts" ], "properties": { "rutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Rutter vendor ID. If null, the vendor will be created in the accounting platform." }, "currencyCode": { "type": "string", "description": "ISO 4217 currency code" }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "name", "default", "email" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } } ] } } } ], "title": "createVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "updateVendor", "enum": [ "updateVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "address": { "anyOf": [ { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, { "type": "null" } ] }, "taxId": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "legalName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "logoUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantCategory": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantIds": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] } } } } } ], "title": "updateVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendorPaymentMethod", "enum": [ "createVendorPaymentMethod" ] }, "request": { "anyOf": [ { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH business payment method" }, { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH individual payment method" } ] } } } ], "title": "createVendorPaymentMethod" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "deleteVendorPaymentMethod", "enum": [ "deleteVendorPaymentMethod" ] }, "request": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } } } } ], "title": "deleteVendorPaymentMethod" } ], "description": "Approval request, discriminated by `type`" } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/approval-request/{id}/request": { "patch": { "summary": "Update approval request's underlying request", "tags": [ "Approval Request" ], "description": "Only updates `request`. To update other fields, see `PATCH /v1/web/approval-request/{id}`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "approvalRequestType" ], "properties": { "approvalRequestType": { "type": "string", "enum": [ "createCard" ] } } }, { "type": "object", "required": [ "name", "frequencyType", "cardholderId", "userId", "accountId" ], "properties": { "name": { "type": "string" }, "frequencyType": { "anyOf": [ { "type": "string", "enum": [ "recurring" ] }, { "type": "string", "enum": [ "single" ] } ] }, "cardholderId": { "type": "string" }, "userId": { "type": "string" }, "accountId": { "type": "number" }, "cardProfileId": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "expiry": { "type": "string" }, "categoryIds": { "type": "array", "items": { "type": "string" } }, "allowedCountries": { "type": "array", "items": { "type": "string" } }, "spendFrequency": { "anyOf": [ { "type": "string", "enum": [ "purchase_1d" ] }, { "type": "string", "enum": [ "purchase_7d" ] }, { "type": "string", "enum": [ "purchase_30d" ] }, { "type": "string", "enum": [ "purchase_1y" ] }, { "type": "string", "enum": [ "card_debit_lifetime" ] } ] }, "spendLimit": { "type": "number" }, "userGroupId": { "type": "string" } } } ], "title": "createCard" }, { "allOf": [ { "type": "object", "required": [ "approvalRequestType" ], "properties": { "approvalRequestType": { "type": "string", "enum": [ "payBill" ] } } }, { "type": "object", "properties": {} } ], "title": "payBill" }, { "allOf": [ { "type": "object", "required": [ "approvalRequestType" ], "properties": { "approvalRequestType": { "type": "string", "enum": [ "submitExpense" ] } } }, { "type": "object", "properties": {} } ], "title": "submitExpense" }, { "allOf": [ { "type": "object", "required": [ "approvalRequestType" ], "properties": { "approvalRequestType": { "type": "string", "enum": [ "createVendor" ] } } }, { "allOf": [ { "type": "object", "required": [ "name", "owners", "currencyCode", "country" ], "properties": { "externalId": { "type": "string" }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } } } }, { "type": "object", "required": [ "rutterId", "currencyCode", "contacts" ], "properties": { "rutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Rutter vendor ID. If null, the vendor will be created in the accounting platform." }, "currencyCode": { "type": "string", "description": "ISO 4217 currency code" }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "name", "default", "email" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } } ] } ], "title": "createVendor" }, { "allOf": [ { "type": "object", "required": [ "approvalRequestType" ], "properties": { "approvalRequestType": { "type": "string", "enum": [ "updateVendor" ] } } }, { "type": "object", "properties": { "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "address": { "anyOf": [ { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, { "type": "null" } ] }, "taxId": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "legalName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "logoUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantCategory": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantIds": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] } } } ], "title": "updateVendor" }, { "allOf": [ { "type": "object", "required": [ "approvalRequestType" ], "properties": { "approvalRequestType": { "type": "string", "enum": [ "createVendorPaymentMethod" ] } } }, { "anyOf": [ { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH business payment method" }, { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH individual payment method" } ] } ], "title": "createVendorPaymentMethod" }, { "allOf": [ { "type": "object", "required": [ "approvalRequestType" ], "properties": { "approvalRequestType": { "type": "string", "enum": [ "deleteVendorPaymentMethod" ] } } }, { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } } ], "title": "deleteVendorPaymentMethod" } ], "description": "Request payload to update an approval request's `request`, discriminated by `approvalRequestType`" } } }, "description": "Request payload to update an approval request's `request`, discriminated by `approvalRequestType`" }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Approval request, discriminated by `type`", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createCard", "enum": [ "createCard" ] }, "request": { "type": "object", "required": [ "name", "frequencyType", "cardholderId", "userId", "accountId" ], "properties": { "name": { "type": "string" }, "frequencyType": { "anyOf": [ { "type": "string", "enum": [ "recurring" ] }, { "type": "string", "enum": [ "single" ] } ] }, "cardholderId": { "type": "string" }, "userId": { "type": "string" }, "accountId": { "type": "number" }, "cardProfileId": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "expiry": { "type": "string" }, "categoryIds": { "type": "array", "items": { "type": "string" } }, "allowedCountries": { "type": "array", "items": { "type": "string" } }, "spendFrequency": { "anyOf": [ { "type": "string", "enum": [ "purchase_1d" ] }, { "type": "string", "enum": [ "purchase_7d" ] }, { "type": "string", "enum": [ "purchase_30d" ] }, { "type": "string", "enum": [ "purchase_1y" ] }, { "type": "string", "enum": [ "card_debit_lifetime" ] } ] }, "spendLimit": { "type": "number" }, "userGroupId": { "type": "string" } } } } } ], "title": "createCard" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "payBill", "enum": [ "payBill" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "payBill" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "submitExpense", "enum": [ "submitExpense" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "submitExpense" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendor", "enum": [ "createVendor" ] }, "request": { "allOf": [ { "type": "object", "required": [ "name", "owners", "currencyCode", "country" ], "properties": { "externalId": { "type": "string" }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } } } }, { "type": "object", "required": [ "rutterId", "currencyCode", "contacts" ], "properties": { "rutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Rutter vendor ID. If null, the vendor will be created in the accounting platform." }, "currencyCode": { "type": "string", "description": "ISO 4217 currency code" }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "name", "default", "email" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } } ] } } } ], "title": "createVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "updateVendor", "enum": [ "updateVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "address": { "anyOf": [ { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, { "type": "null" } ] }, "taxId": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "legalName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "logoUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantCategory": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantIds": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] } } } } } ], "title": "updateVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendorPaymentMethod", "enum": [ "createVendorPaymentMethod" ] }, "request": { "anyOf": [ { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH business payment method" }, { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH individual payment method" } ] } } } ], "title": "createVendorPaymentMethod" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "deleteVendorPaymentMethod", "enum": [ "deleteVendorPaymentMethod" ] }, "request": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } } } } ], "title": "deleteVendorPaymentMethod" } ], "description": "Approval request, discriminated by `type`" } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/approval-request/{id}/submit": { "post": { "summary": "Submit an Approval Request for Decision", "tags": [ "Approval Request" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Approval request, discriminated by `type`", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createCard", "enum": [ "createCard" ] }, "request": { "type": "object", "required": [ "name", "frequencyType", "cardholderId", "userId", "accountId" ], "properties": { "name": { "type": "string" }, "frequencyType": { "anyOf": [ { "type": "string", "enum": [ "recurring" ] }, { "type": "string", "enum": [ "single" ] } ] }, "cardholderId": { "type": "string" }, "userId": { "type": "string" }, "accountId": { "type": "number" }, "cardProfileId": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "expiry": { "type": "string" }, "categoryIds": { "type": "array", "items": { "type": "string" } }, "allowedCountries": { "type": "array", "items": { "type": "string" } }, "spendFrequency": { "anyOf": [ { "type": "string", "enum": [ "purchase_1d" ] }, { "type": "string", "enum": [ "purchase_7d" ] }, { "type": "string", "enum": [ "purchase_30d" ] }, { "type": "string", "enum": [ "purchase_1y" ] }, { "type": "string", "enum": [ "card_debit_lifetime" ] } ] }, "spendLimit": { "type": "number" }, "userGroupId": { "type": "string" } } } } } ], "title": "createCard" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "payBill", "enum": [ "payBill" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "payBill" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "submitExpense", "enum": [ "submitExpense" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "submitExpense" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendor", "enum": [ "createVendor" ] }, "request": { "allOf": [ { "type": "object", "required": [ "name", "owners", "currencyCode", "country" ], "properties": { "externalId": { "type": "string" }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } } } }, { "type": "object", "required": [ "rutterId", "currencyCode", "contacts" ], "properties": { "rutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Rutter vendor ID. If null, the vendor will be created in the accounting platform." }, "currencyCode": { "type": "string", "description": "ISO 4217 currency code" }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "name", "default", "email" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } } ] } } } ], "title": "createVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "updateVendor", "enum": [ "updateVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "address": { "anyOf": [ { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, { "type": "null" } ] }, "taxId": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "legalName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "logoUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantCategory": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantIds": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] } } } } } ], "title": "updateVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendorPaymentMethod", "enum": [ "createVendorPaymentMethod" ] }, "request": { "anyOf": [ { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH business payment method" }, { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH individual payment method" } ] } } } ], "title": "createVendorPaymentMethod" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "deleteVendorPaymentMethod", "enum": [ "deleteVendorPaymentMethod" ] }, "request": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } } } } ], "title": "deleteVendorPaymentMethod" } ], "description": "Approval request, discriminated by `type`" } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/approval-request/{id}/unsubmit": { "post": { "summary": "Pull back a submitted approval request", "tags": [ "Approval Request" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Approval request, discriminated by `type`", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createCard", "enum": [ "createCard" ] }, "request": { "type": "object", "required": [ "name", "frequencyType", "cardholderId", "userId", "accountId" ], "properties": { "name": { "type": "string" }, "frequencyType": { "anyOf": [ { "type": "string", "enum": [ "recurring" ] }, { "type": "string", "enum": [ "single" ] } ] }, "cardholderId": { "type": "string" }, "userId": { "type": "string" }, "accountId": { "type": "number" }, "cardProfileId": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "expiry": { "type": "string" }, "categoryIds": { "type": "array", "items": { "type": "string" } }, "allowedCountries": { "type": "array", "items": { "type": "string" } }, "spendFrequency": { "anyOf": [ { "type": "string", "enum": [ "purchase_1d" ] }, { "type": "string", "enum": [ "purchase_7d" ] }, { "type": "string", "enum": [ "purchase_30d" ] }, { "type": "string", "enum": [ "purchase_1y" ] }, { "type": "string", "enum": [ "card_debit_lifetime" ] } ] }, "spendLimit": { "type": "number" }, "userGroupId": { "type": "string" } } } } } ], "title": "createCard" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "payBill", "enum": [ "payBill" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "payBill" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "submitExpense", "enum": [ "submitExpense" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "submitExpense" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendor", "enum": [ "createVendor" ] }, "request": { "allOf": [ { "type": "object", "required": [ "name", "owners", "currencyCode", "country" ], "properties": { "externalId": { "type": "string" }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } } } }, { "type": "object", "required": [ "rutterId", "currencyCode", "contacts" ], "properties": { "rutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Rutter vendor ID. If null, the vendor will be created in the accounting platform." }, "currencyCode": { "type": "string", "description": "ISO 4217 currency code" }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "name", "default", "email" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } } ] } } } ], "title": "createVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "updateVendor", "enum": [ "updateVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "address": { "anyOf": [ { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, { "type": "null" } ] }, "taxId": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "legalName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "logoUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantCategory": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantIds": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] } } } } } ], "title": "updateVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendorPaymentMethod", "enum": [ "createVendorPaymentMethod" ] }, "request": { "anyOf": [ { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH business payment method" }, { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH individual payment method" } ] } } } ], "title": "createVendorPaymentMethod" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "deleteVendorPaymentMethod", "enum": [ "deleteVendorPaymentMethod" ] }, "request": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } } } } ], "title": "deleteVendorPaymentMethod" } ], "description": "Approval request, discriminated by `type`" } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/approval-request/{id}/decide": { "post": { "summary": "Decide on an Approval Request", "tags": [ "Approval Request" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] } ] } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Approval request, discriminated by `type`", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createCard", "enum": [ "createCard" ] }, "request": { "type": "object", "required": [ "name", "frequencyType", "cardholderId", "userId", "accountId" ], "properties": { "name": { "type": "string" }, "frequencyType": { "anyOf": [ { "type": "string", "enum": [ "recurring" ] }, { "type": "string", "enum": [ "single" ] } ] }, "cardholderId": { "type": "string" }, "userId": { "type": "string" }, "accountId": { "type": "number" }, "cardProfileId": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "expiry": { "type": "string" }, "categoryIds": { "type": "array", "items": { "type": "string" } }, "allowedCountries": { "type": "array", "items": { "type": "string" } }, "spendFrequency": { "anyOf": [ { "type": "string", "enum": [ "purchase_1d" ] }, { "type": "string", "enum": [ "purchase_7d" ] }, { "type": "string", "enum": [ "purchase_30d" ] }, { "type": "string", "enum": [ "purchase_1y" ] }, { "type": "string", "enum": [ "card_debit_lifetime" ] } ] }, "spendLimit": { "type": "number" }, "userGroupId": { "type": "string" } } } } } ], "title": "createCard" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "payBill", "enum": [ "payBill" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "payBill" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "submitExpense", "enum": [ "submitExpense" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "submitExpense" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendor", "enum": [ "createVendor" ] }, "request": { "allOf": [ { "type": "object", "required": [ "name", "owners", "currencyCode", "country" ], "properties": { "externalId": { "type": "string" }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } } } }, { "type": "object", "required": [ "rutterId", "currencyCode", "contacts" ], "properties": { "rutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Rutter vendor ID. If null, the vendor will be created in the accounting platform." }, "currencyCode": { "type": "string", "description": "ISO 4217 currency code" }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "name", "default", "email" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } } ] } } } ], "title": "createVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "updateVendor", "enum": [ "updateVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "address": { "anyOf": [ { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, { "type": "null" } ] }, "taxId": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "legalName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "logoUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantCategory": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantIds": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] } } } } } ], "title": "updateVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendorPaymentMethod", "enum": [ "createVendorPaymentMethod" ] }, "request": { "anyOf": [ { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH business payment method" }, { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH individual payment method" } ] } } } ], "title": "createVendorPaymentMethod" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "deleteVendorPaymentMethod", "enum": [ "deleteVendorPaymentMethod" ] }, "request": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } } } } ], "title": "deleteVendorPaymentMethod" } ], "description": "Approval request, discriminated by `type`" } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/approval-request/{id}/deciders": { "get": { "summary": "Get resolved deciders for an Approval Request", "tags": [ "Approval Request" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "status", "name", "email", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "invited" ] }, { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/approval-request/{approvalRequestId}/note": { "post": { "summary": "Add a Note to an Approval Request", "tags": [ "Approval Request" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "content" ], "properties": { "content": { "type": "string" } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "approvalRequestId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/approval-request/{approvalRequestId}/note/{id}": { "patch": { "summary": "Update a Note on an Approval Request", "tags": [ "Approval Request" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "content" ], "properties": { "content": { "type": "string" } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "approvalRequestId", "required": true }, { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "delete": { "summary": "Delete a Note from an Approval Request", "tags": [ "Approval Request" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "approvalRequestId", "required": true }, { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/aggregate": { "post": { "summary": "Aggregate Bill Data", "tags": [ "Bill Analytics" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "bucket", "value" ], "properties": { "bucket": { "anyOf": [ { "type": "object", "required": [ "field" ], "properties": { "field": { "anyOf": [ { "type": "string", "enum": [ "status" ] }, { "type": "string", "enum": [ "fundingSource" ] }, { "type": "string", "enum": [ "syncStatus" ] }, { "type": "string", "enum": [ "ingestionChannel" ] }, { "type": "string", "enum": [ "vendor" ] } ] } } }, { "type": "object", "required": [ "field", "timeframe" ], "properties": { "field": { "anyOf": [ { "type": "string", "enum": [ "createdAt" ] }, { "type": "string", "enum": [ "invoiceDate" ] }, { "type": "string", "enum": [ "paymentDueDate" ] }, { "type": "string", "enum": [ "paymentScheduledDate" ] }, { "type": "string", "enum": [ "completedAt" ] } ] }, "timeframe": { "anyOf": [ { "type": "string", "enum": [ "day" ] }, { "type": "string", "enum": [ "month" ] } ] } } } ] }, "value": { "anyOf": [ { "type": "object", "required": [ "field", "aggregateMethod" ], "properties": { "field": { "type": "string", "enum": [ "amount" ] }, "aggregateMethod": { "anyOf": [ { "type": "string", "enum": [ "avg" ] }, { "type": "string", "enum": [ "sum" ] } ] } } }, { "type": "object", "required": [ "aggregateMethod" ], "properties": { "aggregateMethod": { "type": "string", "enum": [ "count" ] } } } ] }, "filters": { "type": "array", "items": { "anyOf": [ { "type": "object", "required": [ "field", "value" ], "properties": { "field": { "anyOf": [ { "type": "string", "enum": [ "createdAt" ] }, { "type": "string", "enum": [ "completedAt" ] } ] }, "value": { "type": "object", "properties": { "before": { "type": "string", "format": "date-time" }, "after": { "type": "string", "format": "date-time" } }, "minProperties": 1 } } }, { "type": "object", "required": [ "field", "value" ], "properties": { "field": { "anyOf": [ { "type": "string", "enum": [ "invoiceDate" ] }, { "type": "string", "enum": [ "paymentDueDate" ] }, { "type": "string", "enum": [ "paymentScheduledDate" ] } ] }, "value": { "type": "object", "properties": { "before": { "type": "string", "format": "date" }, "after": { "type": "string", "format": "date" } }, "minProperties": 1 } } }, { "type": "object", "required": [ "field", "value" ], "properties": { "field": { "anyOf": [ { "type": "string", "enum": [ "status" ] }, { "type": "string", "enum": [ "fundingSource" ] }, { "type": "string", "enum": [ "syncStatus" ] }, { "type": "string", "enum": [ "ingestionChannel" ] } ] }, "value": { "type": "array", "items": { "type": "string" }, "minItems": 1 } } }, { "type": "object", "required": [ "field", "value" ], "properties": { "field": { "type": "string", "enum": [ "vendorIds" ] }, "value": { "type": "array", "items": { "type": "string", "minLength": 1 }, "minItems": 1, "maxItems": 100 } } } ] } } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "bucket", "value" ], "properties": { "bucket": { "anyOf": [ { "type": "string" }, { "type": "boolean" }, { "type": "null" } ] }, "value": { "type": "string" } } } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/aging": { "post": { "summary": "Bill AP Aging", "tags": [ "Bill Analytics" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": {} } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "buckets" ], "properties": { "buckets": { "type": "array", "items": { "type": "object", "required": [ "bucket", "count", "totalAmount" ], "properties": { "bucket": { "anyOf": [ { "type": "string", "enum": [ "overdue60Plus" ] }, { "type": "string", "enum": [ "overdue31to60" ] }, { "type": "string", "enum": [ "overdue1to30" ] }, { "type": "string", "enum": [ "dueThisWeek" ] }, { "type": "string", "enum": [ "future" ] }, { "type": "string", "enum": [ "noDueDate" ] } ] }, "count": { "type": "number" }, "totalAmount": { "type": "string" } } } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/stage-durations": { "post": { "summary": "Bill Pipeline Stage Durations", "tags": [ "Bill Analytics" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "before": { "type": "string", "format": "date-time" }, "after": { "type": "string", "format": "date-time" } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "stages" ], "properties": { "stages": { "type": "array", "items": { "type": "object", "required": [ "stage", "avgDays", "medianDays", "count" ], "properties": { "stage": { "anyOf": [ { "type": "string", "enum": [ "draftToSubmitted" ] }, { "type": "string", "enum": [ "submittedToApproved" ] }, { "type": "string", "enum": [ "submittedToPaid" ] } ] }, "avgDays": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "medianDays": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "count": { "type": "number" } } } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill": { "post": { "summary": "Create a bill", "tags": [ "Bill" ], "description": "If you want to create a bill based on an invoice, use `POST /v1/web/bill/invoice` instead.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "externalId": { "type": "string" }, "vendorId": { "type": "string" }, "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "paymentDueDate": { "type": "string", "format": "date", "description": "The date that the invoice says the payment is due, in ISO date string, YYYY-MM-DD" }, "totalAmount": { "type": "string", "description": "number string" }, "description": { "type": "string" }, "paymentScheduledDate": { "type": "string", "format": "date", "description": "When the payment will be triggered, in ISO date string, YYYY-MM-DD. It should be far enough in advance so when the payment reaches the vendor, it is still before or on the paymentDueDate. Date is based on the payment processor's timezone, i.e. EST." }, "paymentRoute": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] } } } ] }, { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "id", "speed", "memo" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" } } }, { "type": "object", "required": [ "type", "sharedByName", "email" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" } } } ] } ] }, "description": "Flat ordered array of hops the funds will travel through" }, { "type": "array", "additionalItems": false, "items": [ { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "offPlatform" ] }, "note": { "type": "string" } } } ], "minItems": 1 } ] }, "remittanceNotification": { "type": "object", "required": [ "recipients" ], "properties": { "recipients": { "type": "array", "items": { "type": "object", "required": [ "name", "email" ], "properties": { "name": { "type": "string" }, "email": { "type": "string" } } } } }, "description": "Notifications when a bill is paid" }, "purchaseOrder": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "manual" ] }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "rutterId", "platformId" ], "properties": { "type": { "type": "string", "enum": [ "rutter" ] }, "rutterId": { "type": "string" }, "platformId": { "type": "string" } } } ] } } } } } }, "responses": { "201": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "creatorUserId", "lineItems", "documents", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "paymentPending" ] }, { "type": "string", "enum": [ "paymentInProgress" ] }, { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "paymentFailed" ] }, { "type": "string", "enum": [ "manuallyCompleted" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creatorUserId": { "type": "string" }, "vendorId": { "type": "string" }, "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "paymentDueDate": { "type": "string", "format": "date", "description": "The date that the invoice says the payment is due, in ISO date string, YYYY-MM-DD" }, "totalAmount": { "type": "string", "description": "number string" }, "description": { "type": "string" }, "lineItems": { "type": "array", "items": { "type": "object", "required": [ "id", "amount" ], "properties": { "id": { "type": "string" }, "description": { "type": "string" }, "amount": { "type": "string", "description": "Number string" }, "spendCategoryId": { "type": "string" } } } }, "documents": { "type": "array", "items": { "type": "object", "required": [ "id", "fileName", "type", "status", "createdAt" ], "properties": { "id": { "type": "string" }, "fileName": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "invoice" ] }, { "type": "string", "enum": [ "supporting" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "parsed" ] } ] }, "parsedData": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achRoutingNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "amount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } } }, "paymentScheduledDate": { "type": "string", "format": "date", "description": "When the payment will be triggered, in ISO date string, YYYY-MM-DD. It should be far enough in advance so when the payment reaches the vendor, it is still before or on the paymentDueDate. Date is based on the payment processor's timezone, i.e. EST." }, "paymentRoute": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] } } } ] }, { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "id", "speed", "memo" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" } } }, { "type": "object", "required": [ "type", "sharedByName", "email" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" } } } ] } ] }, "description": "Flat ordered array of hops the funds will travel through" }, { "type": "array", "additionalItems": false, "items": [ { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "offPlatform" ] }, "note": { "type": "string" } } } ], "minItems": 1 } ] }, "remittanceNotification": { "type": "object", "required": [ "recipients" ], "properties": { "recipients": { "type": "array", "items": { "type": "object", "required": [ "name", "email" ], "properties": { "name": { "type": "string" }, "email": { "type": "string" } } } } }, "description": "Notifications when a bill is paid" }, "payment": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "description": "Reference ID for this payment" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } }, "manualCompletion": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "notPaid" ] } ] }, "reason": { "type": "string" } }, "description": "Set when the bill was manually completed" }, "purchaseOrder": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "manual" ] }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "rutterId", "platformId" ], "properties": { "type": { "type": "string", "enum": [ "rutter" ] }, "rutterId": { "type": "string" }, "platformId": { "type": "string" } } } ] }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidCurrencyCode" ] }, "message": { "type": "string" } }, "title": "invalidCurrencyCode", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidTotalAmount" ] }, "message": { "type": "string" } }, "title": "invalidTotalAmount", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidVendorId" ] }, "message": { "type": "string" } }, "title": "invalidVendorId", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidPaymentScheduledDate" ] }, "message": { "type": "string" } }, "title": "invalidPaymentScheduledDate", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Search for bills", "tags": [ "Bill" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "ids", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "externalIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list; bill statuses (draft, submitted, returned, paymentPending, paymentInProgress, paymentFailed, paid, manuallyCompleted, deleted) or accounting integration sync statuses (sync:inProgress, sync:successful, sync:failed), payment sync statuses (paymentSync:inProgress, paymentSync:successful, paymentSync:failed), or document sync statuses (documentSync:inProgress, documentSync:successful, documentSync:failed)" }, { "schema": { "type": "string" }, "in": "query", "name": "vendorIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "creatorUserIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "invoiceIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "partialText", "required": false, "description": "case-insensitive substring match on billId, externalId, invoiceId, creator name, or vendor name" }, { "schema": { "type": "string" }, "in": "query", "name": "rutterIds", "required": false, "description": "comma-separated list; include `null` to match unlinked bills" }, { "schema": { "type": "string" }, "in": "query", "name": "accountingPlatformIds", "required": false, "description": "comma-separated list; include `null` to match unlinked bills" }, { "schema": { "type": "string" }, "in": "query", "name": "invoiceDate", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "paymentDueDate", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "paymentScheduledDate", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "submittedAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "completedAt", "required": false, "description": "::,..." }, { "schema": { "type": "integer", "minimum": 1, "default": 1 }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext", "totalCount" ], "properties": { "items": { "type": "array", "items": { "allOf": [ { "type": "object", "required": [ "id", "status", "creatorUserId", "lineItems", "documents", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "paymentPending" ] }, { "type": "string", "enum": [ "paymentInProgress" ] }, { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "paymentFailed" ] }, { "type": "string", "enum": [ "manuallyCompleted" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creatorUserId": { "type": "string" }, "vendorId": { "type": "string" }, "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "paymentDueDate": { "type": "string", "format": "date", "description": "The date that the invoice says the payment is due, in ISO date string, YYYY-MM-DD" }, "totalAmount": { "type": "string", "description": "number string" }, "description": { "type": "string" }, "lineItems": { "type": "array", "items": { "type": "object", "required": [ "id", "amount" ], "properties": { "id": { "type": "string" }, "description": { "type": "string" }, "amount": { "type": "string", "description": "Number string" }, "spendCategoryId": { "type": "string" } } } }, "documents": { "type": "array", "items": { "type": "object", "required": [ "id", "fileName", "type", "status", "createdAt" ], "properties": { "id": { "type": "string" }, "fileName": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "invoice" ] }, { "type": "string", "enum": [ "supporting" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "parsed" ] } ] }, "parsedData": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achRoutingNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "amount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } } }, "paymentScheduledDate": { "type": "string", "format": "date", "description": "When the payment will be triggered, in ISO date string, YYYY-MM-DD. It should be far enough in advance so when the payment reaches the vendor, it is still before or on the paymentDueDate. Date is based on the payment processor's timezone, i.e. EST." }, "paymentRoute": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] } } } ] }, { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "id", "speed", "memo" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" } } }, { "type": "object", "required": [ "type", "sharedByName", "email" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" } } } ] } ] }, "description": "Flat ordered array of hops the funds will travel through" }, { "type": "array", "additionalItems": false, "items": [ { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "offPlatform" ] }, "note": { "type": "string" } } } ], "minItems": 1 } ] }, "remittanceNotification": { "type": "object", "required": [ "recipients" ], "properties": { "recipients": { "type": "array", "items": { "type": "object", "required": [ "name", "email" ], "properties": { "name": { "type": "string" }, "email": { "type": "string" } } } } }, "description": "Notifications when a bill is paid" }, "payment": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "description": "Reference ID for this payment" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } }, "manualCompletion": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "notPaid" ] } ] }, "reason": { "type": "string" } }, "description": "Set when the bill was manually completed" }, "purchaseOrder": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "manual" ] }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "rutterId", "platformId" ], "properties": { "type": { "type": "string", "enum": [ "rutter" ] }, "rutterId": { "type": "string" }, "platformId": { "type": "string" } } } ] }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "canSubmitErrors" ], "properties": { "canSubmitErrors": { "type": "array", "items": { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidVendor" ] }, "message": { "type": "string" } }, "title": "invalidVendor", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidInvoiceId" ] }, "message": { "type": "string" } }, "title": "invalidInvoiceId", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidCurrencyCode" ] }, "message": { "type": "string" } }, "title": "invalidCurrencyCode", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidInvoiceDate" ] }, "message": { "type": "string" } }, "title": "invalidInvoiceDate", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidPaymentScheduledDate" ] }, "message": { "type": "string" } }, "title": "invalidPaymentScheduledDate", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidPaymentRoute" ] }, "message": { "type": "string" } }, "title": "invalidPaymentRoute", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidLineItems" ] }, "message": { "type": "string" } }, "title": "invalidLineItems", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidInvoice" ] }, "message": { "type": "string" } }, "title": "invalidInvoice", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidTotalAmount" ] }, "message": { "type": "string" } }, "title": "invalidTotalAmount", "description": "A service error has occurred" } ] } } } } ] } }, "hasNext": { "type": "boolean" }, "totalCount": { "type": "number" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/invoice": { "post": { "summary": "Create a bill by uploading an invoice", "tags": [ "Bill" ], "description": "An empty draft bill is created.\nTo upload the invoice, submit a `multipart/form-data` `POST` to `invoiceUpload.url`: add each key/value from `invoiceUpload.fields` as a form field, then append the file last.\nSubsequently, the invoice will be parsed and the bill is prefilled with suggestions based on the invoice.\nThe status of parsing can be monitored by either listening for `bill.documentUpdated` events or polling `GET /v1/web/bill/{billId}/document/{id}`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "fileName" ], "properties": { "fileName": { "type": "string" } } } } } }, "responses": { "202": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "id", "status", "creatorUserId", "lineItems", "documents", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "paymentPending" ] }, { "type": "string", "enum": [ "paymentInProgress" ] }, { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "paymentFailed" ] }, { "type": "string", "enum": [ "manuallyCompleted" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creatorUserId": { "type": "string" }, "vendorId": { "type": "string" }, "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "paymentDueDate": { "type": "string", "format": "date", "description": "The date that the invoice says the payment is due, in ISO date string, YYYY-MM-DD" }, "totalAmount": { "type": "string", "description": "number string" }, "description": { "type": "string" }, "lineItems": { "type": "array", "items": { "type": "object", "required": [ "id", "amount" ], "properties": { "id": { "type": "string" }, "description": { "type": "string" }, "amount": { "type": "string", "description": "Number string" }, "spendCategoryId": { "type": "string" } } } }, "documents": { "type": "array", "items": { "type": "object", "required": [ "id", "fileName", "type", "status", "createdAt" ], "properties": { "id": { "type": "string" }, "fileName": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "invoice" ] }, { "type": "string", "enum": [ "supporting" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "parsed" ] } ] }, "parsedData": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achRoutingNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "amount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } } }, "paymentScheduledDate": { "type": "string", "format": "date", "description": "When the payment will be triggered, in ISO date string, YYYY-MM-DD. It should be far enough in advance so when the payment reaches the vendor, it is still before or on the paymentDueDate. Date is based on the payment processor's timezone, i.e. EST." }, "paymentRoute": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] } } } ] }, { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "id", "speed", "memo" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" } } }, { "type": "object", "required": [ "type", "sharedByName", "email" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" } } } ] } ] }, "description": "Flat ordered array of hops the funds will travel through" }, { "type": "array", "additionalItems": false, "items": [ { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "offPlatform" ] }, "note": { "type": "string" } } } ], "minItems": 1 } ] }, "remittanceNotification": { "type": "object", "required": [ "recipients" ], "properties": { "recipients": { "type": "array", "items": { "type": "object", "required": [ "name", "email" ], "properties": { "name": { "type": "string" }, "email": { "type": "string" } } } } }, "description": "Notifications when a bill is paid" }, "payment": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "description": "Reference ID for this payment" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } }, "manualCompletion": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "notPaid" ] } ] }, "reason": { "type": "string" } }, "description": "Set when the bill was manually completed" }, "purchaseOrder": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "manual" ] }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "rutterId", "platformId" ], "properties": { "type": { "type": "string", "enum": [ "rutter" ] }, "rutterId": { "type": "string" }, "platformId": { "type": "string" } } } ] }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "invoiceUploadUrl", "invoiceUpload" ], "properties": { "invoiceUploadUrl": { "type": "string", "deprecated": true, "description": "Deprecated. Use `invoiceUpload` instead." }, "invoiceUpload": { "type": "object", "required": [ "url", "fields" ], "properties": { "url": { "type": "string" }, "fields": { "type": "object", "additionalProperties": { "type": "string" } } }, "description": "Presigned S3 POST: append each `fields` entry as a form field, then the file last." } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidFileFormat" ] }, "message": { "type": "string" } }, "title": "invalidFileFormat", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/invoice-address": { "get": { "summary": "Get the customer's invoice email address", "tags": [ "Bill" ], "description": "Returns the email address invoices can be forwarded to for ingestion. Responds 404 until the inbox has been created via `POST /v1/web/bill/invoice-address`.", "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "address" ], "properties": { "address": { "type": "string", "description": "The customer's invoice inbox email address, e.g. `acme@invoices.dash.fi`" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "post": { "summary": "Create the customer's invoice email inbox", "tags": [ "Bill" ], "description": "Provisions the customer's invoice email address. Idempotent — once created, the address is frozen and every subsequent call returns the same address.", "responses": { "201": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "address" ], "properties": { "address": { "type": "string", "description": "The customer's invoice inbox email address, e.g. `acme@invoices.dash.fi`" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "slugUnavailable" ] }, "message": { "type": "string" } }, "title": "slugUnavailable", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/invoice-email": { "get": { "summary": "List emails received at the customer's invoice inbox", "tags": [ "Bill" ], "description": "Audit log of emails forwarded to the customer's invoice address, newest first. Each email carries its attachments with per-attachment status and, for imported attachments, the `billId` of the draft bill it became.", "parameters": [ { "schema": { "type": "integer", "minimum": 1, "default": 1 }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 }, "in": "query", "name": "pageSize", "required": false } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext", "totalCount" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "status", "attachmentCount", "attachments", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "received" ] }, { "type": "string", "enum": [ "rejected" ] }, { "type": "string", "enum": [ "processed" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "sender": { "type": "string" }, "receivedAt": { "type": "string", "format": "date-time" }, "rejectReason": { "anyOf": [ { "type": "string", "enum": [ "unknownSlug" ] }, { "type": "string", "enum": [ "domainMismatch" ] }, { "type": "string", "enum": [ "authFail" ] }, { "type": "string", "enum": [ "spam" ] }, { "type": "string", "enum": [ "volumeExceeded" ] }, { "type": "string", "enum": [ "unknownSender" ] }, { "type": "string", "enum": [ "noUsableAttachment" ] } ] }, "attachmentCount": { "type": "number" }, "attachments": { "type": "array", "items": { "type": "object", "required": [ "id", "status" ], "properties": { "id": { "type": "string" }, "fileName": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "importing" ] }, { "type": "string", "enum": [ "imported" ] }, { "type": "string", "enum": [ "skipped" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "duplicated" ] }, { "type": "string", "enum": [ "released" ] } ] }, "skipReason": { "anyOf": [ { "type": "string", "enum": [ "unsupported" ] }, { "type": "string", "enum": [ "unreadable" ] }, { "type": "string", "enum": [ "oversized" ] } ] }, "statusReason": { "anyOf": [ { "type": "string", "enum": [ "duplicate" ] }, { "type": "string", "enum": [ "billDeleted" ] } ] }, "billId": { "type": "string" }, "duplicateOfBillId": { "type": "string" }, "duplicateOfBillStatus": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "paymentPending" ] }, { "type": "string", "enum": [ "paymentInProgress" ] }, { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "paymentFailed" ] }, { "type": "string", "enum": [ "manuallyCompleted" ] }, { "type": "string", "enum": [ "deleted" ] } ] } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "hasNext": { "type": "boolean" }, "totalCount": { "type": "number" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/file-bulk-import": { "post": { "summary": "Start a Bill Bulk Import from File", "tags": [ "Bill" ], "description": "Creates a file source and returns a presigned `upload`. POST the file to continue.\nThe file source can subsequently be managed via the `/v1/web/bulk-import-file-source` endpoints.\nThe expected file structure can be retrieved from `GET /v1/web/bill/file-bulk-import/template`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "filename" ], "properties": { "filename": { "type": "string" } } } } } }, "responses": { "201": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "id", "status", "filename", "structure", "errors", "creatorUserId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "processed" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "filename": { "type": "string" }, "structure": { "anyOf": [ { "type": "object", "required": [ "type", "fields", "fileHeaders" ], "properties": { "type": { "type": "string", "enum": [ "billLineItemTable" ] }, "fields": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "paymentDueDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItem.description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItem.amount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } }, "fileHeaders": { "type": "array", "items": { "type": "string" }, "description": "Column headers detected in the uploaded file" } } }, { "type": "object", "required": [ "type", "fields", "fileHeaders" ], "properties": { "type": { "type": "string", "enum": [ "vendorTable" ] }, "fields": { "type": "object", "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "country": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.firstName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.middleName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.lastName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.email": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.phone": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } }, "fileHeaders": { "type": "array", "items": { "type": "string" }, "description": "Column headers detected in the uploaded file" } } } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "invalidFile" ] }, "message": { "type": "string" } } } }, "creatorUserId": { "type": "string" }, "bulkImportId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "processedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "uploadUrl", "upload" ], "properties": { "uploadUrl": { "type": "string", "deprecated": true, "description": "Deprecated. Use `upload` instead." }, "upload": { "type": "object", "required": [ "url", "fields" ], "properties": { "url": { "type": "string" }, "fields": { "type": "object", "additionalProperties": { "type": "string" } } }, "description": "Presigned S3 POST: append each `fields` entry as a form field, then the file last." } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidFileFormat" ] }, "message": { "type": "string" } }, "title": "invalidFileFormat", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/file-bulk-import/template": { "get": { "summary": "Get a Bill Bulk Import File Template", "tags": [ "Bill" ], "description": "Returns a template with the expected structure and example values that can be filled and uploaded.", "parameters": [ { "schema": { "anyOf": [ { "type": "string", "enum": [ "csv" ] } ] }, "in": "query", "name": "fileType", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "string", "contentMediaType": "text/csv" } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/export": { "post": { "summary": "Export Bills", "tags": [ "Bill" ], "description": "This is a streaming endpoint. BFFs should pipe the stream response back to user's browser.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "format" ], "properties": { "format": { "type": "string", "enum": [ "csv" ] }, "fields": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "vendorName" ] }, { "type": "string", "enum": [ "vendorId" ] }, { "type": "string", "enum": [ "invoiceId" ] }, { "type": "string", "enum": [ "status" ] }, { "type": "string", "enum": [ "currencyCode" ] }, { "type": "string", "enum": [ "invoiceDate" ] }, { "type": "string", "enum": [ "paymentDueDate" ] }, { "type": "string", "enum": [ "totalAmount" ] }, { "type": "string", "enum": [ "description" ] }, { "type": "string", "enum": [ "paymentScheduledDate" ] }, { "type": "string", "enum": [ "externalId" ] }, { "type": "string", "enum": [ "id" ] }, { "type": "string", "enum": [ "createdAt" ] }, { "type": "string", "enum": [ "updatedAt" ] }, { "type": "string", "enum": [ "submittedAt" ] }, { "type": "string", "enum": [ "completedAt" ] } ] }, "description": "columns to include; defaults to all" } } }, { "type": "object", "properties": { "ids": { "type": "array", "items": { "type": "string" } }, "externalIds": { "type": "array", "items": { "type": "string" } }, "statuses": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "paymentPending" ] }, { "type": "string", "enum": [ "paymentInProgress" ] }, { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "paymentFailed" ] }, { "type": "string", "enum": [ "manuallyCompleted" ] }, { "type": "string", "enum": [ "deleted" ] } ] } }, "vendorIds": { "type": "array", "items": { "type": "string" } }, "creatorUserIds": { "type": "array", "items": { "type": "string" } }, "invoiceIds": { "type": "array", "items": { "type": "string" } }, "partialText": { "type": "string" }, "rutterIds": { "type": "array", "items": { "type": "string", "description": "include the string \"null\" to match unlinked bills" } }, "accountingPlatformIds": { "type": "array", "items": { "type": "string", "description": "include the string \"null\" to match unlinked bills" } }, "invoiceDate": { "type": "array", "items": { "type": "object", "required": [ "op", "value" ], "properties": { "op": { "anyOf": [ { "type": "string", "enum": [ "lt" ] }, { "type": "string", "enum": [ "lte" ] }, { "type": "string", "enum": [ "eq" ] }, { "type": "string", "enum": [ "ne" ] }, { "type": "string", "enum": [ "gte" ] }, { "type": "string", "enum": [ "gt" ] } ] }, "value": { "type": "string", "format": "date" } } } }, "paymentDueDate": { "type": "array", "items": { "type": "object", "required": [ "op", "value" ], "properties": { "op": { "anyOf": [ { "type": "string", "enum": [ "lt" ] }, { "type": "string", "enum": [ "lte" ] }, { "type": "string", "enum": [ "eq" ] }, { "type": "string", "enum": [ "ne" ] }, { "type": "string", "enum": [ "gte" ] }, { "type": "string", "enum": [ "gt" ] } ] }, "value": { "type": "string", "format": "date" } } } }, "paymentScheduledDate": { "type": "array", "items": { "type": "object", "required": [ "op", "value" ], "properties": { "op": { "anyOf": [ { "type": "string", "enum": [ "lt" ] }, { "type": "string", "enum": [ "lte" ] }, { "type": "string", "enum": [ "eq" ] }, { "type": "string", "enum": [ "ne" ] }, { "type": "string", "enum": [ "gte" ] }, { "type": "string", "enum": [ "gt" ] } ] }, "value": { "type": "string", "format": "date" } } } }, "createdAt": { "type": "array", "items": { "type": "object", "required": [ "op", "value" ], "properties": { "op": { "anyOf": [ { "type": "string", "enum": [ "lt" ] }, { "type": "string", "enum": [ "lte" ] }, { "type": "string", "enum": [ "eq" ] }, { "type": "string", "enum": [ "ne" ] }, { "type": "string", "enum": [ "gte" ] }, { "type": "string", "enum": [ "gt" ] } ] }, "value": { "type": "string", "format": "date-time" } } } }, "updatedAt": { "type": "array", "items": { "type": "object", "required": [ "op", "value" ], "properties": { "op": { "anyOf": [ { "type": "string", "enum": [ "lt" ] }, { "type": "string", "enum": [ "lte" ] }, { "type": "string", "enum": [ "eq" ] }, { "type": "string", "enum": [ "ne" ] }, { "type": "string", "enum": [ "gte" ] }, { "type": "string", "enum": [ "gt" ] } ] }, "value": { "type": "string", "format": "date-time" } } } }, "submittedAt": { "type": "array", "items": { "type": "object", "required": [ "op", "value" ], "properties": { "op": { "anyOf": [ { "type": "string", "enum": [ "lt" ] }, { "type": "string", "enum": [ "lte" ] }, { "type": "string", "enum": [ "eq" ] }, { "type": "string", "enum": [ "ne" ] }, { "type": "string", "enum": [ "gte" ] }, { "type": "string", "enum": [ "gt" ] } ] }, "value": { "type": "string", "format": "date-time" } } } }, "completedAt": { "type": "array", "items": { "type": "object", "required": [ "op", "value" ], "properties": { "op": { "anyOf": [ { "type": "string", "enum": [ "lt" ] }, { "type": "string", "enum": [ "lte" ] }, { "type": "string", "enum": [ "eq" ] }, { "type": "string", "enum": [ "ne" ] }, { "type": "string", "enum": [ "gte" ] }, { "type": "string", "enum": [ "gt" ] } ] }, "value": { "type": "string", "format": "date-time" } } } } } }, { "type": "object", "properties": { "orderBy": { "type": "array", "items": { "type": "object", "required": [ "field", "direction" ], "properties": { "field": { "anyOf": [ { "type": "string", "enum": [ "createdAt" ] }, { "type": "string", "enum": [ "updatedAt" ] }, { "type": "string", "enum": [ "submittedAt" ] }, { "type": "string", "enum": [ "completedAt" ] }, { "type": "string", "enum": [ "invoiceDate" ] }, { "type": "string", "enum": [ "paymentDueDate" ] }, { "type": "string", "enum": [ "paymentScheduledDate" ] }, { "type": "string", "enum": [ "totalAmount" ] } ] }, "direction": { "anyOf": [ { "type": "string", "enum": [ "asc" ] }, { "type": "string", "enum": [ "desc" ] } ] } } } } } } ] } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "string", "contentMediaType": "text/csv" } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "tooManyItems" ] }, "message": { "type": "string" } }, "title": "tooManyItems", "description": "A service error has occurred" }, { "type": "object", "required": [ "max", "actual" ], "properties": { "max": { "type": "number", "description": "Maximum number of items allowed" }, "actual": { "type": "number", "description": "Number of items that matched the request" } } } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/invoice-export": { "post": { "summary": "Export bill invoice documents", "tags": [ "Bill" ], "description": "Asynchronously archives the invoice documents of the matching bills into a zip and notifies the user with a download link when ready. Returns an `id` to correlate the notification.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "ids": { "type": "array", "items": { "type": "string" } }, "externalIds": { "type": "array", "items": { "type": "string" } }, "statuses": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "paymentPending" ] }, { "type": "string", "enum": [ "paymentInProgress" ] }, { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "paymentFailed" ] }, { "type": "string", "enum": [ "manuallyCompleted" ] }, { "type": "string", "enum": [ "deleted" ] } ] } }, "vendorIds": { "type": "array", "items": { "type": "string" } }, "creatorUserIds": { "type": "array", "items": { "type": "string" } }, "invoiceIds": { "type": "array", "items": { "type": "string" } }, "partialText": { "type": "string" }, "rutterIds": { "type": "array", "items": { "type": "string", "description": "include the string \"null\" to match unlinked bills" } }, "accountingPlatformIds": { "type": "array", "items": { "type": "string", "description": "include the string \"null\" to match unlinked bills" } }, "invoiceDate": { "type": "array", "items": { "type": "object", "required": [ "op", "value" ], "properties": { "op": { "anyOf": [ { "type": "string", "enum": [ "lt" ] }, { "type": "string", "enum": [ "lte" ] }, { "type": "string", "enum": [ "eq" ] }, { "type": "string", "enum": [ "ne" ] }, { "type": "string", "enum": [ "gte" ] }, { "type": "string", "enum": [ "gt" ] } ] }, "value": { "type": "string", "format": "date" } } } }, "paymentDueDate": { "type": "array", "items": { "type": "object", "required": [ "op", "value" ], "properties": { "op": { "anyOf": [ { "type": "string", "enum": [ "lt" ] }, { "type": "string", "enum": [ "lte" ] }, { "type": "string", "enum": [ "eq" ] }, { "type": "string", "enum": [ "ne" ] }, { "type": "string", "enum": [ "gte" ] }, { "type": "string", "enum": [ "gt" ] } ] }, "value": { "type": "string", "format": "date" } } } }, "paymentScheduledDate": { "type": "array", "items": { "type": "object", "required": [ "op", "value" ], "properties": { "op": { "anyOf": [ { "type": "string", "enum": [ "lt" ] }, { "type": "string", "enum": [ "lte" ] }, { "type": "string", "enum": [ "eq" ] }, { "type": "string", "enum": [ "ne" ] }, { "type": "string", "enum": [ "gte" ] }, { "type": "string", "enum": [ "gt" ] } ] }, "value": { "type": "string", "format": "date" } } } }, "createdAt": { "type": "array", "items": { "type": "object", "required": [ "op", "value" ], "properties": { "op": { "anyOf": [ { "type": "string", "enum": [ "lt" ] }, { "type": "string", "enum": [ "lte" ] }, { "type": "string", "enum": [ "eq" ] }, { "type": "string", "enum": [ "ne" ] }, { "type": "string", "enum": [ "gte" ] }, { "type": "string", "enum": [ "gt" ] } ] }, "value": { "type": "string", "format": "date-time" } } } }, "updatedAt": { "type": "array", "items": { "type": "object", "required": [ "op", "value" ], "properties": { "op": { "anyOf": [ { "type": "string", "enum": [ "lt" ] }, { "type": "string", "enum": [ "lte" ] }, { "type": "string", "enum": [ "eq" ] }, { "type": "string", "enum": [ "ne" ] }, { "type": "string", "enum": [ "gte" ] }, { "type": "string", "enum": [ "gt" ] } ] }, "value": { "type": "string", "format": "date-time" } } } }, "submittedAt": { "type": "array", "items": { "type": "object", "required": [ "op", "value" ], "properties": { "op": { "anyOf": [ { "type": "string", "enum": [ "lt" ] }, { "type": "string", "enum": [ "lte" ] }, { "type": "string", "enum": [ "eq" ] }, { "type": "string", "enum": [ "ne" ] }, { "type": "string", "enum": [ "gte" ] }, { "type": "string", "enum": [ "gt" ] } ] }, "value": { "type": "string", "format": "date-time" } } } }, "completedAt": { "type": "array", "items": { "type": "object", "required": [ "op", "value" ], "properties": { "op": { "anyOf": [ { "type": "string", "enum": [ "lt" ] }, { "type": "string", "enum": [ "lte" ] }, { "type": "string", "enum": [ "eq" ] }, { "type": "string", "enum": [ "ne" ] }, { "type": "string", "enum": [ "gte" ] }, { "type": "string", "enum": [ "gt" ] } ] }, "value": { "type": "string", "format": "date-time" } } } } } } } } }, "responses": { "202": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "tooManyItems" ] }, "message": { "type": "string" } }, "title": "tooManyItems", "description": "A service error has occurred" }, { "type": "object", "required": [ "max", "actual" ], "properties": { "max": { "type": "number", "description": "Maximum number of items allowed" }, "actual": { "type": "number", "description": "Number of items that matched the request" } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "noInvoices" ] }, "message": { "type": "string" } }, "title": "noInvoices", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/pending-decision": { "get": { "summary": "Search for bills that are pending a decision", "tags": [ "Bill" ], "parameters": [ { "schema": { "type": "integer", "minimum": 1, "default": 1 }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext", "totalCount" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "bill", "approvalRequest" ], "properties": { "bill": { "type": "object", "required": [ "id", "status", "creatorUserId", "lineItems", "documents", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "paymentPending" ] }, { "type": "string", "enum": [ "paymentInProgress" ] }, { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "paymentFailed" ] }, { "type": "string", "enum": [ "manuallyCompleted" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creatorUserId": { "type": "string" }, "vendorId": { "type": "string" }, "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "paymentDueDate": { "type": "string", "format": "date", "description": "The date that the invoice says the payment is due, in ISO date string, YYYY-MM-DD" }, "totalAmount": { "type": "string", "description": "number string" }, "description": { "type": "string" }, "lineItems": { "type": "array", "items": { "type": "object", "required": [ "id", "amount" ], "properties": { "id": { "type": "string" }, "description": { "type": "string" }, "amount": { "type": "string", "description": "Number string" }, "spendCategoryId": { "type": "string" } } } }, "documents": { "type": "array", "items": { "type": "object", "required": [ "id", "fileName", "type", "status", "createdAt" ], "properties": { "id": { "type": "string" }, "fileName": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "invoice" ] }, { "type": "string", "enum": [ "supporting" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "parsed" ] } ] }, "parsedData": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achRoutingNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "amount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } } }, "paymentScheduledDate": { "type": "string", "format": "date", "description": "When the payment will be triggered, in ISO date string, YYYY-MM-DD. It should be far enough in advance so when the payment reaches the vendor, it is still before or on the paymentDueDate. Date is based on the payment processor's timezone, i.e. EST." }, "paymentRoute": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] } } } ] }, { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "id", "speed", "memo" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" } } }, { "type": "object", "required": [ "type", "sharedByName", "email" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" } } } ] } ] }, "description": "Flat ordered array of hops the funds will travel through" }, { "type": "array", "additionalItems": false, "items": [ { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "offPlatform" ] }, "note": { "type": "string" } } } ], "minItems": 1 } ] }, "remittanceNotification": { "type": "object", "required": [ "recipients" ], "properties": { "recipients": { "type": "array", "items": { "type": "object", "required": [ "name", "email" ], "properties": { "name": { "type": "string" }, "email": { "type": "string" } } } } }, "description": "Notifications when a bill is paid" }, "payment": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "description": "Reference ID for this payment" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } }, "manualCompletion": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "notPaid" ] } ] }, "reason": { "type": "string" } }, "description": "Set when the bill was manually completed" }, "purchaseOrder": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "manual" ] }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "rutterId", "platformId" ], "properties": { "type": { "type": "string", "enum": [ "rutter" ] }, "rutterId": { "type": "string" }, "platformId": { "type": "string" } } } ] }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } }, "approvalRequest": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createCard", "enum": [ "createCard" ] }, "request": { "type": "object", "required": [ "name", "frequencyType", "cardholderId", "userId", "accountId" ], "properties": { "name": { "type": "string" }, "frequencyType": { "anyOf": [ { "type": "string", "enum": [ "recurring" ] }, { "type": "string", "enum": [ "single" ] } ] }, "cardholderId": { "type": "string" }, "userId": { "type": "string" }, "accountId": { "type": "number" }, "cardProfileId": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "expiry": { "type": "string" }, "categoryIds": { "type": "array", "items": { "type": "string" } }, "allowedCountries": { "type": "array", "items": { "type": "string" } }, "spendFrequency": { "anyOf": [ { "type": "string", "enum": [ "purchase_1d" ] }, { "type": "string", "enum": [ "purchase_7d" ] }, { "type": "string", "enum": [ "purchase_30d" ] }, { "type": "string", "enum": [ "purchase_1y" ] }, { "type": "string", "enum": [ "card_debit_lifetime" ] } ] }, "spendLimit": { "type": "number" }, "userGroupId": { "type": "string" } } } } } ], "title": "createCard" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "payBill", "enum": [ "payBill" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "payBill" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "submitExpense", "enum": [ "submitExpense" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "submitExpense" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendor", "enum": [ "createVendor" ] }, "request": { "allOf": [ { "type": "object", "required": [ "name", "owners", "currencyCode", "country" ], "properties": { "externalId": { "type": "string" }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } } } }, { "type": "object", "required": [ "rutterId", "currencyCode", "contacts" ], "properties": { "rutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Rutter vendor ID. If null, the vendor will be created in the accounting platform." }, "currencyCode": { "type": "string", "description": "ISO 4217 currency code" }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "name", "default", "email" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } } ] } } } ], "title": "createVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "updateVendor", "enum": [ "updateVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "address": { "anyOf": [ { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, { "type": "null" } ] }, "taxId": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "legalName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "logoUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantCategory": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantIds": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] } } } } } ], "title": "updateVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendorPaymentMethod", "enum": [ "createVendorPaymentMethod" ] }, "request": { "anyOf": [ { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH business payment method" }, { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH individual payment method" } ] } } } ], "title": "createVendorPaymentMethod" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "deleteVendorPaymentMethod", "enum": [ "deleteVendorPaymentMethod" ] }, "request": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } } } } ], "title": "deleteVendorPaymentMethod" } ], "description": "Approval request, discriminated by `type`" } } } }, "hasNext": { "type": "boolean" }, "totalCount": { "type": "number" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/{id}": { "get": { "summary": "Get a bill", "tags": [ "Bill" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "id", "status", "creatorUserId", "lineItems", "documents", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "paymentPending" ] }, { "type": "string", "enum": [ "paymentInProgress" ] }, { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "paymentFailed" ] }, { "type": "string", "enum": [ "manuallyCompleted" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creatorUserId": { "type": "string" }, "vendorId": { "type": "string" }, "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "paymentDueDate": { "type": "string", "format": "date", "description": "The date that the invoice says the payment is due, in ISO date string, YYYY-MM-DD" }, "totalAmount": { "type": "string", "description": "number string" }, "description": { "type": "string" }, "lineItems": { "type": "array", "items": { "type": "object", "required": [ "id", "amount" ], "properties": { "id": { "type": "string" }, "description": { "type": "string" }, "amount": { "type": "string", "description": "Number string" }, "spendCategoryId": { "type": "string" } } } }, "documents": { "type": "array", "items": { "type": "object", "required": [ "id", "fileName", "type", "status", "createdAt" ], "properties": { "id": { "type": "string" }, "fileName": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "invoice" ] }, { "type": "string", "enum": [ "supporting" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "parsed" ] } ] }, "parsedData": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achRoutingNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "amount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } } }, "paymentScheduledDate": { "type": "string", "format": "date", "description": "When the payment will be triggered, in ISO date string, YYYY-MM-DD. It should be far enough in advance so when the payment reaches the vendor, it is still before or on the paymentDueDate. Date is based on the payment processor's timezone, i.e. EST." }, "paymentRoute": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] } } } ] }, { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "id", "speed", "memo" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" } } }, { "type": "object", "required": [ "type", "sharedByName", "email" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" } } } ] } ] }, "description": "Flat ordered array of hops the funds will travel through" }, { "type": "array", "additionalItems": false, "items": [ { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "offPlatform" ] }, "note": { "type": "string" } } } ], "minItems": 1 } ] }, "remittanceNotification": { "type": "object", "required": [ "recipients" ], "properties": { "recipients": { "type": "array", "items": { "type": "object", "required": [ "name", "email" ], "properties": { "name": { "type": "string" }, "email": { "type": "string" } } } } }, "description": "Notifications when a bill is paid" }, "manualCompletion": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "notPaid" ] } ] }, "reason": { "type": "string" } }, "description": "Set when the bill was manually completed" }, "purchaseOrder": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "manual" ] }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "rutterId", "platformId" ], "properties": { "type": { "type": "string", "enum": [ "rutter" ] }, "rutterId": { "type": "string" }, "platformId": { "type": "string" } } } ] }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "canSubmitErrors" ], "properties": { "payment": { "allOf": [ { "type": "object", "required": [ "id", "status", "creator", "scheduledAt", "legs", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "scheduled" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "succeeded" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "stopped" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creator": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "bill" ] }, "id": { "type": "string" } } }, "scheduledAt": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "legs": { "type": "array", "items": { "type": "object", "required": [ "id", "type", "status", "source", "target" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "debitAch" ] }, { "type": "string", "enum": [ "creditAch" ] }, { "type": "string", "enum": [ "emailSingleUseCard" ] }, { "type": "string", "enum": [ "advanceCash" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "succeeded" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "source": { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name", "amount" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule", "amount" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } } ] }, "target": { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "id", "speed", "memo", "amount" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "sharedByName", "email", "amount" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } } ] }, "fees": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } }, "integration": { "anyOf": [ { "type": "object", "required": [ "type", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxDeposit" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" }, "depositRequestId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } } }, { "type": "object", "required": [ "type", "id", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxWithdrawal" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cardShare" ] }, "id": { "type": "string" }, "cardSpendLimitRuleId": { "type": "string" }, "cardShare": { "type": "object", "required": [ "id", "shareUrl", "expiresAt" ], "properties": { "id": { "type": "string" }, "shareUrl": { "type": "string" }, "expiresAt": { "type": "string", "format": "date-time" } } }, "knockWorkflowRunId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "id": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } ] }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "description": "Reference ID for this payment" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } } ] }, "canSubmitErrors": { "type": "array", "items": { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidVendor" ] }, "message": { "type": "string" } }, "title": "invalidVendor", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidInvoiceId" ] }, "message": { "type": "string" } }, "title": "invalidInvoiceId", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidCurrencyCode" ] }, "message": { "type": "string" } }, "title": "invalidCurrencyCode", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidInvoiceDate" ] }, "message": { "type": "string" } }, "title": "invalidInvoiceDate", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidPaymentScheduledDate" ] }, "message": { "type": "string" } }, "title": "invalidPaymentScheduledDate", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidPaymentRoute" ] }, "message": { "type": "string" } }, "title": "invalidPaymentRoute", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidLineItems" ] }, "message": { "type": "string" } }, "title": "invalidLineItems", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidInvoice" ] }, "message": { "type": "string" } }, "title": "invalidInvoice", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidTotalAmount" ] }, "message": { "type": "string" } }, "title": "invalidTotalAmount", "description": "A service error has occurred" } ] } } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "patch": { "summary": "Update a bill", "tags": [ "Bill" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "externalId": { "type": "string" }, "vendorId": { "type": "string" }, "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "totalAmount": { "type": "string", "description": "number string" }, "description": { "type": "string" }, "remittanceNotification": { "type": "object", "required": [ "recipients" ], "properties": { "recipients": { "type": "array", "items": { "type": "object", "required": [ "name", "email" ], "properties": { "name": { "type": "string" }, "email": { "type": "string" } } } } }, "description": "Notifications when a bill is paid" }, "invoiceDate": { "anyOf": [ { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "paymentDueDate": { "anyOf": [ { "type": "string", "format": "date", "description": "The date that the invoice says the payment is due, in ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "paymentScheduledDate": { "anyOf": [ { "type": "string", "format": "date", "description": "When the payment will be triggered, in ISO date string, YYYY-MM-DD. It should be far enough in advance so when the payment reaches the vendor, it is still before or on the paymentDueDate. Date is based on the payment processor's timezone, i.e. EST." }, { "type": "null" } ] }, "paymentRoute": { "anyOf": [ { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] } } } ] }, { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "id", "speed", "memo" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" } } }, { "type": "object", "required": [ "type", "sharedByName", "email" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" } } } ] } ] }, "description": "Flat ordered array of hops the funds will travel through" }, { "type": "array", "additionalItems": false, "items": [ { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "offPlatform" ] }, "note": { "type": "string" } } } ], "minItems": 1 } ] }, { "type": "null" } ] }, "purchaseOrder": { "anyOf": [ { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "manual" ] }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "rutterId", "platformId" ], "properties": { "type": { "type": "string", "enum": [ "rutter" ] }, "rutterId": { "type": "string" }, "platformId": { "type": "string" } } } ] }, { "type": "null" } ] } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "creatorUserId", "lineItems", "documents", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "paymentPending" ] }, { "type": "string", "enum": [ "paymentInProgress" ] }, { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "paymentFailed" ] }, { "type": "string", "enum": [ "manuallyCompleted" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creatorUserId": { "type": "string" }, "vendorId": { "type": "string" }, "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "paymentDueDate": { "type": "string", "format": "date", "description": "The date that the invoice says the payment is due, in ISO date string, YYYY-MM-DD" }, "totalAmount": { "type": "string", "description": "number string" }, "description": { "type": "string" }, "lineItems": { "type": "array", "items": { "type": "object", "required": [ "id", "amount" ], "properties": { "id": { "type": "string" }, "description": { "type": "string" }, "amount": { "type": "string", "description": "Number string" }, "spendCategoryId": { "type": "string" } } } }, "documents": { "type": "array", "items": { "type": "object", "required": [ "id", "fileName", "type", "status", "createdAt" ], "properties": { "id": { "type": "string" }, "fileName": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "invoice" ] }, { "type": "string", "enum": [ "supporting" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "parsed" ] } ] }, "parsedData": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achRoutingNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "amount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } } }, "paymentScheduledDate": { "type": "string", "format": "date", "description": "When the payment will be triggered, in ISO date string, YYYY-MM-DD. It should be far enough in advance so when the payment reaches the vendor, it is still before or on the paymentDueDate. Date is based on the payment processor's timezone, i.e. EST." }, "paymentRoute": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] } } } ] }, { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "id", "speed", "memo" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" } } }, { "type": "object", "required": [ "type", "sharedByName", "email" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" } } } ] } ] }, "description": "Flat ordered array of hops the funds will travel through" }, { "type": "array", "additionalItems": false, "items": [ { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "offPlatform" ] }, "note": { "type": "string" } } } ], "minItems": 1 } ] }, "remittanceNotification": { "type": "object", "required": [ "recipients" ], "properties": { "recipients": { "type": "array", "items": { "type": "object", "required": [ "name", "email" ], "properties": { "name": { "type": "string" }, "email": { "type": "string" } } } } }, "description": "Notifications when a bill is paid" }, "payment": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "description": "Reference ID for this payment" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } }, "manualCompletion": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "notPaid" ] } ] }, "reason": { "type": "string" } }, "description": "Set when the bill was manually completed" }, "purchaseOrder": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "manual" ] }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "rutterId", "platformId" ], "properties": { "type": { "type": "string", "enum": [ "rutter" ] }, "rutterId": { "type": "string" }, "platformId": { "type": "string" } } } ] }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidCurrencyCode" ] }, "message": { "type": "string" } }, "title": "invalidCurrencyCode", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidTotalAmount" ] }, "message": { "type": "string" } }, "title": "invalidTotalAmount", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidVendorId" ] }, "message": { "type": "string" } }, "title": "invalidVendorId", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidPaymentScheduledDate" ] }, "message": { "type": "string" } }, "title": "invalidPaymentScheduledDate", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "delete": { "summary": "Delete a bill", "tags": [ "Bill" ], "description": "Soft-deletes a bill. Only draft, submitted, or returned bills can be deleted.", "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "creatorUserId", "lineItems", "documents", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "paymentPending" ] }, { "type": "string", "enum": [ "paymentInProgress" ] }, { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "paymentFailed" ] }, { "type": "string", "enum": [ "manuallyCompleted" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creatorUserId": { "type": "string" }, "vendorId": { "type": "string" }, "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "paymentDueDate": { "type": "string", "format": "date", "description": "The date that the invoice says the payment is due, in ISO date string, YYYY-MM-DD" }, "totalAmount": { "type": "string", "description": "number string" }, "description": { "type": "string" }, "lineItems": { "type": "array", "items": { "type": "object", "required": [ "id", "amount" ], "properties": { "id": { "type": "string" }, "description": { "type": "string" }, "amount": { "type": "string", "description": "Number string" }, "spendCategoryId": { "type": "string" } } } }, "documents": { "type": "array", "items": { "type": "object", "required": [ "id", "fileName", "type", "status", "createdAt" ], "properties": { "id": { "type": "string" }, "fileName": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "invoice" ] }, { "type": "string", "enum": [ "supporting" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "parsed" ] } ] }, "parsedData": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achRoutingNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "amount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } } }, "paymentScheduledDate": { "type": "string", "format": "date", "description": "When the payment will be triggered, in ISO date string, YYYY-MM-DD. It should be far enough in advance so when the payment reaches the vendor, it is still before or on the paymentDueDate. Date is based on the payment processor's timezone, i.e. EST." }, "paymentRoute": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] } } } ] }, { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "id", "speed", "memo" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" } } }, { "type": "object", "required": [ "type", "sharedByName", "email" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" } } } ] } ] }, "description": "Flat ordered array of hops the funds will travel through" }, { "type": "array", "additionalItems": false, "items": [ { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "offPlatform" ] }, "note": { "type": "string" } } } ], "minItems": 1 } ] }, "remittanceNotification": { "type": "object", "required": [ "recipients" ], "properties": { "recipients": { "type": "array", "items": { "type": "object", "required": [ "name", "email" ], "properties": { "name": { "type": "string" }, "email": { "type": "string" } } } } }, "description": "Notifications when a bill is paid" }, "payment": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "description": "Reference ID for this payment" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } }, "manualCompletion": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "notPaid" ] } ] }, "reason": { "type": "string" } }, "description": "Set when the bill was manually completed" }, "purchaseOrder": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "manual" ] }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "rutterId", "platformId" ], "properties": { "type": { "type": "string", "enum": [ "rutter" ] }, "rutterId": { "type": "string" }, "platformId": { "type": "string" } } } ] }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/{id}/undelete": { "post": { "summary": "Undelete a bill", "tags": [ "Bill" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "creatorUserId", "lineItems", "documents", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "paymentPending" ] }, { "type": "string", "enum": [ "paymentInProgress" ] }, { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "paymentFailed" ] }, { "type": "string", "enum": [ "manuallyCompleted" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creatorUserId": { "type": "string" }, "vendorId": { "type": "string" }, "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "paymentDueDate": { "type": "string", "format": "date", "description": "The date that the invoice says the payment is due, in ISO date string, YYYY-MM-DD" }, "totalAmount": { "type": "string", "description": "number string" }, "description": { "type": "string" }, "lineItems": { "type": "array", "items": { "type": "object", "required": [ "id", "amount" ], "properties": { "id": { "type": "string" }, "description": { "type": "string" }, "amount": { "type": "string", "description": "Number string" }, "spendCategoryId": { "type": "string" } } } }, "documents": { "type": "array", "items": { "type": "object", "required": [ "id", "fileName", "type", "status", "createdAt" ], "properties": { "id": { "type": "string" }, "fileName": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "invoice" ] }, { "type": "string", "enum": [ "supporting" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "parsed" ] } ] }, "parsedData": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achRoutingNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "amount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } } }, "paymentScheduledDate": { "type": "string", "format": "date", "description": "When the payment will be triggered, in ISO date string, YYYY-MM-DD. It should be far enough in advance so when the payment reaches the vendor, it is still before or on the paymentDueDate. Date is based on the payment processor's timezone, i.e. EST." }, "paymentRoute": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] } } } ] }, { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "id", "speed", "memo" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" } } }, { "type": "object", "required": [ "type", "sharedByName", "email" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" } } } ] } ] }, "description": "Flat ordered array of hops the funds will travel through" }, { "type": "array", "additionalItems": false, "items": [ { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "offPlatform" ] }, "note": { "type": "string" } } } ], "minItems": 1 } ] }, "remittanceNotification": { "type": "object", "required": [ "recipients" ], "properties": { "recipients": { "type": "array", "items": { "type": "object", "required": [ "name", "email" ], "properties": { "name": { "type": "string" }, "email": { "type": "string" } } } } }, "description": "Notifications when a bill is paid" }, "payment": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "description": "Reference ID for this payment" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } }, "manualCompletion": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "notPaid" ] } ] }, "reason": { "type": "string" } }, "description": "Set when the bill was manually completed" }, "purchaseOrder": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "manual" ] }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "rutterId", "platformId" ], "properties": { "type": { "type": "string", "enum": [ "rutter" ] }, "rutterId": { "type": "string" }, "platformId": { "type": "string" } } } ] }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/{id}/submit": { "post": { "summary": "Submit a bill for payment", "tags": [ "Bill" ], "description": "If auto-approved by policy, returns the bill directly. Otherwise returns an approval request.", "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "creatorUserId", "lineItems", "documents", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "paymentPending" ] }, { "type": "string", "enum": [ "paymentInProgress" ] }, { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "paymentFailed" ] }, { "type": "string", "enum": [ "manuallyCompleted" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creatorUserId": { "type": "string" }, "vendorId": { "type": "string" }, "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "paymentDueDate": { "type": "string", "format": "date", "description": "The date that the invoice says the payment is due, in ISO date string, YYYY-MM-DD" }, "totalAmount": { "type": "string", "description": "number string" }, "description": { "type": "string" }, "lineItems": { "type": "array", "items": { "type": "object", "required": [ "id", "amount" ], "properties": { "id": { "type": "string" }, "description": { "type": "string" }, "amount": { "type": "string", "description": "Number string" }, "spendCategoryId": { "type": "string" } } } }, "documents": { "type": "array", "items": { "type": "object", "required": [ "id", "fileName", "type", "status", "createdAt" ], "properties": { "id": { "type": "string" }, "fileName": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "invoice" ] }, { "type": "string", "enum": [ "supporting" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "parsed" ] } ] }, "parsedData": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achRoutingNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "amount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } } }, "paymentScheduledDate": { "type": "string", "format": "date", "description": "When the payment will be triggered, in ISO date string, YYYY-MM-DD. It should be far enough in advance so when the payment reaches the vendor, it is still before or on the paymentDueDate. Date is based on the payment processor's timezone, i.e. EST." }, "paymentRoute": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] } } } ] }, { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "id", "speed", "memo" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" } } }, { "type": "object", "required": [ "type", "sharedByName", "email" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" } } } ] } ] }, "description": "Flat ordered array of hops the funds will travel through" }, { "type": "array", "additionalItems": false, "items": [ { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "offPlatform" ] }, "note": { "type": "string" } } } ], "minItems": 1 } ] }, "remittanceNotification": { "type": "object", "required": [ "recipients" ], "properties": { "recipients": { "type": "array", "items": { "type": "object", "required": [ "name", "email" ], "properties": { "name": { "type": "string" }, "email": { "type": "string" } } } } }, "description": "Notifications when a bill is paid" }, "payment": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "description": "Reference ID for this payment" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } }, "manualCompletion": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "notPaid" ] } ] }, "reason": { "type": "string" } }, "description": "Set when the bill was manually completed" }, "purchaseOrder": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "manual" ] }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "rutterId", "platformId" ], "properties": { "type": { "type": "string", "enum": [ "rutter" ] }, "rutterId": { "type": "string" }, "platformId": { "type": "string" } } } ] }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } } } }, "202": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "payBill", "enum": [ "payBill" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "payBill" } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "cannotSubmit" ] }, "message": { "type": "string" } }, "title": "cannotSubmit", "description": "A service error has occurred" }, { "type": "object", "required": [ "reasons" ], "properties": { "reasons": { "type": "array", "items": { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidVendor" ] }, "message": { "type": "string" } }, "title": "invalidVendor", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidInvoiceId" ] }, "message": { "type": "string" } }, "title": "invalidInvoiceId", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidCurrencyCode" ] }, "message": { "type": "string" } }, "title": "invalidCurrencyCode", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidInvoiceDate" ] }, "message": { "type": "string" } }, "title": "invalidInvoiceDate", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidPaymentScheduledDate" ] }, "message": { "type": "string" } }, "title": "invalidPaymentScheduledDate", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidPaymentRoute" ] }, "message": { "type": "string" } }, "title": "invalidPaymentRoute", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidLineItems" ] }, "message": { "type": "string" } }, "title": "invalidLineItems", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidInvoice" ] }, "message": { "type": "string" } }, "title": "invalidInvoice", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidTotalAmount" ] }, "message": { "type": "string" } }, "title": "invalidTotalAmount", "description": "A service error has occurred" } ] } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "422": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "declinedByPolicy" ] }, "message": { "type": "string" } }, "title": "declinedByPolicy", "description": "A service error has occurred" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/{id}/pay-offplatform": { "post": { "summary": "Mark a bill as paid, if it was configured to be paid off-platform", "tags": [ "Bill" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "paymentId" ], "properties": { "paymentId": { "type": "string", "description": "A reference for the off-platform payment" }, "completedAt": { "type": "string", "format": "date-time", "description": "Defaults to now" } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "creatorUserId", "lineItems", "documents", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "paymentPending" ] }, { "type": "string", "enum": [ "paymentInProgress" ] }, { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "paymentFailed" ] }, { "type": "string", "enum": [ "manuallyCompleted" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creatorUserId": { "type": "string" }, "vendorId": { "type": "string" }, "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "paymentDueDate": { "type": "string", "format": "date", "description": "The date that the invoice says the payment is due, in ISO date string, YYYY-MM-DD" }, "totalAmount": { "type": "string", "description": "number string" }, "description": { "type": "string" }, "lineItems": { "type": "array", "items": { "type": "object", "required": [ "id", "amount" ], "properties": { "id": { "type": "string" }, "description": { "type": "string" }, "amount": { "type": "string", "description": "Number string" }, "spendCategoryId": { "type": "string" } } } }, "documents": { "type": "array", "items": { "type": "object", "required": [ "id", "fileName", "type", "status", "createdAt" ], "properties": { "id": { "type": "string" }, "fileName": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "invoice" ] }, { "type": "string", "enum": [ "supporting" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "parsed" ] } ] }, "parsedData": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achRoutingNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "amount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } } }, "paymentScheduledDate": { "type": "string", "format": "date", "description": "When the payment will be triggered, in ISO date string, YYYY-MM-DD. It should be far enough in advance so when the payment reaches the vendor, it is still before or on the paymentDueDate. Date is based on the payment processor's timezone, i.e. EST." }, "paymentRoute": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] } } } ] }, { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "id", "speed", "memo" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" } } }, { "type": "object", "required": [ "type", "sharedByName", "email" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" } } } ] } ] }, "description": "Flat ordered array of hops the funds will travel through" }, { "type": "array", "additionalItems": false, "items": [ { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "offPlatform" ] }, "note": { "type": "string" } } } ], "minItems": 1 } ] }, "remittanceNotification": { "type": "object", "required": [ "recipients" ], "properties": { "recipients": { "type": "array", "items": { "type": "object", "required": [ "name", "email" ], "properties": { "name": { "type": "string" }, "email": { "type": "string" } } } } }, "description": "Notifications when a bill is paid" }, "payment": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "description": "Reference ID for this payment" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } }, "manualCompletion": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "notPaid" ] } ] }, "reason": { "type": "string" } }, "description": "Set when the bill was manually completed" }, "purchaseOrder": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "manual" ] }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "rutterId", "platformId" ], "properties": { "type": { "type": "string", "enum": [ "rutter" ] }, "rutterId": { "type": "string" }, "platformId": { "type": "string" } } } ] }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidPaymentRoute" ] }, "message": { "type": "string" } }, "title": "invalidPaymentRoute", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/{id}/cancel-payment": { "post": { "summary": "Cancel a pending payment for a bill", "tags": [ "Bill" ], "description": "The underlying payment is deleted and the bill sent back to `returned`.", "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "creatorUserId", "lineItems", "documents", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "paymentPending" ] }, { "type": "string", "enum": [ "paymentInProgress" ] }, { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "paymentFailed" ] }, { "type": "string", "enum": [ "manuallyCompleted" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creatorUserId": { "type": "string" }, "vendorId": { "type": "string" }, "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "paymentDueDate": { "type": "string", "format": "date", "description": "The date that the invoice says the payment is due, in ISO date string, YYYY-MM-DD" }, "totalAmount": { "type": "string", "description": "number string" }, "description": { "type": "string" }, "lineItems": { "type": "array", "items": { "type": "object", "required": [ "id", "amount" ], "properties": { "id": { "type": "string" }, "description": { "type": "string" }, "amount": { "type": "string", "description": "Number string" }, "spendCategoryId": { "type": "string" } } } }, "documents": { "type": "array", "items": { "type": "object", "required": [ "id", "fileName", "type", "status", "createdAt" ], "properties": { "id": { "type": "string" }, "fileName": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "invoice" ] }, { "type": "string", "enum": [ "supporting" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "parsed" ] } ] }, "parsedData": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achRoutingNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "amount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } } }, "paymentScheduledDate": { "type": "string", "format": "date", "description": "When the payment will be triggered, in ISO date string, YYYY-MM-DD. It should be far enough in advance so when the payment reaches the vendor, it is still before or on the paymentDueDate. Date is based on the payment processor's timezone, i.e. EST." }, "paymentRoute": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] } } } ] }, { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "id", "speed", "memo" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" } } }, { "type": "object", "required": [ "type", "sharedByName", "email" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" } } } ] } ] }, "description": "Flat ordered array of hops the funds will travel through" }, { "type": "array", "additionalItems": false, "items": [ { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "offPlatform" ] }, "note": { "type": "string" } } } ], "minItems": 1 } ] }, "remittanceNotification": { "type": "object", "required": [ "recipients" ], "properties": { "recipients": { "type": "array", "items": { "type": "object", "required": [ "name", "email" ], "properties": { "name": { "type": "string" }, "email": { "type": "string" } } } } }, "description": "Notifications when a bill is paid" }, "payment": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "description": "Reference ID for this payment" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } }, "manualCompletion": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "notPaid" ] } ] }, "reason": { "type": "string" } }, "description": "Set when the bill was manually completed" }, "purchaseOrder": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "manual" ] }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "rutterId", "platformId" ], "properties": { "type": { "type": "string", "enum": [ "rutter" ] }, "rutterId": { "type": "string" }, "platformId": { "type": "string" } } } ] }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidPaymentStatus" ] }, "message": { "type": "string" } }, "title": "invalidPaymentStatus", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/{id}/manually-complete": { "post": { "summary": "Manually complete a bill", "tags": [ "Bill" ], "description": "It should only be used when a bill is `paymentFailed` or we are 100% confident that a `paymentInProgress` bill cannot continue.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "notPaid" ] } ] }, "reason": { "type": "string" }, "completedAt": { "type": "string", "format": "date-time", "description": "Defaults to now" } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "creatorUserId", "lineItems", "documents", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "paymentPending" ] }, { "type": "string", "enum": [ "paymentInProgress" ] }, { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "paymentFailed" ] }, { "type": "string", "enum": [ "manuallyCompleted" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creatorUserId": { "type": "string" }, "vendorId": { "type": "string" }, "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "paymentDueDate": { "type": "string", "format": "date", "description": "The date that the invoice says the payment is due, in ISO date string, YYYY-MM-DD" }, "totalAmount": { "type": "string", "description": "number string" }, "description": { "type": "string" }, "lineItems": { "type": "array", "items": { "type": "object", "required": [ "id", "amount" ], "properties": { "id": { "type": "string" }, "description": { "type": "string" }, "amount": { "type": "string", "description": "Number string" }, "spendCategoryId": { "type": "string" } } } }, "documents": { "type": "array", "items": { "type": "object", "required": [ "id", "fileName", "type", "status", "createdAt" ], "properties": { "id": { "type": "string" }, "fileName": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "invoice" ] }, { "type": "string", "enum": [ "supporting" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "parsed" ] } ] }, "parsedData": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achRoutingNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "amount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } } }, "paymentScheduledDate": { "type": "string", "format": "date", "description": "When the payment will be triggered, in ISO date string, YYYY-MM-DD. It should be far enough in advance so when the payment reaches the vendor, it is still before or on the paymentDueDate. Date is based on the payment processor's timezone, i.e. EST." }, "paymentRoute": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] } } } ] }, { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "id", "speed", "memo" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" } } }, { "type": "object", "required": [ "type", "sharedByName", "email" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" } } } ] } ] }, "description": "Flat ordered array of hops the funds will travel through" }, { "type": "array", "additionalItems": false, "items": [ { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "offPlatform" ] }, "note": { "type": "string" } } } ], "minItems": 1 } ] }, "remittanceNotification": { "type": "object", "required": [ "recipients" ], "properties": { "recipients": { "type": "array", "items": { "type": "object", "required": [ "name", "email" ], "properties": { "name": { "type": "string" }, "email": { "type": "string" } } } } }, "description": "Notifications when a bill is paid" }, "payment": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "description": "Reference ID for this payment" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } }, "manualCompletion": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "notPaid" ] } ] }, "reason": { "type": "string" } }, "description": "Set when the bill was manually completed" }, "purchaseOrder": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "manual" ] }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "rutterId", "platformId" ], "properties": { "type": { "type": "string", "enum": [ "rutter" ] }, "rutterId": { "type": "string" }, "platformId": { "type": "string" } } } ] }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/{id}/accounting-integration/force-sync": { "post": { "summary": "Force a sync of this bill to the accounting platform", "tags": [ "Bill" ], "description": "WARNING: Only use this in extraordinary circumstances where the bill was not automatically synced for some reason.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "type" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "bill" ] }, { "type": "string", "enum": [ "billPayment" ] }, { "type": "string", "enum": [ "deleteBill" ] } ] } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "creatorUserId", "lineItems", "documents", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "paymentPending" ] }, { "type": "string", "enum": [ "paymentInProgress" ] }, { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "paymentFailed" ] }, { "type": "string", "enum": [ "manuallyCompleted" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creatorUserId": { "type": "string" }, "vendorId": { "type": "string" }, "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "paymentDueDate": { "type": "string", "format": "date", "description": "The date that the invoice says the payment is due, in ISO date string, YYYY-MM-DD" }, "totalAmount": { "type": "string", "description": "number string" }, "description": { "type": "string" }, "lineItems": { "type": "array", "items": { "type": "object", "required": [ "id", "amount" ], "properties": { "id": { "type": "string" }, "description": { "type": "string" }, "amount": { "type": "string", "description": "Number string" }, "spendCategoryId": { "type": "string" } } } }, "documents": { "type": "array", "items": { "type": "object", "required": [ "id", "fileName", "type", "status", "createdAt" ], "properties": { "id": { "type": "string" }, "fileName": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "invoice" ] }, { "type": "string", "enum": [ "supporting" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "parsed" ] } ] }, "parsedData": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achRoutingNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "amount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } } }, "paymentScheduledDate": { "type": "string", "format": "date", "description": "When the payment will be triggered, in ISO date string, YYYY-MM-DD. It should be far enough in advance so when the payment reaches the vendor, it is still before or on the paymentDueDate. Date is based on the payment processor's timezone, i.e. EST." }, "paymentRoute": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] } } } ] }, { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "id", "speed", "memo" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" } } }, { "type": "object", "required": [ "type", "sharedByName", "email" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" } } } ] } ] }, "description": "Flat ordered array of hops the funds will travel through" }, { "type": "array", "additionalItems": false, "items": [ { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "offPlatform" ] }, "note": { "type": "string" } } } ], "minItems": 1 } ] }, "remittanceNotification": { "type": "object", "required": [ "recipients" ], "properties": { "recipients": { "type": "array", "items": { "type": "object", "required": [ "name", "email" ], "properties": { "name": { "type": "string" }, "email": { "type": "string" } } } } }, "description": "Notifications when a bill is paid" }, "payment": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "description": "Reference ID for this payment" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } }, "manualCompletion": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "notPaid" ] } ] }, "reason": { "type": "string" } }, "description": "Set when the bill was manually completed" }, "purchaseOrder": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "manual" ] }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "rutterId", "platformId" ], "properties": { "type": { "type": "string", "enum": [ "rutter" ] }, "rutterId": { "type": "string" }, "platformId": { "type": "string" } } } ] }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "alreadyExists" ] }, "message": { "type": "string" } }, "title": "alreadyExists", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/{billId}/line-item": { "post": { "summary": "Add a line item to a bill", "tags": [ "Bill" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "amount" ], "properties": { "description": { "type": "string" }, "amount": { "type": "string", "description": "Number string" }, "spendCategoryId": { "type": "string" } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "billId", "required": true } ], "responses": { "201": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "amount" ], "properties": { "id": { "type": "string" }, "description": { "type": "string" }, "amount": { "type": "string", "description": "Number string" }, "spendCategoryId": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidAmount" ] }, "message": { "type": "string" } }, "title": "invalidAmount", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/{billId}/line-item/{id}": { "patch": { "summary": "Update a line item", "tags": [ "Bill" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "amount" ], "properties": { "description": { "type": "string" }, "amount": { "type": "string", "description": "Number string" }, "spendCategoryId": { "type": "string" } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "billId", "required": true }, { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "amount" ], "properties": { "id": { "type": "string" }, "description": { "type": "string" }, "amount": { "type": "string", "description": "Number string" }, "spendCategoryId": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidAmount" ] }, "message": { "type": "string" } }, "title": "invalidAmount", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "delete": { "summary": "Delete a line item", "tags": [ "Bill" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "billId", "required": true }, { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "amount" ], "properties": { "id": { "type": "string" }, "description": { "type": "string" }, "amount": { "type": "string", "description": "Number string" }, "spendCategoryId": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/{billId}/document": { "post": { "summary": "Add a document to a bill", "tags": [ "Bill" ], "description": "Returns a presigned `upload` to `POST` the document to.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "fileName", "type" ], "properties": { "fileName": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "invoice" ] }, { "type": "string", "enum": [ "supporting" ] } ] } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "billId", "required": true } ], "responses": { "201": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "id", "fileName", "type", "status", "createdAt" ], "properties": { "id": { "type": "string" }, "fileName": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "invoice" ] }, { "type": "string", "enum": [ "supporting" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "parsed" ] } ] }, "parsedData": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achRoutingNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "amount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } }, { "type": "object", "required": [ "uploadUrl", "upload" ], "properties": { "uploadUrl": { "type": "string", "deprecated": true, "description": "Deprecated. Use `upload` instead." }, "upload": { "type": "object", "required": [ "url", "fields" ], "properties": { "url": { "type": "string" }, "fields": { "type": "object", "additionalProperties": { "type": "string" } } }, "description": "Presigned S3 POST: append each `fields` entry as a form field, then the file last." } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidFileFormat" ] }, "message": { "type": "string" } }, "title": "invalidFileFormat", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/{billId}/document/{id}": { "get": { "summary": "Get a bill document", "tags": [ "Bill" ], "description": "Get an individual document's details. Useful for polling document status. To download the file, use `GET /v1/web/bill/{billId}/document/{id}/download` instead.", "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "billId", "required": true }, { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "fileName", "type", "status", "createdAt" ], "properties": { "id": { "type": "string" }, "fileName": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "invoice" ] }, { "type": "string", "enum": [ "supporting" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "parsed" ] } ] }, "parsedData": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achRoutingNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "amount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "delete": { "summary": "Delete a bill document", "tags": [ "Bill" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "billId", "required": true }, { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "fileName", "type", "status", "createdAt" ], "properties": { "id": { "type": "string" }, "fileName": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "invoice" ] }, { "type": "string", "enum": [ "supporting" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "parsed" ] } ] }, "parsedData": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achRoutingNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "amount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bill/{billId}/document/{id}/download": { "get": { "summary": "Download a bill document", "tags": [ "Bill" ], "description": "Redirects via `Location` header to a pre-signed download URL.", "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "billId", "required": true }, { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "302": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "fileName", "type", "status", "createdAt" ], "properties": { "id": { "type": "string" }, "fileName": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "invoice" ] }, { "type": "string", "enum": [ "supporting" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "parsed" ] } ] }, "parsedData": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string", "description": "ISO date string, YYYY-MM-DD" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achRoutingNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "achAccountNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "amount": { "anyOf": [ { "type": "string", "description": "Decimal string" }, { "type": "null" } ] } } } } } }, "createdAt": { "type": "string", "format": "date-time" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" }, "platformMessage": { "type": "string" } } } } } } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bulk-import": { "get": { "summary": "Search Bulk Imports", "tags": [ "Bulk Import" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "ids", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "externalIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "types", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "creatorUserIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "integer", "minimum": 1, "default": 1 }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext", "totalCount" ], "properties": { "items": { "type": "array", "items": { "allOf": [ { "type": "object", "required": [ "id", "type", "status", "source", "creatorUserId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "vendor" ] }, { "type": "string", "enum": [ "bill" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "creating" ] }, { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "source": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "fileSource" ] }, "id": { "type": "string" } } } ] }, "creatorUserId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "processedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "itemStatusSummary" ], "properties": { "itemStatusSummary": { "type": "object", "required": [ "ready", "processing", "imported", "skipped", "failed" ], "properties": { "ready": { "type": "integer" }, "processing": { "type": "integer" }, "imported": { "type": "integer" }, "skipped": { "type": "integer" }, "failed": { "type": "integer" } }, "description": "Count of the bulk import's items grouped by their status" } } } ] } }, "hasNext": { "type": "boolean" }, "totalCount": { "type": "number" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bulk-import/{id}": { "get": { "summary": "Get a Bulk Import", "tags": [ "Bulk Import" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "id", "type", "status", "source", "creatorUserId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "vendor" ] }, { "type": "string", "enum": [ "bill" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "creating" ] }, { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "source": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "fileSource" ] }, "id": { "type": "string" } } } ] }, "creatorUserId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "processedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "itemStatusSummary" ], "properties": { "itemStatusSummary": { "type": "object", "required": [ "ready", "processing", "imported", "skipped", "failed" ], "properties": { "ready": { "type": "integer" }, "processing": { "type": "integer" }, "imported": { "type": "integer" }, "skipped": { "type": "integer" }, "failed": { "type": "integer" } }, "description": "Count of the bulk import's items grouped by their status" } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "delete": { "summary": "Delete a Bulk Import", "tags": [ "Bulk Import" ], "description": "Cannot be deleted while `processing`.", "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "type", "status", "source", "creatorUserId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "vendor" ] }, { "type": "string", "enum": [ "bill" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "creating" ] }, { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "source": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "fileSource" ] }, "id": { "type": "string" } } } ] }, "creatorUserId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "processedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bulk-import/{id}/validate": { "post": { "summary": "Validate a Bulk Import", "tags": [ "Bulk Import" ], "description": "Asynchronously validates all pending items. Only allowed while `ready`.", "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "type", "status", "source", "creatorUserId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "vendor" ] }, { "type": "string", "enum": [ "bill" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "creating" ] }, { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "source": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "fileSource" ] }, "id": { "type": "string" } } } ] }, "creatorUserId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "processedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bulk-import/{id}/process": { "post": { "summary": "Process a Bulk Import", "tags": [ "Bulk Import" ], "description": "Asynchronously processes all valid items. Only allowed while `ready`.", "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "type", "status", "source", "creatorUserId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "vendor" ] }, { "type": "string", "enum": [ "bill" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "creating" ] }, { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "source": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "fileSource" ] }, "id": { "type": "string" } } } ] }, "creatorUserId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "processedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bulk-import/{bulkImportId}/items": { "post": { "summary": "Add an Item to a Bulk Import", "tags": [ "Bulk Import" ], "description": "Only allowed while the bulk import is `ready`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "enum": [ "createBillLineItem" ] }, "request": { "type": "object", "properties": { "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string" }, "paymentDueDate": { "type": "string" }, "totalAmount": { "type": "string" }, "externalId": { "type": "string" }, "vendorId": { "type": "string" }, "vendorName": { "type": "string" }, "description": { "type": "string" }, "lineItem": { "type": "object", "properties": { "description": { "type": "string" }, "amount": { "type": "string" } } } } } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "enum": [ "createVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "externalId": { "type": "string" }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "contact": { "type": "object", "properties": { "name": { "type": "object", "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "phone": { "type": "string" } } } } } } } ] } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "bulkImportId", "required": true } ], "responses": { "201": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "id", "status", "type", "request", "validation", "processingErrors", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "imported" ] }, { "type": "string", "enum": [ "skipped" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "imported": { "type": "object", "required": [ "billId", "billLineItemId" ], "properties": { "billId": { "type": "string" }, "billLineItemId": { "type": "string" } } }, "type": { "type": "string", "enum": [ "createBillLineItem" ] }, "request": { "type": "object", "properties": { "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string" }, "paymentDueDate": { "type": "string" }, "totalAmount": { "type": "string" }, "externalId": { "type": "string" }, "vendorId": { "type": "string" }, "vendorName": { "type": "string" }, "description": { "type": "string" }, "lineItem": { "type": "object", "properties": { "description": { "type": "string" }, "amount": { "type": "string" } } } } }, "validation": { "type": "object", "required": [ "status", "errors" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "valid" ] }, { "type": "string", "enum": [ "invalid" ] } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code", "level" ], "properties": { "code": { "anyOf": [ { "type": "string", "enum": [ "invalidCurrencyCode" ] }, { "type": "string", "enum": [ "invalidInvoiceDate" ] }, { "type": "string", "enum": [ "invalidPaymentDueDate" ] }, { "type": "string", "enum": [ "invalidPaymentScheduledDate" ] }, { "type": "string", "enum": [ "invalidTotalAmount" ] }, { "type": "string", "enum": [ "invalidVendorId" ] }, { "type": "string", "enum": [ "invalidAmount" ] }, { "type": "string", "enum": [ "invalidInvoiceId" ] }, { "type": "string", "enum": [ "notFound" ] }, { "type": "string", "enum": [ "invalidStatus" ] } ] }, "level": { "anyOf": [ { "type": "string", "enum": [ "info" ] }, { "type": "string", "enum": [ "warn" ] }, { "type": "string", "enum": [ "error" ] } ] }, "message": { "type": "string" } } } } } }, "processingErrors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "id", "status", "type", "request", "validation", "processingErrors", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "imported" ] }, { "type": "string", "enum": [ "skipped" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "imported": { "type": "object", "required": [ "vendorId" ], "properties": { "vendorId": { "type": "string" } } }, "type": { "type": "string", "enum": [ "createVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "externalId": { "type": "string" }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "contact": { "type": "object", "properties": { "name": { "type": "object", "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "phone": { "type": "string" } } } } }, "validation": { "type": "object", "required": [ "status", "errors" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "valid" ] }, { "type": "string", "enum": [ "invalid" ] } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code", "level" ], "properties": { "code": { "anyOf": [ { "type": "string", "enum": [ "invalidName" ] }, { "type": "string", "enum": [ "invalidCurrencyCode" ] }, { "type": "string", "enum": [ "invalidCountry" ] }, { "type": "string", "enum": [ "invalidContactName" ] }, { "type": "string", "enum": [ "invalidContactEmail" ] }, { "type": "string", "enum": [ "invalidRutterId" ] } ] }, "level": { "anyOf": [ { "type": "string", "enum": [ "info" ] }, { "type": "string", "enum": [ "warn" ] }, { "type": "string", "enum": [ "error" ] } ] }, "message": { "type": "string" } } } } } }, "processingErrors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidType" ] }, "message": { "type": "string" } }, "title": "invalidType", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Search Items in a Bulk Import", "tags": [ "Bulk Import" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "validationStatuses", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "types", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "integer", "minimum": 1, "default": 1 }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." }, { "schema": { "type": "string" }, "in": "path", "name": "bulkImportId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext", "totalCount" ], "properties": { "items": { "type": "array", "items": { "anyOf": [ { "type": "object", "required": [ "id", "status", "type", "request", "validation", "processingErrors", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "imported" ] }, { "type": "string", "enum": [ "skipped" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "imported": { "type": "object", "required": [ "billId", "billLineItemId" ], "properties": { "billId": { "type": "string" }, "billLineItemId": { "type": "string" } } }, "type": { "type": "string", "enum": [ "createBillLineItem" ] }, "request": { "type": "object", "properties": { "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string" }, "paymentDueDate": { "type": "string" }, "totalAmount": { "type": "string" }, "externalId": { "type": "string" }, "vendorId": { "type": "string" }, "vendorName": { "type": "string" }, "description": { "type": "string" }, "lineItem": { "type": "object", "properties": { "description": { "type": "string" }, "amount": { "type": "string" } } } } }, "validation": { "type": "object", "required": [ "status", "errors" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "valid" ] }, { "type": "string", "enum": [ "invalid" ] } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code", "level" ], "properties": { "code": { "anyOf": [ { "type": "string", "enum": [ "invalidCurrencyCode" ] }, { "type": "string", "enum": [ "invalidInvoiceDate" ] }, { "type": "string", "enum": [ "invalidPaymentDueDate" ] }, { "type": "string", "enum": [ "invalidPaymentScheduledDate" ] }, { "type": "string", "enum": [ "invalidTotalAmount" ] }, { "type": "string", "enum": [ "invalidVendorId" ] }, { "type": "string", "enum": [ "invalidAmount" ] }, { "type": "string", "enum": [ "invalidInvoiceId" ] }, { "type": "string", "enum": [ "notFound" ] }, { "type": "string", "enum": [ "invalidStatus" ] } ] }, "level": { "anyOf": [ { "type": "string", "enum": [ "info" ] }, { "type": "string", "enum": [ "warn" ] }, { "type": "string", "enum": [ "error" ] } ] }, "message": { "type": "string" } } } } } }, "processingErrors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "id", "status", "type", "request", "validation", "processingErrors", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "imported" ] }, { "type": "string", "enum": [ "skipped" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "imported": { "type": "object", "required": [ "vendorId" ], "properties": { "vendorId": { "type": "string" } } }, "type": { "type": "string", "enum": [ "createVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "externalId": { "type": "string" }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "contact": { "type": "object", "properties": { "name": { "type": "object", "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "phone": { "type": "string" } } } } }, "validation": { "type": "object", "required": [ "status", "errors" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "valid" ] }, { "type": "string", "enum": [ "invalid" ] } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code", "level" ], "properties": { "code": { "anyOf": [ { "type": "string", "enum": [ "invalidName" ] }, { "type": "string", "enum": [ "invalidCurrencyCode" ] }, { "type": "string", "enum": [ "invalidCountry" ] }, { "type": "string", "enum": [ "invalidContactName" ] }, { "type": "string", "enum": [ "invalidContactEmail" ] }, { "type": "string", "enum": [ "invalidRutterId" ] } ] }, "level": { "anyOf": [ { "type": "string", "enum": [ "info" ] }, { "type": "string", "enum": [ "warn" ] }, { "type": "string", "enum": [ "error" ] } ] }, "message": { "type": "string" } } } } } }, "processingErrors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } ] } }, "hasNext": { "type": "boolean" }, "totalCount": { "type": "number" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bulk-import/{bulkImportId}/items/{id}": { "get": { "summary": "Get an Item from a Bulk Import", "tags": [ "Bulk Import" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "bulkImportId", "required": true }, { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "id", "status", "type", "request", "validation", "processingErrors", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "imported" ] }, { "type": "string", "enum": [ "skipped" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "imported": { "type": "object", "required": [ "billId", "billLineItemId" ], "properties": { "billId": { "type": "string" }, "billLineItemId": { "type": "string" } } }, "type": { "type": "string", "enum": [ "createBillLineItem" ] }, "request": { "type": "object", "properties": { "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string" }, "paymentDueDate": { "type": "string" }, "totalAmount": { "type": "string" }, "externalId": { "type": "string" }, "vendorId": { "type": "string" }, "vendorName": { "type": "string" }, "description": { "type": "string" }, "lineItem": { "type": "object", "properties": { "description": { "type": "string" }, "amount": { "type": "string" } } } } }, "validation": { "type": "object", "required": [ "status", "errors" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "valid" ] }, { "type": "string", "enum": [ "invalid" ] } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code", "level" ], "properties": { "code": { "anyOf": [ { "type": "string", "enum": [ "invalidCurrencyCode" ] }, { "type": "string", "enum": [ "invalidInvoiceDate" ] }, { "type": "string", "enum": [ "invalidPaymentDueDate" ] }, { "type": "string", "enum": [ "invalidPaymentScheduledDate" ] }, { "type": "string", "enum": [ "invalidTotalAmount" ] }, { "type": "string", "enum": [ "invalidVendorId" ] }, { "type": "string", "enum": [ "invalidAmount" ] }, { "type": "string", "enum": [ "invalidInvoiceId" ] }, { "type": "string", "enum": [ "notFound" ] }, { "type": "string", "enum": [ "invalidStatus" ] } ] }, "level": { "anyOf": [ { "type": "string", "enum": [ "info" ] }, { "type": "string", "enum": [ "warn" ] }, { "type": "string", "enum": [ "error" ] } ] }, "message": { "type": "string" } } } } } }, "processingErrors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "id", "status", "type", "request", "validation", "processingErrors", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "imported" ] }, { "type": "string", "enum": [ "skipped" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "imported": { "type": "object", "required": [ "vendorId" ], "properties": { "vendorId": { "type": "string" } } }, "type": { "type": "string", "enum": [ "createVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "externalId": { "type": "string" }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "contact": { "type": "object", "properties": { "name": { "type": "object", "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "phone": { "type": "string" } } } } }, "validation": { "type": "object", "required": [ "status", "errors" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "valid" ] }, { "type": "string", "enum": [ "invalid" ] } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code", "level" ], "properties": { "code": { "anyOf": [ { "type": "string", "enum": [ "invalidName" ] }, { "type": "string", "enum": [ "invalidCurrencyCode" ] }, { "type": "string", "enum": [ "invalidCountry" ] }, { "type": "string", "enum": [ "invalidContactName" ] }, { "type": "string", "enum": [ "invalidContactEmail" ] }, { "type": "string", "enum": [ "invalidRutterId" ] } ] }, "level": { "anyOf": [ { "type": "string", "enum": [ "info" ] }, { "type": "string", "enum": [ "warn" ] }, { "type": "string", "enum": [ "error" ] } ] }, "message": { "type": "string" } } } } } }, "processingErrors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "patch": { "summary": "Update an Item in a Bulk Import", "tags": [ "Bulk Import" ], "description": "Updates the request data or toggles the item between `ready` and `skipped`. Only allowed while the bulk import is `ready`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "skipped" ] } ] }, "request": { "anyOf": [ { "type": "object", "properties": { "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string" }, "paymentDueDate": { "type": "string" }, "totalAmount": { "type": "string" }, "externalId": { "type": "string" }, "vendorId": { "type": "string" }, "vendorName": { "type": "string" }, "description": { "type": "string" }, "lineItem": { "type": "object", "properties": { "description": { "type": "string" }, "amount": { "type": "string" } } } } }, { "type": "object", "properties": { "name": { "type": "string" }, "externalId": { "type": "string" }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "contact": { "type": "object", "properties": { "name": { "type": "object", "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "phone": { "type": "string" } } } } } ] } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "bulkImportId", "required": true }, { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "id", "status", "type", "request", "validation", "processingErrors", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "imported" ] }, { "type": "string", "enum": [ "skipped" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "imported": { "type": "object", "required": [ "billId", "billLineItemId" ], "properties": { "billId": { "type": "string" }, "billLineItemId": { "type": "string" } } }, "type": { "type": "string", "enum": [ "createBillLineItem" ] }, "request": { "type": "object", "properties": { "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string" }, "paymentDueDate": { "type": "string" }, "totalAmount": { "type": "string" }, "externalId": { "type": "string" }, "vendorId": { "type": "string" }, "vendorName": { "type": "string" }, "description": { "type": "string" }, "lineItem": { "type": "object", "properties": { "description": { "type": "string" }, "amount": { "type": "string" } } } } }, "validation": { "type": "object", "required": [ "status", "errors" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "valid" ] }, { "type": "string", "enum": [ "invalid" ] } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code", "level" ], "properties": { "code": { "anyOf": [ { "type": "string", "enum": [ "invalidCurrencyCode" ] }, { "type": "string", "enum": [ "invalidInvoiceDate" ] }, { "type": "string", "enum": [ "invalidPaymentDueDate" ] }, { "type": "string", "enum": [ "invalidPaymentScheduledDate" ] }, { "type": "string", "enum": [ "invalidTotalAmount" ] }, { "type": "string", "enum": [ "invalidVendorId" ] }, { "type": "string", "enum": [ "invalidAmount" ] }, { "type": "string", "enum": [ "invalidInvoiceId" ] }, { "type": "string", "enum": [ "notFound" ] }, { "type": "string", "enum": [ "invalidStatus" ] } ] }, "level": { "anyOf": [ { "type": "string", "enum": [ "info" ] }, { "type": "string", "enum": [ "warn" ] }, { "type": "string", "enum": [ "error" ] } ] }, "message": { "type": "string" } } } } } }, "processingErrors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "id", "status", "type", "request", "validation", "processingErrors", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "imported" ] }, { "type": "string", "enum": [ "skipped" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "imported": { "type": "object", "required": [ "vendorId" ], "properties": { "vendorId": { "type": "string" } } }, "type": { "type": "string", "enum": [ "createVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "externalId": { "type": "string" }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "contact": { "type": "object", "properties": { "name": { "type": "object", "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "phone": { "type": "string" } } } } }, "validation": { "type": "object", "required": [ "status", "errors" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "valid" ] }, { "type": "string", "enum": [ "invalid" ] } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code", "level" ], "properties": { "code": { "anyOf": [ { "type": "string", "enum": [ "invalidName" ] }, { "type": "string", "enum": [ "invalidCurrencyCode" ] }, { "type": "string", "enum": [ "invalidCountry" ] }, { "type": "string", "enum": [ "invalidContactName" ] }, { "type": "string", "enum": [ "invalidContactEmail" ] }, { "type": "string", "enum": [ "invalidRutterId" ] } ] }, "level": { "anyOf": [ { "type": "string", "enum": [ "info" ] }, { "type": "string", "enum": [ "warn" ] }, { "type": "string", "enum": [ "error" ] } ] }, "message": { "type": "string" } } } } } }, "processingErrors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "delete": { "summary": "Delete an Item from a Bulk Import", "tags": [ "Bulk Import" ], "description": "Imported items cannot be deleted. Only allowed while the bulk import is `ready`.", "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "bulkImportId", "required": true }, { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "id", "status", "type", "request", "validation", "processingErrors", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "imported" ] }, { "type": "string", "enum": [ "skipped" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "imported": { "type": "object", "required": [ "billId", "billLineItemId" ], "properties": { "billId": { "type": "string" }, "billLineItemId": { "type": "string" } } }, "type": { "type": "string", "enum": [ "createBillLineItem" ] }, "request": { "type": "object", "properties": { "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string" }, "paymentDueDate": { "type": "string" }, "totalAmount": { "type": "string" }, "externalId": { "type": "string" }, "vendorId": { "type": "string" }, "vendorName": { "type": "string" }, "description": { "type": "string" }, "lineItem": { "type": "object", "properties": { "description": { "type": "string" }, "amount": { "type": "string" } } } } }, "validation": { "type": "object", "required": [ "status", "errors" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "valid" ] }, { "type": "string", "enum": [ "invalid" ] } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code", "level" ], "properties": { "code": { "anyOf": [ { "type": "string", "enum": [ "invalidCurrencyCode" ] }, { "type": "string", "enum": [ "invalidInvoiceDate" ] }, { "type": "string", "enum": [ "invalidPaymentDueDate" ] }, { "type": "string", "enum": [ "invalidPaymentScheduledDate" ] }, { "type": "string", "enum": [ "invalidTotalAmount" ] }, { "type": "string", "enum": [ "invalidVendorId" ] }, { "type": "string", "enum": [ "invalidAmount" ] }, { "type": "string", "enum": [ "invalidInvoiceId" ] }, { "type": "string", "enum": [ "notFound" ] }, { "type": "string", "enum": [ "invalidStatus" ] } ] }, "level": { "anyOf": [ { "type": "string", "enum": [ "info" ] }, { "type": "string", "enum": [ "warn" ] }, { "type": "string", "enum": [ "error" ] } ] }, "message": { "type": "string" } } } } } }, "processingErrors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "id", "status", "type", "request", "validation", "processingErrors", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "imported" ] }, { "type": "string", "enum": [ "skipped" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "imported": { "type": "object", "required": [ "vendorId" ], "properties": { "vendorId": { "type": "string" } } }, "type": { "type": "string", "enum": [ "createVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "externalId": { "type": "string" }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "contact": { "type": "object", "properties": { "name": { "type": "object", "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "phone": { "type": "string" } } } } }, "validation": { "type": "object", "required": [ "status", "errors" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "valid" ] }, { "type": "string", "enum": [ "invalid" ] } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code", "level" ], "properties": { "code": { "anyOf": [ { "type": "string", "enum": [ "invalidName" ] }, { "type": "string", "enum": [ "invalidCurrencyCode" ] }, { "type": "string", "enum": [ "invalidCountry" ] }, { "type": "string", "enum": [ "invalidContactName" ] }, { "type": "string", "enum": [ "invalidContactEmail" ] }, { "type": "string", "enum": [ "invalidRutterId" ] } ] }, "level": { "anyOf": [ { "type": "string", "enum": [ "info" ] }, { "type": "string", "enum": [ "warn" ] }, { "type": "string", "enum": [ "error" ] } ] }, "message": { "type": "string" } } } } } }, "processingErrors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bulk-import/{bulkImportId}/items/{id}/validate": { "post": { "summary": "Validate a Single Item", "tags": [ "Bulk Import" ], "description": "Validates this item and updates `validation`. Only allowed while the bulk import is `ready`.", "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "bulkImportId", "required": true }, { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "id", "status", "type", "request", "validation", "processingErrors", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "imported" ] }, { "type": "string", "enum": [ "skipped" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "imported": { "type": "object", "required": [ "billId", "billLineItemId" ], "properties": { "billId": { "type": "string" }, "billLineItemId": { "type": "string" } } }, "type": { "type": "string", "enum": [ "createBillLineItem" ] }, "request": { "type": "object", "properties": { "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string" }, "paymentDueDate": { "type": "string" }, "totalAmount": { "type": "string" }, "externalId": { "type": "string" }, "vendorId": { "type": "string" }, "vendorName": { "type": "string" }, "description": { "type": "string" }, "lineItem": { "type": "object", "properties": { "description": { "type": "string" }, "amount": { "type": "string" } } } } }, "validation": { "type": "object", "required": [ "status", "errors" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "valid" ] }, { "type": "string", "enum": [ "invalid" ] } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code", "level" ], "properties": { "code": { "anyOf": [ { "type": "string", "enum": [ "invalidCurrencyCode" ] }, { "type": "string", "enum": [ "invalidInvoiceDate" ] }, { "type": "string", "enum": [ "invalidPaymentDueDate" ] }, { "type": "string", "enum": [ "invalidPaymentScheduledDate" ] }, { "type": "string", "enum": [ "invalidTotalAmount" ] }, { "type": "string", "enum": [ "invalidVendorId" ] }, { "type": "string", "enum": [ "invalidAmount" ] }, { "type": "string", "enum": [ "invalidInvoiceId" ] }, { "type": "string", "enum": [ "notFound" ] }, { "type": "string", "enum": [ "invalidStatus" ] } ] }, "level": { "anyOf": [ { "type": "string", "enum": [ "info" ] }, { "type": "string", "enum": [ "warn" ] }, { "type": "string", "enum": [ "error" ] } ] }, "message": { "type": "string" } } } } } }, "processingErrors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "id", "status", "type", "request", "validation", "processingErrors", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "imported" ] }, { "type": "string", "enum": [ "skipped" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "imported": { "type": "object", "required": [ "vendorId" ], "properties": { "vendorId": { "type": "string" } } }, "type": { "type": "string", "enum": [ "createVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "externalId": { "type": "string" }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "contact": { "type": "object", "properties": { "name": { "type": "object", "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "phone": { "type": "string" } } } } }, "validation": { "type": "object", "required": [ "status", "errors" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "valid" ] }, { "type": "string", "enum": [ "invalid" ] } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code", "level" ], "properties": { "code": { "anyOf": [ { "type": "string", "enum": [ "invalidName" ] }, { "type": "string", "enum": [ "invalidCurrencyCode" ] }, { "type": "string", "enum": [ "invalidCountry" ] }, { "type": "string", "enum": [ "invalidContactName" ] }, { "type": "string", "enum": [ "invalidContactEmail" ] }, { "type": "string", "enum": [ "invalidRutterId" ] } ] }, "level": { "anyOf": [ { "type": "string", "enum": [ "info" ] }, { "type": "string", "enum": [ "warn" ] }, { "type": "string", "enum": [ "error" ] } ] }, "message": { "type": "string" } } } } } }, "processingErrors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bulk-import/{bulkImportId}/items/{id}/process": { "post": { "summary": "Process a Single Item", "tags": [ "Bulk Import" ], "description": "Processes this item end-to-end. Item must have `validation.status = valid`.", "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "bulkImportId", "required": true }, { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "id", "status", "type", "request", "validation", "processingErrors", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "imported" ] }, { "type": "string", "enum": [ "skipped" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "imported": { "type": "object", "required": [ "billId", "billLineItemId" ], "properties": { "billId": { "type": "string" }, "billLineItemId": { "type": "string" } } }, "type": { "type": "string", "enum": [ "createBillLineItem" ] }, "request": { "type": "object", "properties": { "invoiceId": { "type": "string" }, "currencyCode": { "type": "string" }, "invoiceDate": { "type": "string" }, "paymentDueDate": { "type": "string" }, "totalAmount": { "type": "string" }, "externalId": { "type": "string" }, "vendorId": { "type": "string" }, "vendorName": { "type": "string" }, "description": { "type": "string" }, "lineItem": { "type": "object", "properties": { "description": { "type": "string" }, "amount": { "type": "string" } } } } }, "validation": { "type": "object", "required": [ "status", "errors" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "valid" ] }, { "type": "string", "enum": [ "invalid" ] } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code", "level" ], "properties": { "code": { "anyOf": [ { "type": "string", "enum": [ "invalidCurrencyCode" ] }, { "type": "string", "enum": [ "invalidInvoiceDate" ] }, { "type": "string", "enum": [ "invalidPaymentDueDate" ] }, { "type": "string", "enum": [ "invalidPaymentScheduledDate" ] }, { "type": "string", "enum": [ "invalidTotalAmount" ] }, { "type": "string", "enum": [ "invalidVendorId" ] }, { "type": "string", "enum": [ "invalidAmount" ] }, { "type": "string", "enum": [ "invalidInvoiceId" ] }, { "type": "string", "enum": [ "notFound" ] }, { "type": "string", "enum": [ "invalidStatus" ] } ] }, "level": { "anyOf": [ { "type": "string", "enum": [ "info" ] }, { "type": "string", "enum": [ "warn" ] }, { "type": "string", "enum": [ "error" ] } ] }, "message": { "type": "string" } } } } } }, "processingErrors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "id", "status", "type", "request", "validation", "processingErrors", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "imported" ] }, { "type": "string", "enum": [ "skipped" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "imported": { "type": "object", "required": [ "vendorId" ], "properties": { "vendorId": { "type": "string" } } }, "type": { "type": "string", "enum": [ "createVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "externalId": { "type": "string" }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "contact": { "type": "object", "properties": { "name": { "type": "object", "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "phone": { "type": "string" } } } } }, "validation": { "type": "object", "required": [ "status", "errors" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "valid" ] }, { "type": "string", "enum": [ "invalid" ] } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code", "level" ], "properties": { "code": { "anyOf": [ { "type": "string", "enum": [ "invalidName" ] }, { "type": "string", "enum": [ "invalidCurrencyCode" ] }, { "type": "string", "enum": [ "invalidCountry" ] }, { "type": "string", "enum": [ "invalidContactName" ] }, { "type": "string", "enum": [ "invalidContactEmail" ] }, { "type": "string", "enum": [ "invalidRutterId" ] } ] }, "level": { "anyOf": [ { "type": "string", "enum": [ "info" ] }, { "type": "string", "enum": [ "warn" ] }, { "type": "string", "enum": [ "error" ] } ] }, "message": { "type": "string" } } } } } }, "processingErrors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidValidationStatus" ] }, "message": { "type": "string" } }, "title": "invalidValidationStatus", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bulk-import-file-source": { "get": { "summary": "Search Bulk Import File Sources", "tags": [ "Bulk Import File Source" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "ids", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "structureTypes", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "creatorUserIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "bulkImportIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "integer", "minimum": 1, "default": 1 }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext", "totalCount" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "status", "filename", "structure", "errors", "creatorUserId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "processed" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "filename": { "type": "string" }, "structure": { "anyOf": [ { "type": "object", "required": [ "type", "fields", "fileHeaders" ], "properties": { "type": { "type": "string", "enum": [ "billLineItemTable" ] }, "fields": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "paymentDueDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItem.description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItem.amount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } }, "fileHeaders": { "type": "array", "items": { "type": "string" }, "description": "Column headers detected in the uploaded file" } } }, { "type": "object", "required": [ "type", "fields", "fileHeaders" ], "properties": { "type": { "type": "string", "enum": [ "vendorTable" ] }, "fields": { "type": "object", "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "country": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.firstName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.middleName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.lastName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.email": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.phone": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } }, "fileHeaders": { "type": "array", "items": { "type": "string" }, "description": "Column headers detected in the uploaded file" } } } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "invalidFile" ] }, "message": { "type": "string" } } } }, "creatorUserId": { "type": "string" }, "bulkImportId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "processedAt": { "type": "string", "format": "date-time" } } } }, "hasNext": { "type": "boolean" }, "totalCount": { "type": "number" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bulk-import-file-source/{id}": { "get": { "summary": "Get a Bulk Import File Source", "tags": [ "Bulk Import File Source" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "filename", "structure", "errors", "creatorUserId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "processed" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "filename": { "type": "string" }, "structure": { "anyOf": [ { "type": "object", "required": [ "type", "fields", "fileHeaders" ], "properties": { "type": { "type": "string", "enum": [ "billLineItemTable" ] }, "fields": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "paymentDueDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItem.description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItem.amount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } }, "fileHeaders": { "type": "array", "items": { "type": "string" }, "description": "Column headers detected in the uploaded file" } } }, { "type": "object", "required": [ "type", "fields", "fileHeaders" ], "properties": { "type": { "type": "string", "enum": [ "vendorTable" ] }, "fields": { "type": "object", "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "country": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.firstName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.middleName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.lastName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.email": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.phone": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } }, "fileHeaders": { "type": "array", "items": { "type": "string" }, "description": "Column headers detected in the uploaded file" } } } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "invalidFile" ] }, "message": { "type": "string" } } } }, "creatorUserId": { "type": "string" }, "bulkImportId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "processedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "patch": { "summary": "Update a Bulk Import File Source", "tags": [ "Bulk Import File Source" ], "description": "Replaces the entire field mapping. Only allowed while the file source is `uploaded` or `failed`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "structure" ], "properties": { "structure": { "anyOf": [ { "type": "object", "required": [ "type", "fields" ], "properties": { "type": { "type": "string", "enum": [ "billLineItemTable" ] }, "fields": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "paymentDueDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItem.description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItem.amount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } } } }, { "type": "object", "required": [ "type", "fields" ], "properties": { "type": { "type": "string", "enum": [ "vendorTable" ] }, "fields": { "type": "object", "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "country": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.firstName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.middleName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.lastName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.email": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.phone": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } } } } ] } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "filename", "structure", "errors", "creatorUserId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "processed" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "filename": { "type": "string" }, "structure": { "anyOf": [ { "type": "object", "required": [ "type", "fields", "fileHeaders" ], "properties": { "type": { "type": "string", "enum": [ "billLineItemTable" ] }, "fields": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "paymentDueDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItem.description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItem.amount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } }, "fileHeaders": { "type": "array", "items": { "type": "string" }, "description": "Column headers detected in the uploaded file" } } }, { "type": "object", "required": [ "type", "fields", "fileHeaders" ], "properties": { "type": { "type": "string", "enum": [ "vendorTable" ] }, "fields": { "type": "object", "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "country": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.firstName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.middleName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.lastName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.email": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.phone": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } }, "fileHeaders": { "type": "array", "items": { "type": "string" }, "description": "Column headers detected in the uploaded file" } } } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "invalidFile" ] }, "message": { "type": "string" } } } }, "creatorUserId": { "type": "string" }, "bulkImportId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "processedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "delete": { "summary": "Delete a Bulk Import File Source", "tags": [ "Bulk Import File Source" ], "description": "Cannot be deleted while `processing`.", "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "filename", "structure", "errors", "creatorUserId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "processed" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "filename": { "type": "string" }, "structure": { "anyOf": [ { "type": "object", "required": [ "type", "fields", "fileHeaders" ], "properties": { "type": { "type": "string", "enum": [ "billLineItemTable" ] }, "fields": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "paymentDueDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItem.description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItem.amount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } }, "fileHeaders": { "type": "array", "items": { "type": "string" }, "description": "Column headers detected in the uploaded file" } } }, { "type": "object", "required": [ "type", "fields", "fileHeaders" ], "properties": { "type": { "type": "string", "enum": [ "vendorTable" ] }, "fields": { "type": "object", "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "country": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.firstName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.middleName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.lastName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.email": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.phone": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } }, "fileHeaders": { "type": "array", "items": { "type": "string" }, "description": "Column headers detected in the uploaded file" } } } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "invalidFile" ] }, "message": { "type": "string" } } } }, "creatorUserId": { "type": "string" }, "bulkImportId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "processedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/bulk-import-file-source/{id}/process": { "post": { "summary": "Process a Bulk Import File Source", "tags": [ "Bulk Import File Source" ], "description": "The resulting bulk import, identified by `bulkImportId`, can be managed via `/v1/web/bulk-import` endpoints.", "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "filename", "structure", "errors", "creatorUserId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "processed" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "filename": { "type": "string" }, "structure": { "anyOf": [ { "type": "object", "required": [ "type", "fields", "fileHeaders" ], "properties": { "type": { "type": "string", "enum": [ "billLineItemTable" ] }, "fields": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "paymentDueDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItem.description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItem.amount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } }, "fileHeaders": { "type": "array", "items": { "type": "string" }, "description": "Column headers detected in the uploaded file" } } }, { "type": "object", "required": [ "type", "fields", "fileHeaders" ], "properties": { "type": { "type": "string", "enum": [ "vendorTable" ] }, "fields": { "type": "object", "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "country": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.firstName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.middleName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.lastName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.email": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.phone": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } }, "fileHeaders": { "type": "array", "items": { "type": "string" }, "description": "Column headers detected in the uploaded file" } } } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "invalidFile" ] }, "message": { "type": "string" } } } }, "creatorUserId": { "type": "string" }, "bulkImportId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "processedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/card": { "post": { "summary": "Check card creation policy", "tags": [ "Card" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "name", "frequencyType", "cardholderId", "userId", "accountId" ], "properties": { "name": { "type": "string" }, "frequencyType": { "anyOf": [ { "type": "string", "enum": [ "recurring" ] }, { "type": "string", "enum": [ "single" ] } ] }, "cardholderId": { "type": "string" }, "userId": { "type": "string" }, "accountId": { "type": "number" }, "cardProfileId": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "expiry": { "type": "string" }, "categoryIds": { "type": "array", "items": { "type": "string" } }, "allowedCountries": { "type": "array", "items": { "type": "string" } }, "spendFrequency": { "anyOf": [ { "type": "string", "enum": [ "purchase_1d" ] }, { "type": "string", "enum": [ "purchase_7d" ] }, { "type": "string", "enum": [ "purchase_30d" ] }, { "type": "string", "enum": [ "purchase_1y" ] }, { "type": "string", "enum": [ "card_debit_lifetime" ] } ] }, "spendLimit": { "type": "number" }, "userGroupId": { "type": "string" } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": {} } } }, "202": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "approvalRequestId" ], "properties": { "approvalRequestId": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "422": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "declinedByPolicy" ] }, "message": { "type": "string" } }, "title": "declinedByPolicy", "description": "A service error has occurred" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/card/{cardId}/user-group": { "get": { "summary": "List a card's user group associations", "tags": [ "Card" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "cardId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "required": [ "cardId", "userGroupId", "userGroupName", "createdAt", "updatedAt" ], "properties": { "cardId": { "type": "string" }, "userGroupId": { "type": "string" }, "userGroupName": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "put": { "summary": "Replace all user group associations for a card", "tags": [ "Card" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "userGroupIds" ], "properties": { "userGroupIds": { "type": "array", "items": { "type": "string" } } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "cardId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "required": [ "cardId", "userGroupId", "userGroupName", "createdAt", "updatedAt" ], "properties": { "cardId": { "type": "string" }, "userGroupId": { "type": "string" }, "userGroupName": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "A service error has occurred" } } } }, "422": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidUserGroupType" ] }, "message": { "type": "string" } }, "title": "invalidUserGroupType", "description": "A service error has occurred" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "delete": { "summary": "Remove all user group associations for a card", "tags": [ "Card" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "cardId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": {} } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/card/{cardId}/user-group/{userGroupId}": { "delete": { "summary": "Remove a specific user group association from a card", "tags": [ "Card" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "cardId", "required": true }, { "schema": { "type": "string" }, "in": "path", "name": "userGroupId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": {} } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "A service error has occurred" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/customer-product": { "get": { "summary": "Search customer products", "tags": [ "CustomerProduct" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list" } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "productId", "status", "updatedAt" ], "properties": { "productId": { "anyOf": [ { "type": "string", "enum": [ "accounting" ] }, { "type": "string", "enum": [ "advertisingAgent" ] }, { "type": "string", "enum": [ "billPay" ] }, { "type": "string", "enum": [ "billPayCashAdvance" ] }, { "type": "string", "enum": [ "card" ] }, { "type": "string", "enum": [ "cashAdvance" ] }, { "type": "string", "enum": [ "expense" ] }, { "type": "string", "enum": [ "shippingAgent" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "enabled" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "locked": { "type": "boolean", "enum": [ true ] }, "updatedAt": { "type": "string", "format": "date-time" } } } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/customer-product/{id}": { "get": { "summary": "Get customer product", "tags": [ "CustomerProduct" ], "parameters": [ { "schema": { "anyOf": [ { "type": "string", "enum": [ "accounting" ] }, { "type": "string", "enum": [ "advertisingAgent" ] }, { "type": "string", "enum": [ "billPay" ] }, { "type": "string", "enum": [ "billPayCashAdvance" ] }, { "type": "string", "enum": [ "card" ] }, { "type": "string", "enum": [ "cashAdvance" ] }, { "type": "string", "enum": [ "expense" ] }, { "type": "string", "enum": [ "shippingAgent" ] } ] }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "productId", "status", "updatedAt" ], "properties": { "productId": { "anyOf": [ { "type": "string", "enum": [ "accounting" ] }, { "type": "string", "enum": [ "advertisingAgent" ] }, { "type": "string", "enum": [ "billPay" ] }, { "type": "string", "enum": [ "billPayCashAdvance" ] }, { "type": "string", "enum": [ "card" ] }, { "type": "string", "enum": [ "cashAdvance" ] }, { "type": "string", "enum": [ "expense" ] }, { "type": "string", "enum": [ "shippingAgent" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "enabled" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "locked": { "type": "boolean", "enum": [ true ] }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "patch": { "summary": "Update customer product", "tags": [ "CustomerProduct" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "enabled" ] }, { "type": "string", "enum": [ "disabled" ] } ] } } } } } }, "parameters": [ { "schema": { "anyOf": [ { "type": "string", "enum": [ "accounting" ] }, { "type": "string", "enum": [ "advertisingAgent" ] }, { "type": "string", "enum": [ "billPay" ] }, { "type": "string", "enum": [ "billPayCashAdvance" ] }, { "type": "string", "enum": [ "card" ] }, { "type": "string", "enum": [ "cashAdvance" ] }, { "type": "string", "enum": [ "expense" ] }, { "type": "string", "enum": [ "shippingAgent" ] } ] }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "productId", "status", "updatedAt" ], "properties": { "productId": { "anyOf": [ { "type": "string", "enum": [ "accounting" ] }, { "type": "string", "enum": [ "advertisingAgent" ] }, { "type": "string", "enum": [ "billPay" ] }, { "type": "string", "enum": [ "billPayCashAdvance" ] }, { "type": "string", "enum": [ "card" ] }, { "type": "string", "enum": [ "cashAdvance" ] }, { "type": "string", "enum": [ "expense" ] }, { "type": "string", "enum": [ "shippingAgent" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "enabled" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "locked": { "type": "boolean", "enum": [ true ] }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/expense/aggregate": { "post": { "summary": "Aggregate Expense Data", "tags": [ "Expense Analytics" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "bucket", "value" ], "properties": { "population": { "anyOf": [ { "type": "string", "enum": [ "coded" ] }, { "type": "string", "enum": [ "all" ] }, { "type": "string", "enum": [ "uncoded" ] } ] }, "bucket": { "anyOf": [ { "type": "object", "required": [ "field" ], "properties": { "field": { "anyOf": [ { "type": "string", "enum": [ "status" ] }, { "type": "string", "enum": [ "syncEligibility" ] }, { "type": "string", "enum": [ "syncStatus" ] }, { "type": "string", "enum": [ "hasReceipt" ] }, { "type": "string", "enum": [ "billable" ] }, { "type": "string", "enum": [ "spendCategoryId" ] } ] } } }, { "type": "object", "required": [ "field", "timeframe" ], "properties": { "field": { "anyOf": [ { "type": "string", "enum": [ "createdAt" ] }, { "type": "string", "enum": [ "readyAt" ] }, { "type": "string", "enum": [ "syncedAt" ] } ] }, "timeframe": { "anyOf": [ { "type": "string", "enum": [ "day" ] }, { "type": "string", "enum": [ "month" ] } ] } } } ] }, "value": { "anyOf": [ { "type": "object", "required": [ "field", "aggregateMethod" ], "properties": { "field": { "type": "string", "enum": [ "amount" ] }, "aggregateMethod": { "anyOf": [ { "type": "string", "enum": [ "avg" ] }, { "type": "string", "enum": [ "sum" ] } ] } } }, { "type": "object", "required": [ "aggregateMethod" ], "properties": { "aggregateMethod": { "type": "string", "enum": [ "count" ] } } } ] }, "filters": { "type": "array", "items": { "anyOf": [ { "type": "object", "required": [ "field", "value" ], "properties": { "field": { "anyOf": [ { "type": "string", "enum": [ "createdAt" ] }, { "type": "string", "enum": [ "readyAt" ] }, { "type": "string", "enum": [ "syncedAt" ] }, { "type": "string", "enum": [ "transactionDate" ] } ] }, "value": { "type": "object", "properties": { "before": { "type": "string", "format": "date-time" }, "after": { "type": "string", "format": "date-time" } }, "minProperties": 1 } } }, { "type": "object", "required": [ "field", "value" ], "properties": { "field": { "anyOf": [ { "type": "string", "enum": [ "status" ] }, { "type": "string", "enum": [ "syncEligibility" ] }, { "type": "string", "enum": [ "syncStatus" ] }, { "type": "string", "enum": [ "spendCategoryId" ] } ] }, "value": { "type": "array", "items": { "type": "string" }, "minItems": 1 } } }, { "type": "object", "required": [ "field", "value" ], "properties": { "field": { "type": "string", "enum": [ "vendorIds" ] }, "value": { "type": "array", "items": { "type": "string", "minLength": 1 }, "minItems": 1, "maxItems": 100 } } }, { "type": "object", "required": [ "field", "value" ], "properties": { "field": { "anyOf": [ { "type": "string", "enum": [ "hasReceipt" ] }, { "type": "string", "enum": [ "billable" ] }, { "type": "string", "enum": [ "hasPolicyViolations" ] } ] }, "value": { "type": "boolean" } } } ] } } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "bucket", "value" ], "properties": { "bucket": { "anyOf": [ { "type": "string" }, { "type": "boolean" }, { "type": "null" } ] }, "value": { "type": "string" } } } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/expense/stage-durations": { "post": { "summary": "Expense Pipeline Stage Durations", "tags": [ "Expense Analytics" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "before": { "type": "string", "format": "date-time" }, "after": { "type": "string", "format": "date-time" } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "stages" ], "properties": { "stages": { "type": "array", "items": { "type": "object", "required": [ "stage", "avgDays", "medianDays", "count" ], "properties": { "stage": { "anyOf": [ { "type": "string", "enum": [ "draftToSubmitted" ] }, { "type": "string", "enum": [ "submittedToApproved" ] }, { "type": "string", "enum": [ "draftToSynced" ] } ] }, "avgDays": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "medianDays": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "count": { "type": "number" } } } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/expense/approval-mix": { "post": { "summary": "Expense Approval Mix", "tags": [ "Expense Analytics" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "before": { "type": "string", "format": "date-time" }, "after": { "type": "string", "format": "date-time" } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "buckets" ], "properties": { "buckets": { "type": "array", "items": { "type": "object", "required": [ "bucket", "count" ], "properties": { "bucket": { "anyOf": [ { "type": "string", "enum": [ "autoApproved" ] }, { "type": "string", "enum": [ "manualCompliant" ] }, { "type": "string", "enum": [ "manualWithViolation" ] } ] }, "count": { "type": "number" } } } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/expense": { "post": { "summary": "Create Expense", "tags": [ "Expense" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "transactionId" ], "properties": { "transactionId": { "type": "string" }, "expenseReceiptId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "accountingDate": { "type": "string", "format": "date-time" }, "spendCategoryId": { "type": "string" }, "memo": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "referenceNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterCustomerId": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "rutterVendorId": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "rutterDepartmentId": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "rutterLocationId": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "billable": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] }, "status": { "type": "string", "enum": [ "draft" ] } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "creatorUserId", "accountingDate", "memo", "description", "referenceNumber", "rutterCustomerId", "rutterVendorId", "rutterDepartmentId", "rutterLocationId", "billable", "spendCategoryId", "policyViolations", "syncEligibility", "latestSync", "readyAt", "createdAt", "updatedAt", "deletedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creatorUserId": { "type": "string" }, "accountingDate": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "memo": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "referenceNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterCustomerId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterVendorId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterDepartmentId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterLocationId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "billable": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "policyViolations": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "memo" ] }, { "type": "string", "enum": [ "receipt" ] }, { "type": "string", "enum": [ "spendCategoryId" ] } ] }, "description": "Fields that were still missing at the most-recent submit. Empty if submitted clean (or never submitted)." }, { "type": "null" } ] }, "syncEligibility": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "skipped" ] } ] }, "latestSync": { "anyOf": [ { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "required": [ "type", "code", "message" ], "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" } } } } }, { "type": "null" } ] }, "readyAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "deletedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "cannotEditWhileInReview" ] }, "message": { "type": "string" } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "422": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "incompleteRecord" ] }, "message": { "type": "string" } } } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Search Expenses", "tags": [ "Expense" ], "description": "Pure domain search — returns expense records without transaction/merchant/receipt enrichment. Use /v1/web/expense/enriched for the accounting view.", "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "ids", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "transactionIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list" }, { "schema": { "type": "integer", "minimum": 1, "default": 1 }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,... (field=createdAt|updatedAt)" } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext", "totalCount" ], "properties": { "items": { "type": "array", "items": { "allOf": [ { "type": "object", "required": [ "id", "status", "creatorUserId", "accountingDate", "memo", "description", "referenceNumber", "rutterCustomerId", "rutterVendorId", "rutterDepartmentId", "rutterLocationId", "billable", "spendCategoryId", "policyViolations", "syncEligibility", "latestSync", "readyAt", "createdAt", "updatedAt", "deletedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creatorUserId": { "type": "string" }, "accountingDate": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "memo": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "referenceNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterCustomerId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterVendorId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterDepartmentId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterLocationId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "billable": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "policyViolations": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "memo" ] }, { "type": "string", "enum": [ "receipt" ] }, { "type": "string", "enum": [ "spendCategoryId" ] } ] }, "description": "Fields that were still missing at the most-recent submit. Empty if submitted clean (or never submitted)." }, { "type": "null" } ] }, "syncEligibility": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "skipped" ] } ] }, "latestSync": { "anyOf": [ { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "required": [ "type", "code", "message" ], "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" } } } } }, { "type": "null" } ] }, "readyAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "deletedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] } } }, { "type": "object", "required": [ "transactionId" ], "properties": { "transactionId": { "type": "string" } } } ] } }, "hasNext": { "type": "boolean" }, "totalCount": { "type": "integer" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/expense/enriched": { "get": { "summary": "Search Enriched Expenses", "tags": [ "Expense" ], "description": "Returns expenses enriched with transaction, merchant, receipt, and accounting integration mapping data. Use `transactionStages` to include authorizations alongside settled transactions.", "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "ids", "required": false, "description": "comma-separated list of expense ids" }, { "schema": { "type": "string" }, "in": "query", "name": "accountIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "cardIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "userIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "vendorIds", "required": false, "description": "comma-separated list of vendor ids" }, { "schema": { "type": "string" }, "in": "query", "name": "transactionIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "transactionStages", "required": false, "description": "comma-separated list (authorization, settled) — defaults to settled" }, { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "transactionStatuses", "required": false, "description": "comma-separated list of card_transaction statuses (success, declined, reversed)" }, { "schema": { "type": "string" }, "in": "query", "name": "spendCategoryIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "syncEligibilities", "required": false, "description": "comma-separated list (pending, ready, skipped)" }, { "schema": { "type": "string" }, "in": "query", "name": "syncStatuses", "required": false, "description": "comma-separated list (inProgress, successful, failed)" }, { "schema": { "type": "boolean" }, "in": "query", "name": "hasPolicyViolations", "required": false, "description": "If true, only return expenses with at least one entry in `data.policyViolations`. If false, only return expenses with none. Omit to include both." }, { "schema": { "type": "boolean" }, "in": "query", "name": "hasExpense", "required": false, "description": "Filter on whether an expense record exists. Omit for everything (rows with an expense OR uncoded); true = only rows with an expense (combined with `statuses`); false = only uncoded (no expense yet) rows, ignoring `statuses`." }, { "schema": { "type": "string" }, "in": "query", "name": "merchantNameLike", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "cardHolderNameLike", "required": false }, { "schema": { "type": "string", "format": "date-time" }, "in": "query", "name": "transactionDateStart", "required": false }, { "schema": { "type": "string", "format": "date-time" }, "in": "query", "name": "transactionDateEnd", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "amountMin", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "amountMax", "required": false }, { "schema": { "type": "integer", "minimum": 1, "default": 1 }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,... (field=transactionDate|clearedDate)" } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext", "totalCount" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "transactionId", "transactionStage", "expenseId", "accountId", "cardId", "mcc", "merchantId", "merchantName", "merchantLogoUrl", "merchantConfidence", "transactionDate", "clearedDate", "spendCategoryId", "spendCategories", "amount", "currency", "cardHolderName", "cardHolderId", "status", "creatorUserId", "policyViolations", "accountingDate", "memo", "description", "referenceNumber", "rutterCustomerId", "billable", "receiptId", "receiptStatus", "file", "deletedAt", "rutterGlAccountId", "rutterGlAccountName", "rutterDepartmentId", "rutterDepartmentName", "rutterLocationId", "rutterLocationName", "rutterVendorId", "rutterVendorName", "vendorId", "rutterCustomerName", "aiSuggestedSpendCategoryId", "aiSuggestionConfidence", "aiSuggestionReasoning", "vendorSyncStatus", "syncEligibility", "latestSync" ], "properties": { "transactionId": { "type": "string" }, "transactionStage": { "anyOf": [ { "type": "string", "enum": [ "authorization" ] }, { "type": "string", "enum": [ "settled" ] } ] }, "expenseId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "accountId": { "type": "string" }, "cardId": { "type": "string" }, "mcc": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantId": { "type": "string" }, "merchantName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantLogoUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantConfidence": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "transactionDate": { "type": "string", "format": "date-time" }, "clearedDate": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "spendCategories": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "type" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "primary" ] }, { "type": "string", "enum": [ "secondary" ] } ] } } } }, "amount": { "type": "string" }, "currency": { "type": "string" }, "cardHolderName": { "type": "string" }, "cardHolderId": { "type": "string" }, "status": { "anyOf": [ { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, { "type": "null" } ] }, "creatorUserId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "policyViolations": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "memo" ] }, { "type": "string", "enum": [ "receipt" ] }, { "type": "string", "enum": [ "spendCategoryId" ] } ] }, "description": "Fields that were still missing at the most-recent submit. Empty if submitted clean (or never submitted)." }, { "type": "null" } ] }, "accountingDate": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "memo": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "referenceNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterCustomerId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "billable": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] }, "receiptId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "receiptStatus": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "null" } ] }, "file": { "anyOf": [ { "type": "object", "required": [ "name", "bucketName", "path" ], "properties": { "name": { "type": "string" }, "bucketName": { "type": "string" }, "path": { "type": "string" } } }, { "type": "null" } ] }, "deletedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "rutterGlAccountId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterGlAccountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterDepartmentId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterDepartmentName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterLocationId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterLocationName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterVendorId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterVendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterCustomerName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "aiSuggestedSpendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "aiSuggestionConfidence": { "anyOf": [ { "type": "string", "enum": [ "high" ] }, { "type": "string", "enum": [ "medium" ] }, { "type": "string", "enum": [ "low" ] }, { "type": "null" } ] }, "aiSuggestionReasoning": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorSyncStatus": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "null" } ] }, "syncEligibility": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "skipped" ] } ] }, "latestSync": { "anyOf": [ { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "required": [ "type", "code", "message" ], "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" } } } } }, { "type": "null" } ] } } } }, "hasNext": { "type": "boolean" }, "totalCount": { "type": "integer" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/expense/{id}/submit": { "post": { "summary": "Submit an expense for review", "tags": [ "Expense" ], "description": "Submits an expense. Evaluates the `expenseRequirement` policy and persists any unmet `requiredFields` to `expense.policyViolations` so they remain visible to managers/accountants — never blocks on these. Then routes by the `expenseApproval` policy: `requiresApproval` → AR created with policy-derived deciders, expense transitions to `submitted` (202); `approved` or no active policy → expense transitions straight to `approved`, no AR (200); `declined` → 422 `declinedByPolicy`.", "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "creatorUserId", "accountingDate", "memo", "description", "referenceNumber", "rutterCustomerId", "rutterVendorId", "rutterDepartmentId", "rutterLocationId", "billable", "spendCategoryId", "policyViolations", "syncEligibility", "latestSync", "readyAt", "createdAt", "updatedAt", "deletedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creatorUserId": { "type": "string" }, "accountingDate": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "memo": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "referenceNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterCustomerId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterVendorId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterDepartmentId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterLocationId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "billable": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "policyViolations": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "memo" ] }, { "type": "string", "enum": [ "receipt" ] }, { "type": "string", "enum": [ "spendCategoryId" ] } ] }, "description": "Fields that were still missing at the most-recent submit. Empty if submitted clean (or never submitted)." }, { "type": "null" } ] }, "syncEligibility": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "skipped" ] } ] }, "latestSync": { "anyOf": [ { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "required": [ "type", "code", "message" ], "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" } } } } }, { "type": "null" } ] }, "readyAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "deletedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] } } } } } }, "202": { "description": "Approval request, discriminated by `type`", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createCard", "enum": [ "createCard" ] }, "request": { "type": "object", "required": [ "name", "frequencyType", "cardholderId", "userId", "accountId" ], "properties": { "name": { "type": "string" }, "frequencyType": { "anyOf": [ { "type": "string", "enum": [ "recurring" ] }, { "type": "string", "enum": [ "single" ] } ] }, "cardholderId": { "type": "string" }, "userId": { "type": "string" }, "accountId": { "type": "number" }, "cardProfileId": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "expiry": { "type": "string" }, "categoryIds": { "type": "array", "items": { "type": "string" } }, "allowedCountries": { "type": "array", "items": { "type": "string" } }, "spendFrequency": { "anyOf": [ { "type": "string", "enum": [ "purchase_1d" ] }, { "type": "string", "enum": [ "purchase_7d" ] }, { "type": "string", "enum": [ "purchase_30d" ] }, { "type": "string", "enum": [ "purchase_1y" ] }, { "type": "string", "enum": [ "card_debit_lifetime" ] } ] }, "spendLimit": { "type": "number" }, "userGroupId": { "type": "string" } } } } } ], "title": "createCard" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "payBill", "enum": [ "payBill" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "payBill" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "submitExpense", "enum": [ "submitExpense" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "submitExpense" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendor", "enum": [ "createVendor" ] }, "request": { "allOf": [ { "type": "object", "required": [ "name", "owners", "currencyCode", "country" ], "properties": { "externalId": { "type": "string" }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } } } }, { "type": "object", "required": [ "rutterId", "currencyCode", "contacts" ], "properties": { "rutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Rutter vendor ID. If null, the vendor will be created in the accounting platform." }, "currencyCode": { "type": "string", "description": "ISO 4217 currency code" }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "name", "default", "email" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } } ] } } } ], "title": "createVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "updateVendor", "enum": [ "updateVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "address": { "anyOf": [ { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, { "type": "null" } ] }, "taxId": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "legalName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "logoUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantCategory": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantIds": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] } } } } } ], "title": "updateVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendorPaymentMethod", "enum": [ "createVendorPaymentMethod" ] }, "request": { "anyOf": [ { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH business payment method" }, { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH individual payment method" } ] } } } ], "title": "createVendorPaymentMethod" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "deleteVendorPaymentMethod", "enum": [ "deleteVendorPaymentMethod" ] }, "request": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } } } } ], "title": "deleteVendorPaymentMethod" } ], "description": "Approval request, discriminated by `type`" } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message", "reason" ], "properties": { "code": { "type": "string", "enum": [ "cannotSubmit" ] }, "message": { "type": "string" }, "reason": { "anyOf": [ { "type": "string", "enum": [ "invalidStatus" ] }, { "type": "string", "enum": [ "alreadyInReview" ] } ] } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "422": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "declinedByPolicy" ] }, "message": { "type": "string" } }, "title": "declinedByPolicy", "description": "A service error has occurred" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/expense/{id}/requirements": { "get": { "summary": "Preview expense requirements policy result", "tags": [ "Expense" ], "description": "Returns the fields the user must populate before this expense can be submitted, derived from the active `expenseRequirement` policy and the expense's current state. Empty `missingFields` means the policy is satisfied (or no policy is active).", "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "missingFields" ], "properties": { "missingFields": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "memo" ] }, { "type": "string", "enum": [ "receipt" ] }, { "type": "string", "enum": [ "spendCategoryId" ] } ] } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/expense/export": { "post": { "summary": "Export Expenses", "tags": [ "Expense" ], "description": "This is a streaming endpoint. BFFs should pipe the stream response back to user's browser.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "format" ], "properties": { "format": { "type": "string", "enum": [ "csv" ] }, "fields": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "merchantName" ] }, { "type": "string", "enum": [ "transactionDate" ] }, { "type": "string", "enum": [ "clearedDate" ] }, { "type": "string", "enum": [ "amount" ] }, { "type": "string", "enum": [ "currency" ] }, { "type": "string", "enum": [ "transactionStage" ] }, { "type": "string", "enum": [ "mcc" ] }, { "type": "string", "enum": [ "cardHolderName" ] }, { "type": "string", "enum": [ "status" ] }, { "type": "string", "enum": [ "spendCategory" ] }, { "type": "string", "enum": [ "memo" ] }, { "type": "string", "enum": [ "description" ] }, { "type": "string", "enum": [ "accountingDate" ] }, { "type": "string", "enum": [ "referenceNumber" ] }, { "type": "string", "enum": [ "billable" ] }, { "type": "string", "enum": [ "transactionId" ] }, { "type": "string", "enum": [ "expenseId" ] } ] }, "description": "columns to include; defaults to all" }, "accountIds": { "type": "array", "items": { "type": "string" } }, "cardIds": { "type": "array", "items": { "type": "string" } }, "userIds": { "type": "array", "items": { "type": "string" } }, "transactionIds": { "type": "array", "items": { "type": "string" } }, "transactionStages": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "authorization" ] }, { "type": "string", "enum": [ "settled" ] } ] }, "description": "defaults to settled" }, "statuses": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] } ] } }, "spendCategoryIds": { "type": "array", "items": { "type": "string" } }, "hasPolicyViolations": { "type": "boolean" }, "merchantNameLike": { "type": "string" }, "cardHolderNameLike": { "type": "string" }, "transactionDateStart": { "type": "string", "format": "date-time" }, "transactionDateEnd": { "type": "string", "format": "date-time" }, "amountMin": { "type": "string" }, "amountMax": { "type": "string" } } }, { "type": "object", "required": [ "format" ], "properties": { "format": { "type": "string", "enum": [ "ofxV1" ] }, "accountIds": { "type": "array", "items": { "type": "string" } }, "cardIds": { "type": "array", "items": { "type": "string" } }, "userIds": { "type": "array", "items": { "type": "string" } }, "transactionIds": { "type": "array", "items": { "type": "string" } }, "transactionStages": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "authorization" ] }, { "type": "string", "enum": [ "settled" ] } ] }, "description": "defaults to settled" }, "statuses": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] } ] } }, "spendCategoryIds": { "type": "array", "items": { "type": "string" } }, "hasPolicyViolations": { "type": "boolean" }, "merchantNameLike": { "type": "string" }, "cardHolderNameLike": { "type": "string" }, "transactionDateStart": { "type": "string", "format": "date-time" }, "transactionDateEnd": { "type": "string", "format": "date-time" }, "amountMin": { "type": "string" }, "amountMax": { "type": "string" } } } ] } } } }, "responses": { "200": { "description": "text/csv for format=csv; application/x-ofx for format=ofxV1", "content": { "application/json": { "schema": { "type": "string", "description": "text/csv for format=csv; application/x-ofx for format=ofxV1" } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "tooManyItems" ] }, "message": { "type": "string" } }, "title": "tooManyItems", "description": "A service error has occurred" }, { "type": "object", "required": [ "max", "actual" ], "properties": { "max": { "type": "number", "description": "Maximum number of items allowed" }, "actual": { "type": "number", "description": "Number of items that matched the request" } } } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/expense/{id}/sync-eligibility": { "post": { "summary": "Update sync eligibility", "tags": [ "Expense" ], "description": "Sets the sync eligibility for an expense. Marking `ready` requires `accountingDate` and `spendCategoryId` to be populated.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "syncEligibility" ], "properties": { "syncEligibility": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "skipped" ] } ] } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "creatorUserId", "accountingDate", "memo", "description", "referenceNumber", "rutterCustomerId", "rutterVendorId", "rutterDepartmentId", "rutterLocationId", "billable", "spendCategoryId", "policyViolations", "syncEligibility", "latestSync", "readyAt", "createdAt", "updatedAt", "deletedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creatorUserId": { "type": "string" }, "accountingDate": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "memo": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "referenceNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterCustomerId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterVendorId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterDepartmentId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterLocationId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "billable": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "policyViolations": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "memo" ] }, { "type": "string", "enum": [ "receipt" ] }, { "type": "string", "enum": [ "spendCategoryId" ] } ] }, "description": "Fields that were still missing at the most-recent submit. Empty if submitted clean (or never submitted)." }, { "type": "null" } ] }, "syncEligibility": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "skipped" ] } ] }, "latestSync": { "anyOf": [ { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "required": [ "type", "code", "message" ], "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" } } } } }, { "type": "null" } ] }, "readyAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "deletedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "422": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "incompleteRecord" ] }, "message": { "type": "string" } } } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/expense/pending-decision": { "get": { "summary": "Search expenses pending a decision", "tags": [ "Expense" ], "description": "Returns { expense, approvalRequest } pairs for expenses with active submitExpense approval requests matching the given `arStatuses`. Mirrors /v1/web/bill/pending-decision.", "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "arStatuses", "required": false, "description": "comma-separated list of approval_request.status values (e.g. submitted,returned,approved)" }, { "schema": { "type": "integer", "minimum": 1, "default": 1 }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,... (field=createdAt|updatedAt)" } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext", "totalCount" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "expense", "approvalRequest" ], "properties": { "expense": { "type": "object", "required": [ "id", "status", "creatorUserId", "accountingDate", "memo", "description", "referenceNumber", "rutterCustomerId", "rutterVendorId", "rutterDepartmentId", "rutterLocationId", "billable", "spendCategoryId", "policyViolations", "syncEligibility", "latestSync", "readyAt", "createdAt", "updatedAt", "deletedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creatorUserId": { "type": "string" }, "accountingDate": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "memo": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "referenceNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterCustomerId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterVendorId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterDepartmentId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterLocationId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "billable": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "policyViolations": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "memo" ] }, { "type": "string", "enum": [ "receipt" ] }, { "type": "string", "enum": [ "spendCategoryId" ] } ] }, "description": "Fields that were still missing at the most-recent submit. Empty if submitted clean (or never submitted)." }, { "type": "null" } ] }, "syncEligibility": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "ready" ] }, { "type": "string", "enum": [ "skipped" ] } ] }, "latestSync": { "anyOf": [ { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "required": [ "type", "code", "message" ], "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "source": { "type": "string" } } } } }, { "type": "null" } ] }, "readyAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "deletedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] } } }, "approvalRequest": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createCard", "enum": [ "createCard" ] }, "request": { "type": "object", "required": [ "name", "frequencyType", "cardholderId", "userId", "accountId" ], "properties": { "name": { "type": "string" }, "frequencyType": { "anyOf": [ { "type": "string", "enum": [ "recurring" ] }, { "type": "string", "enum": [ "single" ] } ] }, "cardholderId": { "type": "string" }, "userId": { "type": "string" }, "accountId": { "type": "number" }, "cardProfileId": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "expiry": { "type": "string" }, "categoryIds": { "type": "array", "items": { "type": "string" } }, "allowedCountries": { "type": "array", "items": { "type": "string" } }, "spendFrequency": { "anyOf": [ { "type": "string", "enum": [ "purchase_1d" ] }, { "type": "string", "enum": [ "purchase_7d" ] }, { "type": "string", "enum": [ "purchase_30d" ] }, { "type": "string", "enum": [ "purchase_1y" ] }, { "type": "string", "enum": [ "card_debit_lifetime" ] } ] }, "spendLimit": { "type": "number" }, "userGroupId": { "type": "string" } } } } } ], "title": "createCard" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "payBill", "enum": [ "payBill" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "payBill" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "submitExpense", "enum": [ "submitExpense" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "submitExpense" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendor", "enum": [ "createVendor" ] }, "request": { "allOf": [ { "type": "object", "required": [ "name", "owners", "currencyCode", "country" ], "properties": { "externalId": { "type": "string" }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } } } }, { "type": "object", "required": [ "rutterId", "currencyCode", "contacts" ], "properties": { "rutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Rutter vendor ID. If null, the vendor will be created in the accounting platform." }, "currencyCode": { "type": "string", "description": "ISO 4217 currency code" }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "name", "default", "email" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } } ] } } } ], "title": "createVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "updateVendor", "enum": [ "updateVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "address": { "anyOf": [ { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, { "type": "null" } ] }, "taxId": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "legalName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "logoUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantCategory": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantIds": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] } } } } } ], "title": "updateVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendorPaymentMethod", "enum": [ "createVendorPaymentMethod" ] }, "request": { "anyOf": [ { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH business payment method" }, { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH individual payment method" } ] } } } ], "title": "createVendorPaymentMethod" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "deleteVendorPaymentMethod", "enum": [ "deleteVendorPaymentMethod" ] }, "request": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } } } } ], "title": "deleteVendorPaymentMethod" } ], "description": "Approval request, discriminated by `type`" } } } }, "hasNext": { "type": "boolean" }, "totalCount": { "type": "integer" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/payment": { "post": { "summary": "Create a payment", "tags": [ "Payment" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "creator", "scheduledAt", "route", "targetAmount" ], "properties": { "externalId": { "type": "string" }, "creator": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "bill" ] }, "id": { "type": "string" } } }, "scheduledAt": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "route": { "type": "array", "items": { "anyOf": [ { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] } } } ] }, { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "id", "speed", "memo" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" } } }, { "type": "object", "required": [ "type", "sharedByName", "email" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" } } } ] } ] }, "description": "Flat ordered array of hops the funds will travel through" }, "targetAmount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } } } } }, "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "header", "name": "idempotency-id", "required": true, "description": "Unique per logical create attempt. Retrying with the same value returns the original payment instead of creating a duplicate." } ], "responses": { "201": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "creator", "scheduledAt", "legs", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "scheduled" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "succeeded" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "stopped" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creator": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "bill" ] }, "id": { "type": "string" } } }, "scheduledAt": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "legs": { "type": "array", "items": { "type": "object", "required": [ "id", "type", "status", "source", "target" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "debitAch" ] }, { "type": "string", "enum": [ "creditAch" ] }, { "type": "string", "enum": [ "emailSingleUseCard" ] }, { "type": "string", "enum": [ "advanceCash" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "succeeded" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "source": { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name", "amount" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule", "amount" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } } ] }, "target": { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "id", "speed", "memo", "amount" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "sharedByName", "email", "amount" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } } ] }, "fees": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } }, "integration": { "anyOf": [ { "type": "object", "required": [ "type", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxDeposit" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" }, "depositRequestId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } } }, { "type": "object", "required": [ "type", "id", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxWithdrawal" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cardShare" ] }, "id": { "type": "string" }, "cardSpendLimitRuleId": { "type": "string" }, "cardShare": { "type": "object", "required": [ "id", "shareUrl", "expiresAt" ], "properties": { "id": { "type": "string" }, "shareUrl": { "type": "string" }, "expiresAt": { "type": "string", "format": "date-time" } } }, "knockWorkflowRunId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "id": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } ] }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "impossibleRoute" ] }, "message": { "type": "string" } }, "title": "impossibleRoute", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidCurrencyCode" ] }, "message": { "type": "string" } }, "title": "invalidCurrencyCode", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidAccountId" ] }, "message": { "type": "string" } }, "title": "invalidAccountId", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "idempotencyConflict" ] }, "message": { "type": "string" } }, "title": "idempotencyConflict", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Search for payments", "tags": [ "Payment" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "ids", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "externalIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "scheduledAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "startedAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "completedAt", "required": false, "description": "::,..." }, { "schema": { "type": "integer", "minimum": 1, "default": 1 }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext", "totalCount" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "status", "creator", "scheduledAt", "legs", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "scheduled" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "succeeded" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "stopped" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creator": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "bill" ] }, "id": { "type": "string" } } }, "scheduledAt": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "legs": { "type": "array", "items": { "type": "object", "required": [ "id", "type", "status", "source", "target" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "debitAch" ] }, { "type": "string", "enum": [ "creditAch" ] }, { "type": "string", "enum": [ "emailSingleUseCard" ] }, { "type": "string", "enum": [ "advanceCash" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "succeeded" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "source": { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name", "amount" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule", "amount" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } } ] }, "target": { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "id", "speed", "memo", "amount" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "sharedByName", "email", "amount" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } } ] }, "fees": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } }, "integration": { "anyOf": [ { "type": "object", "required": [ "type", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxDeposit" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" }, "depositRequestId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } } }, { "type": "object", "required": [ "type", "id", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxWithdrawal" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cardShare" ] }, "id": { "type": "string" }, "cardSpendLimitRuleId": { "type": "string" }, "cardShare": { "type": "object", "required": [ "id", "shareUrl", "expiresAt" ], "properties": { "id": { "type": "string" }, "shareUrl": { "type": "string" }, "expiresAt": { "type": "string", "format": "date-time" } } }, "knockWorkflowRunId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "id": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } ] }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } }, "hasNext": { "type": "boolean" }, "totalCount": { "type": "number" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/payment/{id}": { "get": { "summary": "Get a payment", "tags": [ "Payment" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "creator", "scheduledAt", "legs", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "scheduled" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "succeeded" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "stopped" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creator": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "bill" ] }, "id": { "type": "string" } } }, "scheduledAt": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "legs": { "type": "array", "items": { "type": "object", "required": [ "id", "type", "status", "source", "target" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "debitAch" ] }, { "type": "string", "enum": [ "creditAch" ] }, { "type": "string", "enum": [ "emailSingleUseCard" ] }, { "type": "string", "enum": [ "advanceCash" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "succeeded" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "source": { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name", "amount" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule", "amount" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } } ] }, "target": { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "id", "speed", "memo", "amount" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "sharedByName", "email", "amount" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } } ] }, "fees": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } }, "integration": { "anyOf": [ { "type": "object", "required": [ "type", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxDeposit" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" }, "depositRequestId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } } }, { "type": "object", "required": [ "type", "id", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxWithdrawal" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cardShare" ] }, "id": { "type": "string" }, "cardSpendLimitRuleId": { "type": "string" }, "cardShare": { "type": "object", "required": [ "id", "shareUrl", "expiresAt" ], "properties": { "id": { "type": "string" }, "shareUrl": { "type": "string" }, "expiresAt": { "type": "string", "format": "date-time" } } }, "knockWorkflowRunId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "id": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } ] }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "patch": { "summary": "Update a payment", "tags": [ "Payment" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "externalId": { "type": "string" }, "scheduledAt": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "route": { "type": "array", "items": { "anyOf": [ { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] } } } ] }, { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" } } }, { "type": "object", "required": [ "type", "id", "speed", "memo" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" } } }, { "type": "object", "required": [ "type", "sharedByName", "email" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" } } } ] } ] }, "description": "Flat ordered array of hops the funds will travel through" }, "targetAmount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } }, "minProperties": 1 } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "creator", "scheduledAt", "legs", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "scheduled" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "succeeded" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "stopped" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creator": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "bill" ] }, "id": { "type": "string" } } }, "scheduledAt": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "legs": { "type": "array", "items": { "type": "object", "required": [ "id", "type", "status", "source", "target" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "debitAch" ] }, { "type": "string", "enum": [ "creditAch" ] }, { "type": "string", "enum": [ "emailSingleUseCard" ] }, { "type": "string", "enum": [ "advanceCash" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "succeeded" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "source": { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name", "amount" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule", "amount" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } } ] }, "target": { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "id", "speed", "memo", "amount" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "sharedByName", "email", "amount" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } } ] }, "fees": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } }, "integration": { "anyOf": [ { "type": "object", "required": [ "type", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxDeposit" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" }, "depositRequestId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } } }, { "type": "object", "required": [ "type", "id", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxWithdrawal" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cardShare" ] }, "id": { "type": "string" }, "cardSpendLimitRuleId": { "type": "string" }, "cardShare": { "type": "object", "required": [ "id", "shareUrl", "expiresAt" ], "properties": { "id": { "type": "string" }, "shareUrl": { "type": "string" }, "expiresAt": { "type": "string", "format": "date-time" } } }, "knockWorkflowRunId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "id": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } ] }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "impossibleRoute" ] }, "message": { "type": "string" } }, "title": "impossibleRoute", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidCurrencyCode" ] }, "message": { "type": "string" } }, "title": "invalidCurrencyCode", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidAccountId" ] }, "message": { "type": "string" } }, "title": "invalidAccountId", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/payment/{id}/stop": { "post": { "summary": "Stop a processing payment", "tags": [ "Payment" ], "description": "Payments can only be deleted via the creator (parent) object", "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "creator", "scheduledAt", "legs", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "scheduled" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "succeeded" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "stopped" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creator": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "bill" ] }, "id": { "type": "string" } } }, "scheduledAt": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "legs": { "type": "array", "items": { "type": "object", "required": [ "id", "type", "status", "source", "target" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "debitAch" ] }, { "type": "string", "enum": [ "creditAch" ] }, { "type": "string", "enum": [ "emailSingleUseCard" ] }, { "type": "string", "enum": [ "advanceCash" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "succeeded" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "source": { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name", "amount" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule", "amount" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } } ] }, "target": { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "id", "speed", "memo", "amount" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "sharedByName", "email", "amount" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } } ] }, "fees": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } }, "integration": { "anyOf": [ { "type": "object", "required": [ "type", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxDeposit" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" }, "depositRequestId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } } }, { "type": "object", "required": [ "type", "id", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxWithdrawal" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cardShare" ] }, "id": { "type": "string" }, "cardSpendLimitRuleId": { "type": "string" }, "cardShare": { "type": "object", "required": [ "id", "shareUrl", "expiresAt" ], "properties": { "id": { "type": "string" }, "shareUrl": { "type": "string" }, "expiresAt": { "type": "string", "format": "date-time" } } }, "knockWorkflowRunId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "id": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } ] }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/payment/{id}/resume": { "post": { "summary": "Resume a stopped payment", "tags": [ "Payment" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "creator", "scheduledAt", "legs", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "scheduled" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "succeeded" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "stopped" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creator": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "bill" ] }, "id": { "type": "string" } } }, "scheduledAt": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "legs": { "type": "array", "items": { "type": "object", "required": [ "id", "type", "status", "source", "target" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "debitAch" ] }, { "type": "string", "enum": [ "creditAch" ] }, { "type": "string", "enum": [ "emailSingleUseCard" ] }, { "type": "string", "enum": [ "advanceCash" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "succeeded" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "source": { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name", "amount" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule", "amount" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } } ] }, "target": { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "id", "speed", "memo", "amount" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "sharedByName", "email", "amount" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } } ] }, "fees": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } }, "integration": { "anyOf": [ { "type": "object", "required": [ "type", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxDeposit" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" }, "depositRequestId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } } }, { "type": "object", "required": [ "type", "id", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxWithdrawal" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cardShare" ] }, "id": { "type": "string" }, "cardSpendLimitRuleId": { "type": "string" }, "cardShare": { "type": "object", "required": [ "id", "shareUrl", "expiresAt" ], "properties": { "id": { "type": "string" }, "shareUrl": { "type": "string" }, "expiresAt": { "type": "string", "format": "date-time" } } }, "knockWorkflowRunId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "id": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } ] }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/payment/{id}/retry": { "post": { "summary": "Retry a failed payment", "tags": [ "Payment" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "creator", "scheduledAt", "legs", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "scheduled" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "succeeded" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "stopped" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creator": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "bill" ] }, "id": { "type": "string" } } }, "scheduledAt": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "legs": { "type": "array", "items": { "type": "object", "required": [ "id", "type", "status", "source", "target" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "debitAch" ] }, { "type": "string", "enum": [ "creditAch" ] }, { "type": "string", "enum": [ "emailSingleUseCard" ] }, { "type": "string", "enum": [ "advanceCash" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "succeeded" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "source": { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name", "amount" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule", "amount" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } } ] }, "target": { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "id", "speed", "memo", "amount" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "sharedByName", "email", "amount" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } } ] }, "fees": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } }, "integration": { "anyOf": [ { "type": "object", "required": [ "type", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxDeposit" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" }, "depositRequestId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } } }, { "type": "object", "required": [ "type", "id", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxWithdrawal" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cardShare" ] }, "id": { "type": "string" }, "cardSpendLimitRuleId": { "type": "string" }, "cardShare": { "type": "object", "required": [ "id", "shareUrl", "expiresAt" ], "properties": { "id": { "type": "string" }, "shareUrl": { "type": "string" }, "expiresAt": { "type": "string", "format": "date-time" } } }, "knockWorkflowRunId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "id": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } ] }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/payment/{id}/resend-single-use-card-email": { "post": { "summary": "Re-send the single-use card share email", "tags": [ "Payment" ], "description": "Re-sends the share email for an in-progress single-use card payment, optionally to a different recipient.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "email": { "type": "string", "format": "email", "description": "Replaces the recipient before re-sending." } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "creator", "scheduledAt", "legs", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "scheduled" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "succeeded" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "stopped" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "creator": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "bill" ] }, "id": { "type": "string" } } }, "scheduledAt": { "type": "string", "format": "date", "description": "ISO date string, YYYY-MM-DD" }, "legs": { "type": "array", "items": { "type": "object", "required": [ "id", "type", "status", "source", "target" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "debitAch" ] }, { "type": "string", "enum": [ "creditAch" ] }, { "type": "string", "enum": [ "emailSingleUseCard" ] }, { "type": "string", "enum": [ "advanceCash" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "succeeded" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "source": { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "id", "speed", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingSource" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "cardHolderId", "name", "amount" ], "properties": { "type": { "type": "string", "enum": [ "singleUseCard" ] }, "accountId": { "type": "string" }, "cardHolderId": { "type": "string" }, "name": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "accountId", "repaymentSchedule", "amount" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "accountId": { "type": "string" }, "repaymentSchedule": { "anyOf": [ { "type": "string", "enum": [ "today" ] }, { "type": "string", "enum": [ "net-1" ] }, { "type": "string", "enum": [ "net-3" ] }, { "type": "string", "enum": [ "net-7" ] }, { "type": "string", "enum": [ "net-15" ] }, { "type": "string", "enum": [ "net-20" ] }, { "type": "string", "enum": [ "net-30" ] }, { "type": "string", "enum": [ "net-45" ] }, { "type": "string", "enum": [ "net-60" ] }, { "type": "string", "enum": [ "net-90" ] } ] }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } } ] }, "target": { "anyOf": [ { "type": "object", "required": [ "type", "accountId", "id", "amount" ], "properties": { "type": { "type": "string", "enum": [ "fundingAccount" ] }, "accountId": { "type": "string" }, "id": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "id", "speed", "memo", "amount" ], "properties": { "type": { "type": "string", "enum": [ "achPaymentMethod" ] }, "id": { "type": "string" }, "speed": { "anyOf": [ { "type": "string", "enum": [ "sameDay" ] }, { "type": "string", "enum": [ "standard" ] } ] }, "memo": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "sharedByName", "email", "amount" ], "properties": { "type": { "type": "string", "enum": [ "email" ] }, "sharedByName": { "type": "string" }, "email": { "type": "string" }, "amount": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } } } } ] }, "fees": { "type": "object", "required": [ "value", "currencyCode" ], "properties": { "value": { "type": "string", "description": "Decimal number string" }, "currencyCode": { "type": "string" } } }, "integration": { "anyOf": [ { "type": "object", "required": [ "type", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxDeposit" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" }, "depositRequestId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } } }, { "type": "object", "required": [ "type", "id", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxWithdrawal" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cardShare" ] }, "id": { "type": "string" }, "cardSpendLimitRuleId": { "type": "string" }, "cardShare": { "type": "object", "required": [ "id", "shareUrl", "expiresAt" ], "properties": { "id": { "type": "string" }, "shareUrl": { "type": "string" }, "expiresAt": { "type": "string", "format": "date-time" } } }, "knockWorkflowRunId": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "id": { "type": "string" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } ] }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidStatus" ] }, "message": { "type": "string" } }, "title": "invalidStatus", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/policy/create-card-approval": { "post": { "summary": "Create an approval policy for requesting a card", "tags": [ "Policy" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "status", "rules" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "rules": { "type": "array", "items": { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "anyOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] } ] } } }, { "type": "object", "required": [ "status", "approvers" ], "properties": { "status": { "type": "string", "enum": [ "requiresApproval" ] }, "approvers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "userGroupManager" ] } ] } } } } } } ] } } } } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "status", "createdAt", "updatedAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "rules" ], "properties": { "rules": { "type": "array", "items": { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "anyOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] } ] } } }, { "type": "object", "required": [ "status", "approvers" ], "properties": { "status": { "type": "string", "enum": [ "requiresApproval" ] }, "approvers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "userGroupManager" ] } ] } } } } } } ] } } } } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Get the configured approval policy for requesting a card", "tags": [ "Policy" ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "status", "createdAt", "updatedAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "rules" ], "properties": { "rules": { "type": "array", "items": { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "anyOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] } ] } } }, { "type": "object", "required": [ "status", "approvers" ], "properties": { "status": { "type": "string", "enum": [ "requiresApproval" ] }, "approvers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "userGroupManager" ] } ] } } } } } } ] } } } } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/policy/create-card-approval/execute": { "post": { "summary": "Execute the configured approval policy against given facts", "tags": [ "Policy" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "userGroupIds", "userRoleIds" ], "properties": { "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "spendLimit": { "type": "string", "description": "Number string" }, "spendFrequency": { "anyOf": [ { "type": "string", "enum": [ "purchase_1d" ] }, { "type": "string", "enum": [ "purchase_7d" ] }, { "type": "string", "enum": [ "purchase_30d" ] }, { "type": "string", "enum": [ "purchase_1y" ] }, { "type": "string", "enum": [ "card_debit_lifetime" ] } ] } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "matchedRule" ], "properties": { "matchedRule": { "anyOf": [ { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "anyOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] } ] } } }, { "type": "object", "required": [ "status", "approvers" ], "properties": { "status": { "type": "string", "enum": [ "requiresApproval" ] }, "approvers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "userGroupManager" ] } ] } } } } } } ] } } }, { "type": "null", "description": "No rules matched" } ] } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/policy/pay-bill-approval": { "post": { "summary": "Create an approval policy for paying a bill", "tags": [ "Policy" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "status", "rules" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "rules": { "type": "array", "items": { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "anyOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] } ] } } }, { "type": "object", "required": [ "status", "approvers" ], "properties": { "status": { "type": "string", "enum": [ "requiresApproval" ] }, "approvers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "userGroupManager" ] } ] } } } } } } ] } } } } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "status", "createdAt", "updatedAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "rules" ], "properties": { "rules": { "type": "array", "items": { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "anyOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] } ] } } }, { "type": "object", "required": [ "status", "approvers" ], "properties": { "status": { "type": "string", "enum": [ "requiresApproval" ] }, "approvers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "userGroupManager" ] } ] } } } } } } ] } } } } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Get the configured approval policy for paying a bill", "tags": [ "Policy" ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "status", "createdAt", "updatedAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "rules" ], "properties": { "rules": { "type": "array", "items": { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "anyOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] } ] } } }, { "type": "object", "required": [ "status", "approvers" ], "properties": { "status": { "type": "string", "enum": [ "requiresApproval" ] }, "approvers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "userGroupManager" ] } ] } } } } } } ] } } } } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/policy/pay-bill-approval/execute": { "post": { "summary": "Execute the configured approval policy against given facts", "tags": [ "Policy" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "userGroupIds", "userRoleIds", "totalAmount", "paymentMethod" ], "properties": { "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "totalAmount": { "type": "string", "description": "Number string" }, "paymentMethod": { "anyOf": [ { "type": "string", "enum": [ "ach" ] }, { "type": "string", "enum": [ "offPlatform" ] }, { "type": "string", "enum": [ "emailSingleUseCard" ] } ] }, "purchaseOrderType": { "anyOf": [ { "type": "string", "enum": [ "rutter" ] }, { "type": "string", "enum": [ "manual" ] } ] } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "matchedRule" ], "properties": { "matchedRule": { "anyOf": [ { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "anyOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] } ] } } }, { "type": "object", "required": [ "status", "approvers" ], "properties": { "status": { "type": "string", "enum": [ "requiresApproval" ] }, "approvers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "userGroupManager" ] } ] } } } } } } ] } } }, { "type": "null", "description": "No rules matched" } ] } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/policy/create-vendor-approval": { "post": { "summary": "Create an approval policy for creating new vendors", "tags": [ "Policy" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "status", "rules" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "rules": { "type": "array", "items": { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "anyOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] } ] } } }, { "type": "object", "required": [ "status", "approvers" ], "properties": { "status": { "type": "string", "enum": [ "requiresApproval" ] }, "approvers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "userGroupManager" ] } ] } } } } } } ] } } } } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "status", "createdAt", "updatedAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "rules" ], "properties": { "rules": { "type": "array", "items": { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "anyOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] } ] } } }, { "type": "object", "required": [ "status", "approvers" ], "properties": { "status": { "type": "string", "enum": [ "requiresApproval" ] }, "approvers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "userGroupManager" ] } ] } } } } } } ] } } } } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Get the configured approval policy for creating new vendors", "tags": [ "Policy" ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "status", "createdAt", "updatedAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "rules" ], "properties": { "rules": { "type": "array", "items": { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "anyOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] } ] } } }, { "type": "object", "required": [ "status", "approvers" ], "properties": { "status": { "type": "string", "enum": [ "requiresApproval" ] }, "approvers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "userGroupManager" ] } ] } } } } } } ] } } } } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/policy/create-vendor-approval/execute": { "post": { "summary": "Execute the configured approval policy against given facts", "tags": [ "Policy" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "userGroupIds", "userRoleIds", "source" ], "properties": { "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "source": { "anyOf": [ { "type": "string", "enum": [ "bill" ] }, { "type": "string", "enum": [ "expense" ] }, { "type": "string", "enum": [ "manual" ] } ] } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "matchedRule" ], "properties": { "matchedRule": { "anyOf": [ { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "anyOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] } ] } } }, { "type": "object", "required": [ "status", "approvers" ], "properties": { "status": { "type": "string", "enum": [ "requiresApproval" ] }, "approvers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "userGroupManager" ] } ] } } } } } } ] } } }, { "type": "null", "description": "No rules matched" } ] } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/policy/update-vendor-approval": { "post": { "summary": "Create an approval policy for updating a vendor", "tags": [ "Policy" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "status", "rules" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "rules": { "type": "array", "items": { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "anyOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] } ] } } }, { "type": "object", "required": [ "status", "approvers" ], "properties": { "status": { "type": "string", "enum": [ "requiresApproval" ] }, "approvers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "userGroupManager" ] } ] } } } } } } ] } } } } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "status", "createdAt", "updatedAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "rules" ], "properties": { "rules": { "type": "array", "items": { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "anyOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] } ] } } }, { "type": "object", "required": [ "status", "approvers" ], "properties": { "status": { "type": "string", "enum": [ "requiresApproval" ] }, "approvers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "userGroupManager" ] } ] } } } } } } ] } } } } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Get the configured approval policy for updating a vendor", "tags": [ "Policy" ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "status", "createdAt", "updatedAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "rules" ], "properties": { "rules": { "type": "array", "items": { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "anyOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] } ] } } }, { "type": "object", "required": [ "status", "approvers" ], "properties": { "status": { "type": "string", "enum": [ "requiresApproval" ] }, "approvers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "userGroupManager" ] } ] } } } } } } ] } } } } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/policy/update-vendor-approval/execute": { "post": { "summary": "Execute the configured approval policy against given facts", "tags": [ "Policy" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "userGroupIds", "userRoleIds", "fieldsToUpdate" ], "properties": { "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "fieldsToUpdate": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "status" ] }, { "type": "string", "enum": [ "externalId" ] }, { "type": "string", "enum": [ "name" ] }, { "type": "string", "enum": [ "owners" ] }, { "type": "string", "enum": [ "country" ] }, { "type": "string", "enum": [ "logoUrl" ] }, { "type": "string", "enum": [ "spendCategoryId" ] }, { "type": "string", "enum": [ "merchantCategory" ] }, { "type": "string", "enum": [ "legalName" ] }, { "type": "string", "enum": [ "taxId" ] }, { "type": "string", "enum": [ "address" ] }, { "type": "string", "enum": [ "contacts" ] }, { "type": "string", "enum": [ "paymentMethods" ] } ] } } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "matchedRule" ], "properties": { "matchedRule": { "anyOf": [ { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "anyOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] } ] } } }, { "type": "object", "required": [ "status", "approvers" ], "properties": { "status": { "type": "string", "enum": [ "requiresApproval" ] }, "approvers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "userGroupManager" ] } ] } } } } } } ] } } }, { "type": "null", "description": "No rules matched" } ] } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/policy/expense-approval": { "post": { "summary": "Create an approval policy for submitting an expense", "tags": [ "Policy" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "status", "rules" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "rules": { "type": "array", "items": { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "anyOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] } ] } } }, { "type": "object", "required": [ "status", "approvers" ], "properties": { "status": { "type": "string", "enum": [ "requiresApproval" ] }, "approvers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "userGroupManager" ] } ] } } } } } } ] } } } } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "status", "createdAt", "updatedAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "rules" ], "properties": { "rules": { "type": "array", "items": { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "anyOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] } ] } } }, { "type": "object", "required": [ "status", "approvers" ], "properties": { "status": { "type": "string", "enum": [ "requiresApproval" ] }, "approvers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "userGroupManager" ] } ] } } } } } } ] } } } } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Get the configured approval policy for submitting an expense", "tags": [ "Policy" ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "status", "createdAt", "updatedAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "rules" ], "properties": { "rules": { "type": "array", "items": { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "anyOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] } ] } } }, { "type": "object", "required": [ "status", "approvers" ], "properties": { "status": { "type": "string", "enum": [ "requiresApproval" ] }, "approvers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "userGroupManager" ] } ] } } } } } } ] } } } } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/policy/expense-approval/execute": { "post": { "summary": "Execute the configured approval policy against given facts", "tags": [ "Policy" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "userGroupIds", "userRoleIds", "expenseType", "amount", "policyViolations" ], "properties": { "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "expenseType": { "anyOf": [ { "type": "string", "enum": [ "card" ] }, { "type": "string", "enum": [ "reimbursement" ] } ] }, "amount": { "type": "string", "description": "Number string" }, "policyViolations": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "memo" ] }, { "type": "string", "enum": [ "receipt" ] }, { "type": "string", "enum": [ "spendCategoryId" ] } ] }, "description": "Required fields the user left unmet at submit, derived from the `expenseRequirement` policy. Empty when satisfied or no policy is active." } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "matchedRule" ], "properties": { "matchedRule": { "anyOf": [ { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "anyOf": [ { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] } ] } } }, { "type": "object", "required": [ "status", "approvers" ], "properties": { "status": { "type": "string", "enum": [ "requiresApproval" ] }, "approvers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "userGroupManager" ] } ] } } } } } } ] } } }, { "type": "null", "description": "No rules matched" } ] } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/policy/expense-requirement": { "post": { "summary": "Create a policy for expense requirements", "tags": [ "Policy" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "status", "rules" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "rules": { "type": "array", "items": { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "type": "object", "required": [ "requiredFields" ], "properties": { "requiredFields": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "memo" ] }, { "type": "string", "enum": [ "receipt" ] }, { "type": "string", "enum": [ "spendCategoryId" ] } ] } } } } } } } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "status", "createdAt", "updatedAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "rules" ], "properties": { "rules": { "type": "array", "items": { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "type": "object", "required": [ "requiredFields" ], "properties": { "requiredFields": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "memo" ] }, { "type": "string", "enum": [ "receipt" ] }, { "type": "string", "enum": [ "spendCategoryId" ] } ] } } } } } } } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Get the configured policy for expense requirements", "tags": [ "Policy" ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "status", "createdAt", "updatedAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "rules" ], "properties": { "rules": { "type": "array", "items": { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "type": "object", "required": [ "requiredFields" ], "properties": { "requiredFields": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "memo" ] }, { "type": "string", "enum": [ "receipt" ] }, { "type": "string", "enum": [ "spendCategoryId" ] } ] } } } } } } } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/policy/expense-requirement/execute": { "post": { "summary": "Execute the configured expense requirements against given facts", "tags": [ "Policy" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "userGroupIds", "userRoleIds", "expenseType", "amount", "hasMemo", "hasReceipt" ], "properties": { "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "expenseType": { "anyOf": [ { "type": "string", "enum": [ "card" ] }, { "type": "string", "enum": [ "reimbursement" ] } ] }, "amount": { "type": "string", "description": "Number string" }, "spendCategoryId": { "type": "string" }, "hasMemo": { "type": "boolean" }, "hasReceipt": { "type": "boolean" } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "matchedRules" ], "properties": { "matchedRules": { "type": "array", "items": { "type": "object", "required": [ "conditions", "outcome" ], "properties": { "conditions": { "type": "object", "properties": {}, "additionalProperties": true, "description": "[Sift](https://github.com/crcn/sift.js) query for corresponding facts" }, "outcome": { "type": "object", "required": [ "requiredFields" ], "properties": { "requiredFields": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "memo" ] }, { "type": "string", "enum": [ "receipt" ] }, { "type": "string", "enum": [ "spendCategoryId" ] } ] } } } } } }, "description": "All rules whose conditions matched, in policy order. Empty if none matched." } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/product": { "get": { "summary": "Search products", "tags": [ "Product" ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "customerAccess", "newCustomerStatus", "updatedAt" ], "properties": { "id": { "anyOf": [ { "type": "string", "enum": [ "accounting" ] }, { "type": "string", "enum": [ "advertisingAgent" ] }, { "type": "string", "enum": [ "billPay" ] }, { "type": "string", "enum": [ "billPayCashAdvance" ] }, { "type": "string", "enum": [ "card" ] }, { "type": "string", "enum": [ "cashAdvance" ] }, { "type": "string", "enum": [ "expense" ] }, { "type": "string", "enum": [ "shippingAgent" ] } ] }, "customerAccess": { "anyOf": [ { "type": "string", "enum": [ "read" ] }, { "type": "string", "enum": [ "write" ] } ] }, "newCustomerStatus": { "anyOf": [ { "type": "string", "enum": [ "enabled" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "updatedAt": { "type": "string", "format": "date-time" } } } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/product/{id}": { "get": { "summary": "Get product", "tags": [ "Product" ], "parameters": [ { "schema": { "anyOf": [ { "type": "string", "enum": [ "accounting" ] }, { "type": "string", "enum": [ "advertisingAgent" ] }, { "type": "string", "enum": [ "billPay" ] }, { "type": "string", "enum": [ "billPayCashAdvance" ] }, { "type": "string", "enum": [ "card" ] }, { "type": "string", "enum": [ "cashAdvance" ] }, { "type": "string", "enum": [ "expense" ] }, { "type": "string", "enum": [ "shippingAgent" ] } ] }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "customerAccess", "newCustomerStatus", "updatedAt" ], "properties": { "id": { "anyOf": [ { "type": "string", "enum": [ "accounting" ] }, { "type": "string", "enum": [ "advertisingAgent" ] }, { "type": "string", "enum": [ "billPay" ] }, { "type": "string", "enum": [ "billPayCashAdvance" ] }, { "type": "string", "enum": [ "card" ] }, { "type": "string", "enum": [ "cashAdvance" ] }, { "type": "string", "enum": [ "expense" ] }, { "type": "string", "enum": [ "shippingAgent" ] } ] }, "customerAccess": { "anyOf": [ { "type": "string", "enum": [ "read" ] }, { "type": "string", "enum": [ "write" ] } ] }, "newCustomerStatus": { "anyOf": [ { "type": "string", "enum": [ "enabled" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/settlement/aggregate": { "post": { "summary": "Aggregate Settlement Data", "tags": [ "Settlement Analytics" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "accountId", "bucket", "value" ], "properties": { "accountId": { "type": "integer", "description": "DashFi Account ID" }, "userGroupId": { "type": "string", "description": "Filter by group" }, "bucket": { "anyOf": [ { "type": "object", "required": [ "field" ], "properties": { "field": { "anyOf": [ { "type": "string", "enum": [ "cardId" ] }, { "type": "string", "enum": [ "merchantCountryCode" ] }, { "type": "string", "enum": [ "primaryCategoryName" ] }, { "type": "string", "enum": [ "standardizedMerchantName" ] } ] } } }, { "type": "object", "required": [ "field", "timeframe" ], "properties": { "field": { "type": "string", "enum": [ "settlementDate" ] }, "timeframe": { "anyOf": [ { "type": "string", "enum": [ "day" ] }, { "type": "string", "enum": [ "month" ] } ] } } } ] }, "value": { "anyOf": [ { "type": "object", "required": [ "field", "aggregateMethod" ], "properties": { "field": { "anyOf": [ { "type": "string", "enum": [ "settlementAmount" ] }, { "type": "string", "enum": [ "interchangeAmount" ] } ] }, "aggregateMethod": { "anyOf": [ { "type": "string", "enum": [ "avg" ] }, { "type": "string", "enum": [ "sum" ] } ] } } }, { "type": "object", "required": [ "aggregateMethod" ], "properties": { "aggregateMethod": { "type": "string", "enum": [ "count" ] } } } ] }, "filters": { "type": "array", "items": { "anyOf": [ { "type": "object", "required": [ "field", "value" ], "properties": { "field": { "type": "string", "enum": [ "settlementDate" ] }, "value": { "type": "object", "properties": { "before": { "type": "string", "format": "date-time" }, "after": { "type": "string", "format": "date-time" } } } } }, { "type": "object", "required": [ "field", "value" ], "properties": { "field": { "anyOf": [ { "type": "string", "enum": [ "cardId" ] }, { "type": "string", "enum": [ "merchantCountryCode" ] }, { "type": "string", "enum": [ "primaryCategoryName" ] }, { "type": "string", "enum": [ "standardizedMerchantName" ] } ] }, "value": { "type": "array", "items": { "type": "string" } } } } ] } } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "bucket", "value" ], "properties": { "bucket": { "anyOf": [ { "type": "string" }, { "type": "boolean" }, { "type": "null" } ] }, "value": { "type": "string" } } } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/transaction/aggregate": { "post": { "summary": "Aggregate Transaction Data", "tags": [ "Transaction Analytics" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "accountId", "bucket", "value" ], "properties": { "accountId": { "type": "string", "description": "DashFi Account ID" }, "userGroupId": { "type": "string", "description": "Filter by group" }, "bucket": { "anyOf": [ { "type": "object", "required": [ "field" ], "properties": { "field": { "anyOf": [ { "type": "string", "enum": [ "amountDirection" ] }, { "type": "string", "enum": [ "cardId" ] }, { "type": "string", "enum": [ "cardName" ] }, { "type": "string", "enum": [ "cardStatus" ] }, { "type": "string", "enum": [ "cardType" ] }, { "type": "string", "enum": [ "currencyCode" ] }, { "type": "string", "enum": [ "declineReason" ] }, { "type": "string", "enum": [ "isDeclined" ] }, { "type": "string", "enum": [ "isRewardsTransaction" ] }, { "type": "string", "enum": [ "issuerAndUseCase" ] }, { "type": "string", "enum": [ "merchantCategoryCode" ] }, { "type": "string", "enum": [ "merchantCountryCode" ] }, { "type": "string", "enum": [ "standardizedMerchantName" ] }, { "type": "string", "enum": [ "termName" ] }, { "type": "string", "enum": [ "transactionCategoryName" ] }, { "type": "string", "enum": [ "transactionStatus" ] } ] } } }, { "type": "object", "required": [ "field", "timeframe" ], "properties": { "field": { "type": "string", "enum": [ "transactionCreatedAt" ] }, "timeframe": { "anyOf": [ { "type": "string", "enum": [ "day" ] }, { "type": "string", "enum": [ "month" ] } ] } } } ] }, "value": { "anyOf": [ { "type": "object", "required": [ "field", "aggregateMethod" ], "properties": { "field": { "anyOf": [ { "type": "string", "enum": [ "settledAmount" ] }, { "type": "string", "enum": [ "totalRefundedAmount" ] }, { "type": "string", "enum": [ "amount" ] } ] }, "aggregateMethod": { "anyOf": [ { "type": "string", "enum": [ "avg" ] }, { "type": "string", "enum": [ "sum" ] } ] } } }, { "type": "object", "required": [ "aggregateMethod" ], "properties": { "aggregateMethod": { "type": "string", "enum": [ "count" ] } } } ] }, "filters": { "type": "array", "items": { "anyOf": [ { "type": "object", "required": [ "field", "value" ], "properties": { "field": { "type": "string", "enum": [ "transactionCreatedAt" ] }, "value": { "type": "object", "properties": { "before": { "type": "string", "format": "date-time" }, "after": { "type": "string", "format": "date-time" } } } } }, { "type": "object", "required": [ "field", "value" ], "properties": { "field": { "anyOf": [ { "type": "string", "enum": [ "isDeclined" ] }, { "type": "string", "enum": [ "isRewardsTransaction" ] } ] }, "value": { "type": "boolean" } } }, { "type": "object", "required": [ "field", "value" ], "properties": { "field": { "type": "string", "enum": [ "merchantCategoryCode" ] }, "value": { "type": "array", "items": { "type": "string" } } } }, { "type": "object", "required": [ "field", "value" ], "properties": { "field": { "anyOf": [ { "type": "string", "enum": [ "amountDirection" ] }, { "type": "string", "enum": [ "cardId" ] }, { "type": "string", "enum": [ "cardName" ] }, { "type": "string", "enum": [ "cardStatus" ] }, { "type": "string", "enum": [ "cardType" ] }, { "type": "string", "enum": [ "currencyCode" ] }, { "type": "string", "enum": [ "declineReason" ] }, { "type": "string", "enum": [ "issuerAndUseCase" ] }, { "type": "string", "enum": [ "merchantCountryCode" ] }, { "type": "string", "enum": [ "standardizedMerchantName" ] }, { "type": "string", "enum": [ "termName" ] }, { "type": "string", "enum": [ "transactionCategoryName" ] }, { "type": "string", "enum": [ "transactionStatus" ] } ] }, "value": { "type": "array", "items": { "type": "string" } } } } ] } } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "bucket", "value" ], "properties": { "bucket": { "anyOf": [ { "type": "string" }, { "type": "boolean" }, { "type": "null" } ] }, "value": { "type": "string" } } } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/transaction-receipt": { "post": { "summary": "Create Transaction Receipt", "tags": [ "Transaction Receipt" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "fileName" ], "properties": { "fileName": { "type": "string" } } }, { "type": "object", "required": [ "transactionId" ], "properties": { "transactionId": { "type": "string" } } } ] } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "url", "fileName", "ocrStatus", "ocrData", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "url": { "type": "string", "format": "url" }, "fileName": { "type": "string" }, "ocrStatus": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "completed" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "null" } ] }, "ocrData": { "anyOf": [ { "type": "object", "required": [ "merchantName", "merchantAddress", "totalAmount", "subtotal", "taxAmount", "tipAmount", "currency", "date", "receiptNumber", "lineItems" ], "properties": { "merchantName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantAddress": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "subtotal": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "taxAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "tipAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currency": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "date": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "receiptNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItems": { "type": "array", "items": { "type": "object", "required": [ "name", "quantity", "unitPrice" ], "properties": { "name": { "type": "string" }, "quantity": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "unitPrice": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } } } } }, { "type": "null" } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Search Transaction Receipts", "tags": [ "Transaction Receipt" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "ids", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "number" }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "number" }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "status", "url", "fileName", "ocrStatus", "ocrData", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "url": { "type": "string", "format": "url" }, "fileName": { "type": "string" }, "ocrStatus": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "completed" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "null" } ] }, "ocrData": { "anyOf": [ { "type": "object", "required": [ "merchantName", "merchantAddress", "totalAmount", "subtotal", "taxAmount", "tipAmount", "currency", "date", "receiptNumber", "lineItems" ], "properties": { "merchantName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantAddress": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "subtotal": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "taxAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "tipAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currency": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "date": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "receiptNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItems": { "type": "array", "items": { "type": "object", "required": [ "name", "quantity", "unitPrice" ], "properties": { "name": { "type": "string" }, "quantity": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "unitPrice": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } } } } }, { "type": "null" } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "hasNext": { "type": "boolean" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/transaction-receipt/{id}": { "get": { "summary": "Get Transaction Receipt", "tags": [ "Transaction Receipt" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "url", "fileName", "ocrStatus", "ocrData", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "url": { "type": "string", "format": "url" }, "fileName": { "type": "string" }, "ocrStatus": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "completed" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "null" } ] }, "ocrData": { "anyOf": [ { "type": "object", "required": [ "merchantName", "merchantAddress", "totalAmount", "subtotal", "taxAmount", "tipAmount", "currency", "date", "receiptNumber", "lineItems" ], "properties": { "merchantName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantAddress": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "subtotal": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "taxAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "tipAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currency": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "date": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "receiptNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItems": { "type": "array", "items": { "type": "object", "required": [ "name", "quantity", "unitPrice" ], "properties": { "name": { "type": "string" }, "quantity": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "unitPrice": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } } } } }, { "type": "null" } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "delete": { "summary": "Delete Transaction Receipt", "tags": [ "Transaction Receipt" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "204": { "description": "Default Response", "content": { "application/json": { "schema": {} } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/user": { "post": { "summary": "Create User", "tags": [ "User" ], "description": "An email invite will be sent to the user", "requestBody": { "required": true, "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "name", "email", "roles" ], "properties": { "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "phone": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } } } }, { "type": "object", "required": [ "legacyAppdashId", "legacyCoreId" ], "properties": { "legacyAppdashId": { "type": "number" }, "legacyCoreId": { "type": "string" } } } ] } } } }, "responses": { "201": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "name", "email", "emailVerified", "phoneVerified", "roles", "legacyAppdashId", "legacyCoreId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "invited" ] }, { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "emailVerified": { "type": "boolean" }, "phone": { "type": "string" }, "phoneVerified": { "type": "boolean" }, "roles": { "type": "array", "items": { "type": "string" } }, "legacyAppdashId": { "type": "number" }, "legacyCoreId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidEmail" ] }, "message": { "type": "string" } }, "title": "invalidEmail", "description": "A service error has occurred" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string" } } } ] }, { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidPhone" ] }, "message": { "type": "string" } }, "title": "invalidPhone", "description": "A service error has occurred" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string" } } } ] } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Search Users", "tags": [ "User" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "ids", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "externalIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "emails", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "nameLike", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "integer", "minimum": 1, "default": 1 }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext", "totalCount" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "status", "name", "email", "legacyAppdashId", "legacyCoreId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "invited" ] }, { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "legacyAppdashId": { "type": "number" }, "legacyCoreId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "hasNext": { "type": "boolean" }, "totalCount": { "type": "number" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/user/{id}": { "patch": { "summary": "Update User", "tags": [ "User" ], "description": "If email is updated, all passwords will be cleared, the new email must be verified, and any existing session will become invalid.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "phone": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "legacyAppdashId": { "type": "number" }, "legacyCoreId": { "type": "string" } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "name", "email", "emailVerified", "phoneVerified", "roles", "legacyAppdashId", "legacyCoreId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "invited" ] }, { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "emailVerified": { "type": "boolean" }, "phone": { "type": "string" }, "phoneVerified": { "type": "boolean" }, "roles": { "type": "array", "items": { "type": "string" } }, "legacyAppdashId": { "type": "number" }, "legacyCoreId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidEmail" ] }, "message": { "type": "string" } }, "title": "invalidEmail", "description": "A service error has occurred" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string" } } } ] }, { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidPhone" ] }, "message": { "type": "string" } }, "title": "invalidPhone", "description": "A service error has occurred" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string" } } } ] } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Get User", "tags": [ "User" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "name", "email", "emailVerified", "phoneVerified", "roles", "legacyAppdashId", "legacyCoreId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "invited" ] }, { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "emailVerified": { "type": "boolean" }, "phone": { "type": "string" }, "phoneVerified": { "type": "boolean" }, "roles": { "type": "array", "items": { "type": "string" } }, "legacyAppdashId": { "type": "number" }, "legacyCoreId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "delete": { "summary": "Delete User", "tags": [ "User" ], "description": "You can also use this endpoint to un-invite an invited user.", "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "204": { "description": "Default Response", "content": { "application/json": { "schema": {} } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/user/{id}/undelete": { "post": { "summary": "Reactivate a deleted user", "tags": [ "User" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "name", "email", "emailVerified", "phoneVerified", "roles", "legacyAppdashId", "legacyCoreId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "invited" ] }, { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "emailVerified": { "type": "boolean" }, "phone": { "type": "string" }, "phoneVerified": { "type": "boolean" }, "roles": { "type": "array", "items": { "type": "string" } }, "legacyAppdashId": { "type": "number" }, "legacyCoreId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidEmail" ] }, "message": { "type": "string" } }, "title": "invalidEmail", "description": "A service error has occurred" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string" } } } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/user/{id}/resend-invite": { "post": { "summary": "Resend an invite to an existing user", "tags": [ "User" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "name", "email", "emailVerified", "phoneVerified", "roles", "legacyAppdashId", "legacyCoreId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "invited" ] }, { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "emailVerified": { "type": "boolean" }, "phone": { "type": "string" }, "phoneVerified": { "type": "boolean" }, "roles": { "type": "array", "items": { "type": "string" } }, "legacyAppdashId": { "type": "number" }, "legacyCoreId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/user/{id}/user-group": { "get": { "summary": "Search user groups membership for user", "tags": [ "User" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "userGroupIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "types", "required": false, "description": "comma-separated list" }, { "schema": { "anyOf": [ { "type": "string", "enum": [ "manager" ] }, { "type": "string", "enum": [ "member" ] } ] }, "in": "query", "name": "role", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "nameLike", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "integer", "minimum": 1, "default": 1 }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." }, { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext", "totalCount" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "status", "type", "role", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "name": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "type": { "anyOf": [ { "type": "string", "enum": [ "team" ] }, { "type": "string", "enum": [ "location" ] }, { "type": "string", "enum": [ "custom" ] } ] }, "role": { "anyOf": [ { "type": "string", "enum": [ "manager" ] }, { "type": "string", "enum": [ "member" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "hasNext": { "type": "boolean" }, "totalCount": { "type": "number" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/user/onboarding": { "post": { "summary": "Create user from onboarding member", "tags": [ "User" ], "description": "Creates a user in the customer organization from the current onboarding member.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "customerId" ], "properties": { "customerId": { "type": "string" } } }, { "type": "object", "required": [ "legacyAppdashId", "legacyCoreId" ], "properties": { "legacyAppdashId": { "type": "number" }, "legacyCoreId": { "type": "string" } } } ] } } } }, "responses": { "201": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "name", "email", "emailVerified", "phoneVerified", "roles", "legacyAppdashId", "legacyCoreId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "invited" ] }, { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "emailVerified": { "type": "boolean" }, "phone": { "type": "string" }, "phoneVerified": { "type": "boolean" }, "roles": { "type": "array", "items": { "type": "string" } }, "legacyAppdashId": { "type": "number" }, "legacyCoreId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidEmail" ] }, "message": { "type": "string" } }, "title": "invalidEmail", "description": "A service error has occurred" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string" } } } ] }, { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "onboardingMemberNotFound" ] }, "message": { "type": "string" } }, "title": "onboardingMemberNotFound", "description": "A service error has occurred" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string" } } } ] } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/user-group": { "post": { "summary": "Create User Group", "tags": [ "User Group" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "name", "type" ], "properties": { "externalId": { "type": "string" }, "name": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "team" ] }, { "type": "string", "enum": [ "location" ] }, { "type": "string", "enum": [ "custom" ] } ] }, "budget": { "type": "string" } } }, { "type": "object", "properties": { "managerUserId": { "type": "string" } } } ] } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "name", "status", "type", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "name": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "type": { "anyOf": [ { "type": "string", "enum": [ "team" ] }, { "type": "string", "enum": [ "location" ] }, { "type": "string", "enum": [ "custom" ] } ] }, "budget": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidBudget" ] }, "message": { "type": "string" } }, "title": "invalidBudget", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "duplicate" ] }, "message": { "type": "string" } }, "title": "duplicate", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Search User Groups", "tags": [ "User Group" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "ids", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "externalIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "userIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "managerIds", "required": false, "description": "comma-separated list" }, { "schema": { "anyOf": [ { "type": "string", "enum": [ "team" ] }, { "type": "string", "enum": [ "location" ] }, { "type": "string", "enum": [ "custom" ] } ] }, "in": "query", "name": "type", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "nameLike", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "number" }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "number" }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext", "totalCount" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "status", "type", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "name": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "type": { "anyOf": [ { "type": "string", "enum": [ "team" ] }, { "type": "string", "enum": [ "location" ] }, { "type": "string", "enum": [ "custom" ] } ] }, "budget": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "hasNext": { "type": "boolean" }, "totalCount": { "type": "number" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/user-group/{id}": { "patch": { "summary": "Update User Group", "tags": [ "User Group" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "externalId": { "type": "string" }, "name": { "type": "string" }, "budget": { "anyOf": [ { "type": "null" }, { "type": "string" } ] } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "name", "status", "type", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "name": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "type": { "anyOf": [ { "type": "string", "enum": [ "team" ] }, { "type": "string", "enum": [ "location" ] }, { "type": "string", "enum": [ "custom" ] } ] }, "budget": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidBudget" ] }, "message": { "type": "string" } }, "title": "invalidBudget", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Get User Group", "tags": [ "User Group" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "name", "status", "type", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "name": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "type": { "anyOf": [ { "type": "string", "enum": [ "team" ] }, { "type": "string", "enum": [ "location" ] }, { "type": "string", "enum": [ "custom" ] } ] }, "budget": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "delete": { "summary": "Delete User Group", "tags": [ "User Group" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "name", "status", "type", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "name": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "type": { "anyOf": [ { "type": "string", "enum": [ "team" ] }, { "type": "string", "enum": [ "location" ] }, { "type": "string", "enum": [ "custom" ] } ] }, "budget": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/user-group/{id}/user": { "post": { "summary": "Create User Group User", "tags": [ "User Group" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "role" ], "properties": { "id": { "type": "string" }, "role": { "anyOf": [ { "type": "string", "enum": [ "manager" ] }, { "type": "string", "enum": [ "member" ] } ] } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "id", "name", "email", "legacyAppdashId", "legacyCoreId" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "legacyAppdashId": { "type": "number" }, "legacyCoreId": { "type": "string" } } }, { "type": "object", "required": [ "role", "createdAt", "updatedAt" ], "properties": { "role": { "anyOf": [ { "type": "string", "enum": [ "manager" ] }, { "type": "string", "enum": [ "member" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "duplicate" ] }, "message": { "type": "string" } }, "title": "duplicate", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Search User Group Users", "tags": [ "User Group" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "userIds", "required": false, "description": "comma-separated list" }, { "schema": { "anyOf": [ { "type": "string", "enum": [ "manager" ] }, { "type": "string", "enum": [ "member" ] } ] }, "in": "query", "name": "role", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "nameLike", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "number" }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "number" }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." }, { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext", "totalCount" ], "properties": { "items": { "type": "array", "items": { "allOf": [ { "type": "object", "required": [ "id", "name", "email", "legacyAppdashId", "legacyCoreId" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "legacyAppdashId": { "type": "number" }, "legacyCoreId": { "type": "string" } } }, { "type": "object", "required": [ "role", "createdAt", "updatedAt" ], "properties": { "role": { "anyOf": [ { "type": "string", "enum": [ "manager" ] }, { "type": "string", "enum": [ "member" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } ] } }, "hasNext": { "type": "boolean" }, "totalCount": { "type": "number" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/user-group/{id}/user/{userId}": { "patch": { "summary": "Update User Group User", "tags": [ "User Group" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "role" ], "properties": { "role": { "anyOf": [ { "type": "string", "enum": [ "manager" ] }, { "type": "string", "enum": [ "member" ] } ] } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true }, { "schema": { "type": "string" }, "in": "path", "name": "userId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "id", "name", "email", "legacyAppdashId", "legacyCoreId" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "legacyAppdashId": { "type": "number" }, "legacyCoreId": { "type": "string" } } }, { "type": "object", "required": [ "role", "createdAt", "updatedAt" ], "properties": { "role": { "anyOf": [ { "type": "string", "enum": [ "manager" ] }, { "type": "string", "enum": [ "member" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRoleChange" ] }, "message": { "type": "string" } }, "title": "invalidRoleChange", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "delete": { "summary": "Delete User Group User", "tags": [ "User Group" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true }, { "schema": { "type": "string" }, "in": "path", "name": "userId", "required": true } ], "responses": { "204": { "description": "Default Response" }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidManagerDeletion" ] }, "message": { "type": "string" } }, "title": "invalidManagerDeletion", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/user-group/{id}/card": { "get": { "summary": "List cards associated with a user group", "tags": [ "User Group" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "cardId", "userGroupId", "userGroupName", "createdAt", "updatedAt" ], "properties": { "cardId": { "type": "string" }, "userGroupId": { "type": "string" }, "userGroupName": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/user-group/managees": { "get": { "summary": "Search Managees", "tags": [ "User Group" ], "description": "Returns groups the current user manages, with each group's members.", "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "manageeUserIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "userGroupTypes", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list of managee user statuses to include; defaults to excluding `deleted`" }, { "schema": { "type": "number" }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "number" }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext", "totalCount" ], "properties": { "items": { "type": "array", "items": { "allOf": [ { "type": "object", "required": [ "id", "name", "status", "type", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "name": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "type": { "anyOf": [ { "type": "string", "enum": [ "team" ] }, { "type": "string", "enum": [ "location" ] }, { "type": "string", "enum": [ "custom" ] } ] }, "budget": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "managees" ], "properties": { "managees": { "type": "array", "items": { "type": "object", "required": [ "id", "status", "name", "email", "legacyAppdashId", "legacyCoreId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "invited" ] }, { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "legacyAppdashId": { "type": "number" }, "legacyCoreId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } } ] } }, "hasNext": { "type": "boolean" }, "totalCount": { "type": "number" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/user-group/managers": { "get": { "summary": "Search Managers", "tags": [ "User Group" ], "description": "Returns groups the current user belongs to as a member, with each group's managers.", "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "managerUserIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "userGroupTypes", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list of manager user statuses to include; defaults to excluding `deleted`" }, { "schema": { "type": "number" }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "number" }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext", "totalCount" ], "properties": { "items": { "type": "array", "items": { "allOf": [ { "type": "object", "required": [ "id", "name", "status", "type", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "name": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "type": { "anyOf": [ { "type": "string", "enum": [ "team" ] }, { "type": "string", "enum": [ "location" ] }, { "type": "string", "enum": [ "custom" ] } ] }, "budget": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "managers" ], "properties": { "managers": { "type": "array", "items": { "type": "object", "required": [ "id", "status", "name", "email", "legacyAppdashId", "legacyCoreId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "invited" ] }, { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "email": { "type": "string" }, "legacyAppdashId": { "type": "number" }, "legacyCoreId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } } ] } }, "hasNext": { "type": "boolean" }, "totalCount": { "type": "number" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/user-role": { "get": { "summary": "Get User Roles", "tags": [ "User Role" ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "type", "permissions" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "standard" ] }, { "type": "string", "enum": [ "custom" ] } ] }, "description": { "type": "string" }, "permissions": { "type": "array", "items": { "type": "object", "required": [ "resourceId", "actions" ], "properties": { "resourceId": { "type": "string" }, "actions": { "type": "array", "items": { "type": "string" } } } } } } } }, "hasNext": { "type": "boolean" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/vendor": { "post": { "summary": "Create a Vendor", "tags": [ "Vendor" ], "description": "Returns the vendor, if auto-approved, otherwise returns the approval request that needs to approved before vendor is created", "requestBody": { "required": true, "content": { "application/json": { "schema": { "allOf": [ { "allOf": [ { "type": "object", "required": [ "name", "owners", "currencyCode", "country" ], "properties": { "externalId": { "type": "string" }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } } } }, { "type": "object", "required": [ "rutterId", "currencyCode", "contacts" ], "properties": { "rutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Rutter vendor ID. If null, the vendor will be created in the accounting platform." }, "currencyCode": { "type": "string", "description": "ISO 4217 currency code" }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "name", "default", "email" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "source" ], "properties": { "source": { "anyOf": [ { "type": "string", "enum": [ "bill" ] }, { "type": "string", "enum": [ "expense" ] }, { "type": "string", "enum": [ "manual" ] } ], "description": "Where did this prospective vendor originate from" } } } ] } } } }, "responses": { "201": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "name", "owners", "currencyCode", "country", "contacts", "paymentMethods", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" } } } } } } }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "default", "email" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } }, "paymentMethods": { "type": "array", "items": { "anyOf": [ { "type": "object", "required": [ "id", "type", "achPaymentMethodId", "entityType", "accountType", "routingNumber", "accountNumber", "accountName" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "ach" ] }, "achPaymentMethodId": { "type": "string" }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" } }, "title": "Vendor ACH business payment method" }, { "type": "object", "required": [ "id", "type", "achPaymentMethodId", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "ach" ] }, "achPaymentMethodId": { "type": "string" }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" } }, "title": "Vendor ACH individual payment method" } ] } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "202": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendor", "enum": [ "createVendor" ] }, "request": { "allOf": [ { "type": "object", "required": [ "name", "owners", "currencyCode", "country" ], "properties": { "externalId": { "type": "string" }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } } } }, { "type": "object", "required": [ "rutterId", "currencyCode", "contacts" ], "properties": { "rutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Rutter vendor ID. If null, the vendor will be created in the accounting platform." }, "currencyCode": { "type": "string", "description": "ISO 4217 currency code" }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "name", "default", "email" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } } ] } } } ], "title": "createVendor" } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidName" ] }, "message": { "type": "string" } }, "title": "invalidName", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRutterId" ] }, "message": { "type": "string" } }, "title": "invalidRutterId", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidCurrencyCode" ] }, "message": { "type": "string" } }, "title": "invalidCurrencyCode", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "422": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "declinedByPolicy" ] }, "message": { "type": "string" } }, "title": "declinedByPolicy", "description": "A service error has occurred" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Search Vendors", "tags": [ "Vendor" ], "description": "Payment method details are returned as reference only. Use `GET /vendor/{id}` to retrieve the full details.", "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "ids", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "externalIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list; vendor statuses (active, disabled, deleted) or accounting integration latest sync statuses (sync:inProgress, sync:successful, sync:failed)" }, { "schema": { "type": "string" }, "in": "query", "name": "ownerUserIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "ownerUserGroupIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "countries", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "spendCategoryIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "merchantIds", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string" }, "in": "query", "name": "nameLike", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "legalNameLike", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "createdAt", "required": false, "description": "::,..." }, { "schema": { "type": "string" }, "in": "query", "name": "updatedAt", "required": false, "description": "::,..." }, { "schema": { "type": "integer", "minimum": 1, "default": 1 }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext", "totalCount" ], "properties": { "items": { "type": "array", "items": { "allOf": [ { "type": "object", "required": [ "id", "status", "name", "owners", "currencyCode", "country", "contacts", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" } } } } } } }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "default", "email" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "paymentMethods" ], "properties": { "paymentMethods": { "type": "array", "items": { "type": "object", "required": [ "id", "type" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "ach" ] } } } } } } ] } }, "hasNext": { "type": "boolean" }, "totalCount": { "type": "number" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/vendor/pending-decision": { "get": { "summary": "Search for vendors that are pending a decision", "tags": [ "Vendor" ], "description": "* The results do not include `createVendor` requests. \n* Vendor payment methods are returned as reference only; use `GET /vendor/{id}` to resolve those into details.", "parameters": [ { "schema": { "type": "integer", "minimum": 1, "default": 1 }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "orderBy", "required": false, "description": ":,..." } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext", "totalCount" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "vendor", "approvalRequest" ], "properties": { "vendor": { "allOf": [ { "type": "object", "required": [ "id", "status", "name", "owners", "currencyCode", "country", "contacts", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" } } } } } } }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "default", "email" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "paymentMethods" ], "properties": { "paymentMethods": { "type": "array", "items": { "type": "object", "required": [ "id", "type" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "ach" ] } } } } } } ] }, "approvalRequest": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createCard", "enum": [ "createCard" ] }, "request": { "type": "object", "required": [ "name", "frequencyType", "cardholderId", "userId", "accountId" ], "properties": { "name": { "type": "string" }, "frequencyType": { "anyOf": [ { "type": "string", "enum": [ "recurring" ] }, { "type": "string", "enum": [ "single" ] } ] }, "cardholderId": { "type": "string" }, "userId": { "type": "string" }, "accountId": { "type": "number" }, "cardProfileId": { "type": "string" }, "cardProfileStrategy": { "anyOf": [ { "type": "string", "enum": [ "advertising_least_used" ] }, { "type": "string", "enum": [ "vertical_optimized" ] }, { "type": "string", "enum": [ "shipping_optimized" ] }, { "type": "string", "enum": [ "plastiq" ] }, { "type": "string", "enum": [ "tokenizable" ] } ] }, "expiry": { "type": "string" }, "categoryIds": { "type": "array", "items": { "type": "string" } }, "allowedCountries": { "type": "array", "items": { "type": "string" } }, "spendFrequency": { "anyOf": [ { "type": "string", "enum": [ "purchase_1d" ] }, { "type": "string", "enum": [ "purchase_7d" ] }, { "type": "string", "enum": [ "purchase_30d" ] }, { "type": "string", "enum": [ "purchase_1y" ] }, { "type": "string", "enum": [ "card_debit_lifetime" ] } ] }, "spendLimit": { "type": "number" }, "userGroupId": { "type": "string" } } } } } ], "title": "createCard" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "payBill", "enum": [ "payBill" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "payBill" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "submitExpense", "enum": [ "submitExpense" ] }, "request": { "type": "object", "properties": {} } } } ], "title": "submitExpense" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendor", "enum": [ "createVendor" ] }, "request": { "allOf": [ { "type": "object", "required": [ "name", "owners", "currencyCode", "country" ], "properties": { "externalId": { "type": "string" }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } } } }, { "type": "object", "required": [ "rutterId", "currencyCode", "contacts" ], "properties": { "rutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Rutter vendor ID. If null, the vendor will be created in the accounting platform." }, "currencyCode": { "type": "string", "description": "ISO 4217 currency code" }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "name", "default", "email" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } } ] } } } ], "title": "createVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "updateVendor", "enum": [ "updateVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "address": { "anyOf": [ { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, { "type": "null" } ] }, "taxId": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "legalName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "logoUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantCategory": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantIds": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] } } } } } ], "title": "updateVendor" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendorPaymentMethod", "enum": [ "createVendorPaymentMethod" ] }, "request": { "anyOf": [ { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH business payment method" }, { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH individual payment method" } ] } } } ], "title": "createVendorPaymentMethod" }, { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "deleteVendorPaymentMethod", "enum": [ "deleteVendorPaymentMethod" ] }, "request": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } } } } ], "title": "deleteVendorPaymentMethod" } ], "description": "Approval request, discriminated by `type`" } } } }, "hasNext": { "type": "boolean" }, "totalCount": { "type": "number" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/vendor/export": { "post": { "summary": "Export Vendors", "tags": [ "Vendor" ], "description": "This is a streaming endpoint. BFFs should pipe the stream response back to user's browser.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "format" ], "properties": { "format": { "type": "string", "enum": [ "csv" ] }, "fields": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "name" ] }, { "type": "string", "enum": [ "status" ] }, { "type": "string", "enum": [ "country" ] }, { "type": "string", "enum": [ "currencyCode" ] }, { "type": "string", "enum": [ "legalName" ] }, { "type": "string", "enum": [ "taxId" ] }, { "type": "string", "enum": [ "address" ] }, { "type": "string", "enum": [ "merchantCategory" ] }, { "type": "string", "enum": [ "contactName" ] }, { "type": "string", "enum": [ "contactEmail" ] }, { "type": "string", "enum": [ "contactPhone" ] }, { "type": "string", "enum": [ "externalId" ] }, { "type": "string", "enum": [ "id" ] }, { "type": "string", "enum": [ "createdAt" ] }, { "type": "string", "enum": [ "updatedAt" ] } ] }, "description": "columns to include; defaults to all" } } }, { "type": "object", "properties": { "ids": { "type": "array", "items": { "type": "string" } }, "externalIds": { "type": "array", "items": { "type": "string" } }, "statuses": { "type": "array", "items": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] }, { "type": "string", "enum": [ "deleted" ] } ] } }, "ownerUserIds": { "type": "array", "items": { "type": "string" } }, "ownerUserGroupIds": { "type": "array", "items": { "type": "string" } }, "countries": { "type": "array", "items": { "type": "string" } }, "spendCategoryIds": { "type": "array", "items": { "type": "string" } }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "nameLike": { "type": "string" }, "legalNameLike": { "type": "string" }, "createdAt": { "type": "array", "items": { "type": "object", "required": [ "op", "value" ], "properties": { "op": { "anyOf": [ { "type": "string", "enum": [ "lt" ] }, { "type": "string", "enum": [ "lte" ] }, { "type": "string", "enum": [ "eq" ] }, { "type": "string", "enum": [ "ne" ] }, { "type": "string", "enum": [ "gte" ] }, { "type": "string", "enum": [ "gt" ] } ] }, "value": { "type": "string", "format": "date-time" } } } }, "updatedAt": { "type": "array", "items": { "type": "object", "required": [ "op", "value" ], "properties": { "op": { "anyOf": [ { "type": "string", "enum": [ "lt" ] }, { "type": "string", "enum": [ "lte" ] }, { "type": "string", "enum": [ "eq" ] }, { "type": "string", "enum": [ "ne" ] }, { "type": "string", "enum": [ "gte" ] }, { "type": "string", "enum": [ "gt" ] } ] }, "value": { "type": "string", "format": "date-time" } } } }, "orderBy": { "type": "array", "items": { "type": "object", "required": [ "field", "direction" ], "properties": { "field": { "anyOf": [ { "type": "string", "enum": [ "createdAt" ] }, { "type": "string", "enum": [ "updatedAt" ] } ] }, "direction": { "anyOf": [ { "type": "string", "enum": [ "asc" ] }, { "type": "string", "enum": [ "desc" ] } ] } } } } } } ] } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "string", "contentMediaType": "text/csv" } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "tooManyItems" ] }, "message": { "type": "string" } }, "title": "tooManyItems", "description": "A service error has occurred" }, { "type": "object", "required": [ "max", "actual" ], "properties": { "max": { "type": "number", "description": "Maximum number of items allowed" }, "actual": { "type": "number", "description": "Number of items that matched the request" } } } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/vendor/file-bulk-import": { "post": { "summary": "Start a Vendor Bulk Import from File", "tags": [ "Vendor" ], "description": "Creates a file source and returns a presigned `upload`. POST the file to continue.\nThe file source can subsequently be managed via the `/v1/web/bulk-import-file-source` endpoints.\nThe expected file structure can be retrieved from `GET /v1/web/vendor/file-bulk-import/template`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "filename" ], "properties": { "filename": { "type": "string" } } } } } }, "responses": { "201": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "id", "status", "filename", "structure", "errors", "creatorUserId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "uploading" ] }, { "type": "string", "enum": [ "uploaded" ] }, { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "processed" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "filename": { "type": "string" }, "structure": { "anyOf": [ { "type": "object", "required": [ "type", "fields", "fileHeaders" ], "properties": { "type": { "type": "string", "enum": [ "billLineItemTable" ] }, "fields": { "type": "object", "properties": { "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "paymentDueDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "vendorName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItem.description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lineItem.amount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } }, "fileHeaders": { "type": "array", "items": { "type": "string" }, "description": "Column headers detected in the uploaded file" } } }, { "type": "object", "required": [ "type", "fields", "fileHeaders" ], "properties": { "type": { "type": "string", "enum": [ "vendorTable" ] }, "fields": { "type": "object", "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "country": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.firstName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.middleName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.name.lastName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.email": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contact.phone": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } }, "fileHeaders": { "type": "array", "items": { "type": "string" }, "description": "Column headers detected in the uploaded file" } } } ] }, "errors": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "invalidFile" ] }, "message": { "type": "string" } } } }, "creatorUserId": { "type": "string" }, "bulkImportId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "processedAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "uploadUrl", "upload" ], "properties": { "uploadUrl": { "type": "string", "deprecated": true, "description": "Deprecated. Use `upload` instead." }, "upload": { "type": "object", "required": [ "url", "fields" ], "properties": { "url": { "type": "string" }, "fields": { "type": "object", "additionalProperties": { "type": "string" } } }, "description": "Presigned S3 POST: append each `fields` entry as a form field, then the file last." } } } ] } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidFileFormat" ] }, "message": { "type": "string" } }, "title": "invalidFileFormat", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/vendor/file-bulk-import/template": { "get": { "summary": "Get a Vendor Bulk Import File Template", "tags": [ "Vendor" ], "description": "Returns a template with the expected structure and example values that can be filled and uploaded.", "parameters": [ { "schema": { "anyOf": [ { "type": "string", "enum": [ "csv" ] } ] }, "in": "query", "name": "fileType", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "string", "contentMediaType": "text/csv" } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/vendor/{id}": { "patch": { "summary": "Update a Vendor", "tags": [ "Vendor" ], "description": "Returns the vendor, if auto-approved, otherwise returns the approval request that needs to approved before vendor is updated", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "address": { "anyOf": [ { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, { "type": "null" } ] }, "taxId": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "legalName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "logoUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantCategory": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantIds": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "name", "owners", "currencyCode", "country", "contacts", "paymentMethods", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" } } } } } } }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "default", "email" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } }, "paymentMethods": { "type": "array", "items": { "anyOf": [ { "type": "object", "required": [ "id", "type", "achPaymentMethodId", "entityType", "accountType", "routingNumber", "accountNumber", "accountName" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "ach" ] }, "achPaymentMethodId": { "type": "string" }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" } }, "title": "Vendor ACH business payment method" }, { "type": "object", "required": [ "id", "type", "achPaymentMethodId", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "ach" ] }, "achPaymentMethodId": { "type": "string" }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" } }, "title": "Vendor ACH individual payment method" } ] } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "202": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "updateVendor", "enum": [ "updateVendor" ] }, "request": { "type": "object", "properties": { "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "country": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "address": { "anyOf": [ { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, { "type": "null" } ] }, "taxId": { "anyOf": [ { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, { "type": "null" } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "legalName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "logoUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantCategory": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "merchantIds": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] } } } } } ], "title": "updateVendor" } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidName" ] }, "message": { "type": "string" } }, "title": "invalidName", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidCurrencyCode" ] }, "message": { "type": "string" } }, "title": "invalidCurrencyCode", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "422": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "declinedByPolicy" ] }, "message": { "type": "string" } }, "title": "declinedByPolicy", "description": "A service error has occurred" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "delete": { "summary": "Delete a Vendor", "tags": [ "Vendor" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "name", "owners", "currencyCode", "country", "contacts", "paymentMethods", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" } } } } } } }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "default", "email" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } }, "paymentMethods": { "type": "array", "items": { "anyOf": [ { "type": "object", "required": [ "id", "type", "achPaymentMethodId", "entityType", "accountType", "routingNumber", "accountNumber", "accountName" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "ach" ] }, "achPaymentMethodId": { "type": "string" }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" } }, "title": "Vendor ACH business payment method" }, { "type": "object", "required": [ "id", "type", "achPaymentMethodId", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "ach" ] }, "achPaymentMethodId": { "type": "string" }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" } }, "title": "Vendor ACH individual payment method" } ] } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "get": { "summary": "Get a Vendor", "tags": [ "Vendor" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "name", "owners", "currencyCode", "country", "contacts", "paymentMethods", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" } } } } } } }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "default", "email" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } }, "paymentMethods": { "type": "array", "items": { "anyOf": [ { "type": "object", "required": [ "id", "type", "achPaymentMethodId", "entityType", "accountType", "routingNumber", "accountNumber", "accountName" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "ach" ] }, "achPaymentMethodId": { "type": "string" }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" } }, "title": "Vendor ACH business payment method" }, { "type": "object", "required": [ "id", "type", "achPaymentMethodId", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "ach" ] }, "achPaymentMethodId": { "type": "string" }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" } }, "title": "Vendor ACH individual payment method" } ] } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/vendor/{id}/undelete": { "post": { "summary": "Undelete a Vendor", "tags": [ "Vendor" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "name", "owners", "currencyCode", "country", "contacts", "paymentMethods", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" } } } } } } }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "default", "email" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } }, "paymentMethods": { "type": "array", "items": { "anyOf": [ { "type": "object", "required": [ "id", "type", "achPaymentMethodId", "entityType", "accountType", "routingNumber", "accountNumber", "accountName" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "ach" ] }, "achPaymentMethodId": { "type": "string" }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" } }, "title": "Vendor ACH business payment method" }, { "type": "object", "required": [ "id", "type", "achPaymentMethodId", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "ach" ] }, "achPaymentMethodId": { "type": "string" }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" } }, "title": "Vendor ACH individual payment method" } ] } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/vendor/{id}/accounting-integration/force-sync": { "post": { "summary": "Force a sync of this vendor into the accounting platform", "tags": [ "Vendor" ], "description": "This would only create a vendor; it does not update existing vendors.\n\nWARNING: Only use this in extraordinary circumstances where the vendor was not automatically synced for some reason.", "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "name", "owners", "currencyCode", "country", "contacts", "paymentMethods", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" } } } } } } }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "default", "email" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } }, "paymentMethods": { "type": "array", "items": { "anyOf": [ { "type": "object", "required": [ "id", "type", "achPaymentMethodId", "entityType", "accountType", "routingNumber", "accountNumber", "accountName" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "ach" ] }, "achPaymentMethodId": { "type": "string" }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" } }, "title": "Vendor ACH business payment method" }, { "type": "object", "required": [ "id", "type", "achPaymentMethodId", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "ach" ] }, "achPaymentMethodId": { "type": "string" }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" } }, "title": "Vendor ACH individual payment method" } ] } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "alreadySynced" ] }, "message": { "type": "string" } }, "title": "alreadySynced", "description": "A service error has occurred" } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/vendor/{id}/accounting-integration": { "patch": { "summary": "Update this vendor's accounting integration", "tags": [ "Vendor" ], "description": "Points the vendor at an existing accounting platform (Rutter) vendor.\n\nUsed to recover a vendor whose automatic sync failed because a vendor with the same name already exists in the accounting platform.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "rutterId" ], "properties": { "rutterId": { "type": "string" } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "name", "owners", "currencyCode", "country", "contacts", "paymentMethods", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "currencyCode": { "type": "string" }, "accountingIntegration": { "type": "object", "required": [ "latestSync" ], "properties": { "rutterId": { "type": "string" }, "platformId": { "type": "string" }, "latestSync": { "type": "object", "required": [ "status", "createdAt" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "inProgress" ] }, { "type": "string", "enum": [ "successful" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" } } } } } } }, "country": { "type": "string" }, "logoUrl": { "type": "string" }, "spendCategoryId": { "type": "string" }, "merchantIds": { "type": "array", "items": { "type": "string" } }, "merchantCategory": { "type": "string" }, "legalName": { "type": "string" }, "taxId": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "ssn" ] }, { "type": "string", "enum": [ "ein" ] } ] }, "id": { "type": "string" } } }, "address": { "type": "object", "required": [ "line1", "city", "zipCode", "state", "country" ], "properties": { "attn": { "type": "string" }, "line1": { "type": "string" }, "line2": { "type": "string" }, "city": { "type": "string" }, "zipCode": { "type": "string" }, "state": { "type": "string" }, "country": { "type": "string" } } }, "contacts": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "default", "email" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } }, "paymentMethods": { "type": "array", "items": { "anyOf": [ { "type": "object", "required": [ "id", "type", "achPaymentMethodId", "entityType", "accountType", "routingNumber", "accountNumber", "accountName" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "ach" ] }, "achPaymentMethodId": { "type": "string" }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" } }, "title": "Vendor ACH business payment method" }, { "type": "object", "required": [ "id", "type", "achPaymentMethodId", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "ach" ] }, "achPaymentMethodId": { "type": "string" }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" } }, "title": "Vendor ACH individual payment method" } ] } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "alreadyIntegrated" ] }, "message": { "type": "string" } }, "title": "alreadyIntegrated", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRutterId" ] }, "message": { "type": "string" } }, "title": "invalidRutterId", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/vendor/{vendorId}/contact": { "post": { "summary": "Add a Contact to a Vendor", "tags": [ "Vendor" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "name", "default", "email" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "vendorId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "name", "default", "email" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/vendor/{vendorId}/contact/{id}": { "patch": { "summary": "Update a Vendor Contact", "tags": [ "Vendor" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "name", "default", "email" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "vendorId", "required": true }, { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "name", "default", "email" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } }, "delete": { "summary": "Delete a Vendor Contact", "tags": [ "Vendor" ], "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "vendorId", "required": true }, { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "name", "default", "email" ], "properties": { "id": { "type": "string" }, "type": { "anyOf": [ { "type": "string", "enum": [ "accountsPayable" ] }, { "type": "string", "enum": [ "accountsReceivable" ] }, { "type": "string", "enum": [ "it" ] }, { "type": "string", "enum": [ "procurement" ] }, { "type": "string", "enum": [ "sales" ] }, { "type": "string", "enum": [ "support" ] }, { "type": "string", "enum": [ "other" ] } ] }, "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } }, "default": { "type": "boolean" }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/vendor/{vendorId}/payment-method": { "post": { "summary": "Add a Payment Method to a Vendor", "tags": [ "Vendor" ], "description": "Adds the payment method if auto-approved, otherwise returns an approval request to action it.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH business payment method" }, { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH individual payment method" } ] } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "vendorId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "id", "type", "achPaymentMethodId", "entityType", "accountType", "routingNumber", "accountNumber", "accountName" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "ach" ] }, "achPaymentMethodId": { "type": "string" }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" } }, "title": "Vendor ACH business payment method" }, { "type": "object", "required": [ "id", "type", "achPaymentMethodId", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "ach" ] }, "achPaymentMethodId": { "type": "string" }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" } }, "title": "Vendor ACH individual payment method" } ] } } } }, "202": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "createVendorPaymentMethod", "enum": [ "createVendorPaymentMethod" ] }, "request": { "anyOf": [ { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH business payment method" }, { "type": "object", "required": [ "type", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName", "accountId" ], "properties": { "type": { "type": "string", "enum": [ "ach" ] }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" }, "accountId": { "type": "string", "description": "Dashfi account number (deprecated — will be removed)" } }, "title": "Create request for vendor ACH individual payment method" } ] } } } ], "title": "createVendorPaymentMethod" } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] }, { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidOrganization" ] }, "message": { "type": "string" } }, "title": "invalidOrganization", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "duplicate" ] }, "message": { "type": "string" } }, "title": "duplicate", "description": "A service error has occurred" } ] } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "422": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "declinedByPolicy" ] }, "message": { "type": "string" } }, "title": "declinedByPolicy", "description": "A service error has occurred" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } }, "/v1/web/vendor/{vendorId}/payment-method/{id}": { "delete": { "summary": "Delete a Vendor Payment Method", "tags": [ "Vendor" ], "description": "Removes the payment method if auto-approved, otherwise returns an approval request to action it.", "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "vendorId", "required": true }, { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "id", "type", "achPaymentMethodId", "entityType", "accountType", "routingNumber", "accountNumber", "accountName" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "ach" ] }, "achPaymentMethodId": { "type": "string" }, "entityType": { "type": "string", "enum": [ "business" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" } }, "title": "Vendor ACH business payment method" }, { "type": "object", "required": [ "id", "type", "achPaymentMethodId", "entityType", "accountType", "routingNumber", "accountNumber", "accountName", "accountHolderName" ], "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "ach" ] }, "achPaymentMethodId": { "type": "string" }, "entityType": { "type": "string", "enum": [ "individual" ] }, "accountType": { "anyOf": [ { "type": "string", "enum": [ "checking" ] }, { "type": "string", "enum": [ "saving" ] } ] }, "routingNumber": { "type": "string" }, "accountNumber": { "type": "string" }, "accountName": { "type": "string" }, "accountHolderName": { "type": "string" } }, "title": "Vendor ACH individual payment method" } ] } } } }, "202": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "id", "status", "requesterUserId", "deciders", "observers", "notes", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "externalId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "draft" ] }, { "type": "string", "enum": [ "submitted" ] }, { "type": "string", "enum": [ "approved" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "deleted" ] }, { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "type": "string" }, "deciders": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "observers": { "type": "object", "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } }, "userRoleIds": { "type": "array", "items": { "type": "string" } }, "userTypes": { "type": "array", "items": { "type": "string", "enum": [ "userGroupManager" ] } } } }, "objectId": { "type": "string" }, "notes": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "userId", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "userId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "submittedAt": { "type": "string", "format": "date-time" }, "decidedAt": { "type": "string", "format": "date-time" }, "fulfilledAt": { "type": "string", "format": "date-time" } } }, { "type": "object", "required": [ "type", "request" ], "properties": { "type": { "type": "string", "title": "deleteVendorPaymentMethod", "enum": [ "deleteVendorPaymentMethod" ] }, "request": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } } } } ], "title": "deleteVendorPaymentMethod" } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "description": "A service error has occurred" }, { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "path", "message" ], "properties": { "path": { "type": "string" }, "message": { "type": "string" } } } } } } ] } } } }, "401": { "description": "The access to this resource has been denied", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "unauthorized" ] }, "message": { "type": "string" } }, "title": "unauthorized", "description": "The access to this resource has been denied" } } } }, "403": { "description": "The access to this resource is forbidden", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "forbidden" ] }, "message": { "type": "string" } }, "title": "forbidden", "description": "The access to this resource is forbidden" } } } }, "404": { "description": "The resource was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "notFound" ] }, "message": { "type": "string" } }, "title": "notFound", "description": "The resource was not found" } } } }, "422": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "declinedByPolicy" ] }, "message": { "type": "string" } }, "title": "declinedByPolicy", "description": "A service error has occurred" } } } }, "default": { "description": "Catch-all error response for any unexpected internal errors", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "internal" ] }, "message": { "type": "string", "enum": [ "An unexpected internal error has occurred" ] } }, "title": "internal", "description": "Catch-all error response for any unexpected internal errors" } } } } } } } } }