UNPKG

pocketsmith-ts

Version:

TypeScript client library for PocketSmith API

1,417 lines 140 kB
/** * This file was auto-generated by openapi-typescript. * Do not make direct changes to the file. */ export interface paths { "/me": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get the authorised user * @description Gets the user that corresponds to the access token used in the request. */ get: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["User"]; }; }; 403: components["responses"]["403"]; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/users/{id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get user * @description Gets a user by ID. You must be authorised as the target user in order to make this request. */ get: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier of the user. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: never; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["User"]; }; }; 403: components["responses"]["403"]; 404: components["responses"]["404"]; }; }; /** * Update user * @description Updates the user by their ID. You must be authorised as the target user in order to make this request. */ put: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier of the user. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: { content: { "application/json": { /** * @description A new email address for the user. * @example foo@bar.com */ email?: string; /** * @description A new name for the user. * @example John Appleseed */ name?: string; /** * @description A new time zone for the user. * @example Auckland */ time_zone?: string; /** * @description The day of the week the user wishes their calendars to start on. A number between 0 and 6, where 0 is Sunday and 6 is Saturday. * @example 1 */ week_start_day?: number; /** * @description Whether the user is a beta user, and wishes to try out new features. * @example true */ beta_user?: boolean; /** * @description A new base currency code for the user. * @example nzd */ base_currency_code?: string; /** * @description Whether the user wishes to have all monetary values converted to their base currency. * @example true */ always_show_base_currency?: boolean; }; }; }; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["User"]; }; }; 403: components["responses"]["403"]; 404: components["responses"]["404"]; 422: components["responses"]["422"]; }; }; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/institutions/{id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get institution * @description Gets an institution by its ID. */ get: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier of the institution. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: never; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Institution"]; }; }; 403: components["responses"]["403"]; 404: components["responses"]["404"]; }; }; /** * Update institution * @description Updates the title and currency code for an institution. */ put: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier of the institution. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: { content: { "application/json": { /** * @description A new title for the institution. * @example Bank of Foo */ title?: string; /** * @description A new currency code for the institution. * @example NZD */ currency_code?: string; }; }; }; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Institution"]; }; }; 403: components["responses"]["403"]; 404: components["responses"]["404"]; 422: components["responses"]["422"]; }; }; post?: never; /** * Delete institution * @description Deletes an institution and all data within. Alternatively, another institution can be provided to merge the data into to avoid losing it. */ delete: { parameters: { query?: { /** * @description The unique identifier of the institution to merge into. * @example 44 */ merge_into_institution_id?: number; }; header?: never; path: { /** * @description The unique identifier of the institution. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: never; responses: { /** @description Success */ 204: { headers: { [name: string]: unknown; }; content?: never; }; 403: components["responses"]["403"]; 404: components["responses"]["404"]; 422: components["responses"]["422"]; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/users/{id}/institutions": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List institutions in user * @description Lists all the institutions belonging to the user. */ get: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier of the user * @example 42 */ id: number; }; cookie?: never; }; requestBody?: never; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Institution"][]; }; }; 403: components["responses"]["403"]; 404: components["responses"]["404"]; }; }; put?: never; /** * Create institution in user * @description Creates an institution belonging to a user. */ post: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier of the user * @example 42 */ id: number; }; cookie?: never; }; requestBody?: { content: { "application/json": { /** * @description A title for the institution. * @example Bank of Foo */ title: string; /** * @description A currency code for the institution. * @example NZD */ currency_code: string; }; }; }; responses: { /** @description Success */ 201: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Institution"]; }; }; 403: components["responses"]["403"]; 404: components["responses"]["404"]; 422: components["responses"]["422"]; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/accounts/{id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get account * @description Gets an account by its ID. */ get: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier of the account. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: never; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Account"]; }; }; 403: components["responses"]["403"]; 404: components["responses"]["404"]; }; }; /** * Update account * @description Updates and returns an account by its ID. */ put: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier of the account. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: { content: { "application/json": { /** * @description A new title for the account. * @example Savings */ title?: string; /** * @description A new currency code for the account. * @example NZD */ currency_code?: string; /** * @description The type of the account. * @example bank * @enum {string} */ type?: "bank" | "credits" | "cash" | "loans" | "mortgage" | "stocks" | "vehicle" | "property" | "insurance" | "other_asset" | "other_liability"; /** * @description Whether the account is a net worth account. * @example false */ is_net_worth?: boolean; }; }; }; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Account"]; }; }; 403: components["responses"]["403"]; 404: components["responses"]["404"]; 422: components["responses"]["422"]; }; }; post?: never; /** * Delete account * @description Deletes an account and all its data by ID, optionally merge scenarios into another account. */ delete: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier of the account. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: never; responses: { /** @description Success */ 204: { headers: { [name: string]: unknown; }; content?: never; }; 403: components["responses"]["403"]; 404: components["responses"]["404"]; 422: components["responses"]["422"]; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/users/{id}/accounts": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List accounts in user * @description Lists all accounts belonging to the user by their ID. */ get: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier of the user. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: never; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Account"][]; }; }; 403: components["responses"]["403"]; 404: components["responses"]["404"]; }; }; /** * Update the display order of accounts in user * @description Updates the display order of accounts belonging to the user, by accepting an array of accounts in their new display order. */ put: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier of the user. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: { content: { "application/json": { /** @description List the account objects in their new display order. */ accounts: components["schemas"]["Account"][]; }; }; }; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Account"][]; }; }; 400: components["responses"]["400"]; 403: components["responses"]["403"]; 404: components["responses"]["404"]; }; }; /** * Create an account in user * @description Creates and returns an account belonging to the user by their ID. */ post: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier of the user. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: { content: { "application/json": { /** * @description The ID of the institution to create this account in. * @example 42 */ institution_id: number; /** * @description A title for the account. * @example Foo */ title: string; /** * @description A currency code for the account. * @example NZD */ currency_code: string; /** * @description The type of the account. * @example bank * @enum {string} */ type: "bank" | "credits" | "cash" | "loans" | "mortgage" | "stocks" | "vehicle" | "property" | "insurance" | "other_asset" | "other_liability"; }; }; }; responses: { /** @description Success */ 201: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Account"]; }; }; 403: components["responses"]["403"]; 404: components["responses"]["404"]; 422: components["responses"]["422"]; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/institutions/{id}/accounts": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List accounts in institution * @description Lists accounts belonging to an institution by its ID. */ get: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier of the institution. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: never; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Account"][]; }; }; 403: components["responses"]["403"]; 404: components["responses"]["404"]; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/transaction_accounts/{id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get transaction account * @description Gets a transaction account by its ID. */ get: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier of the transaction account. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: never; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["TransactionAccount"]; }; }; 403: components["responses"]["403"]; 404: components["responses"]["404"]; }; }; /** * Update transaction account * @description Updates the transaction account by its ID. */ put: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier of the transaction account. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: { content: { "application/json": { /** * @description The unique identifier of a new institution for the transaction account. * @example 42 */ institution_id?: number; /** * @description The starting balance amount of the transaction account. * @example 3547.45 */ starting_balance?: number; /** * @description The starting balance date of the transaction account. * @example 2015-03-15 */ starting_balance_date?: string; }; }; }; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["TransactionAccount"]; }; }; 403: components["responses"]["403"]; 404: components["responses"]["404"]; 422: components["responses"]["422"]; }; }; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/users/{id}/transaction_accounts": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List transaction accounts in user * @description List all transaction accounts belonging to a user. */ get: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier of the user. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: never; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["TransactionAccount"][]; }; }; 403: components["responses"]["403"]; 404: components["responses"]["404"]; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/transactions/{id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get a transaction * @description Gets a transaction by its ID. */ get: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier of the transaction. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: never; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Transaction"]; }; }; 403: components["responses"]["403"]; 404: components["responses"]["404"]; }; }; /** * Update a transaction * @description Updates a transaction by its ID. */ put: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier of the transaction. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: { content: { "application/json": { /** * @description A new memo for the transaction. * @example Rent */ memo?: string; /** * @description A new cheque number for the transaction. * @example 503113643691 */ cheque_number?: string; /** * @description A new payee for the transaction. * @example Bill */ payee?: string; /** * @description A new amount for the transaction. * @example 225 */ amount?: number; /** * @description A new date for the transaction. * @example 2018-02-27 */ date?: string; /** * @description Whether the transaction is a transfer or not. * @example false */ is_transfer?: boolean; /** * @description The unique identifier of a new category for the transaction. Sending an empty string will uncategorize the transaction. * @example 42 */ category_id?: number; /** @description A new note for the transaction. */ note?: string; /** * @description Whether the transaction needs to be reviewed or not. * @example false */ needs_review?: boolean; /** * @description A new comma-separated set of labels for the transaction. * @example foo,bar,baz */ labels?: string; }; }; }; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Transaction"]; }; }; 403: components["responses"]["403"]; 404: components["responses"]["404"]; 422: components["responses"]["422"]; }; }; post?: never; /** * Delete transaction * @description Deletes a transaction and all its data by ID. */ delete: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier of the transaction. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: never; responses: { /** @description Success */ 204: { headers: { [name: string]: unknown; }; content?: never; }; 403: components["responses"]["403"]; 404: components["responses"]["404"]; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/users/{id}/transactions": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List transactions in user * @description Lists transactions belonging to a user by their ID. */ get: { parameters: { query?: { /** * @description Limit to transactions on or after this date. Required if end_date is provided. If not provided, defaults to the furtherest date allowed by the user's subscription. * @example 2016-11-01 */ start_date?: string; /** * @description Limit to transactions on or before this date. Required if start_date is provided. If not provided, defaults to today's date. * @example 2016-11-30 */ end_date?: string; /** * @description Limit to transactions updated since an ISO 8601 timestamp. * @example 2020-10-14T09:20:33+13:00 */ updated_since?: string; /** * @description Limit to uncategorised transactions. * @example 1 */ uncategorised?: number; /** * @description Limit to transactions of this type. * @example debit */ type?: "debit" | "credit"; /** * @description Limit to transactions that need to be reviewed. * @example 1 */ needs_review?: number; /** * @description Limit to transactions matching a keyword search string. The provided string is matched against the transaction amount, account name, payee, category title, note, labels, and the date in ISO 8601 format. * @example Paypal */ search?: string; /** * @description Choose a particular page of the results. * @example 3 */ page?: number; }; header?: never; path: { /** * @description The unique identifier of the user. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: never; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Transaction"][]; }; }; 400: components["responses"]["400"]; 403: components["responses"]["403"]; 404: components["responses"]["404"]; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/accounts/{id}/transactions": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List transactions in account * @description Lists transactions belonging to an account by its ID. */ get: { parameters: { query?: { /** * @description Limit to transactions on or after this date. Required if end_date is provided. If not provided, defaults to the furtherest date allowed by the user's subscription. * @example 2016-11-01 */ start_date?: string; /** * @description Limit to transactions on or before this date. Required if start_date is provided. If not provided, defaults to today's date. * @example 2016-11-30 */ end_date?: string; /** * @description Limit to transactions updated since an ISO 8601 timestamp. * @example 2020-10-14T09:20:33+13:00 */ updated_since?: string; /** * @description Limit to uncategorised transactions. * @example 1 */ uncategorised?: number; /** * @description Limit to transactions of this type. * @example debit */ type?: "debit" | "credit"; /** * @description Limit to transactions that need to be reviewed. * @example 1 */ needs_review?: number; /** * @description Limit to transactions matching a keyword search string. The provided string is matched against the transaction amount, account name, payee, category title, note, labels, and the date in ISO 8601 format. * @example Paypal */ search?: string; /** * @description Choose a particular page of the results. * @example 3 */ page?: number; }; header?: never; path: { /** * @description The unique identifier of the account. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: never; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Transaction"][]; }; }; 400: components["responses"]["400"]; 403: components["responses"]["403"]; 404: components["responses"]["404"]; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/categories/{id}/transactions": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List transactions in categories * @description Lists transactions belonging to one or more categories by their IDs. */ get: { parameters: { query?: { /** * @description Limit to transactions on or after this date. Required if end_date is provided. If not provided, defaults to the furtherest date allowed by the user's subscription. * @example 2016-11-01 */ start_date?: string; /** * @description Limit to transactions on or before this date. Required if start_date is provided. If not provided, defaults to today's date. * @example 2016-11-30 */ end_date?: string; /** * @description Limit to transactions updated since an ISO 8601 timestamp. * @example 2020-10-14T09:20:33+13:00 */ updated_since?: string; /** * @description Limit to uncategorised transactions. * @example 1 */ uncategorised?: number; /** * @description Limit to transactions of this type. * @example debit */ type?: "debit" | "credit"; /** * @description Limit to transactions that need to be reviewed. * @example 1 */ needs_review?: number; /** * @description Limit to transactions matching a keyword search string. The provided string is matched against the transaction amount, account name, payee, category title, note, labels, and the date in ISO 8601 format. * @example Paypal */ search?: string; /** * @description Choose a particular page of the results. * @example 3 */ page?: number; }; header?: never; path: { /** * @description A comma-separated list of category IDs. * @example 42,43 */ id: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Transaction"][]; }; }; 400: components["responses"]["400"]; 403: components["responses"]["403"]; 404: components["responses"]["404"]; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/transaction_accounts/{id}/transactions": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List transactions in transaction account * @description Lists transactions belonging to a transaction account by its ID. */ get: { parameters: { query?: { /** * @description Limit to transactions on or after this date. Required if end_date is provided. If not provided, defaults to the furtherest date allowed by the user's subscription. * @example 2016-11-01 */ start_date?: string; /** * @description Limit to transactions on or before this date. Required if start_date is provided. If not provided, defaults to today's date. * @example 2016-11-30 */ end_date?: string; /** * @description Limit to transactions updated since an ISO 8601 timestamp. * @example 2020-10-14T09:20:33+13:00 */ updated_since?: string; /** * @description Limit to uncategorised transactions. * @example 1 */ uncategorised?: number; /** * @description Limit to transactions of this type. * @example debit */ type?: "debit" | "credit"; /** * @description Limit to transactions that need to be reviewed. * @example 1 */ needs_review?: number; /** * @description Limit to transactions matching a keyword search string. The provided string is matched against the transaction amount, account name, payee, category title, note, labels, and the date in ISO 8601 format. * @example Paypal */ search?: string; /** * @description Choose a particular page of the results. * @example 3 */ page?: number; }; header?: never; path: { /** * @description The unique identifier of the transaction account. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: never; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Transaction"][]; }; }; 400: components["responses"]["400"]; 403: components["responses"]["403"]; 404: components["responses"]["404"]; }; }; put?: never; /** * Create a transaction in transaction account * @description Creates a transaction in a transaction account by its ID. */ post: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier of the transaction account. * @example 42 */ id: number; }; cookie?: never; }; requestBody?: { content: { "application/json": { /** * @description The payee/merchant of the transaction. * @example Tex Otago */ payee: string; /** * @description The amount of the transaction. A positive amount is a credit, and a negative amount is a debit. * @example 11.5 */ amount: number; /** * @description The date when the transaction occurred. * @example 2018-02-27 */ date: string; /** * @description Whether the transaction should be indicated as a transfer. * @example false */ is_transfer?: boolean; /** * @description A set of comma-separated labels for the transaction. * @example lunch,mexican */ labels?: string; /** * @description The unique identifier of a category for the transaction. * @exam