{ "openapi": "3.1.0", "info": { "title": "Surface Admin API", "version": "20260702.113608", "description": "BFF APIs for the dashfi admin app" }, "components": { "schemas": {} }, "paths": { "/v1/admin/account": { "get": { "summary": "List Core accounts (Net 1 underwriting)", "tags": [ "Account" ], "parameters": [ { "schema": { "type": "string", "format": "uuid" }, "in": "query", "name": "customerId", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "accountType", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "status", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "term", "required": false, "description": "Comma-separated repayment terms to include." }, { "schema": { "type": "string" }, "in": "query", "name": "termExclude", "required": false, "description": "Comma-separated repayment terms to exclude." }, { "schema": { "type": "integer", "minimum": 1 }, "in": "query", "name": "page", "required": false }, { "schema": { "type": "integer", "minimum": 1, "maximum": 200 }, "in": "query", "name": "pageSize", "required": false } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "page", "pageSize", "hasNext" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "coreAccountId", "customerId", "accountType", "status", "statusReason", "term", "displayName", "isPrepaid", "isRewardsAccount", "isFraudulent", "areSettlementsNotConsolidatedForPayments", "mainAccountId", "rewardsAccountId", "businessCountries", "lastTransactionDatetime", "createdAt", "updatedAt", "deletedAt" ], "properties": { "id": { "type": "number" }, "coreAccountId": { "type": "string" }, "customerId": { "type": "string" }, "accountType": { "type": "string" }, "status": { "type": "string" }, "statusReason": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "term": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "displayName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "isPrepaid": { "type": "boolean" }, "isRewardsAccount": { "type": "boolean" }, "isFraudulent": { "type": "boolean" }, "areSettlementsNotConsolidatedForPayments": { "type": "boolean" }, "mainAccountId": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "rewardsAccountId": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "businessCountries": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] }, "lastTransactionDatetime": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "createdAt": { "type": "string" }, "updatedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "deletedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } } }, "page": { "type": "integer" }, "pageSize": { "type": "integer" }, "hasNext": { "type": "boolean" }, "totalItemCount": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } }, "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/account/{accountId}/group-overview": { "get": { "summary": "Get an account group's current limits + term", "tags": [ "Account" ], "parameters": [ { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "accountId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "overallCreditLimit", "availableCreditLimit", "dailySpendLimit", "monthlySpendLimit", "last24HoursSpend", "last30DaysSpend", "nextPaymentAmount", "nextPaymentDate", "groupStatus", "term" ], "properties": { "overallCreditLimit": { "type": "string" }, "availableCreditLimit": { "type": "string" }, "dailySpendLimit": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "monthlySpendLimit": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "last24HoursSpend": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "last30DaysSpend": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "nextPaymentAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "nextPaymentDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "groupStatus": { "type": "string" }, "term": { "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/account/{accountId}/groups": { "get": { "summary": "List an account's groups (resolves groupId + customerNumber)", "tags": [ "Account" ], "parameters": [ { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "accountId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "page", "pageSize", "hasNext" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "accountId", "customerNumber", "childCustomerNumber", "creditLimit", "defaultCardProfileIds", "status", "hasLegacyAccount", "createdAt", "updatedAt", "deletedAt" ], "properties": { "id": { "type": "string" }, "accountId": { "type": "number" }, "customerNumber": { "type": "string" }, "childCustomerNumber": { "type": "string" }, "creditLimit": { "type": "string" }, "defaultCardProfileIds": { "type": "string" }, "status": { "type": "string" }, "hasLegacyAccount": { "type": "boolean" }, "createdAt": { "type": "string" }, "updatedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "deletedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } } }, "page": { "type": "integer" }, "pageSize": { "type": "integer" }, "hasNext": { "type": "boolean" }, "totalItemCount": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } }, "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/account/group-credit-limit": { "put": { "summary": "Set a group/customer credit limit (pushes to E6)", "tags": [ "Account" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "customerNumber", "creditLimit" ], "properties": { "customerNumber": { "type": "string", "minLength": 1, "description": "E6 customer number of the customer account group." }, "creditLimit": { "type": "integer", "minimum": 0, "description": "Credit limit to set for the customer account group." } } } } } }, "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/account/group/{groupId}/control": { "post": { "summary": "Set a group-level spend control (daily/monthly)", "tags": [ "Account" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "type", "value", "releaseTime" ], "properties": { "type": { "type": "string", "description": "E6 group control type, e.g. purchase_1d." }, "value": { "type": "integer", "minimum": 0, "description": "Control value." }, "releaseTime": { "type": "integer", "description": "Control release time (unix timestamp, milliseconds)." } } } } } }, "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "groupId", "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/account/{accountId}/term": { "post": { "summary": "Update an account's repayment term", "tags": [ "Account" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "term" ], "properties": { "term": { "type": "string", "description": "Repayment term, e.g. net-1..net-90." } } } } } }, "parameters": [ { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "accountId", "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/application": { "get": { "summary": "List Core application-approval applications", "tags": [ "Application" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "status", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "type", "required": false }, { "schema": { "type": "integer", "minimum": 1 }, "in": "query", "name": "companyId", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "nameLike", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "submittedAtSince", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "submittedAtBefore", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "approvedAtSince", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "approvedAtBefore", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "rejectedAtSince", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "rejectedAtBefore", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "createdAtSince", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "createdAtBefore", "required": false }, { "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", "page", "pageSize", "hasNext" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "accountId", "companyId", "companyLegalName", "doingBusinessAs", "status", "type", "createdAt", "submittedAt", "approvedAt", "rejectedAt" ], "properties": { "id": { "type": "number" }, "accountId": { "type": "number" }, "companyId": { "type": "number" }, "companyLegalName": { "type": "string" }, "doingBusinessAs": { "type": "string" }, "status": { "type": "string" }, "type": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "submittedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "approvedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "rejectedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] } } } }, "page": { "type": "integer" }, "pageSize": { "type": "integer" }, "hasNext": { "type": "boolean" }, "totalItemCount": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } }, "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/application/{applicationId}": { "get": { "summary": "Get a Core application-approval application by ID", "tags": [ "Application" ], "parameters": [ { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "applicationId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "accountId", "companyId", "companyLegalName", "doingBusinessAs", "status", "type", "createdAt", "submittedAt", "approvedAt", "rejectedAt" ], "properties": { "id": { "type": "number" }, "accountId": { "type": "number" }, "companyId": { "type": "number" }, "companyLegalName": { "type": "string" }, "doingBusinessAs": { "type": "string" }, "status": { "type": "string" }, "type": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "submittedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "approvedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "rejectedAt": { "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/application/{applicationId}/onboarding-data": { "get": { "summary": "Get the rich application-detail (onboarding) payload", "tags": [ "Application" ], "parameters": [ { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "applicationId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "accountId", "companyId", "status", "type", "hasConsented", "spendingRange", "nonAdSpendingRange", "isApproved", "isRejected", "isSubmitted", "firstAccess", "beneficialOwnersConfirmed", "applicationSteps", "submittedAt", "approvedAt", "rejectedAt", "createdAt", "business" ], "properties": { "id": { "type": "integer" }, "accountId": { "type": "integer" }, "companyId": { "type": "integer" }, "status": { "type": "string" }, "type": { "type": "string" }, "hasConsented": { "type": "boolean" }, "spendingRange": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "nonAdSpendingRange": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "isApproved": { "type": "boolean" }, "isRejected": { "type": "boolean" }, "isSubmitted": { "type": "boolean" }, "firstAccess": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "beneficialOwnersConfirmed": { "type": "boolean" }, "applicationSteps": { "type": "object", "required": [ "beneficiaries", "bankDetails", "controllingOfficer", "uploadedDocuments" ], "properties": { "beneficiaries": { "type": "string" }, "bankDetails": { "type": "string" }, "controllingOfficer": { "type": "string" }, "uploadedDocuments": { "type": "string" } } }, "submittedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "approvedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rejectedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "createdAt": { "type": "string" }, "business": { "type": "object", "required": [ "company", "administrator", "controllingOfficer", "beneficiaries", "fundingSource" ], "properties": { "company": { "type": "object", "required": [ "id", "legalName", "doingBusinessAs", "ein", "businessType", "incorporationMonth", "incorporationYear", "incorporationState", "naicsCode", "naicsCategory", "naicsSubcategory", "email", "phone", "website", "address", "suite", "city", "state", "zip", "country", "shortDescription", "industry" ], "properties": { "id": { "type": "integer" }, "legalName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "doingBusinessAs": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "ein": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "businessType": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "incorporationMonth": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "incorporationYear": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "incorporationState": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "naicsCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "naicsCategory": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "naicsSubcategory": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "email": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "phone": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "website": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "address": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "suite": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "city": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "state": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "zip": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "country": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "shortDescription": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "industry": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } }, "administrator": { "type": "object", "required": [ "id", "firstName", "lastName", "email", "isAdmin", "stake", "shareableLink", "kycStatus", "plaidIdentityVerificationId" ], "properties": { "id": { "type": "integer" }, "firstName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lastName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "email": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "isAdmin": { "type": "boolean" }, "stake": { "type": "string" }, "shareableLink": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "kycStatus": { "type": "string" }, "plaidIdentityVerificationId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } }, "controllingOfficer": { "type": "object", "required": [ "id", "firstName", "lastName", "email", "isAdmin", "stake", "shareableLink", "kycStatus", "plaidIdentityVerificationId" ], "properties": { "id": { "type": "integer" }, "firstName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lastName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "email": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "isAdmin": { "type": "boolean" }, "stake": { "type": "string" }, "shareableLink": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "kycStatus": { "type": "string" }, "plaidIdentityVerificationId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } }, "beneficiaries": { "type": "array", "items": { "type": "object", "required": [ "id", "firstName", "lastName", "email", "isAdmin", "stake", "shareableLink", "kycStatus", "plaidIdentityVerificationId" ], "properties": { "id": { "type": "integer" }, "firstName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lastName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "email": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "isAdmin": { "type": "boolean" }, "stake": { "type": "string" }, "shareableLink": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "kycStatus": { "type": "string" }, "plaidIdentityVerificationId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } } }, "fundingSource": { "anyOf": [ { "type": "object", "required": [ "id", "brokenLink", "plaidInstitutionName", "plaidLastFour", "plaidName", "plaidOfficialName", "verificationStatus", "isRepairable" ], "properties": { "id": { "type": "integer" }, "brokenLink": { "type": "boolean" }, "plaidInstitutionName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "plaidLastFour": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "plaidName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "plaidOfficialName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "verificationStatus": { "type": "string" }, "isRepairable": { "type": "boolean" } } }, { "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/application/{applicationId}/approve": { "post": { "summary": "Approve a Core application-approval application", "tags": [ "Application" ], "description": "Triggers Core's approval orchestration (E6 enrolment, rewards provisioning, `application-approved` event). Idempotent: an already-approved application returns 204.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "accountTerm", "defaultCardProfileIds", "isPrepaid" ], "properties": { "accountTerm": { "type": "string" }, "defaultCardProfileIds": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, "isPrepaid": { "type": "boolean" } } } } } }, "parameters": [ { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "applicationId", "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/application/{applicationId}/reject": { "post": { "summary": "Reject a Core application-approval application", "tags": [ "Application" ], "description": "Marks the application rejected and publishes `application-rejected`. An already-rejected application returns 400 (mapped to invalidRequest).", "parameters": [ { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "applicationId", "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/account/{accountId}/card-transaction": { "get": { "summary": "List Core card transactions for a Dash.fi account", "tags": [ "CardTransaction" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "cardholderId", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "cardId", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "descriptor", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "Comma-separated list of transaction statuses. Allowed values: pending, declined, settled, released." }, { "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": "integer", "minimum": 1 }, "in": "path", "name": "accountId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "page", "pageSize", "hasNext" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "status", "clientId", "cardId", "cardName", "cardLastFour", "cardProfileRepaymentSchedule", "billingAmountDirection", "billingCurrencyCode", "pendingBillingAmount", "pendingBillingDecimalAmount", "settledBillingAmount", "settledBillingDecimalAmount", "merchant", "merchantDetails", "issues", "createdAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "settled" ] }, { "type": "string", "enum": [ "released" ] } ] }, "clientId": { "type": "string" }, "cardId": { "type": "string" }, "cardName": { "type": "string" }, "cardLastFour": { "type": "string" }, "cardProfileRepaymentSchedule": { "anyOf": [ { "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" ] } ] }, "billingAmountDirection": { "anyOf": [ { "type": "string", "enum": [ "debit" ] }, { "type": "string", "enum": [ "credit" ] } ] }, "billingCurrencyCode": { "type": "string" }, "pendingBillingAmount": { "type": "number" }, "pendingBillingDecimalAmount": { "type": "string" }, "settledBillingAmount": { "type": "number" }, "settledBillingDecimalAmount": { "type": "string" }, "merchant": { "type": "object", "properties": { "name": { "type": "string" }, "logoUrl": { "type": "string" }, "websiteUrl": { "type": "string" }, "confidence": { "type": "string" } } }, "merchantDetails": { "type": "object", "properties": { "acceptorId": { "type": "string" }, "categoryCode": { "type": "string" }, "name": { "type": "string" }, "streetAddress": { "type": "string" }, "city": { "type": "string" }, "countrySubdivisionCode": { "type": "string" }, "countryCode": { "type": "string" }, "postalCode": { "type": "string" }, "taxId": { "type": "string" }, "customerServicePhoneNumber": { "type": "string" }, "url": { "type": "string" } } }, "issues": { "type": "array", "items": { "type": "object", "properties": { "origin": { "type": "string" }, "reason": { "type": "string" }, "severity": { "type": "string" } } } }, "details": { "type": "string" }, "error": { "type": "string" }, "externalTransactionId": { "type": "string" }, "externalCreatedAt": { "type": "string", "format": "date-time" }, "createdAt": { "type": "string", "format": "date-time" } } } }, "page": { "type": "integer" }, "pageSize": { "type": "integer" }, "hasNext": { "type": "boolean" }, "totalItemCount": { "type": "integer" }, "totalSpendAmount": { "type": "number" } } } } } }, "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/card-transaction/{transactionId}": { "get": { "summary": "Get a Core card transaction by ID", "tags": [ "CardTransaction" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "transactionId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "clientId", "cardId", "cardName", "cardLastFour", "cardProfileRepaymentSchedule", "billingAmountDirection", "billingCurrencyCode", "pendingBillingAmount", "pendingBillingDecimalAmount", "settledBillingAmount", "settledBillingDecimalAmount", "merchant", "merchantDetails", "issues", "createdAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "declined" ] }, { "type": "string", "enum": [ "settled" ] }, { "type": "string", "enum": [ "released" ] } ] }, "clientId": { "type": "string" }, "cardId": { "type": "string" }, "cardName": { "type": "string" }, "cardLastFour": { "type": "string" }, "cardProfileRepaymentSchedule": { "anyOf": [ { "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" ] } ] }, "billingAmountDirection": { "anyOf": [ { "type": "string", "enum": [ "debit" ] }, { "type": "string", "enum": [ "credit" ] } ] }, "billingCurrencyCode": { "type": "string" }, "pendingBillingAmount": { "type": "number" }, "pendingBillingDecimalAmount": { "type": "string" }, "settledBillingAmount": { "type": "number" }, "settledBillingDecimalAmount": { "type": "string" }, "merchant": { "type": "object", "properties": { "name": { "type": "string" }, "logoUrl": { "type": "string" }, "websiteUrl": { "type": "string" }, "confidence": { "type": "string" } } }, "merchantDetails": { "type": "object", "properties": { "acceptorId": { "type": "string" }, "categoryCode": { "type": "string" }, "name": { "type": "string" }, "streetAddress": { "type": "string" }, "city": { "type": "string" }, "countrySubdivisionCode": { "type": "string" }, "countryCode": { "type": "string" }, "postalCode": { "type": "string" }, "taxId": { "type": "string" }, "customerServicePhoneNumber": { "type": "string" }, "url": { "type": "string" } } }, "issues": { "type": "array", "items": { "type": "object", "properties": { "origin": { "type": "string" }, "reason": { "type": "string" }, "severity": { "type": "string" } } } }, "details": { "type": "string" }, "error": { "type": "string" }, "externalTransactionId": { "type": "string" }, "externalCreatedAt": { "type": "string", "format": "date-time" }, "createdAt": { "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/card-profiles": { "get": { "summary": "List Core card profiles (approve-screen picker source)", "tags": [ "Card" ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "processorId", "cardType", "isActive", "tags" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "processorId": { "type": "string" }, "cardType": { "type": "string" }, "isActive": { "type": "boolean" }, "tags": { "type": "array", "items": { "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/account/{accountId}/card": { "get": { "summary": "List Core cards for a Dash.fi account", "tags": [ "Card" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "Comma-separated list of card statuses. Allowed values: created, shipped, active, frozen, archived." }, { "schema": { "type": "string", "minLength": 4, "maxLength": 4 }, "in": "query", "name": "lastFour", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "name", "required": false }, { "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": "integer", "minimum": 1 }, "in": "path", "name": "accountId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "page", "pageSize", "hasNext" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "accountId", "cardholderId", "cardProfileId", "embossedName", "name", "lastFour", "status", "statusReason", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "accountId": { "type": "number" }, "cardholderId": { "type": "string" }, "cardProfileId": { "type": "string" }, "embossedName": { "type": "string" }, "name": { "type": "string" }, "lastFour": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "created" ] }, { "type": "string", "enum": [ "shipped" ] }, { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "frozen" ] }, { "type": "string", "enum": [ "archived" ] } ] }, "statusReason": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "page": { "type": "integer" }, "pageSize": { "type": "integer" }, "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" } } } }, "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/account/{accountId}/fee-definitions": { "get": { "summary": "List Core fee definitions for a Dash.fi account", "tags": [ "Fee" ], "parameters": [ { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "accountId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "clientId", "feeType", "feeValue", "valueType", "feeFrequency" ], "properties": { "id": { "type": "string" }, "clientId": { "type": "string" }, "feeType": { "anyOf": [ { "type": "string", "enum": [ "account-fee" ] }, { "type": "string", "enum": [ "late-payment-fee" ] }, { "type": "string", "enum": [ "failed-payment-fee" ] }, { "type": "string", "enum": [ "dispute-fee" ] }, { "type": "string", "enum": [ "net-3-term-fee" ] }, { "type": "string", "enum": [ "net-7-term-fee" ] }, { "type": "string", "enum": [ "net-15-term-fee" ] }, { "type": "string", "enum": [ "net-20-term-fee" ] }, { "type": "string", "enum": [ "net-30-term-fee" ] }, { "type": "string", "enum": [ "net-45-term-fee" ] }, { "type": "string", "enum": [ "net-60-term-fee" ] }, { "type": "string", "enum": [ "net-90-term-fee" ] }, { "type": "string", "enum": [ "net-30-ca-fee" ] }, { "type": "string", "enum": [ "net-60-ca-fee" ] }, { "type": "string", "enum": [ "net-90-ca-fee" ] } ] }, "feeValue": { "type": "number", "minimum": 0 }, "valueType": { "anyOf": [ { "type": "string", "enum": [ "constant" ] }, { "type": "string", "enum": [ "percentage" ] } ] }, "feeFrequency": { "anyOf": [ { "type": "string", "enum": [ "annual" ] }, { "type": "string", "enum": [ "non-periodical" ] } ] } } } } } } } } }, "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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" } } } } } }, "put": { "summary": "Create or update a Core fee definition for a Dash.fi account", "tags": [ "Fee" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "feeType", "feeValue", "valueType", "feeFrequency" ], "properties": { "feeType": { "anyOf": [ { "type": "string", "enum": [ "account-fee" ] }, { "type": "string", "enum": [ "late-payment-fee" ] }, { "type": "string", "enum": [ "failed-payment-fee" ] }, { "type": "string", "enum": [ "dispute-fee" ] }, { "type": "string", "enum": [ "net-3-term-fee" ] }, { "type": "string", "enum": [ "net-7-term-fee" ] }, { "type": "string", "enum": [ "net-15-term-fee" ] }, { "type": "string", "enum": [ "net-20-term-fee" ] }, { "type": "string", "enum": [ "net-30-term-fee" ] }, { "type": "string", "enum": [ "net-45-term-fee" ] }, { "type": "string", "enum": [ "net-60-term-fee" ] }, { "type": "string", "enum": [ "net-90-term-fee" ] }, { "type": "string", "enum": [ "net-30-ca-fee" ] }, { "type": "string", "enum": [ "net-60-ca-fee" ] }, { "type": "string", "enum": [ "net-90-ca-fee" ] } ] }, "feeValue": { "type": "number", "minimum": 0 }, "valueType": { "anyOf": [ { "type": "string", "enum": [ "constant" ] }, { "type": "string", "enum": [ "percentage" ] } ] }, "feeFrequency": { "anyOf": [ { "type": "string", "enum": [ "annual" ] }, { "type": "string", "enum": [ "non-periodical" ] } ] } } } } } }, "parameters": [ { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "accountId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "clientId", "feeType", "feeValue", "valueType", "feeFrequency" ], "properties": { "id": { "type": "string" }, "clientId": { "type": "string" }, "feeType": { "anyOf": [ { "type": "string", "enum": [ "account-fee" ] }, { "type": "string", "enum": [ "late-payment-fee" ] }, { "type": "string", "enum": [ "failed-payment-fee" ] }, { "type": "string", "enum": [ "dispute-fee" ] }, { "type": "string", "enum": [ "net-3-term-fee" ] }, { "type": "string", "enum": [ "net-7-term-fee" ] }, { "type": "string", "enum": [ "net-15-term-fee" ] }, { "type": "string", "enum": [ "net-20-term-fee" ] }, { "type": "string", "enum": [ "net-30-term-fee" ] }, { "type": "string", "enum": [ "net-45-term-fee" ] }, { "type": "string", "enum": [ "net-60-term-fee" ] }, { "type": "string", "enum": [ "net-90-term-fee" ] }, { "type": "string", "enum": [ "net-30-ca-fee" ] }, { "type": "string", "enum": [ "net-60-ca-fee" ] }, { "type": "string", "enum": [ "net-90-ca-fee" ] } ] }, "feeValue": { "type": "number", "minimum": 0 }, "valueType": { "anyOf": [ { "type": "string", "enum": [ "constant" ] }, { "type": "string", "enum": [ "percentage" ] } ] }, "feeFrequency": { "anyOf": [ { "type": "string", "enum": [ "annual" ] }, { "type": "string", "enum": [ "non-periodical" ] } ] } } } } } }, "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/account/{accountId}/fee-definitions/{id}": { "delete": { "summary": "Delete a Core fee definition for a Dash.fi account", "tags": [ "Fee" ], "parameters": [ { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "accountId", "required": true }, { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "ok" ], "properties": { "ok": { "type": "boolean", "enum": [ true ] } } } } } }, "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/account/{accountId}/financial-accounts": { "get": { "summary": "List a client's Plaid funding accounts (proxied via Core)", "tags": [ "Account" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "connectionType", "required": false }, { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "accountId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "accountHolderName", "lastFour", "type", "subtype", "connectionType", "isDefault", "activeConnection", "brokenLink", "isRepairable", "verificationStatus", "connectedToPlaid", "cfxConsentedAt", "plaidInstitutionId", "plaidInstitutionName", "plaidName", "plaidOfficialName", "plaidLastFour", "currentBalance" ], "properties": { "id": { "type": "integer" }, "accountHolderName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lastFour": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "type": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "subtype": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "connectionType": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "isDefault": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] }, "activeConnection": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] }, "brokenLink": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] }, "isRepairable": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] }, "verificationStatus": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "connectedToPlaid": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] }, "cfxConsentedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "plaidInstitutionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "plaidInstitutionName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "plaidName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "plaidOfficialName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "plaidLastFour": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currentBalance": { "anyOf": [ { "type": "string" }, { "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/account/{accountId}/financial-accounts/{financialAccountId}/sync-balance": { "post": { "summary": "Refresh + persist a funding account's balance (via Core)", "tags": [ "Account" ], "parameters": [ { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "accountId", "required": true }, { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "financialAccountId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "balance", "date" ], "properties": { "balance": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "date": { "anyOf": [ { "type": "string" }, { "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/account/{accountId}/financial-accounts/{financialAccountId}/balances": { "get": { "summary": "Persisted balance history for a funding account (via Core)", "tags": [ "Account" ], "parameters": [ { "schema": { "type": "string", "format": "date" }, "in": "query", "name": "startDate", "required": false }, { "schema": { "type": "string", "format": "date" }, "in": "query", "name": "endDate", "required": false }, { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "accountId", "required": true }, { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "financialAccountId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "balance", "date" ], "properties": { "balance": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "date": { "anyOf": [ { "type": "string" }, { "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/application/{applicationId}/financial-assessment": { "get": { "summary": "Get Heron financial-assessment data for an application (Net 1 underwriting)", "tags": [ "Application" ], "parameters": [ { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "applicationId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "endUserId", "heronId", "name", "status", "confidence", "lastProcessedAt", "lastUpdated", "profitAndLossLayoutAvailable", "accountAnomalies", "metrics" ], "properties": { "endUserId": { "type": "string" }, "heronId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "status": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "confidence": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "lastProcessedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lastUpdated": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "profitAndLossLayoutAvailable": { "type": "boolean" }, "accountAnomalies": { "type": "array", "items": { "type": "object", "required": [ "accountId", "heronId", "institutionName", "accountName", "anomalyScore" ], "properties": { "accountId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "heronId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "institutionName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "accountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "anomalyScore": { "anyOf": [ { "type": "number" }, { "type": "null" } ] } } } }, "metrics": { "type": "array", "items": { "type": "object", "required": [ "group", "label", "dateRange", "value", "unit", "status" ], "properties": { "group": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "label": { "type": "string" }, "dateRange": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "value": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "unit": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "status": { "anyOf": [ { "type": "string" }, { "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/application/{applicationId}/financial-documents": { "get": { "summary": "List the source documents (bank statements) Heron ingested for an application", "tags": [ "Application" ], "parameters": [ { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "applicationId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "heronId", "filename", "fileClass", "numPages", "status", "createdAt" ], "properties": { "heronId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "filename": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "fileClass": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "numPages": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "status": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "createdAt": { "anyOf": [ { "type": "string" }, { "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/application/{applicationId}/financial-documents/{fileId}/content": { "get": { "summary": "Fetch a single Heron document's content (base64) for view/download", "tags": [ "Application" ], "parameters": [ { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "applicationId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "fileId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "fileB64", "mimeType" ], "properties": { "fileB64": { "type": "string" }, "mimeType": { "anyOf": [ { "type": "string" }, { "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/application/{applicationId}/kyb": { "get": { "summary": "Get Middesk KYB results for an application", "tags": [ "Application" ], "parameters": [ { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "applicationId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "middeskId", "name", "status", "website", "createdAt", "updatedAt", "review", "tin", "formation", "watchlist", "industryClassification", "addresses", "names", "people", "registrations", "bankruptcyCount" ], "properties": { "middeskId": { "type": "string" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "status": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "website": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "createdAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "updatedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "review": { "anyOf": [ { "type": "object", "required": [ "completedAt", "tasks" ], "properties": { "completedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "tasks": { "type": "array", "items": { "type": "object", "required": [ "category", "key", "label", "message", "name", "status", "subLabel" ], "properties": { "category": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "key": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "label": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "message": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "status": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "subLabel": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } } } } }, { "type": "null" } ] }, "tin": { "anyOf": [ { "type": "object", "required": [ "name", "verified", "mismatch", "unknown", "issued" ], "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "verified": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] }, "mismatch": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] }, "unknown": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] }, "issued": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] } } }, { "type": "null" } ] }, "formation": { "anyOf": [ { "type": "object", "required": [ "entityType", "formationDate", "formationState" ], "properties": { "entityType": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "formationDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "formationState": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } }, { "type": "null" } ] }, "watchlist": { "anyOf": [ { "type": "object", "required": [ "hitCount" ], "properties": { "hitCount": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] } } }, { "type": "null" } ] }, "industryClassification": { "anyOf": [ { "type": "object", "required": [ "status", "categories" ], "properties": { "status": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "categories": { "type": "array", "items": { "type": "object", "required": [ "classificationSystem", "name", "category", "score", "highRisk" ], "properties": { "classificationSystem": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "category": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "score": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "highRisk": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] } } } } } }, { "type": "null" } ] }, "addresses": { "type": "array", "items": { "type": "object", "required": [ "addressLine1", "addressLine2", "city", "state", "postalCode", "fullAddress", "propertyType", "deliverable", "submitted" ], "properties": { "addressLine1": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "addressLine2": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "city": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "state": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "postalCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "fullAddress": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "propertyType": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "deliverable": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] }, "submitted": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] } } } }, "names": { "type": "array", "items": { "type": "object", "required": [ "name", "type", "submitted" ], "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "type": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "submitted": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] } } } }, "people": { "type": "array", "items": { "type": "object", "required": [ "name", "titles", "submitted" ], "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "titles": { "type": "array", "items": { "type": "string" } }, "submitted": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] } } } }, "registrations": { "type": "array", "items": { "type": "object", "required": [ "name", "status", "subStatus", "jurisdiction", "entityType", "state", "fileNumber", "registrationDate" ], "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "status": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "subStatus": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "jurisdiction": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "entityType": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "state": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "fileNumber": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "registrationDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } } }, "bankruptcyCount": { "type": "integer" } } } } } }, "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/application/{applicationId}/kyb-documents": { "get": { "summary": "List the Middesk source documents (SOS/formation filings) for an application", "tags": [ "Application" ], "parameters": [ { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "applicationId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "documentType", "filename", "contentType", "size", "filingDate", "createdAt" ], "properties": { "id": { "type": "string" }, "documentType": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "filename": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "contentType": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "size": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "filingDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "createdAt": { "anyOf": [ { "type": "string" }, { "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/application/{applicationId}/kyb-documents/{documentId}/content": { "get": { "summary": "Fetch a single Middesk document's content (base64) for view/download", "tags": [ "Application" ], "parameters": [ { "schema": { "type": "integer", "minimum": 1 }, "in": "path", "name": "applicationId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "documentId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "fileB64", "mimeType" ], "properties": { "fileB64": { "type": "string" }, "mimeType": { "anyOf": [ { "type": "string" }, { "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "413": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "payloadTooLarge" ] }, "message": { "type": "string" } }, "title": "payloadTooLarge", "description": "A service error has occurred" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/customer/{customerId}/user-group": { "get": { "summary": "List customer user groups / teams (admin)", "tags": [ "UserGroup" ], "parameters": [ { "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": 200, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "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", "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/admin/customer/{customerId}/user": { "get": { "summary": "List customer users (admin)", "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": "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", "minLength": 1 }, "in": "path", "name": "customerId", "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", "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/admin/customer/{customerId}/user/{id}": { "get": { "summary": "Get a customer user by ID (admin, expanded)", "tags": [ "User" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "name", "email", "legacyAppdashId", "legacyCoreId", "createdAt", "updatedAt", "emailVerified", "phoneVerified", "mfaEnrolled", "roles" ], "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" }, "emailVerified": { "type": "boolean" }, "phone": { "type": "string" }, "phoneVerified": { "type": "boolean" }, "mfaEnrolled": { "type": "boolean" }, "defaultMfaMethod": { "anyOf": [ { "type": "string", "enum": [ "smsOtp" ] }, { "type": "string", "enum": [ "totp" ] }, { "type": "null" } ] }, "roles": { "type": "array", "items": { "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" } } } } } }, "patch": { "summary": "Update a customer user's name (admin; cascades Core + Surface + Stytch)", "tags": [ "User" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "object", "required": [ "firstName", "lastName" ], "properties": { "firstName": { "type": "string" }, "middleName": { "type": "string" }, "lastName": { "type": "string" } } } } } } } }, "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "status", "systems" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "success" ] }, { "type": "string", "enum": [ "partialFailure" ] } ] }, "systems": { "type": "object", "required": [ "core", "surface", "stytch" ], "properties": { "core": { "anyOf": [ { "type": "string", "enum": [ "ok" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "skipped" ] } ] }, "surface": { "anyOf": [ { "type": "string", "enum": [ "ok" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "skipped" ] } ] }, "stytch": { "anyOf": [ { "type": "string", "enum": [ "ok" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "skipped" ] } ] } } } } } } } }, "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/customer/{customerId}/user/{id}/reset-password": { "post": { "summary": "Initiate a Stytch password reset for a customer user (admin)", "tags": [ "User" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "id", "required": true } ], "responses": { "204": { "description": "Default Response" }, "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/admin/customer/{customerId}/user/{id}/reset-mfa": { "post": { "summary": "Reset a customer user's MFA so they must re-enroll at next login (admin)", "tags": [ "User" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "id", "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/customer/{customerId}/user/{id}/resend-invite": { "post": { "summary": "Re-send a customer user's Stytch invite magic link (admin)", "tags": [ "User" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "id", "required": true } ], "responses": { "204": { "description": "Default Response" }, "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/admin/ai-spend/review": { "get": { "summary": "Pending AI-audit findings across all customers (admin only)", "tags": [ "AiSpend" ], "parameters": [ { "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 }, "in": "query", "name": "limit", "required": false }, { "schema": { "anyOf": [ { "type": "string", "enum": [ "refund_eligible" ] }, { "type": "string", "enum": [ "savings_opportunity" ] }, { "type": "string", "enum": [ "advisory" ] } ] }, "in": "query", "name": "category", "required": false } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "findings", "totalCount" ], "properties": { "findings": { "type": "array", "items": { "type": "object", "required": [ "id", "customerId", "customerName", "ruleId", "title", "severity", "status", "userId", "sessionId", "estimatedDollarImpactUsd", "priceSourceVersion", "humanExplanation", "evidence", "confidence", "category", "reviewedBy", "reviewedAt", "reviewerNotes", "resolutionStatus", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "customerId": { "type": "string" }, "customerName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "ruleId": { "type": "string" }, "title": { "type": "string" }, "severity": { "anyOf": [ { "type": "string", "enum": [ "low" ] }, { "type": "string", "enum": [ "medium" ] }, { "type": "string", "enum": [ "high" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending_review" ] }, { "type": "string", "enum": [ "accepted" ] }, { "type": "string", "enum": [ "rejected" ] } ] }, "userId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "sessionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "estimatedDollarImpactUsd": { "type": "number" }, "priceSourceVersion": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "humanExplanation": { "type": "string" }, "evidence": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": true }, { "type": "null" } ] }, "confidence": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "category": { "anyOf": [ { "anyOf": [ { "type": "string", "enum": [ "refund_eligible" ] }, { "type": "string", "enum": [ "savings_opportunity" ] }, { "type": "string", "enum": [ "advisory" ] } ] }, { "type": "null" } ] }, "reviewedBy": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "reviewedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "reviewerNotes": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "resolutionStatus": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "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/admin/ai-spend/business-summary": { "get": { "summary": "Per-customer AI-spend rollup across enabled customers (admin only)", "tags": [ "AiSpend" ], "parameters": [ { "schema": { "type": "integer", "minimum": 1, "maximum": 365, "default": 90 }, "in": "query", "name": "days", "required": false } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "customers", "windowDays" ], "properties": { "customers": { "type": "array", "items": { "type": "object", "required": [ "customerId", "customerName", "providersConnected", "totalSpendUsd", "totalFindings", "totalImpactUsd", "highSeverityCount", "mediumSeverityCount", "lowSeverityCount", "lastSyncAt" ], "properties": { "customerId": { "type": "string" }, "customerName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "providersConnected": { "type": "array", "items": { "type": "string" } }, "totalSpendUsd": { "type": "number" }, "totalFindings": { "type": "number" }, "totalImpactUsd": { "type": "number" }, "highSeverityCount": { "type": "number" }, "mediumSeverityCount": { "type": "number" }, "lowSeverityCount": { "type": "number" }, "lastSyncAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] } } } }, "windowDays": { "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/admin/customer/{customerId}/ai-spend/finding": { "get": { "summary": "Staff full-fidelity findings for a customer (admin only)", "tags": [ "AiSpend" ], "parameters": [ { "schema": { "anyOf": [ { "type": "string", "enum": [ "pending_review" ] }, { "type": "string", "enum": [ "accepted" ] }, { "type": "string", "enum": [ "rejected" ] }, { "type": "string", "enum": [ "all" ] } ] }, "in": "query", "name": "status", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "ruleId", "required": false }, { "schema": { "anyOf": [ { "type": "string", "enum": [ "low" ] }, { "type": "string", "enum": [ "medium" ] }, { "type": "string", "enum": [ "high" ] } ] }, "in": "query", "name": "severity", "required": false }, { "schema": { "anyOf": [ { "type": "string", "enum": [ "refund_eligible" ] }, { "type": "string", "enum": [ "savings_opportunity" ] }, { "type": "string", "enum": [ "advisory" ] } ] }, "in": "query", "name": "category", "required": false }, { "schema": { "type": "integer", "minimum": 1, "maximum": 500, "default": 50 }, "in": "query", "name": "limit", "required": false }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "findings", "totalCount" ], "properties": { "findings": { "type": "array", "items": { "type": "object", "required": [ "id", "customerId", "customerName", "ruleId", "title", "severity", "status", "userId", "sessionId", "estimatedDollarImpactUsd", "priceSourceVersion", "humanExplanation", "evidence", "confidence", "category", "reviewedBy", "reviewedAt", "reviewerNotes", "resolutionStatus", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "customerId": { "type": "string" }, "customerName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "ruleId": { "type": "string" }, "title": { "type": "string" }, "severity": { "anyOf": [ { "type": "string", "enum": [ "low" ] }, { "type": "string", "enum": [ "medium" ] }, { "type": "string", "enum": [ "high" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending_review" ] }, { "type": "string", "enum": [ "accepted" ] }, { "type": "string", "enum": [ "rejected" ] } ] }, "userId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "sessionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "estimatedDollarImpactUsd": { "type": "number" }, "priceSourceVersion": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "humanExplanation": { "type": "string" }, "evidence": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": true }, { "type": "null" } ] }, "confidence": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "category": { "anyOf": [ { "anyOf": [ { "type": "string", "enum": [ "refund_eligible" ] }, { "type": "string", "enum": [ "savings_opportunity" ] }, { "type": "string", "enum": [ "advisory" ] } ] }, { "type": "null" } ] }, "reviewedBy": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "reviewedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "reviewerNotes": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "resolutionStatus": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "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/admin/ai-spend/finding/{findingId}/accept": { "post": { "summary": "Accept a pending AI-audit finding (admin only)", "tags": [ "AiSpend" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "notes": { "type": "string" } } } } } }, "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "findingId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "customerId", "customerName", "ruleId", "title", "severity", "status", "userId", "sessionId", "estimatedDollarImpactUsd", "priceSourceVersion", "humanExplanation", "evidence", "confidence", "category", "reviewedBy", "reviewedAt", "reviewerNotes", "resolutionStatus", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "customerId": { "type": "string" }, "customerName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "ruleId": { "type": "string" }, "title": { "type": "string" }, "severity": { "anyOf": [ { "type": "string", "enum": [ "low" ] }, { "type": "string", "enum": [ "medium" ] }, { "type": "string", "enum": [ "high" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending_review" ] }, { "type": "string", "enum": [ "accepted" ] }, { "type": "string", "enum": [ "rejected" ] } ] }, "userId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "sessionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "estimatedDollarImpactUsd": { "type": "number" }, "priceSourceVersion": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "humanExplanation": { "type": "string" }, "evidence": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": true }, { "type": "null" } ] }, "confidence": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "category": { "anyOf": [ { "anyOf": [ { "type": "string", "enum": [ "refund_eligible" ] }, { "type": "string", "enum": [ "savings_opportunity" ] }, { "type": "string", "enum": [ "advisory" ] } ] }, { "type": "null" } ] }, "reviewedBy": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "reviewedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "reviewerNotes": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "resolutionStatus": { "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" } } } }, "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" } } } }, "409": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "conflict" ] }, "message": { "type": "string" } }, "title": "conflict", "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/admin/ai-spend/finding/{findingId}/reject": { "post": { "summary": "Reject a pending AI-audit finding (admin only)", "tags": [ "AiSpend" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "reason" ], "properties": { "reason": { "type": "string", "minLength": 1 } } } } } }, "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "findingId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "customerId", "customerName", "ruleId", "title", "severity", "status", "userId", "sessionId", "estimatedDollarImpactUsd", "priceSourceVersion", "humanExplanation", "evidence", "confidence", "category", "reviewedBy", "reviewedAt", "reviewerNotes", "resolutionStatus", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "customerId": { "type": "string" }, "customerName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "ruleId": { "type": "string" }, "title": { "type": "string" }, "severity": { "anyOf": [ { "type": "string", "enum": [ "low" ] }, { "type": "string", "enum": [ "medium" ] }, { "type": "string", "enum": [ "high" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending_review" ] }, { "type": "string", "enum": [ "accepted" ] }, { "type": "string", "enum": [ "rejected" ] } ] }, "userId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "sessionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "estimatedDollarImpactUsd": { "type": "number" }, "priceSourceVersion": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "humanExplanation": { "type": "string" }, "evidence": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": true }, { "type": "null" } ] }, "confidence": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "category": { "anyOf": [ { "anyOf": [ { "type": "string", "enum": [ "refund_eligible" ] }, { "type": "string", "enum": [ "savings_opportunity" ] }, { "type": "string", "enum": [ "advisory" ] } ] }, { "type": "null" } ] }, "reviewedBy": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "reviewedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "reviewerNotes": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "resolutionStatus": { "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" } } } }, "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" } } } }, "409": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "conflict" ] }, "message": { "type": "string" } }, "title": "conflict", "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/admin/ai-spend/finding/{findingId}/annotate": { "post": { "summary": "Annotate an AI-audit finding's reviewer notes (admin only)", "tags": [ "AiSpend" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "notes" ], "properties": { "notes": { "type": "string", "minLength": 1 } } } } } }, "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "findingId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "customerId", "customerName", "ruleId", "title", "severity", "status", "userId", "sessionId", "estimatedDollarImpactUsd", "priceSourceVersion", "humanExplanation", "evidence", "confidence", "category", "reviewedBy", "reviewedAt", "reviewerNotes", "resolutionStatus", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "customerId": { "type": "string" }, "customerName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "ruleId": { "type": "string" }, "title": { "type": "string" }, "severity": { "anyOf": [ { "type": "string", "enum": [ "low" ] }, { "type": "string", "enum": [ "medium" ] }, { "type": "string", "enum": [ "high" ] } ] }, "status": { "anyOf": [ { "type": "string", "enum": [ "pending_review" ] }, { "type": "string", "enum": [ "accepted" ] }, { "type": "string", "enum": [ "rejected" ] } ] }, "userId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "sessionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "estimatedDollarImpactUsd": { "type": "number" }, "priceSourceVersion": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "humanExplanation": { "type": "string" }, "evidence": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": true }, { "type": "null" } ] }, "confidence": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "category": { "anyOf": [ { "anyOf": [ { "type": "string", "enum": [ "refund_eligible" ] }, { "type": "string", "enum": [ "savings_opportunity" ] }, { "type": "string", "enum": [ "advisory" ] } ] }, { "type": "null" } ] }, "reviewedBy": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "reviewedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "reviewerNotes": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "resolutionStatus": { "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" } } } }, "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/admin/customer/{customerId}/ai-spend/connection": { "post": { "summary": "Connect a provider API key for a customer (admin only)", "tags": [ "AiSpend" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "provider", "apiKey" ], "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "anthropic" ] }, { "type": "string", "enum": [ "openai" ] } ] }, "apiKey": { "type": "string", "minLength": 1 } } } } } }, "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "customerId", "provider", "providerOrgId", "keyPreview", "createdBy", "connectedAt", "lastSyncAt", "lastSyncStatus", "lastSyncError", "disconnectedAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "customerId": { "type": "string" }, "provider": { "anyOf": [ { "type": "string", "enum": [ "anthropic" ] }, { "type": "string", "enum": [ "openai" ] } ] }, "providerOrgId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "keyPreview": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "createdBy": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "connectedAt": { "type": "string", "format": "date-time" }, "lastSyncAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "lastSyncStatus": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lastSyncError": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "disconnectedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "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" } } } }, "409": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "conflict" ] }, "message": { "type": "string" } }, "title": "conflict", "description": "A service error has occurred" } ] } } } }, "422": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidProviderKey" ] }, "message": { "type": "string" } }, "title": "invalidProviderKey", "description": "A service error has occurred" } ] } } } }, "502": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "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/admin/customer/{customerId}/ai-spend/connection/rotate": { "post": { "summary": "Rotate a customer's provider API key (admin only)", "tags": [ "AiSpend" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "provider", "apiKey" ], "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "anthropic" ] }, { "type": "string", "enum": [ "openai" ] } ] }, "apiKey": { "type": "string", "minLength": 1 } } } } } }, "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "customerId", "provider", "providerOrgId", "keyPreview", "createdBy", "connectedAt", "lastSyncAt", "lastSyncStatus", "lastSyncError", "disconnectedAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "customerId": { "type": "string" }, "provider": { "anyOf": [ { "type": "string", "enum": [ "anthropic" ] }, { "type": "string", "enum": [ "openai" ] } ] }, "providerOrgId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "keyPreview": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "createdBy": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "connectedAt": { "type": "string", "format": "date-time" }, "lastSyncAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "lastSyncStatus": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lastSyncError": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "disconnectedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "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" } } } }, "422": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidProviderKey" ] }, "message": { "type": "string" } }, "title": "invalidProviderKey", "description": "A service error has occurred" } ] } } } }, "502": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "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/admin/customer/{customerId}/ai-spend/connection/disconnect": { "post": { "summary": "Disconnect a customer's provider connection (admin only)", "tags": [ "AiSpend" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "provider" ], "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "anthropic" ] }, { "type": "string", "enum": [ "openai" ] } ] } } } } } }, "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "customerId", "provider", "providerOrgId", "keyPreview", "createdBy", "connectedAt", "lastSyncAt", "lastSyncStatus", "lastSyncError", "disconnectedAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "customerId": { "type": "string" }, "provider": { "anyOf": [ { "type": "string", "enum": [ "anthropic" ] }, { "type": "string", "enum": [ "openai" ] } ] }, "providerOrgId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "keyPreview": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "createdBy": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "connectedAt": { "type": "string", "format": "date-time" }, "lastSyncAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "lastSyncStatus": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "lastSyncError": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "disconnectedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "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/admin/customer/{customerId}/approval-request": { "get": { "summary": "List approval requests for a customer (admin)", "tags": [ "ApprovalRequest" ], "parameters": [ { "schema": { "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" ] } ] }, "in": "query", "name": "status", "required": false }, { "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "cursor", "required": false }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "status", "externalId", "objectId", "requesterUserId", "deciderUserId", "deciders", "observers", "request", "notes", "submittedAt", "decidedAt", "fulfilledAt", "createdAt", "updatedAt", "customerId" ], "properties": { "id": { "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" ] } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "objectId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "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" ] } } } }, "request": { "type": "object", "properties": {}, "additionalProperties": true }, "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" } } } }, "submittedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "decidedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "fulfilledAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "customerId": { "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/admin/customer/{customerId}/approval-request/{id}": { "get": { "summary": "Get an approval request by ID (admin)", "tags": [ "ApprovalRequest" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "externalId", "objectId", "requesterUserId", "deciderUserId", "deciders", "observers", "request", "notes", "submittedAt", "decidedAt", "fulfilledAt", "createdAt", "updatedAt" ], "properties": { "id": { "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" ] } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "objectId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "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" ] } } } }, "request": { "type": "object", "properties": {}, "additionalProperties": true }, "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" } } } }, "submittedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "decidedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "fulfilledAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "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" } } } } } }, "patch": { "summary": "Advance approval request fulfillment status (admin)", "tags": [ "ApprovalRequest" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "fulfillmentInProgress" ] }, { "type": "string", "enum": [ "fulfilled" ] }, { "type": "string", "enum": [ "fulfillmentFailed" ] } ] }, "objectId": { "type": "string" } } } } } }, "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "externalId", "objectId", "requesterUserId", "deciderUserId", "deciders", "observers", "request", "notes", "submittedAt", "decidedAt", "fulfilledAt", "createdAt", "updatedAt" ], "properties": { "id": { "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" ] } ] }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "objectId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "requesterUserId": { "type": "string" }, "deciderUserId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "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" ] } } } }, "request": { "type": "object", "properties": {}, "additionalProperties": true }, "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" } } } }, "submittedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "decidedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "fulfilledAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "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" } ] } ] } } } }, "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/admin/customer/{customerId}/bill/{billId}/document": { "get": { "summary": "List documents attached to a bill (admin)", "tags": [ "BillDocument" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "billId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "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" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "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" }, { "type": "null" } ] } } } } } }, "createdAt": { "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/admin/customer/{customerId}/bill/{billId}/document/{id}/download": { "get": { "summary": "Download a bill document — 302 redirects to a pre-signed S3 URL (admin)", "tags": [ "BillDocument" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "billId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "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" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "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" }, { "type": "null" } ] } } } } } }, "createdAt": { "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/admin/customer/{customerId}/bill": { "get": { "summary": "List bills for a customer (admin)", "tags": [ "Bill" ], "parameters": [ { "schema": { "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" ] } ] }, "in": "query", "name": "status", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "vendorId", "required": false }, { "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", "minLength": 1 }, "in": "path", "name": "customerId", "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", "status", "vendorId", "creatorUserId", "externalId", "invoiceId", "invoiceDate", "paymentDueDate", "paymentScheduledDate", "totalAmount", "currencyCode", "description", "accountingPlatformId", "accountingRutterId", "accountingLastSyncedAt", "accountingErrorCode", "submittedAt", "completedAt", "createdAt", "updatedAt" ], "properties": { "id": { "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" ] } ] }, "vendorId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "creatorUserId": { "type": "string" }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "paymentDueDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "paymentScheduledDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "accountingPlatformId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "accountingRutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "accountingLastSyncedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "accountingErrorCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "submittedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "completedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "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/admin/customer/{customerId}/bill/{billId}": { "get": { "summary": "Get a single bill with line items and documents (admin)", "tags": [ "Bill" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "billId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "vendorId", "creatorUserId", "externalId", "invoiceId", "invoiceDate", "paymentDueDate", "paymentScheduledDate", "totalAmount", "currencyCode", "description", "accountingPlatformId", "accountingRutterId", "accountingLastSyncedAt", "accountingErrorCode", "submittedAt", "completedAt", "createdAt", "updatedAt", "lineItems", "documents", "canSubmitErrors" ], "properties": { "id": { "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" ] } ] }, "vendorId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "creatorUserId": { "type": "string" }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "paymentDueDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "paymentScheduledDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "accountingPlatformId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "accountingRutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "accountingLastSyncedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "accountingErrorCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "submittedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "completedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "lineItems": { "type": "array", "items": { "type": "object", "required": [ "id", "description", "amount", "spendCategoryId" ], "properties": { "id": { "type": "string" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "amount": { "type": "string" }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } } }, "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" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "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" }, { "type": "null" } ] } } } } } }, "createdAt": { "type": "string", "format": "date-time" } } } }, "canSubmitErrors": { "type": "array", "items": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "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" } } } } } }, "patch": { "summary": "Update bill fields (admin)", "tags": [ "Bill" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "returned" ] }, { "type": "string", "enum": [ "paymentInProgress" ] }, { "type": "string", "enum": [ "paid" ] }, { "type": "string", "enum": [ "paymentFailed" ] } ] }, "vendorId": { "type": "string" }, "invoiceId": { "type": "string" }, "invoiceDate": { "type": "string" }, "paymentDueDate": { "type": "string" }, "totalAmount": { "type": "string" }, "currencyCode": { "type": "string" }, "description": { "type": "string" } }, "minProperties": 1 } } } }, "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "billId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "vendorId", "creatorUserId", "externalId", "invoiceId", "invoiceDate", "paymentDueDate", "paymentScheduledDate", "totalAmount", "currencyCode", "description", "accountingPlatformId", "accountingRutterId", "accountingLastSyncedAt", "accountingErrorCode", "submittedAt", "completedAt", "createdAt", "updatedAt", "lineItems", "documents", "canSubmitErrors" ], "properties": { "id": { "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" ] } ] }, "vendorId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "creatorUserId": { "type": "string" }, "externalId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "invoiceDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "paymentDueDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "paymentScheduledDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "currencyCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "accountingPlatformId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "accountingRutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "accountingLastSyncedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "accountingErrorCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "submittedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "completedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "lineItems": { "type": "array", "items": { "type": "object", "required": [ "id", "description", "amount", "spendCategoryId" ], "properties": { "id": { "type": "string" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "amount": { "type": "string" }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } } }, "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" }, { "type": "null" } ] }, "dueDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "totalAmount": { "anyOf": [ { "type": "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" }, { "type": "null" } ] } } } } } }, "createdAt": { "type": "string", "format": "date-time" } } } }, "canSubmitErrors": { "type": "array", "items": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "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": [ "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" } } } }, "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/admin/customer/{customerId}/bill/{billId}/sync-to-accounting": { "post": { "summary": "Create or update the bill in the accounting platform", "tags": [ "Bill" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "billId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "rutterId", "platformId", "rutterJobId", "syncStatus" ], "properties": { "rutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "platformId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterJobId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "syncStatus": { "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": [ "invalidVendor" ] }, "message": { "type": "string" } }, "title": "invalidVendor", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidSpendCategory" ] }, "message": { "type": "string" } }, "title": "invalidSpendCategory", "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/admin/customer/{customerId}/bill/{billId}/payment/sync-to-accounting": { "post": { "summary": "Create the bill payment in the accounting platform (admin)", "tags": [ "Bill" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "billId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "rutterId", "platformId", "rutterJobId", "syncStatus" ], "properties": { "rutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "platformId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterJobId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "syncStatus": { "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": [ "noRutterId" ] }, "message": { "type": "string" } }, "title": "noRutterId", "description": "A service error has occurred" }, { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "invalidEntityMapping" ] }, "message": { "type": "string" } }, "title": "invalidEntityMapping", "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/admin/customer/{customerId}/bill/{billId}/accounting-integration": { "delete": { "summary": "Delete the bill from the accounting platform", "tags": [ "Bill" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "billId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "ok" ], "properties": { "ok": { "type": "boolean", "enum": [ true ] } } } } } }, "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/admin/accounting-integration": { "get": { "summary": "List accounting integration connections (admin)", "tags": [ "AccountingIntegrationConnection" ], "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" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "customerId", "platform", "status", "createdAt", "updatedAt", "creditCardAccountMapped", "creditCardAccountName" ], "properties": { "id": { "type": "string" }, "customerId": { "type": "string" }, "platform": { "type": "string" }, "status": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "creditCardAccountMapped": { "type": "boolean" }, "creditCardAccountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } } }, "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/admin/customer/{customerId}/accounting-integration": { "get": { "summary": "Get accounting integration connection for a customer", "tags": [ "AccountingIntegrationConnection" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "id", "customerId", "platform", "status", "createdAt", "updatedAt", "creditCardAccountMapped", "creditCardAccountName" ], "properties": { "id": { "type": "string" }, "customerId": { "type": "string" }, "platform": { "type": "string" }, "status": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "creditCardAccountMapped": { "type": "boolean" }, "creditCardAccountName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } }, { "type": "null" } ] } } } }, "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": "Force-delete accounting integration connection for a customer", "tags": [ "AccountingIntegrationConnection" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "customerId", "platform", "status", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "customerId": { "type": "string" }, "platform": { "type": "string" }, "status": { "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": [ "rutterError" ] }, "message": { "type": "string" } }, "title": "rutterError", "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/admin/customer-product/{id}": { "patch": { "summary": "Update a product across ALL customers", "description": "WARNING: Use with care. Does not publish service events; caches must be invalidated manually.", "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": { "204": { "description": "Default Response" }, "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/admin/customer/{customerId}/product": { "get": { "summary": "Search customer products", "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "statuses", "required": false, "description": "comma-separated list" }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true } ], "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/admin/customer/{customerId}/product/{id}": { "get": { "summary": "Get a customer product", "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "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 a customer product", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "enabled" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "locked": { "anyOf": [ { "type": "boolean", "enum": [ true ] }, { "type": "null" } ], "description": "Set to true to lock, null to clear the lock." } }, "minProperties": 1 } } } }, "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "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/admin/customer/{customerId}/product/init": { "post": { "summary": "Initialise all products for a customer", "description": "- Adds a configuration entry for every product that does not yet have configuration for this customer, using each product's default status.\n- Preserves any existing configuration.\n- Does not publish service events; caches must be invalidated manually.", "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true } ], "responses": { "204": { "description": "Default Response" }, "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/admin/customer": { "get": { "summary": "List Dash.fi customers (admin only)", "tags": [ "Customer" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "companyNameLike", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "customerNameLike", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "customerId", "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 } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "page", "pageSize", "hasNext" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "companyName", "companyDoingBusinessAs", "companyCreatedAt" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "companyName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "companyDoingBusinessAs": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "companyCreatedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] } } } }, "page": { "type": "integer" }, "pageSize": { "type": "integer" }, "hasNext": { "type": "boolean" }, "totalItemCount": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } }, "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": [ "invalidRequest" ] }, "message": { "type": "string" } }, "title": "invalidRequest", "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/customer/{customerId}": { "get": { "summary": "Get a single Dash.fi customer (admin only)", "tags": [ "Customer" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "name", "companyName", "companyDoingBusinessAs", "companyCreatedAt" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "companyName": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "companyDoingBusinessAs": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "companyCreatedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] } } } } } }, "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" } } } }, "429": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamRateLimit" ] }, "message": { "type": "string" } }, "title": "upstreamRateLimit", "description": "A service error has occurred" } } } }, "502": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamError" ] }, "message": { "type": "string" } }, "title": "upstreamError", "description": "A service error has occurred" } } } }, "504": { "description": "A service error has occurred", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "upstreamTimeout" ] }, "message": { "type": "string" } }, "title": "upstreamTimeout", "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/admin/customer/names": { "post": { "summary": "Resolve company names for a set of customer ids (admin only)", "tags": [ "Customer" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "ids" ], "properties": { "ids": { "type": "array", "items": { "type": "string", "minLength": 1 }, "maxItems": 500 } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "names" ], "properties": { "names": { "type": "object", "additionalProperties": { "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/admin/customer/{customerId}/accounting-integration/entity-mapping-suggestion": { "get": { "summary": "List AI-generated entity mapping suggestions for a customer", "tags": [ "EntityMappingSuggestion" ], "parameters": [ { "schema": { "type": "string", "enum": [ "category" ] }, "in": "query", "name": "entityType", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "entityId", "required": false }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "connectionId", "customerId", "entityType", "entityId", "entityName", "suggestedRutterEntityId", "suggestedRutterEntityName", "confidence", "reasoning", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "connectionId": { "type": "string" }, "customerId": { "type": "string" }, "entityType": { "type": "string" }, "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/admin/accounting-integration/sync-summary": { "get": { "summary": "Expense sync status counts per customer (cross-customer)", "tags": [ "Expense" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "customerId", "required": false } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "customerId", "synced", "failed", "pending", "ready" ], "properties": { "customerId": { "type": "string" }, "synced": { "type": "integer" }, "failed": { "type": "integer" }, "pending": { "type": "integer" }, "ready": { "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/admin/customer/{customerId}/accounting-integration/expense": { "get": { "summary": "List expenses for a customer (admin)", "tags": [ "Expense" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "status", "required": false }, { "schema": { "anyOf": [ { "type": "string", "enum": [ "synced" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "ready" ] } ] }, "in": "query", "name": "syncState", "required": false }, { "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", "minLength": 1 }, "in": "path", "name": "customerId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "status", "accountingDate", "spendCategoryId", "memo", "description", "referenceNumber", "rutterCustomerId", "billable", "syncState", "syncedAt", "expenseOutcome", "attachmentOutcome", "errorCode", "inngestRunId" ], "properties": { "id": { "type": "string" }, "status": { "type": "string" }, "accountingDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "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" } ] }, "syncState": { "anyOf": [ { "type": "string", "enum": [ "synced" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "ready" ] }, { "type": "null" } ] }, "syncedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "expenseOutcome": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "attachmentOutcome": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "errorCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "inngestRunId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } } }, "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/admin/accounting-integration/failure-summary": { "get": { "summary": "Cross-customer rollup of expense sync failures grouped by error code", "tags": [ "Expense" ], "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", "format": "date-time" }, "in": "query", "name": "since", "required": false } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "totalFailures" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "errorCode", "count", "affectedCustomers", "affectedExpenses", "lastSeenAt" ], "properties": { "errorCode": { "type": "string" }, "count": { "type": "integer" }, "affectedCustomers": { "type": "integer" }, "affectedExpenses": { "type": "integer" }, "lastSeenAt": { "type": "string", "format": "date-time" } } } }, "totalFailures": { "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/admin/customer/{customerId}/accounting-integration/sync-run": { "get": { "summary": "List expense sync runs for a customer (admin)", "tags": [ "Expense" ], "parameters": [ { "schema": { "anyOf": [ { "type": "string", "enum": [ "running" ] }, { "type": "string", "enum": [ "completed" ] }, { "type": "string", "enum": [ "partial" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "in": "query", "name": "status", "required": false }, { "schema": { "type": "boolean" }, "in": "query", "name": "staleOnly", "required": false }, { "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", "minLength": 1 }, "in": "path", "name": "customerId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "inngestRunId", "status", "transactionsDispatched", "transactionsFailedValidation", "errorCode", "startedAt", "completedAt" ], "properties": { "id": { "type": "string" }, "inngestRunId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "status": { "type": "string" }, "transactionsDispatched": { "type": "integer" }, "transactionsFailedValidation": { "type": "integer" }, "errorCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] } } } }, "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/admin/customer/{customerId}/accounting-integration/sync-health": { "get": { "summary": "Per-customer expense sync status rollup (synced/failed/pending/ready)", "tags": [ "Expense" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "synced", "failed", "pending", "ready" ], "properties": { "synced": { "type": "integer" }, "failed": { "type": "integer" }, "pending": { "type": "integer" }, "ready": { "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/admin/customer/{customerId}/accounting-integration/expense/sync-retry": { "post": { "summary": "Retry failed expense sync attempts for a customer (failed → ready)", "tags": [ "Expense" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "transactionIds": { "type": "array", "items": { "type": "string", "minLength": 1 }, "minItems": 1 } }, "additionalProperties": false } } } }, "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "resetCount", "skippedCount" ], "properties": { "resetCount": { "type": "integer" }, "skippedCount": { "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/admin/customer/{customerId}/accounting-integration/expense/{transactionId}": { "patch": { "summary": "Update an expense record by transaction id (admin)", "tags": [ "Expense" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "deleted" ] } ] }, "rutterExpenseId": { "type": "string", "minLength": 1 }, "rutterVendorId": { "type": "string", "minLength": 1 } }, "additionalProperties": false, "minProperties": 1 } } } }, "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "transactionId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "accountingDate", "spendCategoryId", "memo", "description", "referenceNumber", "rutterCustomerId", "billable", "syncState", "syncedAt", "expenseOutcome", "attachmentOutcome", "errorCode", "inngestRunId" ], "properties": { "id": { "type": "string" }, "status": { "type": "string" }, "accountingDate": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "spendCategoryId": { "anyOf": [ { "type": "string" }, { "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" } ] }, "syncState": { "anyOf": [ { "type": "string", "enum": [ "synced" ] }, { "type": "string", "enum": [ "failed" ] }, { "type": "string", "enum": [ "pending" ] }, { "type": "string", "enum": [ "ready" ] }, { "type": "null" } ] }, "syncedAt": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ] }, "expenseOutcome": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "attachmentOutcome": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "errorCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "inngestRunId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } } } } } }, "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/admin/mcp-customer-config": { "get": { "summary": "List MCP customer configs across all customers (admin)", "tags": [ "McpCustomerConfig" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "customerId", "required": false }, { "schema": { "anyOf": [ { "type": "string", "enum": [ "enabled" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "in": "query", "name": "status", "required": false }, { "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" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "customerId", "status", "createdAt", "updatedAt" ], "properties": { "customerId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "enabled" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "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/admin/customer/{customerId}/mcp-customer-config": { "patch": { "summary": "Update the MCP customer config (admin)", "tags": [ "McpCustomerConfig" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "enabled" ] }, { "type": "string", "enum": [ "disabled" ] } ] } }, "additionalProperties": false } } } }, "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "customerId", "status", "createdAt", "updatedAt" ], "properties": { "customerId": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "enabled" ] }, { "type": "string", "enum": [ "disabled" ] } ] }, "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/admin/payment": { "get": { "summary": "Search payments (admin, cross-customer)", "tags": [ "Payment" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "customerId", "required": false }, { "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, "maximum": 200, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "anyOf": [ { "type": "string", "enum": [ "asc" ] }, { "type": "string", "enum": [ "desc" ] } ] }, "in": "query", "name": "direction", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "cursorId", "required": false } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "customerId", "status", "creator", "scheduledAt", "legs", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "customerId": { "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" }, "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": { "type": "object", "properties": {}, "additionalProperties": true }, "target": { "type": "object", "properties": {}, "additionalProperties": true }, "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" } } }, { "type": "object", "required": [ "type", "id", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxWithdrawal" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cardShare" ] }, "id": { "type": "string" }, "cardSpendLimitRuleId": { "type": "string" }, "cardShareId": { "type": "string" } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "id": { "type": "string" } } } ] }, "integrationError": { "anyOf": [ { "type": "object", "required": [ "type", "code", "message" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "cfxDeposit" ] }, { "type": "string", "enum": [ "cfxWithdrawal" ] } ] }, "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } }, { "type": "object", "required": [ "type", "code", "message" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "cardShare" ] }, { "type": "string", "enum": [ "cashAdvance" ] } ] }, "code": { "type": "string" }, "message": { "type": "string" }, "errorCode": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } ] }, "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" } } } } } }, "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/admin/payment/{id}": { "get": { "summary": "Get a payment by ID (admin)", "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", "customerId", "status", "creator", "scheduledAt", "legs", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "customerId": { "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" }, "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": { "type": "object", "properties": {}, "additionalProperties": true }, "target": { "type": "object", "properties": {}, "additionalProperties": true }, "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" } } }, { "type": "object", "required": [ "type", "id", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxWithdrawal" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cardShare" ] }, "id": { "type": "string" }, "cardSpendLimitRuleId": { "type": "string" }, "cardShareId": { "type": "string" } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "id": { "type": "string" } } } ] }, "integrationError": { "anyOf": [ { "type": "object", "required": [ "type", "code", "message" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "cfxDeposit" ] }, { "type": "string", "enum": [ "cfxWithdrawal" ] } ] }, "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } }, { "type": "object", "required": [ "type", "code", "message" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "cardShare" ] }, { "type": "string", "enum": [ "cashAdvance" ] } ] }, "code": { "type": "string" }, "message": { "type": "string" }, "errorCode": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } ] }, "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 status (admin)", "tags": [ "Payment" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "succeeded" ] }, { "type": "string", "enum": [ "failed" ] } ] } } } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "customerId", "status", "creator", "scheduledAt", "legs", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "customerId": { "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" }, "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": { "type": "object", "properties": {}, "additionalProperties": true }, "target": { "type": "object", "properties": {}, "additionalProperties": true }, "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" } } }, { "type": "object", "required": [ "type", "id", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxWithdrawal" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cardShare" ] }, "id": { "type": "string" }, "cardSpendLimitRuleId": { "type": "string" }, "cardShareId": { "type": "string" } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "id": { "type": "string" } } } ] }, "integrationError": { "anyOf": [ { "type": "object", "required": [ "type", "code", "message" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "cfxDeposit" ] }, { "type": "string", "enum": [ "cfxWithdrawal" ] } ] }, "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } }, { "type": "object", "required": [ "type", "code", "message" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "cardShare" ] }, { "type": "string", "enum": [ "cashAdvance" ] } ] }, "code": { "type": "string" }, "message": { "type": "string" }, "errorCode": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } ] }, "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" } ] } ] } } } }, "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/admin/payment/{paymentId}/leg/{legId}": { "patch": { "summary": "Update a payment leg, then advance the payment (admin)", "tags": [ "Payment" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "processing" ] }, { "type": "string", "enum": [ "succeeded" ] }, { "type": "string", "enum": [ "failed" ] } ] }, "integration": { "anyOf": [ { "type": "object", "required": [ "type", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxDeposit" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" }, "depositRequestId": { "type": "string" } } }, { "type": "object", "required": [ "type", "id", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxWithdrawal" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cardShare" ] }, "id": { "type": "string" }, "cardSpendLimitRuleId": { "type": "string" }, "cardShareId": { "type": "string" } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "id": { "type": "string" } } } ] }, "integrationError": { "anyOf": [ { "anyOf": [ { "type": "object", "required": [ "type", "code", "message" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "cfxDeposit" ] }, { "type": "string", "enum": [ "cfxWithdrawal" ] } ] }, "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } }, { "type": "object", "required": [ "type", "code", "message" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "cardShare" ] }, { "type": "string", "enum": [ "cashAdvance" ] } ] }, "code": { "type": "string" }, "message": { "type": "string" }, "errorCode": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } ] }, { "type": "null" } ], "description": "Set null to clear the field" } }, "minProperties": 1 } } } }, "parameters": [ { "schema": { "type": "string" }, "in": "path", "name": "paymentId", "required": true }, { "schema": { "type": "string" }, "in": "path", "name": "legId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "customerId", "status", "creator", "scheduledAt", "legs", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "customerId": { "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" }, "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": { "type": "object", "properties": {}, "additionalProperties": true }, "target": { "type": "object", "properties": {}, "additionalProperties": true }, "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" } } }, { "type": "object", "required": [ "type", "id", "organizationId" ], "properties": { "type": { "type": "string", "enum": [ "cfxWithdrawal" ] }, "id": { "type": "string" }, "organizationId": { "type": "string" } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cardShare" ] }, "id": { "type": "string" }, "cardSpendLimitRuleId": { "type": "string" }, "cardShareId": { "type": "string" } } }, { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string", "enum": [ "cashAdvance" ] }, "id": { "type": "string" } } } ] }, "integrationError": { "anyOf": [ { "type": "object", "required": [ "type", "code", "message" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "cfxDeposit" ] }, { "type": "string", "enum": [ "cfxWithdrawal" ] } ] }, "code": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } }, { "type": "object", "required": [ "type", "code", "message" ], "properties": { "type": { "anyOf": [ { "type": "string", "enum": [ "cardShare" ] }, { "type": "string", "enum": [ "cashAdvance" ] } ] }, "code": { "type": "string" }, "message": { "type": "string" }, "errorCode": { "type": "string" }, "details": { "type": "object", "properties": {}, "additionalProperties": true } } } ] }, "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": [ "invalidPaymentLegIntegration" ] }, "message": { "type": "string" } }, "title": "invalidPaymentLegIntegration", "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" } } } }, "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/admin/ping": { "get": { "summary": "Health check — confirms the Stytch B2C JWT auth chain reaches admin-api", "tags": [ "Ping" ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "ok", "stytchUserId", "stytchSessionId", "roles" ], "properties": { "ok": { "type": "boolean" }, "stytchUserId": { "type": "string" }, "stytchSessionId": { "type": "string" }, "roles": { "type": "array", "items": { "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/admin/product": { "get": { "summary": "Search all products", "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": [ "none" ] }, { "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/admin/product/{id}": { "get": { "summary": "Get a 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": [ "none" ] }, { "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" } } } } } }, "patch": { "summary": "Update a product", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "customerAccess": { "anyOf": [ { "type": "string", "enum": [ "none" ] }, { "type": "string", "enum": [ "read" ] }, { "type": "string", "enum": [ "write" ] } ] }, "newCustomerStatus": { "anyOf": [ { "type": "string", "enum": [ "enabled" ] }, { "type": "string", "enum": [ "disabled" ] } ] } }, "minProperties": 1 } } } }, "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": [ "none" ] }, { "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/admin/customer/{customerId}/service-event": { "get": { "summary": "List service event records for a customer (admin)", "tags": [ "ServiceEvent" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "objectId", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "type", "required": false }, { "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 }, "in": "query", "name": "pageSize", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "cursor", "required": false }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "customerId", "type", "objectId", "userId", "event", "createdAt" ], "properties": { "id": { "type": "string" }, "customerId": { "type": "string" }, "type": { "type": "string" }, "objectId": { "type": "string" }, "userId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "event": { "type": "object", "properties": {}, "additionalProperties": true }, "createdAt": { "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/admin/customer/{customerId}/transaction-receipt": { "get": { "summary": "List transaction receipts for a customer (admin). Excludes soft-deleted receipts by default; pass `status=deleted` to retrieve them.", "tags": [ "TransactionReceipt" ], "parameters": [ { "schema": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "in": "query", "name": "status", "required": false }, { "schema": { "type": "string", "minLength": 1 }, "in": "query", "name": "fileName", "required": false }, { "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", "minLength": 1 }, "in": "path", "name": "customerId", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "items", "hasNext" ], "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "status", "fileName", "ocrStatus", "ocrData", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "fileName": { "type": "string" }, "ocrStatus": { "anyOf": [ { "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/admin/customer/{customerId}/transaction-receipt/{id}": { "get": { "summary": "Get a transaction receipt by ID (admin)", "tags": [ "TransactionReceipt" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "fileName", "ocrStatus", "ocrData", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "fileName": { "type": "string" }, "ocrStatus": { "anyOf": [ { "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" } } } } } } }, "/v1/admin/customer/{customerId}/transaction-receipt/{id}/download": { "get": { "summary": "Download a transaction receipt — 302 redirects to a pre-signed S3 URL (admin)", "tags": [ "TransactionReceipt" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "id", "required": true } ], "responses": { "302": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "fileName", "ocrStatus", "ocrData", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "fileName": { "type": "string" }, "ocrStatus": { "anyOf": [ { "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" } } } } } } }, "/v1/admin/customer/{customerId}/vendor": { "get": { "summary": "List vendors for a customer (admin)", "tags": [ "Vendor" ], "parameters": [ { "schema": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "in": "query", "name": "status", "required": false }, { "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", "minLength": 1 }, "in": "path", "name": "customerId", "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", "status", "name", "owners", "country", "currencyCode", "contacts", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "string" }, "externalId": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "country": { "type": "string" }, "currencyCode": { "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", "email", "default" ], "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" } } }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" }, "default": { "type": "boolean" } } } }, "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" } } } } } } }, "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" } } } } } } ] } }, "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/admin/customer/{customerId}/vendor/{id}": { "get": { "summary": "Get a vendor by ID (admin)", "tags": [ "Vendor" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "status", "name", "owners", "country", "currencyCode", "contacts", "paymentMethods", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "status": { "anyOf": [ { "type": "string", "enum": [ "active" ] }, { "type": "string", "enum": [ "disabled" ] }, { "type": "string", "enum": [ "deleted" ] } ] }, "name": { "type": "string" }, "externalId": { "type": "string" }, "owners": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "string" } }, "userGroupIds": { "type": "array", "items": { "type": "string" } } } }, "country": { "type": "string" }, "currencyCode": { "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", "email", "default" ], "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" } } }, "email": { "type": "string" }, "phone": { "type": "string" }, "notes": { "type": "string" }, "default": { "type": "boolean" } } } }, "paymentMethods": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": true } }, "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" } } } } } } }, "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/admin/customer/{customerId}/vendor/{id}/sync-to-accounting": { "post": { "summary": "Create the vendor in the accounting platform via Rutter", "tags": [ "Vendor" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "customerId", "required": true }, { "schema": { "type": "string", "minLength": 1 }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "rutterId", "platformId", "rutterJobId", "latestSync" ], "properties": { "rutterId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "platformId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "rutterJobId": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "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" } } } } } } } } } }, "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": [ "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" } } } } } } } } }