diff --git a/VERSION.txt b/VERSION.txt index aaeac54d59..cbfa2cc121 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.8.23 \ No newline at end of file +5.8.24 \ No newline at end of file diff --git a/app/Console/Commands/EncryptNinja.php b/app/Console/Commands/EncryptNinja.php new file mode 100644 index 0000000000..162b574d85 --- /dev/null +++ b/app/Console/Commands/EncryptNinja.php @@ -0,0 +1,83 @@ +option('encrypt')) + return $this->encryptFiles(); + + if($this->option('decrypt')) { + return $this->decryptFiles(); + } + + } + + private function encryptFiles() + { + foreach ($this->files as $file) { + $contents = Storage::disk('base')->get($file); + $encrypted = encrypt($contents); + Storage::disk('base')->put($file.".enc", $encrypted); + Storage::disk('base')->delete($file); + } + } + + private function decryptFiles() + { + foreach ($this->files as $file) { + $encrypted_file = "{$file}.enc"; + $contents = Storage::disk('base')->get($encrypted_file); + $decrypted = decrypt($contents); + Storage::disk('base')->put($file, $decrypted); + } + } +} \ No newline at end of file diff --git a/app/Console/Commands/OpenApiYaml.php b/app/Console/Commands/OpenApiYaml.php index 68dc0317f1..6cee6d48d4 100644 --- a/app/Console/Commands/OpenApiYaml.php +++ b/app/Console/Commands/OpenApiYaml.php @@ -78,8 +78,9 @@ class OpenApiYaml extends Command Storage::disk('base')->append('/openapi/api-docs.yaml', file_get_contents($path.'/components.yaml')); - Storage::disk('base')->append('/openapi/api-docs.yaml', file_get_contents($path.'/components/responses.yaml')); Storage::disk('base')->append('/openapi/api-docs.yaml', file_get_contents($path.'/components/examples.yaml')); + + Storage::disk('base')->append('/openapi/api-docs.yaml', file_get_contents($path.'/components/responses.yaml')); $directory = new DirectoryIterator($path . '/components/responses/'); diff --git a/app/Export/CSV/ClientExport.php b/app/Export/CSV/ClientExport.php index 3fb7ee1eb0..e10e6e9cec 100644 --- a/app/Export/CSV/ClientExport.php +++ b/app/Export/CSV/ClientExport.php @@ -225,22 +225,6 @@ class ClientExport extends BaseExport $entity['client.assigned_user'] = $client->assigned_user ? $client->user->present()->name() : ''; } - // if (in_array('client.country_id', $this->input['report_keys'])) { - // $entity['client.country_id'] = $client->country ? ctrans("texts.country_{$client->country->name}") : ''; - // } - - // if (in_array('client.shipping_country_id', $this->input['report_keys'])) { - // $entity['client.shipping_country_id'] = $client->shipping_country ? ctrans("texts.country_{$client->shipping_country->name}") : ''; - // } - - // if (in_array('client.currency_id', $this->input['report_keys'])) { - // $entity['client.currency_id'] = $client->currency() ? $client->currency()->code : $client->company->currency()->code; - // } - - // if (in_array('client.industry_id', $this->input['report_keys'])) { - // $entity['industry_id'] = $client->industry ? ctrans("texts.industry_{$client->industry->name}") : ''; - // } - if (in_array('client.classification', $this->input['report_keys']) && isset($client->classification)) { $entity['client.classification'] = ctrans("texts.{$client->classification}") ?? ''; } diff --git a/app/Filters/ClientFilters.php b/app/Filters/ClientFilters.php index 559ef41c9c..a3504cce4e 100644 --- a/app/Filters/ClientFilters.php +++ b/app/Filters/ClientFilters.php @@ -165,6 +165,11 @@ class ClientFilters extends QueryFilters $dir = ($sort_col[1] == 'asc') ? 'asc' : 'desc'; + if($sort_col[0] == 'number') + { + return $this->builder->orderByRaw('ABS(number) ' . $dir); + } + return $this->builder->orderBy($sort_col[0], $dir); } diff --git a/app/Filters/CreditFilters.php b/app/Filters/CreditFilters.php index 8848318066..cee9b9b8d3 100644 --- a/app/Filters/CreditFilters.php +++ b/app/Filters/CreditFilters.php @@ -146,6 +146,11 @@ class CreditFilters extends QueryFilters ->whereColumn('clients.id', 'credits.client_id'), $dir); } + + if($sort_col[0] == 'number') { + return $this->builder->orderByRaw('ABS(number) ' . $dir); + } + return $this->builder->orderBy($sort_col[0], $dir); } diff --git a/app/Filters/ExpenseFilters.php b/app/Filters/ExpenseFilters.php index c9cddb8dc7..040fd375ac 100644 --- a/app/Filters/ExpenseFilters.php +++ b/app/Filters/ExpenseFilters.php @@ -172,6 +172,8 @@ class ExpenseFilters extends QueryFilters return $this->builder; } + $dir = ($sort_col[1] == 'asc') ? 'asc' : 'desc'; + if ($sort_col[0] == 'client_id' && in_array($sort_col[1], ['asc', 'desc'])) { return $this->builder ->orderByRaw('ISNULL(client_id), client_id '. $sort_col[1]) @@ -194,6 +196,10 @@ class ExpenseFilters extends QueryFilters ->whereColumn('expense_categories.id', 'expenses.category_id'), $sort_col[1]); } + if($sort_col[0] == 'number') { + return $this->builder->orderByRaw('ABS(number) ' . $dir); + } + if (is_array($sort_col) && in_array($sort_col[1], ['asc', 'desc']) && in_array($sort_col[0], ['public_notes', 'date', 'id_number', 'custom_value1', 'custom_value2', 'custom_value3', 'custom_value4'])) { return $this->builder->orderBy($sort_col[0], $sort_col[1]); } diff --git a/app/Filters/InvoiceFilters.php b/app/Filters/InvoiceFilters.php index f7c11e369f..aa0c51f0de 100644 --- a/app/Filters/InvoiceFilters.php +++ b/app/Filters/InvoiceFilters.php @@ -318,11 +318,16 @@ class InvoiceFilters extends QueryFilters if ($sort_col[0] == 'client_id') { - return $this->builder->orderBy(\App\Models\Client::select('name') + return $this->builder->orderBy(\App\Models\Client::select ('name') ->whereColumn('clients.id', 'invoices.client_id'), $dir); } + if($sort_col[0] == 'number') + { + return $this->builder->orderByRaw('ABS(number) ' . $dir); + } + return $this->builder->orderBy($sort_col[0], $dir); } diff --git a/app/Filters/PaymentFilters.php b/app/Filters/PaymentFilters.php index edef4df473..038bc11437 100644 --- a/app/Filters/PaymentFilters.php +++ b/app/Filters/PaymentFilters.php @@ -167,14 +167,18 @@ class PaymentFilters extends QueryFilters return $this->builder; } + $dir = ($sort_col[1] == 'asc') ? 'asc' : 'desc'; if ($sort_col[0] == 'client_id') { return $this->builder->orderBy(\App\Models\Client::select('name') - ->whereColumn('clients.id', 'payments.client_id'), $sort_col[1]); + ->whereColumn('clients.id', 'payments.client_id'), $dir); } + if($sort_col[0] == 'number') { + return $this->builder->orderByRaw('ABS(number) ' . $dir); + } - return $this->builder->orderBy($sort_col[0], $sort_col[1]); + return $this->builder->orderBy($sort_col[0], $dir); } public function date_range(string $date_range = ''): Builder diff --git a/app/Filters/ProjectFilters.php b/app/Filters/ProjectFilters.php index fdf778aa49..cd40155969 100644 --- a/app/Filters/ProjectFilters.php +++ b/app/Filters/ProjectFilters.php @@ -59,21 +59,24 @@ class ProjectFilters extends QueryFilters public function sort(string $sort = ''): Builder { $sort_col = explode('|', $sort); - - if ($sort_col[0] == 'client_id') { - return $this->builder->orderBy(\App\Models\Client::select('name') - ->whereColumn('clients.id', 'projects.client_id'), $sort_col[1]); - } - + if (!is_array($sort_col) || count($sort_col) != 2) { return $this->builder; } - if (is_array($sort_col) && in_array($sort_col[1], ['asc','desc'])) { - return $this->builder->orderBy($sort_col[0], $sort_col[1]); + $dir = ($sort_col[1] == 'asc') ? 'asc' : 'desc'; + + if ($sort_col[0] == 'client_id') { + return $this->builder->orderBy(\App\Models\Client::select('name') + ->whereColumn('clients.id', 'projects.client_id'), $dir); } - return $this->builder; + if($sort_col[0] == 'number') { + return $this->builder->orderByRaw('ABS(number) ' . $dir); + } + + return $this->builder->orderBy($sort_col[0], $dir); + } /** diff --git a/app/Filters/PurchaseOrderFilters.php b/app/Filters/PurchaseOrderFilters.php index 952e151463..5c1c1b460e 100644 --- a/app/Filters/PurchaseOrderFilters.php +++ b/app/Filters/PurchaseOrderFilters.php @@ -130,6 +130,10 @@ class PurchaseOrderFilters extends QueryFilters ->whereColumn('vendors.id', 'purchase_orders.vendor_id'), $dir); } + if($sort_col[0] == 'number') { + return $this->builder->orderByRaw('ABS(number) ' . $dir); + } + return $this->builder->orderBy($sort_col[0], $dir); } diff --git a/app/Filters/QuoteFilters.php b/app/Filters/QuoteFilters.php index e06562ee5e..db1985b691 100644 --- a/app/Filters/QuoteFilters.php +++ b/app/Filters/QuoteFilters.php @@ -155,6 +155,10 @@ class QuoteFilters extends QueryFilters } + if($sort_col[0] == 'number') { + return $this->builder->orderByRaw('ABS(number) ' . $dir); + } + if ($sort_col[0] == 'valid_until') { $sort_col[0] = 'due_date'; } diff --git a/app/Filters/RecurringExpenseFilters.php b/app/Filters/RecurringExpenseFilters.php index b8f3825dc5..c342625379 100644 --- a/app/Filters/RecurringExpenseFilters.php +++ b/app/Filters/RecurringExpenseFilters.php @@ -140,6 +140,8 @@ class RecurringExpenseFilters extends QueryFilters return $this->builder; } + $dir = ($sort_col[1] == 'asc') ? 'asc' : 'desc'; + if ($sort_col[0] == 'client_id' && in_array($sort_col[1], ['asc', 'desc'])) { return $this->builder ->orderByRaw('ISNULL(client_id), client_id '. $sort_col[1]) @@ -162,6 +164,10 @@ class RecurringExpenseFilters extends QueryFilters ->whereColumn('expense_categories.id', 'expenses.category_id'), $sort_col[1]); } + if($sort_col[0] == 'number') { + return $this->builder->orderByRaw('ABS(number) ' . $dir); + } + if (is_array($sort_col) && in_array($sort_col[1], ['asc', 'desc']) && in_array($sort_col[0], ['public_notes', 'date', 'id_number', 'custom_value1', 'custom_value2', 'custom_value3', 'custom_value4'])) { return $this->builder->orderBy($sort_col[0], $sort_col[1]); } diff --git a/app/Filters/TaskFilters.php b/app/Filters/TaskFilters.php index 9743fc63ca..09cac473e0 100644 --- a/app/Filters/TaskFilters.php +++ b/app/Filters/TaskFilters.php @@ -143,6 +143,10 @@ class TaskFilters extends QueryFilters ->whereColumn('users.id', 'tasks.user_id'), $dir); } + if($sort_col[0] == 'number') { + return $this->builder->orderByRaw('ABS(number) ' . $dir); + } + return $this->builder->orderBy($sort_col[0], $dir); } diff --git a/app/Filters/VendorFilters.php b/app/Filters/VendorFilters.php index e1a8eedacf..ffb428dbf1 100644 --- a/app/Filters/VendorFilters.php +++ b/app/Filters/VendorFilters.php @@ -71,6 +71,10 @@ class VendorFilters extends QueryFilters $dir = ($sort_col[1] == 'asc') ? 'asc' : 'desc'; + if($sort_col[0] == 'number') { + return $this->builder->orderByRaw('ABS(number) ' . $dir); + } + return $this->builder->orderBy($sort_col[0], $dir); } diff --git a/app/Helpers/Bank/Nordigen/Transformer/AccountTransformer.php b/app/Helpers/Bank/Nordigen/Transformer/AccountTransformer.php index ef9fec0e26..ab29fa67b9 100644 --- a/app/Helpers/Bank/Nordigen/Transformer/AccountTransformer.php +++ b/app/Helpers/Bank/Nordigen/Transformer/AccountTransformer.php @@ -104,9 +104,9 @@ class AccountTransformer implements AccountTransformerInterface return [ 'id' => $nordigen_account->metadata["id"], 'account_type' => "bank", - 'account_name' => $nordigen_account->data["iban"], + 'account_name' => isset($nordigen_account->data["iban"]) ? $nordigen_account->data["iban"] : '', 'account_status' => $nordigen_account->metadata["status"], - 'account_number' => '**** ' . substr($nordigen_account->data["iban"], -7), + 'account_number' => isset($nordigen_account->data["iban"]) ? '**** ' . substr($nordigen_account->data["iban"], -7) : '', 'provider_account_id' => $nordigen_account->metadata["id"], 'provider_id' => $nordigen_account->institution["id"], 'provider_name' => $nordigen_account->institution["name"], diff --git a/app/Http/Controllers/ClientController.php b/app/Http/Controllers/ClientController.php index 84722eda5c..9f19c338aa 100644 --- a/app/Http/Controllers/ClientController.php +++ b/app/Http/Controllers/ClientController.php @@ -11,37 +11,46 @@ namespace App\Http\Controllers; -use App\Events\Client\ClientWasCreated; -use App\Events\Client\ClientWasUpdated; +use App\Utils\Ninja; +use App\Models\Quote; +use App\Models\Client; +use App\Models\Credit; +use App\Models\Account; +use App\Models\Company; +use App\Models\Invoice; +use App\Models\Document; +use App\Models\SystemLog; +use Postmark\PostmarkClient; +use Illuminate\Http\Response; use App\Factory\ClientFactory; use App\Filters\ClientFilters; +use App\Utils\Traits\MakesHash; +use App\Utils\Traits\Uploadable; +use App\Utils\Traits\BulkOptions; +use App\Jobs\Client\UpdateTaxData; +use App\Utils\Traits\SavesDocuments; +use App\Repositories\ClientRepository; +use App\Events\Client\ClientWasCreated; +use App\Events\Client\ClientWasUpdated; +use App\Transformers\ClientTransformer; +use Illuminate\Support\Facades\Storage; +use App\Services\Template\TemplateAction; +use App\Jobs\PostMark\ProcessPostmarkWebhook; use App\Http\Requests\Client\BulkClientRequest; -use App\Http\Requests\Client\CreateClientRequest; -use App\Http\Requests\Client\DestroyClientRequest; use App\Http\Requests\Client\EditClientRequest; -use App\Http\Requests\Client\PurgeClientRequest; -use App\Http\Requests\Client\ReactivateClientEmailRequest; use App\Http\Requests\Client\ShowClientRequest; +use App\Http\Requests\Client\PurgeClientRequest; use App\Http\Requests\Client\StoreClientRequest; +use App\Http\Requests\Client\CreateClientRequest; use App\Http\Requests\Client\UpdateClientRequest; use App\Http\Requests\Client\UploadClientRequest; -use App\Jobs\Client\UpdateTaxData; -use App\Jobs\PostMark\ProcessPostmarkWebhook; -use App\Models\Account; -use App\Models\Client; -use App\Models\Company; -use App\Models\SystemLog; -use App\Repositories\ClientRepository; -use App\Services\Template\TemplateAction; -use App\Transformers\ClientTransformer; -use App\Utils\Ninja; -use App\Utils\Traits\BulkOptions; -use App\Utils\Traits\MakesHash; -use App\Utils\Traits\SavesDocuments; -use App\Utils\Traits\Uploadable; -use Illuminate\Http\Response; -use Illuminate\Support\Facades\Storage; -use Postmark\PostmarkClient; +use App\Http\Requests\Client\DestroyClientRequest; +use App\Http\Requests\Client\ClientDocumentsRequest; +use App\Http\Requests\Client\ReactivateClientEmailRequest; +use App\Models\Expense; +use App\Models\Payment; +use App\Models\Task; +use App\Transformers\DocumentTransformer; /** * Class ClientController. @@ -402,4 +411,24 @@ class ClientController extends BaseController } } + + public function documents(ClientDocumentsRequest $request, Client $client) + { + + $this->entity_type = Document::class; + + $this->entity_transformer = DocumentTransformer::class; + + $documents = Document::query() + ->company() + ->whereHasMorph('documentable', [Invoice::class, Quote::class, Credit::class, Expense::class, Payment::class, Task::class], function ($query) use($client) { + $query->where('client_id', $client->id); + }) + ->orWhereHasMorph('documentable', [Client::class], function ($query) use ($client){ + $query->where('id', $client->id); + }); + + return $this->listResponse($documents); + + } } diff --git a/app/Http/Controllers/ClientPortal/PaymentMethodController.php b/app/Http/Controllers/ClientPortal/PaymentMethodController.php index b8b0441679..5d131daad7 100644 --- a/app/Http/Controllers/ClientPortal/PaymentMethodController.php +++ b/app/Http/Controllers/ClientPortal/PaymentMethodController.php @@ -144,7 +144,10 @@ class PaymentMethodController extends Controller try { event(new MethodDeleted($payment_method, auth()->guard('contact')->user()->company, Ninja::eventVars(auth()->guard('contact')->user()->id))); + $payment_method->is_deleted = true; $payment_method->delete(); + $payment_method->save(); + } catch (Exception $e) { nlog($e->getMessage()); diff --git a/app/Http/Controllers/ImportController.php b/app/Http/Controllers/ImportController.php index edd51d5d6f..81ae401033 100644 --- a/app/Http/Controllers/ImportController.php +++ b/app/Http/Controllers/ImportController.php @@ -260,7 +260,7 @@ class ImportController extends Controller } } - return $bestDelimiter; + return $bestDelimiter ?? ','; } } diff --git a/app/Http/Middleware/TokenAuth.php b/app/Http/Middleware/TokenAuth.php index 37776bb7c0..ab62859f2f 100644 --- a/app/Http/Middleware/TokenAuth.php +++ b/app/Http/Middleware/TokenAuth.php @@ -74,6 +74,7 @@ class TokenAuth */ app('queue')->createPayloadUsing(function () use ($company_token) { return ['db' => $company_token->company->db]; + // return ['db' => $company_token->company->db, 'is_premium' => $company_token->account->isPremium()]; }); //user who once existed, but has been soft deleted diff --git a/app/Http/Requests/Client/ClientDocumentsRequest.php b/app/Http/Requests/Client/ClientDocumentsRequest.php new file mode 100644 index 0000000000..bbcdf3cf02 --- /dev/null +++ b/app/Http/Requests/Client/ClientDocumentsRequest.php @@ -0,0 +1,30 @@ +user(); + + return $user->can('view', $this->client); + } +} diff --git a/app/Http/Requests/Client/PurgeClientRequest.php b/app/Http/Requests/Client/PurgeClientRequest.php index 7af1ae59e8..68f4fe57cd 100644 --- a/app/Http/Requests/Client/PurgeClientRequest.php +++ b/app/Http/Requests/Client/PurgeClientRequest.php @@ -22,6 +22,9 @@ class PurgeClientRequest extends Request */ public function authorize(): bool { - return auth()->user()->isAdmin(); + /** @var \App\Models\User $user */ + $user = auth()->user(); + + return $user->isAdmin(); } } diff --git a/app/Http/Requests/Client/StoreClientRequest.php b/app/Http/Requests/Client/StoreClientRequest.php index d5df974dc8..66aa798b0a 100644 --- a/app/Http/Requests/Client/StoreClientRequest.php +++ b/app/Http/Requests/Client/StoreClientRequest.php @@ -93,7 +93,7 @@ class StoreClientRequest extends Request $rules['number'] = ['bail', 'nullable', Rule::unique('clients')->where('company_id', $user->company()->id)]; $rules['id_number'] = ['bail', 'nullable', Rule::unique('clients')->where('company_id', $user->company()->id)]; - $rules['classification'] = 'bail|sometimes|nullable|in:individual,business,partnership,trust,charity,government,other'; + $rules['classification'] = 'bail|sometimes|nullable|in:individual,business,company,partnership,trust,charity,government,other'; return $rules; } diff --git a/app/Http/Requests/Client/UpdateClientRequest.php b/app/Http/Requests/Client/UpdateClientRequest.php index 053cd12a32..b891731cbd 100644 --- a/app/Http/Requests/Client/UpdateClientRequest.php +++ b/app/Http/Requests/Client/UpdateClientRequest.php @@ -60,7 +60,7 @@ class UpdateClientRequest extends Request $rules['size_id'] = 'integer|nullable'; $rules['country_id'] = 'integer|nullable'; $rules['shipping_country_id'] = 'integer|nullable'; - $rules['classification'] = 'bail|sometimes|nullable|in:individual,business,partnership,trust,charity,government,other'; + $rules['classification'] = 'bail|sometimes|nullable|in:individual,business,company,partnership,trust,charity,government,other'; if ($this->id_number) { $rules['id_number'] = Rule::unique('clients')->where('company_id', $user->company()->id)->ignore($this->client->id); diff --git a/app/Http/Requests/ExpenseCategory/StoreExpenseCategoryRequest.php b/app/Http/Requests/ExpenseCategory/StoreExpenseCategoryRequest.php index 23b028bb1c..45c614b8fd 100644 --- a/app/Http/Requests/ExpenseCategory/StoreExpenseCategoryRequest.php +++ b/app/Http/Requests/ExpenseCategory/StoreExpenseCategoryRequest.php @@ -11,6 +11,7 @@ namespace App\Http\Requests\ExpenseCategory; +use App\Models\Expense; use App\Http\Requests\Request; use App\Models\ExpenseCategory; @@ -23,14 +24,21 @@ class StoreExpenseCategoryRequest extends Request */ public function authorize(): bool { - return auth()->user()->can('create', ExpenseCategory::class); + /** @var \App\Models\User $user */ + $user = auth()->user(); + + return $user->can('create', ExpenseCategory::class) || $user->can('create', Expense::class); } public function rules() { + + /** @var \App\Models\User $user */ + $user = auth()->user(); + $rules = []; - $rules['name'] = 'required|unique:expense_categories,name,null,null,company_id,'.auth()->user()->companyId(); + $rules['name'] = 'required|unique:expense_categories,name,null,null,company_id,'.$user->companyId(); return $this->globalRules($rules); } diff --git a/app/Http/Requests/ExpenseCategory/UpdateExpenseCategoryRequest.php b/app/Http/Requests/ExpenseCategory/UpdateExpenseCategoryRequest.php index 05293be59b..1ff371ff69 100644 --- a/app/Http/Requests/ExpenseCategory/UpdateExpenseCategoryRequest.php +++ b/app/Http/Requests/ExpenseCategory/UpdateExpenseCategoryRequest.php @@ -26,16 +26,24 @@ class UpdateExpenseCategoryRequest extends Request */ public function authorize(): bool { - return auth()->user()->can('edit', $this->expense_category); + + /** @var \App\Models\User $user */ + $user = auth()->user(); + + return $user->can('edit', $this->expense_category); } public function rules() { + + /** @var \App\Models\User $user */ + $user = auth()->user(); + $rules = []; if ($this->input('name')) { // $rules['name'] = 'unique:expense_categories,name,'.$this->id.',id,company_id,'.$this->expense_category->company_id; - $rules['name'] = Rule::unique('expense_categories')->where('company_id', auth()->user()->company()->id)->ignore($this->expense_category->id); + $rules['name'] = Rule::unique('expense_categories')->where('company_id', $user->company()->id)->ignore($this->expense_category->id); } return $rules; diff --git a/app/Http/Requests/Request.php b/app/Http/Requests/Request.php index 62cd0624a9..1a058e1eb5 100644 --- a/app/Http/Requests/Request.php +++ b/app/Http/Requests/Request.php @@ -198,6 +198,18 @@ class Request extends FormRequest } } + if(isset($input['public_notes'])) + $input['public_notes'] = str_replace("company()->settings->currency_id; } + if (isset($input['name'])) { + $input['name'] = strip_tags($input['name']); + } + $input = $this->decodePrimaryKeys($input); $this->replace($input); diff --git a/app/Http/Requests/Vendor/UpdateVendorRequest.php b/app/Http/Requests/Vendor/UpdateVendorRequest.php index 2f49179f7b..cf2d5a884f 100644 --- a/app/Http/Requests/Vendor/UpdateVendorRequest.php +++ b/app/Http/Requests/Vendor/UpdateVendorRequest.php @@ -74,7 +74,7 @@ class UpdateVendorRequest extends Request } $rules['language_id'] = 'bail|nullable|sometimes|exists:languages,id'; - $rules['classification'] = 'bail|sometimes|nullable|in:individual,company,partnership,trust,charity,government,other'; + $rules['classification'] = 'bail|sometimes|nullable|in:individual,business,company,partnership,trust,charity,government,other'; return $rules; } @@ -92,8 +92,8 @@ class UpdateVendorRequest extends Request { $input = $this->all(); - if (array_key_exists('assigned_user_id', $input) && is_string($input['assigned_user_id'])) { - $input['assigned_user_id'] = $this->decodePrimaryKey($input['assigned_user_id']); + if (isset($input['name'])) { + $input['name'] = strip_tags($input['name']); } if (array_key_exists('country_id', $input) && is_null($input['country_id'])) { diff --git a/app/Import/Definitions/TaskMap.php b/app/Import/Definitions/TaskMap.php index 08af5d591b..c2218341c3 100644 --- a/app/Import/Definitions/TaskMap.php +++ b/app/Import/Definitions/TaskMap.php @@ -31,9 +31,9 @@ class TaskMap 12 => 'task.duration', 13 => 'task.status', 14 => 'task.custom_value1', - 15 => 'task.custom_value1', - 16 => 'task.custom_value1', - 17 => 'task.custom_value1', + 15 => 'task.custom_value2', + 16 => 'task.custom_value3', + 17 => 'task.custom_value4', 18 => 'task.notes', ]; } diff --git a/app/Import/Providers/BaseImport.php b/app/Import/Providers/BaseImport.php index db9d3807ba..56bda23e86 100644 --- a/app/Import/Providers/BaseImport.php +++ b/app/Import/Providers/BaseImport.php @@ -152,7 +152,8 @@ class BaseImport } } - return $bestDelimiter; + + return $bestDelimiter ?? ','; } public function mapCSVHeaderToKeys($csvData) diff --git a/app/Import/Transformer/Csv/TaskTransformer.php b/app/Import/Transformer/Csv/TaskTransformer.php index cfe44f7676..d2c6d4538f 100644 --- a/app/Import/Transformer/Csv/TaskTransformer.php +++ b/app/Import/Transformer/Csv/TaskTransformer.php @@ -115,11 +115,22 @@ class TaskTransformer extends BaseTransformer $this->stubbed_timestamp = $stub_start_date->timestamp; return $stub_start_date->timestamp; + } catch (\Exception $e) { + nlog("fall back failed too" . $e->getMessage()); + // return $this->stubbed_timestamp; + } + + + try { + + $stub_start_date = \Carbon\Carbon::createFromFormat($this->company->date_format(), $stub_start_date); + $this->stubbed_timestamp = $stub_start_date->timestamp; } catch (\Exception $e) { nlog($e->getMessage()); return $this->stubbed_timestamp; } + } private function resolveEndDate($item) @@ -142,9 +153,23 @@ class TaskTransformer extends BaseTransformer } catch (\Exception $e) { nlog($e->getMessage()); + // return $this->stubbed_timestamp; + } + + + + try { + + $stub_end_date = \Carbon\Carbon::createFromFormat($this->company->date_format(), $stub_end_date); + $this->stubbed_timestamp = $stub_end_date->timestamp; + } catch (\Exception $e) { + nlog("fall back failed too" . $e->getMessage()); return $this->stubbed_timestamp; } + + + } private function getTaskStatusId($item): ?int diff --git a/app/Jobs/Company/CompanyExport.php b/app/Jobs/Company/CompanyExport.php index 406ac09e99..00b69d235b 100644 --- a/app/Jobs/Company/CompanyExport.php +++ b/app/Jobs/Company/CompanyExport.php @@ -111,13 +111,16 @@ $this->export_data = null; $this->export_data['users'] = $this->company->users()->withTrashed()->cursor()->map(function ($user) { $user->account_id = $this->encodePrimaryKey($user->account_id); + return $user; })->all(); + $x = $this->writer->collection('users'); $x->addItems($this->export_data['users']); $this->export_data = null; + $this->export_data['client_contacts'] = $this->company->client_contacts->map(function ($client_contact) { $client_contact = $this->transformArrayOfKeys($client_contact, ['company_id', 'user_id', 'client_id']); @@ -663,20 +666,9 @@ $this->writer->end(); private function zipAndSend() { - // $file_name = date('Y-m-d').'_'.str_replace([" ", "/"], ["_",""], $this->company->present()->name() . '_' . $this->company->company_key .'.zip'); $zip_path = \Illuminate\Support\Str::ascii(str_replace(".json", ".zip", $this->file_name)); - // $path = 'backups'; - // Storage::makeDirectory(storage_path('backups/')); - - // try { - // mkdir(storage_path('backups/')); - // } catch(\Exception $e) { - // nlog("could not create directory"); - // } - - // $zip_path = storage_path('backups/'.\Illuminate\Support\Str::ascii($file_name)); $zip = new \ZipArchive(); if ($zip->open($zip_path, \ZipArchive::CREATE) !== true) { @@ -686,7 +678,6 @@ $this->writer->end(); $zip->addFile($this->file_name); $zip->renameName($this->file_name, 'backup.json'); - // $zip->addFromString("backup.json", json_encode($this->export_data)); $zip->close(); Storage::disk(config('filesystems.default'))->put('backups/'.str_replace(".json", ".zip",$this->file_name), file_get_contents($zip_path)); @@ -695,6 +686,10 @@ $this->writer->end(); unlink($zip_path); } + if(file_exists($this->file_name)){ + unlink($this->file_name); + } + if(Ninja::isSelfHost()) { $storage_path = 'backups/'.str_replace(".json", ".zip",$this->file_name); } else { @@ -709,8 +704,6 @@ $this->writer->end(); $t = app('translator'); $t->replace(Ninja::transformTranslations($this->company->settings)); - // $company_reference = Company::find($this->company->id); - $nmo = new NinjaMailerObject(); $nmo->mailable = new DownloadBackup($url, $this->company->withoutRelations()); $nmo->to_user = $this->user; diff --git a/app/Jobs/Company/CompanyImport.php b/app/Jobs/Company/CompanyImport.php index 4636fb4043..0fe90c3e22 100644 --- a/app/Jobs/Company/CompanyImport.php +++ b/app/Jobs/Company/CompanyImport.php @@ -312,7 +312,7 @@ class CompanyImport implements ShouldQueue } unlink($tmp_file); - unlink($this->file_location); + unlink(Storage::path($this->file_location)); } // diff --git a/app/Jobs/Mail/NinjaMailer.php b/app/Jobs/Mail/NinjaMailer.php index 9dfd369de3..8f5de94390 100644 --- a/app/Jobs/Mail/NinjaMailer.php +++ b/app/Jobs/Mail/NinjaMailer.php @@ -34,6 +34,7 @@ class NinjaMailer extends Mailable */ public function build() { + $from_name = config('mail.from.name'); if (property_exists($this->mail_obj, 'from_name')) { diff --git a/app/Livewire/BillingPortalPurchase.php b/app/Livewire/BillingPortalPurchase.php index 0889c2fc88..8ba6fe855d 100644 --- a/app/Livewire/BillingPortalPurchase.php +++ b/app/Livewire/BillingPortalPurchase.php @@ -106,6 +106,7 @@ class BillingPortalPurchase extends Component public $steps = [ 'passed_email' => false, 'existing_user' => false, + 'check_rff' => false, 'fetched_payment_methods' => false, 'fetched_client' => false, 'show_start_trial' => false, @@ -181,6 +182,12 @@ class BillingPortalPurchase extends Component */ public $campaign; + public ?string $contact_first_name; + + public ?string $contact_last_name; + + public ?string $contact_email; + public function mount() { MultiDB::setDb($this->db); @@ -316,10 +323,14 @@ class BillingPortalPurchase extends Component */ protected function getPaymentMethods(ClientContact $contact): self { - Auth::guard('contact')->loginUsingId($contact->id, true); - $this->contact = $contact; + if ($contact->showRff()) { + return $this->rff(); + } + + Auth::guard('contact')->loginUsingId($contact->id, true); + if ($this->subscription->trial_enabled) { $this->heading_text = ctrans('texts.plan_trial'); $this->steps['show_start_trial'] = true; @@ -340,6 +351,33 @@ class BillingPortalPurchase extends Component return $this; } + protected function rff() + { + $this->contact_first_name = $this->contact->first_name; + $this->contact_last_name = $this->contact->last_name; + $this->contact_email = $this->contact->email; + + $this->steps['check_rff'] = true; + + return $this; + } + + public function handleRff() + { + $validated = $this->validate([ + 'contact_first_name' => ['required'], + 'contact_last_name' => ['required'], + 'contact_email' => ['required', 'email'], + ]); + + $this->contact->first_name = $validated['contact_first_name']; + $this->contact->last_name = $validated['contact_last_name']; + $this->contact->email = $validated['contact_email']; + $this->contact->save(); + + return $this->getPaymentMethods($this->contact); + } + /** * Middle method between selecting payment method & * submitting the from to the backend. diff --git a/app/Livewire/SubscriptionPlanSwitch.php b/app/Livewire/SubscriptionPlanSwitch.php index a4518efe84..df39bade41 100644 --- a/app/Livewire/SubscriptionPlanSwitch.php +++ b/app/Livewire/SubscriptionPlanSwitch.php @@ -44,7 +44,7 @@ class SubscriptionPlanSwitch extends Component /** * @var ClientContact */ - public $contact; + public ClientContact $contact; /** * @var array @@ -66,6 +66,7 @@ class SubscriptionPlanSwitch extends Component 'invoice' => null, 'company_gateway_id' => null, 'payment_method_id' => null, + 'show_rff' => false, ]; /** @@ -75,6 +76,12 @@ class SubscriptionPlanSwitch extends Component public $company; + public ?string $first_name; + + public ?string $last_name; + + public ?string $email; + public function mount() { MultiDB::setDb($this->company->db); @@ -84,6 +91,31 @@ class SubscriptionPlanSwitch extends Component $this->methods = $this->contact->client->service()->getPaymentMethods($this->amount); $this->hash = Str::uuid()->toString(); + + $this->state['show_rff'] = auth()->guard('contact')->user()->showRff(); + + $this->first_name = $this->contact->first_name; + + $this->last_name = $this->contact->last_name; + + $this->email = $this->contact->email; + } + + public function handleRff() + { + $this->validate([ + 'first_name' => ['required'], + 'last_name' => ['required'], + 'email' => ['required', 'email'], + ]); + + $this->contact->update([ + 'first_name' => $this->first_name, + 'last_name' => $this->last_name, + 'email' => $this->email, + ]); + + $this->state['show_rff'] = false; } public function handleBeforePaymentEvents(): void diff --git a/app/Models/Account.php b/app/Models/Account.php index 7249f43080..32b81723e4 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -294,6 +294,11 @@ class Account extends BaseModel return Ninja::isNinja() ? ($this->isPaidHostedClient() && !$this->isTrial()) : $this->hasFeature(self::FEATURE_WHITE_LABEL); } + public function isPremium(): bool + { + return Ninja::isHosted() && $this->isPaidHostedClient() && !$this->isTrial() && Carbon::createFromTimestamp($this->created_at)->diffInMonths() > 2; + } + public function isPaidHostedClient(): bool { if (!Ninja::isNinja()) { diff --git a/app/Models/RecurringExpense.php b/app/Models/RecurringExpense.php index ed37adba93..b83bf4b7a3 100644 --- a/app/Models/RecurringExpense.php +++ b/app/Models/RecurringExpense.php @@ -77,6 +77,7 @@ use Illuminate\Support\Carbon; * @property-read mixed $hashed_id * @property-read \App\Models\User $user * @property-read \App\Models\Vendor|null $vendor + * @property-read \App\Models\ExpenseCategory|null $category * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() * @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns) * @method static \Database\Factories\RecurringExpenseFactory factory($count = null, $state = []) @@ -140,17 +141,6 @@ use Illuminate\Support\Carbon; * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense withTrashed() * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense withoutTrashed() * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $documents * @mixin \Eloquent */ class RecurringExpense extends BaseModel @@ -247,6 +237,12 @@ class RecurringExpense extends BaseModel return $this->belongsTo(Client::class); } + public function category(): \Illuminate\Database\Eloquent\Relations\BelongsTo + { + return $this->belongsTo(ExpenseCategory::class)->withTrashed(); + } + + /** * Service entry points. */ diff --git a/app/Models/Subscription.php b/app/Models/Subscription.php index 960817cac9..132b57cfe6 100644 --- a/app/Models/Subscription.php +++ b/app/Models/Subscription.php @@ -11,7 +11,9 @@ namespace App\Models; +use App\Services\Subscription\PaymentLinkService; use App\Services\Subscription\SubscriptionService; +use App\Services\Subscription\SubscriptionStatus; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\SoftDeletes; @@ -121,6 +123,8 @@ class Subscription extends BaseModel 'updated_at' => 'timestamp', 'created_at' => 'timestamp', 'deleted_at' => 'timestamp', + 'trial_enabled' => 'boolean', + 'allow_plan_changes' => 'boolean', ]; protected $with = [ @@ -132,6 +136,16 @@ class Subscription extends BaseModel return new SubscriptionService($this); } + public function link_service(): PaymentLinkService + { + return new PaymentLinkService($this); + } + + public function status(RecurringInvoice $recurring_invoice): SubscriptionStatus + { + return (new SubscriptionStatus($this, $recurring_invoice))->run(); + } + public function company(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Company::class); diff --git a/app/Providers/ComposerServiceProvider.php b/app/Providers/ComposerServiceProvider.php index 7c8199142f..4f71bdf6a2 100644 --- a/app/Providers/ComposerServiceProvider.php +++ b/app/Providers/ComposerServiceProvider.php @@ -24,6 +24,18 @@ class ComposerServiceProvider extends ServiceProvider public function boot() { view()->composer('portal.*', PortalComposer::class); + + // view()->composer( + // ['email.admin.generic', 'email.client.generic'], + // function ($view) { + // $view->with( + // 'template', + // Ninja::isHosted() + // ); + // } + // ); + + } /** diff --git a/app/Providers/MultiDBProvider.php b/app/Providers/MultiDBProvider.php index 8ff9c569dc..4f01911ea0 100644 --- a/app/Providers/MultiDBProvider.php +++ b/app/Providers/MultiDBProvider.php @@ -33,6 +33,7 @@ class MultiDBProvider extends ServiceProvider */ public function register() { + $this->app['events']->listen( JobProcessing::class, function ($event) { diff --git a/app/Repositories/TaskRepository.php b/app/Repositories/TaskRepository.php index f003d4f7a1..426b2e5ed8 100644 --- a/app/Repositories/TaskRepository.php +++ b/app/Repositories/TaskRepository.php @@ -141,7 +141,7 @@ class TaskRepository extends BaseRepository { if(isset($time_log[0][0])) { - return \Carbon\Carbon::createFromTimestamp($time_log[0][0])->addSeconds($task->company->utc_offset()); + return \Carbon\Carbon::createFromTimestamp($time_log[0][0]); } return null; diff --git a/app/Services/Invoice/AutoBillInvoice.php b/app/Services/Invoice/AutoBillInvoice.php index 1ba0846199..1c65aa6999 100644 --- a/app/Services/Invoice/AutoBillInvoice.php +++ b/app/Services/Invoice/AutoBillInvoice.php @@ -323,13 +323,22 @@ class AutoBillInvoice extends AbstractService public function getGateway($amount) { //get all client gateway tokens and set the is_default one to the first record - $gateway_tokens = $this->client - ->gateway_tokens() - ->whereHas('gateway', function ($query) { - $query->where('is_deleted', 0) - ->where('deleted_at', null); - })->orderBy('is_default', 'DESC') - ->get(); + $gateway_tokens = \App\Models\ClientGatewayToken::query() + ->where('client_id', $this->client->id) + ->where('is_deleted', 0) + ->whereHas('gateway', function ($query) { + $query->where('is_deleted', 0) + ->where('deleted_at', null); + })->orderBy('is_default', 'DESC') + ->get(); + + // $gateway_tokens = $this->client + // ->gateway_tokens() + // ->whereHas('gateway', function ($query) { + // $query->where('is_deleted', 0) + // ->where('deleted_at', null); + // })->orderBy('is_default', 'DESC') + // ->get(); $filtered_gateways = $gateway_tokens->filter(function ($gateway_token) use ($amount) { $company_gateway = $gateway_token->gateway; diff --git a/app/Services/Pdf/PdfBuilder.php b/app/Services/Pdf/PdfBuilder.php index 6cdfa06a7b..601bf2229d 100644 --- a/app/Services/Pdf/PdfBuilder.php +++ b/app/Services/Pdf/PdfBuilder.php @@ -1239,7 +1239,7 @@ class PdfBuilder public function productTable(): array { $product_items = collect($this->service->config->entity->line_items)->filter(function ($item) { - return $item->type_id == 1 || $item->type_id == 6 || $item->type_id == 5; + return $item->type_id == 1 || $item->type_id == 6 || $item->type_id == 5 || $item->type_id == 4; }); if (count($product_items) == 0) { diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index 69ba99d5ff..01314aa561 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -441,7 +441,7 @@ class Design extends BaseDesign public function productTable(): array { $product_items = collect($this->entity->line_items)->filter(function ($item) { - return $item->type_id == 1 || $item->type_id == 6 || $item->type_id == 5; + return $item->type_id == 1 || $item->type_id == 6 || $item->type_id == 5 || $item->type_id == 4; }); if (count($product_items) == 0) { diff --git a/app/Services/Subscription/ChangePlanInvoice.php b/app/Services/Subscription/ChangePlanInvoice.php new file mode 100644 index 0000000000..b732072e89 --- /dev/null +++ b/app/Services/Subscription/ChangePlanInvoice.php @@ -0,0 +1,128 @@ +status = $this->recurring_invoice + ->subscription + ->status($this->recurring_invoice); + + //refund + $refund = $this->status->getProRataRefund(); + + //newcharges + $new_charge = $this->target->price; + + $invoice = $this->generateInvoice($refund); + + if($refund >= $new_charge){ + $invoice = $invoice->markPaid()->save(); + + //generate new recurring invoice at this point as we know the user has succeeded with their upgrade. + } + + if($refund > $new_charge) + return $this->generateCredit($refund - $new_charge); + + return $invoice; + } + + private function generateCredit(float $credit_balance): Credit + { + + $credit_repo = new CreditRepository(); + + $credit = CreditFactory::create($this->target->company_id, $this->target->user_id); + $credit->status_id = Credit::STATUS_SENT; + $credit->date = now()->addSeconds($this->recurring_invoice->client->timezone_offset())->format('Y-m-d'); + $credit->subscription_id = $this->target->id; + + $invoice_item = new InvoiceItem(); + $invoice_item->type_id = '1'; + $invoice_item->product_key = ctrans('texts.credit'); + $invoice_item->notes = ctrans('texts.credit') . " # {$this->recurring_invoice->subscription->name} #"; + $invoice_item->quantity = 1; + $invoice_item->cost = $credit_balance; + + $invoice_items = []; + $invoice_items[] = $invoice_item; + + $data = [ + 'client_id' => $this->recurring_invoice->client_id, + 'date' => now()->format('Y-m-d'), + ]; + + return $credit_repo->save($data, $credit)->service()->markSent()->fillDefaults()->save(); + + } + + //Careful with Invoice Numbers. + private function generateInvoice(float $refund): Invoice + { + + $subscription_repo = new SubscriptionRepository(); + $invoice_repo = new InvoiceRepository(); + + $invoice = InvoiceFactory::create($this->target->company_id, $this->target->user_id); + $invoice->date = now()->format('Y-m-d'); + $invoice->subscription_id = $this->target->id; + + $invoice_item = new InvoiceItem(); + $invoice_item->type_id = '1'; + $invoice_item->product_key = ctrans('texts.refund'); + $invoice_item->notes = ctrans('texts.refund'). " #{$this->status->refundable_invoice->number}"; + $invoice_item->quantity = 1; + $invoice_item->cost = $refund; + + $invoice_items = []; + $invoice_items[] = $subscription_repo->generateLineItems($this->target); + $invoice_items[] = $invoice_item; + $invoice->line_items = $invoice_items; + $invoice->is_proforma = true; + + $data = [ + 'client_id' => $this->recurring_invoice->client_id, + 'date' => now()->addSeconds($this->recurring_invoice->client->timezone_offset())->format('Y-m-d'), + ]; + + $invoice = $invoice_repo->save($data, $invoice) + ->service() + ->markSent() + ->fillDefaults() + ->save(); + + return $invoice; + + } +} \ No newline at end of file diff --git a/app/Services/Subscription/InvoiceToRecurring.php b/app/Services/Subscription/InvoiceToRecurring.php new file mode 100644 index 0000000000..8ba371a37b --- /dev/null +++ b/app/Services/Subscription/InvoiceToRecurring.php @@ -0,0 +1,70 @@ +subscription->company->db); + + $client = Client::withTrashed()->find($this->client_id); + + $subscription_repo = new SubscriptionRepository(); + + $line_items = count($this->bundle) > 1 ? $subscription_repo->generateBundleLineItems($this->bundle, true, false) : $subscription_repo->generateLineItems($this->subscription, true, false); + + $recurring_invoice = RecurringInvoiceFactory::create($this->subscription->company_id, $this->subscription->user_id); + $recurring_invoice->client_id = $this->client_id; + $recurring_invoice->line_items = $line_items; + $recurring_invoice->subscription_id = $this->subscription->id; + $recurring_invoice->frequency_id = $this->subscription->frequency_id ?: RecurringInvoice::FREQUENCY_MONTHLY; + $recurring_invoice->date = now(); + $recurring_invoice->remaining_cycles = -1; + $recurring_invoice->auto_bill = $client->getSetting('auto_bill'); + $recurring_invoice->auto_bill_enabled = $this->setAutoBillFlag($recurring_invoice->auto_bill); + $recurring_invoice->due_date_days = 'terms'; + $recurring_invoice->next_send_date = now()->format('Y-m-d'); + $recurring_invoice->next_send_date_client = now()->format('Y-m-d'); + $recurring_invoice->next_send_date = $recurring_invoice->nextSendDate(); + $recurring_invoice->next_send_date_client = $recurring_invoice->nextSendDateClient(); + + return $recurring_invoice; + + } + + private function setAutoBillFlag($auto_bill): bool + { + if ($auto_bill == 'always' || $auto_bill == 'optout') { + return true; + } + + return false; + } +} \ No newline at end of file diff --git a/app/Services/Subscription/PaymentLinkService.php b/app/Services/Subscription/PaymentLinkService.php new file mode 100644 index 0000000000..d62e4f51a7 --- /dev/null +++ b/app/Services/Subscription/PaymentLinkService.php @@ -0,0 +1,469 @@ +data, 'billing_context')) { + throw new \Exception("Illegal entrypoint into method, payload must contain billing context"); + } + + if ($payment_hash->data->billing_context->context == 'change_plan') { + return $this->handlePlanChange($payment_hash); + } + + // if ($payment_hash->data->billing_context->context == 'whitelabel') { + // return $this->handleWhiteLabelPurchase($payment_hash); + // } + + if (strlen($this->subscription->recurring_product_ids) >= 1) { + + $bundle = isset($payment_hash->data->billing_context->bundle) ? $payment_hash->data->billing_context->bundle : []; + $recurring_invoice = (new InvoiceToRecurring($payment_hash->payment->client_id, $this->subscription, $bundle))->run(); + + $recurring_invoice_repo = new RecurringInvoiceRepository(); + + $recurring_invoice = $recurring_invoice_repo->save([], $recurring_invoice); + $recurring_invoice->auto_bill = $this->subscription->auto_bill; + + /* Start the recurring service */ + $recurring_invoice->service() + ->start() + ->save(); + + //update the invoice and attach to the recurring invoice!!!!! + $invoice = Invoice::withTrashed()->find($payment_hash->fee_invoice_id); + $invoice->recurring_id = $recurring_invoice->id; + $invoice->is_proforma = false; + $invoice->save(); + + //execute any webhooks + $context = [ + 'context' => 'recurring_purchase', + 'recurring_invoice' => $recurring_invoice->hashed_id, + 'invoice' => $this->encodePrimaryKey($payment_hash->fee_invoice_id), + 'client' => $recurring_invoice->client->hashed_id, + 'subscription' => $this->subscription->hashed_id, + 'contact' => auth()->guard('contact')->user() ? auth()->guard('contact')->user()->hashed_id : $recurring_invoice->client->contacts()->whereNotNull('email')->first()->hashed_id, + 'account_key' => $recurring_invoice->client->custom_value2, + ]; + + if (property_exists($payment_hash->data->billing_context, 'campaign')) { + $context['campaign'] = $payment_hash->data->billing_context->campaign; + } + + $response = $this->triggerWebhook($context); + + return $this->handleRedirect('/client/recurring_invoices/' . $recurring_invoice->hashed_id); + } else { + $invoice = Invoice::withTrashed()->find($payment_hash->fee_invoice_id); + + $context = [ + 'context' => 'single_purchase', + 'invoice' => $this->encodePrimaryKey($payment_hash->fee_invoice_id), + 'client' => $invoice->client->hashed_id, + 'subscription' => $this->subscription->hashed_id, + 'account_key' => $invoice->client->custom_value2, + ]; + + //execute any webhooks + $this->triggerWebhook($context); + + /* 06-04-2022 */ + /* We may not be in a state where the user is present */ + if (auth()->guard('contact')) { + return $this->handleRedirect('/client/invoices/' . $this->encodePrimaryKey($payment_hash->fee_invoice_id)); + } + } + + return null; + + } + + /** + * isEligible + * ["message" => "Success", "status_code" => 200]; + * @param ClientContact $contact + * @return array{"message": string, "status_code": int} + */ + public function isEligible(ClientContact $contact): array + { + + $context = [ + 'context' => 'is_eligible', + 'subscription' => $this->subscription->hashed_id, + 'contact' => $contact->hashed_id, + 'contact_email' => $contact->email, + 'client' => $contact->client->hashed_id, + 'account_key' => $contact->client->custom_value2, + ]; + + $response = $this->triggerWebhook($context); + + return $response; + + } + + /* Starts the process to create a trial + - we create a recurring invoice, which has its next_send_date as now() + trial_duration + - we then hit the client API end point to advise the trial payload + - we then return the user to either a predefined user endpoint, OR we return the user to the recurring invoice page. + + * startTrial + * + * @param array $data{contact_id: int, client_id: int, bundle: \Illuminate\Support\Collection, coupon?: string, } + * @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse + */ + public function startTrial(array $data): \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse + { + + // Redirects from here work just fine. Livewire will respect it. + $client_contact = ClientContact::find($this->decodePrimaryKey($data['contact_id'])); + + if(is_string($data['client_id'])) { + $data['client_id'] = $this->decodePrimaryKey($data['client_id']); + } + + if (!$this->subscription->trial_enabled) { + return new \Exception("Trials are disabled for this product"); + } + + //create recurring invoice with start date = trial_duration + 1 day + $recurring_invoice_repo = new RecurringInvoiceRepository(); + + $bundle = []; + + if (isset($data['bundle'])) { + + $bundle = $data['bundle']->map(function ($bundle) { + return (object) $bundle; + })->toArray(); + } + + $recurring_invoice = (new InvoiceToRecurring($client_contact->client_id, $this->subscription, $bundle))->run(); + + $recurring_invoice->next_send_date = now()->addSeconds($this->subscription->trial_duration); + $recurring_invoice->next_send_date_client = now()->addSeconds($this->subscription->trial_duration); + $recurring_invoice->backup = 'is_trial'; + + if (array_key_exists('coupon', $data) && ($data['coupon'] == $this->subscription->promo_code) && $this->subscription->promo_discount > 0) { + $recurring_invoice->discount = $this->subscription->promo_discount; + $recurring_invoice->is_amount_discount = $this->subscription->is_amount_discount; + } elseif (strlen($this->subscription->promo_code ?? '') == 0 && $this->subscription->promo_discount > 0) { + $recurring_invoice->discount = $this->subscription->promo_discount; + $recurring_invoice->is_amount_discount = $this->subscription->is_amount_discount; + } + + $recurring_invoice = $recurring_invoice_repo->save($data, $recurring_invoice); + + /* Start the recurring service */ + $recurring_invoice->service() + ->start() + ->save(); + + $context = [ + 'context' => 'trial', + 'recurring_invoice' => $recurring_invoice->hashed_id, + 'client' => $recurring_invoice->client->hashed_id, + 'subscription' => $this->subscription->hashed_id, + 'account_key' => $recurring_invoice->client->custom_value2, + ]; + + //execute any webhooks + $response = $this->triggerWebhook($context); + + return $this->handleRedirect('/client/recurring_invoices/' . $recurring_invoice->hashed_id); + + } + + /** + * calculateUpdatePriceV2 + * + * Need to change the naming of the method + * + * @param RecurringInvoice $recurring_invoice - The Current Recurring Invoice for the subscription. + * @param Subscription $target - The new target subscription to move to + * @return float - the upgrade price + */ + public function calculateUpgradePriceV2(RecurringInvoice $recurring_invoice, Subscription $target): ?float + { + return (new UpgradePrice($recurring_invoice, $target))->run()->upgrade_price; + } + + /** + * When changing plans, we need to generate a pro rata invoice + * + * @param array $data{recurring_invoice: RecurringInvoice, subscription: Subscription, target: Subscription, hash: string} + * @return Invoice | Credit + */ + public function createChangePlanInvoice($data): Invoice | Credit + { + $recurring_invoice = $data['recurring_invoice']; + $old_subscription = $data['subscription']; + $target_subscription = $data['target']; + $hash = $data['hash']; + + return (new ChangePlanInvoice($recurring_invoice, $target_subscription, $hash))->run(); + } + + + /** + * 'email' => $this->email ?? $this->contact->email, + * 'quantity' => $this->quantity, + * 'contact_id' => $this->contact->id, + * + * @param array $data + * @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse + */ + public function handleNoPaymentRequired(array $data): \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse + { + $context = (new ZeroCostProduct($this->subscription, $data))->run(); + + // Forward payload to webhook + if (array_key_exists('context', $context)) { + $response = $this->triggerWebhook($context); + } + + // Hit the redirect + return $this->handleRedirect($context['redirect_url']); + } + + /** + * @param Invoice $invoice + * @return true + */ + public function planPaid(Invoice $invoice) + { + $recurring_invoice_hashed_id = $invoice->recurring_invoice()->exists() ? $invoice->recurring_invoice->hashed_id : null; + + $context = [ + 'context' => 'plan_paid', + 'subscription' => $this->subscription->hashed_id, + 'recurring_invoice' => $recurring_invoice_hashed_id, + 'client' => $invoice->client->hashed_id, + 'contact' => $invoice->client->primary_contact()->first() ? $invoice->client->primary_contact()->first()->hashed_id : $invoice->client->contacts->first()->hashed_id, + 'invoice' => $invoice->hashed_id, + 'account_key' => $invoice->client->custom_value2, + ]; + + $response = $this->triggerWebhook($context); + + nlog($response); + + return true; + } + + + /** + * Response from payment service on + * return from a plan change + * + * @param PaymentHash $payment_hash + */ + private function handlePlanChange(PaymentHash $payment_hash): \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse + { + nlog("handle plan change"); + + $old_recurring_invoice = RecurringInvoice::query()->find($this->decodePrimaryKey($payment_hash->data->billing_context->recurring_invoice)); + + if (!$old_recurring_invoice) { + return $this->handleRedirect('/client/recurring_invoices/'); + } + + $old_recurring_invoice->service()->stop()->save(); + + $recurring_invoice = (new InvoiceToRecurring($old_recurring_invoice->client_id, $this->subscription, []))->run(); + + $recurring_invoice->service() + ->start() + ->save(); + + //update the invoice and attach to the recurring invoice!!!!! + $invoice = Invoice::query()->find($payment_hash->fee_invoice_id); + $invoice->recurring_id = $recurring_invoice->id; + $invoice->is_proforma = false; + $invoice->save(); + + // 29-06-2023 handle webhooks for payment intent - user may not be present. + $context = [ + 'context' => 'change_plan', + 'recurring_invoice' => $recurring_invoice->hashed_id, + 'invoice' => $this->encodePrimaryKey($payment_hash->fee_invoice_id), + 'client' => $recurring_invoice->client->hashed_id, + 'subscription' => $this->subscription->hashed_id, + 'contact' => auth()->guard('contact')->user()?->hashed_id ?? $recurring_invoice->client->contacts()->first()->hashed_id, + 'account_key' => $recurring_invoice->client->custom_value2, + ]; + + $response = $this->triggerWebhook($context); + + nlog($response); + + return $this->handleRedirect('/client/recurring_invoices/'.$recurring_invoice->hashed_id); + } + + + + + + + + + + + + /** + * Handles redirecting the user + */ + private function handleRedirect($default_redirect): \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse + { + if (array_key_exists('return_url', $this->subscription->webhook_configuration) && strlen($this->subscription->webhook_configuration['return_url']) >= 1) { + return method_exists(redirect(), "send") ? redirect($this->subscription->webhook_configuration['return_url'])->send() : redirect($this->subscription->webhook_configuration['return_url']); + } + + return method_exists(redirect(), "send") ? redirect($default_redirect)->send() : redirect($default_redirect); + } + + /** + * Hit a 3rd party API if defined in the subscription + * + * @param array $context + * @return array + */ + public function triggerWebhook($context): array + { + if (empty($this->subscription->webhook_configuration['post_purchase_url']) || is_null($this->subscription->webhook_configuration['post_purchase_url']) || strlen($this->subscription->webhook_configuration['post_purchase_url']) < 1) { + return ["message" => "Success", "status_code" => 200]; + } + + $response = false; + + $body = array_merge($context, [ + 'db' => $this->subscription->company->db, + ]); + + $response = $this->sendLoad($this->subscription, $body); + + /* Append the response to the system logger body */ + if (is_array($response)) { + $body = $response; + } else { + $body = $response->getStatusCode(); + } + + $client = Client::query()->where('id', $this->decodePrimaryKey($body['client']))->withTrashed()->first(); + + SystemLogger::dispatch( + $body, + SystemLog::CATEGORY_WEBHOOK, + SystemLog::EVENT_WEBHOOK_RESPONSE, + SystemLog::TYPE_WEBHOOK_RESPONSE, + $client, + $client->company, + ); + + nlog("ready to fire back"); + + if (is_array($body)) { + return $response; + } else { + return ['message' => 'There was a problem encountered with the webhook', 'status_code' => 500]; + } + } + + public function sendLoad($subscription, $body) + { + $headers = [ + 'Content-Type' => 'application/json', + 'X-Requested-With' => 'XMLHttpRequest', + ]; + + if (!isset($subscription->webhook_configuration['post_purchase_url']) && !isset($subscription->webhook_configuration['post_purchase_rest_method'])) { + return []; + } + + if (count($subscription->webhook_configuration['post_purchase_headers']) >= 1) { + $headers = array_merge($headers, $subscription->webhook_configuration['post_purchase_headers']); + } + + $client = new \GuzzleHttp\Client( + [ + 'headers' => $headers, + ] + ); + + $post_purchase_rest_method = (string) $subscription->webhook_configuration['post_purchase_rest_method']; + $post_purchase_url = (string) $subscription->webhook_configuration['post_purchase_url']; + + try { + $response = $client->{$post_purchase_rest_method}($post_purchase_url, [ + RequestOptions::JSON => ['body' => $body], RequestOptions::ALLOW_REDIRECTS => false, + ]); + + return array_merge($body, json_decode($response->getBody(), true)); + } catch (ClientException $e) { + $message = $e->getMessage(); + + $error = json_decode($e->getResponse()->getBody()->getContents()); + + if (is_null($error)) { + nlog("empty response"); + nlog($e->getMessage()); + } + + if ($error && property_exists($error, 'message')) { + $message = $error->message; + } + + return array_merge($body, ['message' => $message, 'status_code' => 500]); + } catch (\Exception $e) { + return array_merge($body, ['message' => $e->getMessage(), 'status_code' => 500]); + } + } +} \ No newline at end of file diff --git a/app/Services/Subscription/SubscriptionService.php b/app/Services/Subscription/SubscriptionService.php index d9631b766c..3d9d21c1b3 100644 --- a/app/Services/Subscription/SubscriptionService.php +++ b/app/Services/Subscription/SubscriptionService.php @@ -763,7 +763,7 @@ class SubscriptionService /** * When changing plans, we need to generate a pro rata invoice * - * @param array $data + * @param array $data{recurring_invoice: RecurringInvoice, subscription: Subscription, target: Subscription} * @return Invoice */ public function createChangePlanInvoice($data) @@ -1087,12 +1087,12 @@ class SubscriptionService $recurring_invoice->line_items = $subscription_repo->generateBundleLineItems($bundle, true, false); $recurring_invoice->subscription_id = $this->subscription->id; $recurring_invoice->frequency_id = $this->subscription->frequency_id ?: RecurringInvoice::FREQUENCY_MONTHLY; - $recurring_invoice->date = now(); + $recurring_invoice->date = now()->addSeconds($client->timezone_offset()); $recurring_invoice->remaining_cycles = -1; $recurring_invoice->auto_bill = $client->getSetting('auto_bill'); $recurring_invoice->auto_bill_enabled = $this->setAutoBillFlag($recurring_invoice->auto_bill); $recurring_invoice->due_date_days = 'terms'; - $recurring_invoice->next_send_date = now()->format('Y-m-d'); + $recurring_invoice->next_send_date = now()->addSeconds($client->timezone_offset())->format('Y-m-d'); $recurring_invoice->next_send_date_client = now()->format('Y-m-d'); $recurring_invoice->next_send_date = $recurring_invoice->nextSendDate(); $recurring_invoice->next_send_date_client = $recurring_invoice->nextSendDateClient(); @@ -1352,7 +1352,7 @@ class SubscriptionService * * @return int Number of days */ - private function getDaysInFrequency(): int + public function getDaysInFrequency(): int { switch ($this->subscription->frequency_id) { case RecurringInvoice::FREQUENCY_DAILY: diff --git a/app/Services/Subscription/SubscriptionStatus.php b/app/Services/Subscription/SubscriptionStatus.php new file mode 100644 index 0000000000..90633404a5 --- /dev/null +++ b/app/Services/Subscription/SubscriptionStatus.php @@ -0,0 +1,220 @@ +checkTrial() + ->checkRefundable() + ->checkInGoodStanding(); + + return $this; + } + + /** + * GetProRataRefund + * + * @return float + */ + public function getProRataRefund(): float + { + + $subscription_interval_end_date = Carbon::parse($this->recurring_invoice->next_send_date_client); + $subscription_interval_start_date = $subscription_interval_end_date->copy()->subDays($this->recurring_invoice->subscription->service()->getDaysInFrequency())->subDay(); + + $primary_invoice = Invoice::query() + ->where('company_id', $this->recurring_invoice->company_id) + ->where('client_id', $this->recurring_invoice->client_id) + ->where('recurring_id', $this->recurring_invoice->id) + ->whereIn('status_id', [Invoice::STATUS_PAID]) + ->whereBetween('date', [$subscription_interval_start_date, $subscription_interval_end_date]) + ->where('is_deleted', 0) + ->where('is_proforma', 0) + ->orderBy('id', 'desc') + ->first(); + + $this->refundable_invoice = $primary_invoice; + + return $primary_invoice ? max(0, round(($primary_invoice->paid_to_date * $this->getProRataRatio()),2)) : 0; + + } + + /** + * GetProRataRatio + * + * The ratio of days used / days in interval + * @return float + */ + public function getProRataRatio():float + { + + $subscription_interval_end_date = Carbon::parse($this->recurring_invoice->next_send_date_client); + $subscription_interval_start_date = $subscription_interval_end_date->copy()->subDays($this->recurring_invoice->subscription->service()->getDaysInFrequency())->subDay(); + + $primary_invoice = Invoice::query() + ->where('company_id', $this->recurring_invoice->company_id) + ->where('client_id', $this->recurring_invoice->client_id) + ->where('recurring_id', $this->recurring_invoice->id) + ->whereIn('status_id', [Invoice::STATUS_PAID]) + ->whereBetween('date', [$subscription_interval_start_date, $subscription_interval_end_date]) + ->where('is_deleted', 0) + ->where('is_proforma', 0) + ->orderBy('id', 'desc') + ->first(); + + if(!$primary_invoice) + return 0; + + $subscription_start_date = Carbon::parse($primary_invoice->date)->startOfDay(); + + $days_of_subscription_used = $subscription_start_date->copy()->diffInDays(now()); + + return 1 - ($days_of_subscription_used / $this->recurring_invoice->subscription->service()->getDaysInFrequency()); + + } + + /** + * CheckInGoodStanding + * + * Are there any outstanding invoices? + * + * @return self + */ + private function checkInGoodStanding(): self + { + + $this->is_in_good_standing = Invoice::query() + ->where('company_id', $this->recurring_invoice->company_id) + ->where('client_id', $this->recurring_invoice->client_id) + ->where('recurring_id', $this->recurring_invoice->id) + ->where('is_deleted', 0) + ->where('is_proforma', 0) + ->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) + ->where('balance', '>', 0) + ->doesntExist(); + + return $this; + + } + + /** + * CheckTrial + * + * Check if this subscription is in its trial window. + * + * Trials do not have an invoice yet - only a pending recurring invoice. + * + * @return self + */ + private function checkTrial(): self + { + + if(!$this->subscription->trial_enabled) + return $this->setIsTrial(false); + + $primary_invoice = Invoice::query() + ->where('company_id', $this->recurring_invoice->company_id) + ->where('client_id', $this->recurring_invoice->client_id) + ->where('recurring_id', $this->recurring_invoice->id) + ->where('is_deleted', 0) + ->where('is_proforma', 0) + ->orderBy('id', 'asc') + ->doesntExist(); + + if($primary_invoice && Carbon::parse($this->recurring_invoice->next_send_date_client)->gte(now()->startOfDay()->addSeconds($this->recurring_invoice->client->timezone_offset()))) { + return $this->setIsTrial(true); + } + + $this->setIsTrial(false); + + return $this; + + } + + /** + * Determines if this subscription + * is eligible for a refund. + * + * @return self + */ + private function checkRefundable(): self + { + if(!$this->recurring_invoice->subscription->refund_period || $this->recurring_invoice->subscription->refund_period === 0) + return $this->setRefundable(false); + + $primary_invoice = $this->recurring_invoice + ->invoices() + ->where('is_deleted', 0) + ->where('is_proforma', 0) + ->orderBy('id', 'desc') + ->first(); + + if($primary_invoice && + $primary_invoice->status_id == Invoice::STATUS_PAID && + Carbon::parse($primary_invoice->date)->addSeconds($this->recurring_invoice->subscription->refund_period)->lte(now()->startOfDay()->addSeconds($primary_invoice->client->timezone_offset())) + ){ + return $this->setRefundable(true); + } + + return $this->setRefundable(false); + + } + + /** + * setRefundable + * + * @param bool $refundable + * @return self + */ + private function setRefundable(bool $refundable): self + { + $this->is_refundable = $refundable; + + return $this; + } + + /** + * Sets the is_trial flag + * + * @param bool $is_trial + * @return self + */ + private function setIsTrial(bool $is_trial): self + { + $this->is_trial = $is_trial; + + return $this; + } + +} diff --git a/app/Services/Subscription/UpgradePrice.php b/app/Services/Subscription/UpgradePrice.php new file mode 100644 index 0000000000..c4cc6e3e81 --- /dev/null +++ b/app/Services/Subscription/UpgradePrice.php @@ -0,0 +1,99 @@ +status = $this->recurring_invoice + ->subscription + ->status($this->recurring_invoice); + + if($this->status->is_in_good_standing) + $this->calculateUpgrade(); + else + $this->upgrade_price = $this->subscription->price; + + return $this; + + } + + private function calculateUpgrade(): self + { + $ratio = $this->status->getProRataRatio(); + + $last_invoice = $this->recurring_invoice + ->invoices() + ->where('is_deleted', 0) + ->where('is_proforma', 0) + ->orderBy('id', 'desc') + ->first(); + + $this->refund = $this->getRefundableAmount($last_invoice, $ratio); + $this->outstanding_credit = $this->getCredits(); + + nlog("{$this->subscription->price} - {$this->refund} - {$this->outstanding_credit}"); + + $this->upgrade_price = $this->subscription->price - $this->refund - $this->outstanding_credit; + + return $this; + } + + private function getRefundableAmount(?Invoice $invoice, float $ratio): float + { + if (!$invoice || !$invoice->date || $invoice->status_id != Invoice::STATUS_PAID || $ratio == 0) + return 0; + + return max(0, round(($invoice->paid_to_date*$ratio),2)); + } + + private function getCredits(): float + { + $outstanding_credits = 0; + + $use_credit_setting = $this->recurring_invoice->client->getSetting('use_credits_payment'); + + if($use_credit_setting){ + + $outstanding_credits = Credit::query() + ->where('client_id', $this->recurring_invoice->client_id) + ->whereIn('status_id', [Credit::STATUS_SENT,Credit::STATUS_PARTIAL]) + ->where('is_deleted', 0) + ->where('balance', '>', 0) + ->sum('balance'); + + } + + return $outstanding_credits; + } + +} \ No newline at end of file diff --git a/app/Utils/Traits/CleanLineItems.php b/app/Utils/Traits/CleanLineItems.php index 2a734b106c..bf14482386 100644 --- a/app/Utils/Traits/CleanLineItems.php +++ b/app/Utils/Traits/CleanLineItems.php @@ -74,6 +74,12 @@ trait CleanLineItems } + if(isset($item['notes'])) + $item['notes'] = str_replace("company->portal_mode) { case 'subdomain': - if(Ninja::isHosted()) - return 'https://router.invoiceninja.com/route/'.encrypt($domain.'/client/'.$entity_type.'/'.$this->key); - else + // if(Ninja::isHosted()) + // return 'https://router.invoiceninja.com/route/'.encrypt($domain.'/client/'.$entity_type.'/'.$this->key); + // else return $domain.'/client/'.$entity_type.'/'.$this->key; break; case 'iframe': diff --git a/config/ninja.php b/config/ninja.php index e73d23c33c..07147f9b62 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -17,8 +17,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => env('APP_VERSION', '5.8.23'), - 'app_tag' => env('APP_TAG', '5.8.23'), + 'app_version' => env('APP_VERSION', '5.8.24'), + 'app_tag' => env('APP_TAG', '5.8.24'), 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', false), diff --git a/lang/en/texts.php b/lang/en/texts.php index f35c0fdf48..3e995d8213 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -3868,7 +3868,7 @@ $lang = array( 'cancellation_pending' => 'Cancellation pending, we\'ll be in touch!', 'list_of_payments' => 'List of payments', 'payment_details' => 'Details of the payment', - 'list_of_payment_invoices' => 'List of invoices affected by the payment', + 'list_of_payment_invoices' => 'Associate invoices', 'list_of_payment_methods' => 'List of payment methods', 'payment_method_details' => 'Details of payment method', 'permanently_remove_payment_method' => 'Permanently remove this payment method.', @@ -5120,7 +5120,7 @@ $lang = array( 'set_private' => 'Set private', 'individual' => 'Individual', 'business' => 'Business', - 'partnership' => 'partnership', + 'partnership' => 'Partnership', 'trust' => 'Trust', 'charity' => 'Charity', 'government' => 'Government', diff --git a/openapi/api-docs.yaml b/openapi/api-docs.yaml index 3190be9b6f..3ebcf8377e 100644 --- a/openapi/api-docs.yaml +++ b/openapi/api-docs.yaml @@ -26,8 +26,8 @@ paths: /api/v1/activities: get: tags: - - actvities - summary: "Returns a list of actvities" + - activities + summary: "Returns a list of activities" description: "Lists all activities related to this company" operationId: getActivities parameters: @@ -68,10 +68,10 @@ paths: $ref: "#/components/responses/422" default: $ref: "#/components/responses/default" - "/api/v1/actvities/download_entity/{activity_id}": + "/api/v1/activities/download_entity/{activity_id}": get: tags: - - actvities + - activities summary: "Returns a PDF for the given activity" description: "Returns a PDF for the given activity" operationId: getActivityHistoricalEntityPdf @@ -115,8 +115,6 @@ paths: summary: "Attempts authentication" description: "Returns a CompanyUser object on success" operationId: postLogin - security: - - [] parameters: - $ref: "#/components/parameters/X-API-SECRET" - $ref: "#/components/parameters/X-API-TOKEN" @@ -161,7 +159,7 @@ paths: 422: $ref: "#/components/responses/422" 5XX: - $ref: "#/components/responses/5XX" + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/refresh: @@ -173,7 +171,7 @@ paths: Refreshes the dataset. This endpoint can be used if you only need to access the most recent data from a certain point in time. - operationId: refresh + operationId: refresh parameters: - name: updated_at in: query @@ -8304,6 +8302,409 @@ paths: default: $ref: "#/components/responses/default" + /api/v1/vendors: + get: + tags: + - vendors + summary: "List vendors" + description: "Lists vendors, search and filters allow fine grained lists to be generated.\n\n Query parameters can be added to performed more fine grained filtering of the vendors, these are handled by the VendorFilters class which defines the methods available" + operationId: getVendors + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - $ref: "#/components/parameters/index" + responses: + 200: + description: "A list of vendors" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/Vendor' + meta: + type: object + $ref: '#/components/schemas/Meta' + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + post: + tags: + - vendors + summary: "Create vendor" + description: "Adds a vendor to a company" + operationId: storeVendor + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + responses: + 200: + description: "Returns the saved clivendorent object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Vendor" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + "/api/v1/vendors/{id}": + get: + tags: + - vendors + summary: "Show vendor" + description: "Displays a vendor by id" + operationId: showVendor + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: id + in: path + description: "The vendor Hashed ID" + required: true + schema: + type: string + format: string + example: D2J234DFA + responses: + 200: + description: "Returns the vendor object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Vendor" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + put: + tags: + - vendors + summary: "Update vendor" + description: "Handles the updating of a vendor by id" + operationId: updateVendor + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: id + in: path + description: "The Vendor Hashed ID" + required: true + schema: + type: string + format: string + example: D2J234DFA + responses: + 200: + description: "Returns the vendor object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Vendor" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + delete: + tags: + - vendors + summary: "Delete vendor" + description: "Handles the deletion of a vendor by id" + operationId: deleteVendor + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: id + in: path + description: "The Vendor Hashed ID" + required: true + schema: + type: string + format: string + example: D2J234DFA + responses: + 200: + description: "Returns a HTTP status" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + "/api/v1/vendors/{id}/edit": + get: + tags: + - vendors + summary: "Edit vendor" + description: "Displays a vendor by id" + operationId: editVendor + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: id + in: path + description: "The Vendor Hashed ID" + required: true + schema: + type: string + format: string + example: D2J234DFA + responses: + 200: + description: "Returns the vendor object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Vendor" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + /api/v1/vendors/create: + get: + tags: + - vendors + summary: "Blank vendor" + description: "Returns a blank vendor with default values" + operationId: getVendorsCreate + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + responses: + 200: + description: "A blank vendor object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Vendor" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + /api/v1/vendors/bulk: + post: + tags: + - vendors + summary: "Bulk vendor actions" + description: "" + operationId: bulkVendors + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/index" + requestBody: + description: "User credentials" + required: true + content: + application/json: + schema: + type: array + items: + description: "Array of hashed IDs to be bulk 'actioned" + type: integer + example: "[0,1,2,3]" + responses: + 200: + description: "The Vendor User response" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Vendor" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + "/api/v1/vendors/{id}/upload": + post: + tags: + - vendors + summary: "Uploads a vendor document" + description: "Handles the uploading of a document to a vendor" + operationId: uploadVendor + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: id + in: path + description: "The Vendor Hashed ID" + required: true + schema: + type: string + format: string + example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary + responses: + 200: + description: "Returns the Vendor object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Vendor" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" /api/v1/products: get: tags: @@ -8747,21 +9148,59 @@ paths: default: $ref: '#/components/responses/default' - /api/v1/tasks: + /api/v1/recurring_invoices: get: tags: - - tasks - summary: "List tasks" - description: "Lists tasks, search and filters allow fine grained lists to be generated.\n *\n * Query parameters can be added to performed more fine grained filtering of the tasks, these are handled by the TaskFilters class which defines the methods available" - operationId: getTasks + - Recurring Invoices + summary: "List recurring invoices" + description: | + Lists invoices with the option to chain multiple query parameters allowing fine grained filtering of the list. + + operationId: getRecurringInvoices parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" - - $ref: "#/components/parameters/index" + - $ref: "#/components/parameters/client_id" + - $ref: "#/components/parameters/created_at" + - $ref: "#/components/parameters/updated_at" + - $ref: "#/components/parameters/is_deleted" + - $ref: "#/components/parameters/filter_deleted_clients" + - $ref: "#/components/parameters/vendor_id" + - name: filter + in: query + description: | + Searches across a range of columns including: + - custom_value1 + - custom_value2 + - custom_value3 + - custom_value4 + required: false + schema: + type: string + example: ?filter=bob + - name: client_status + in: query + description: | + A comma separated list of invoice status strings. Valid options include: + - all + - active + - paused + - completed + required: false + schema: + type: string + example: ?client_status=active,paused + - name: sort + in: query + description: Returns the list sorted by column in ascending or descending order. + required: false + schema: + type: string + example: id|desc number|desc balance|asc responses: 200: - description: "A list of tasks" + description: "A list of recurring_invoices" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -8777,7 +9216,7 @@ paths: data: type: array items: - $ref: '#/components/schemas/Task' + $ref: '#/components/schemas/RecurringInvoice' meta: type: object $ref: '#/components/schemas/Meta' @@ -8795,17 +9234,17 @@ paths: $ref: "#/components/responses/default" post: tags: - - tasks - summary: "Create task" - description: "Adds an task to a company" - operationId: storeTask + - Recurring Invoices + summary: "Create recurring invoice" + description: "Adds a Recurring Invoice to the system" + operationId: storeRecurringInvoice parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" responses: 200: - description: "Returns the saved task object" + description: "Returns the saved RecurringInvoice object" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -8816,7 +9255,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Task" + $ref: "#/components/schemas/RecurringInvoice" 401: $ref: "#/components/responses/401" 403: @@ -8829,20 +9268,21 @@ paths: description: 'Server error' default: $ref: "#/components/responses/default" - "/api/v1/tasks/{id}": + + "/api/v1/recurring_invoices/{id}": get: tags: - - tasks - summary: "Show task" - description: "Displays a task by id" - operationId: showTask + - Recurring Invoices + summary: "Show recurring invoice" + description: "Displays an RecurringInvoice by id" + operationId: showRecurringInvoice parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" - name: id in: path - description: "The Task Hashed ID" + description: "The RecurringInvoice Hashed ID" required: true schema: type: string @@ -8850,7 +9290,7 @@ paths: example: D2J234DFA responses: 200: - description: "Returns the task object" + description: "Returns the RecurringInvoice object" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -8861,7 +9301,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Task" + $ref: "#/components/schemas/RecurringInvoice" 401: $ref: "#/components/responses/401" 403: @@ -8876,17 +9316,17 @@ paths: $ref: "#/components/responses/default" put: tags: - - tasks - summary: "Update task" - description: "Handles the updating of a task by id" - operationId: updateTask + - Recurring Invoices + summary: "Update recurring invoice" + description: "Handles the updating of an RecurringInvoice by id" + operationId: updateRecurringInvoice parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" - name: id in: path - description: "The task Hashed ID" + description: "The RecurringInvoice Hashed ID" required: true schema: type: string @@ -8894,7 +9334,7 @@ paths: example: D2J234DFA responses: 200: - description: "Returns the task object" + description: "Returns the RecurringInvoice object" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -8905,7 +9345,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Task" + $ref: "#/components/schemas/RecurringInvoice" 401: $ref: "#/components/responses/401" 403: @@ -8920,17 +9360,17 @@ paths: $ref: "#/components/responses/default" delete: tags: - - tasks - summary: "Delete task" - description: "Handles the deletion of a task by id" - operationId: deleteTask + - Recurring Invoices + summary: "Delete recurring invoice" + description: "Handles the deletion of an RecurringInvoice by id" + operationId: deleteRecurringInvoice parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" - name: id in: path - description: "The Task Hashed ID" + description: "The RecurringInvoice Hashed ID" required: true schema: type: string @@ -8958,20 +9398,20 @@ paths: description: 'Server error' default: $ref: "#/components/responses/default" - "/api/v1/tasks/{id}/edit": + "/api/v1/recurring_invoices/{id}/edit": get: tags: - - tasks - summary: "Edit task" - description: "Displays a task by id" - operationId: editTask + - Recurring Invoices + summary: "Edit recurring invoice" + description: "Displays an RecurringInvoice by id" + operationId: editRecurringInvoice parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" - name: id in: path - description: "The Task Hashed ID" + description: "The RecurringInvoice Hashed ID" required: true schema: type: string @@ -8979,7 +9419,7 @@ paths: example: D2J234DFA responses: 200: - description: "Returns the client object" + description: "Returns the RecurringInvoice object" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -8990,7 +9430,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Task" + $ref: "#/components/schemas/RecurringInvoice" 401: $ref: "#/components/responses/401" 403: @@ -9003,456 +9443,21 @@ paths: description: 'Server error' default: $ref: "#/components/responses/default" - /api/v1/tasks/create: + + /api/v1/recurring_invoices/create: get: tags: - - tasks - summary: "Blank task" - description: "Returns a blank task with default values" - operationId: getTasksCreate - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - responses: - 200: - description: "A blank task object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/Task" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - /api/v1/tasks/bulk: - post: - tags: - - tasks - summary: "Bulk task actions" - description: "" - operationId: bulkTasks - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/index" - requestBody: - description: "User credentials" - required: true - content: - application/json: - schema: - type: array - items: - description: "Array of hashed IDs to be bulk 'actioned" - type: integer - example: "[0,1,2,3]" - responses: - 200: - description: "The Task User response" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/Task" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - "/api/v1/tasks/{id}/upload": - post: - tags: - - tasks - summary: "Uploads a task document" - description: "Handles the uploading of a document to a task" - operationId: uploadTask - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: id - in: path - description: "The Task Hashed ID" - required: true - schema: - type: string - format: string - example: D2J234DFA - requestBody: - description: "File Upload Body" - required: true - content: - multipart/form-data: - schema: - type: object - properties: - _method: - type: string - example: PUT - documents: - type: array - items: - description: "Array of binary documents for upload" - type: string - format: binary - responses: - 200: - description: "Returns the Task object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/Task" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - /api/v1/tasks/sort: - post: - tags: - - tasks - summary: "Sort tasks on KanBan" - description: "Sorts tasks after drag and drop on the KanBan." - operationId: sortTasks - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - responses: - 200: - description: "Returns an Ok, 200 HTTP status" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - /api/v1/projects: - get: - tags: - - projects - summary: "List projects" - description: "Lists projects" - operationId: getProjects - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - $ref: "#/components/parameters/index" - responses: - 200: - description: "A list of projects" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/Project' - meta: - type: object - $ref: '#/components/schemas/Meta' - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - post: - tags: - - projects - summary: "Create project" - description: "Adds an project to a company" - operationId: storeProject - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - responses: - 200: - description: "Returns the saved project object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/Project" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - "/api/v1/projects/{id}": - get: - tags: - - projects - summary: "Show project" - description: "Displays a project by id" - operationId: showProject - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: id - in: path - description: "The Project Hashed ID" - required: true - schema: - type: string - format: string - example: D2J234DFA - responses: - 200: - description: "Returns the expense object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/Project" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - put: - tags: - - projects - summary: "Update project" - description: "Handles the updating of a project by id" - operationId: updateProject - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: id - in: path - description: "The Project Hashed ID" - required: true - schema: - type: string - format: string - example: D2J234DFA - responses: - 200: - description: "Returns the project object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/Project" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - delete: - tags: - - projects - summary: "Delete project" - description: "Handles the deletion of a project by id" - operationId: deleteProject - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: id - in: path - description: "The Project Hashed ID" - required: true - schema: - type: string - format: string - example: D2J234DFA - responses: - 200: - description: "Returns a HTTP status" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - "/api/v1/projects/{id}/edit": - get: - tags: - - projects - summary: "Edit project" - description: "Displays a project by id" - operationId: editProject - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: id - in: path - description: "The Project Hashed ID" - required: true - schema: - type: string - format: string - example: D2J234DFA - responses: - 200: - description: "Returns the project object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/Project" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - /api/v1/projects/create: - get: - tags: - - projects - summary: "Blank project" + - Recurring Invoices + summary: "Blank recurring invoice" description: "Returns a blank object with default values" - operationId: getProjectsCreate + operationId: getRecurringInvoicesCreate parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" responses: 200: - description: "A blank project object" + description: "A blank RecurringInvoice object" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -9463,7 +9468,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Project" + $ref: "#/components/schemas/RecurringInvoice" 401: $ref: "#/components/responses/401" 403: @@ -9476,31 +9481,55 @@ paths: description: 'Server error' default: $ref: "#/components/responses/default" - /api/v1/projects/bulk: + /api/v1/recurring_invoices/bulk: post: tags: - - projects - summary: "Bulk project actions" - description: "" - operationId: bulkProjects + - Recurring Invoices + summary: "Bulk recurring invoice actions" + description: | + There are multiple actions that are available including: + + operationId: bulkRecurringInvoices parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/index" requestBody: - description: "User credentials" + description: "Bulk action details" required: true content: application/json: schema: - type: array - items: - description: "Array of hashed IDs to be bulk 'actioned" - type: integer - example: "[0,1,2,3]" + type: object + properties: + action: + type: string + description: | + The action to be performed, options include: + - `start` + Starts (or restarts) the recurring invoice. **note** if the recurring invoice has been stopped for a long time, it will attempt to catch back up firing a new Invoice every hour per interval that has been missed. + If you do not wish to have the recurring invoice catch up, you should set the next_send_date to the correct date you wish the recurring invoice to commence from. + - `stop` + Stops the recurring invoice. + - `send_now` + Force sends the recurring invoice - this option is only available when the recurring invoice is in a draft state. + - `restore` + Restores the recurring invoice from an archived or deleted state. + - `archive` + Archives the recurring invoice. The recurring invoice will not fire in this state. + - `delete` + Deletes a recurring invoice. + ids: + type: array + items: + description: "Array of hashed IDs to be bulk 'actioned - ['D2J234DFA','D2J234DFA','D2J234DFA']" + type: string + example: + action: start + ids: "['D2J234DFA','D2J234DFA','D2J234DFA']" responses: 200: - description: "The Project User response" + description: "The RecurringInvoice response" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -9511,7 +9540,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Project" + $ref: "#/components/schemas/RecurringInvoice" 401: $ref: "#/components/responses/401" 403: @@ -9524,20 +9553,115 @@ paths: description: 'Server error' default: $ref: "#/components/responses/default" - "/api/v1/projects/{id}/upload": - post: + "/api/v1/recurring_invoices/{id}/{action}": + get: + deprecated: true tags: - - projects - summary: "Uploads a project document" - description: "Handles the uploading of a document to a project" - operationId: uploadProject + - Recurring Invoices + summary: "Custom recurring invoice action" + description: "Performs a custom action on an RecurringInvoice.\n\n The current range of actions are as follows\n - clone_to_RecurringInvoice\n - clone_to_quote\n - history\n - delivery_note\n - mark_paid\n - download\n - archive\n - delete\n - email" + operationId: actionRecurringInvoice parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" - name: id in: path - description: "The Project Hashed ID" + description: "The RecurringInvoice Hashed ID" + required: true + schema: + type: string + format: string + example: D2J234DFA + - name: action + in: path + description: "The action string to be performed" + required: true + schema: + type: string + format: string + example: clone_to_quote + responses: + 200: + description: "Returns the RecurringInvoice object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/RecurringInvoice" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + "/api/v1/recurring_invoice/{invitation_key}/download": + get: + tags: + - Recurring Invoices + summary: "Download recurring invoice PDF" + description: "Downloads a specific invoice" + operationId: downloadRecurringInvoice + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: invitation_key + in: path + description: "The Recurring Invoice Invitation Key" + required: true + schema: + type: string + format: string + example: D2J234DFA + responses: + 200: + description: "Returns the recurring invoice pdf" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + "/api/v1/recurring_invoices/{id}/upload": + post: + tags: + - Recurring Invoices + summary: "Add recurring invoice document" + description: "Handles the uploading of a document to a recurring_invoice" + operationId: uploadRecurringInvoice + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: id + in: path + description: "The RecurringInvoice Hashed ID" required: true schema: type: string @@ -9562,7 +9686,7 @@ paths: format: binary responses: 200: - description: "Returns the Project object" + description: "Returns the RecurringInvoice object" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -9573,7 +9697,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Project" + $ref: "#/components/schemas/RecurringInvoice" 401: $ref: "#/components/responses/401" 403: @@ -9713,12 +9837,12 @@ paths: items: $ref: '#/components/schemas/Client' example: - $ref: '#/components/examples/Client' + $ref: '#/components/schemas/Client' meta: type: object $ref: '#/components/schemas/Meta' example: - $ref: '#/components/examples/Meta' + $ref: '#/components/schemas/Meta' 401: $ref: '#/components/responses/401' 403: @@ -10777,56 +10901,21 @@ paths: description: 'Server error' default: $ref: "#/components/responses/default" - /api/v1/payments: + /api/v1/projects: get: tags: - - payments - summary: "List payments" - description: "Lists payments, search and filters allow fine grained lists to be generated.\n\n Query parameters can be added to performed more fine grained filtering of the payments, these are handled by the PaymentFilters class which defines the methods available" - operationId: getPayments + - projects + summary: "List projects" + description: "Lists projects" + operationId: getProjects parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" - - $ref: "#/components/parameters/status" - - $ref: "#/components/parameters/client_id" - - $ref: "#/components/parameters/created_at" - - $ref: "#/components/parameters/updated_at" - - $ref: "#/components/parameters/is_deleted" - - $ref: "#/components/parameters/filter_deleted_clients" - - $ref: "#/components/parameters/vendor_id" - - name: filter - in: query - description: | - Searches across a range of columns including: - - amount - - date - - custom_value1 - - custom_value2 - - custom_value3 - - custom_value4 - required: false - schema: - type: string - example: ?filter=10 - - name: number - in: query - description: | - Search payments by payment number - required: false - schema: - type: string - example: ?number=0001 - - name: sort - in: query - description: Returns the list sorted by column in ascending or descending order. - required: false - schema: - type: string - example: id|desc number|desc balance|asc + - $ref: "#/components/parameters/index" responses: 200: - description: "A list of payments" + description: "A list of projects" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -10842,7 +10931,7 @@ paths: data: type: array items: - $ref: '#/components/schemas/Payment' + $ref: '#/components/schemas/Project' meta: type: object $ref: '#/components/schemas/Meta' @@ -10860,24 +10949,17 @@ paths: $ref: "#/components/responses/default" post: tags: - - payments - summary: "Create payment" - description: "Adds an Payment to the system" - operationId: storePayment + - projects + summary: "Create project" + description: "Adds an project to a company" + operationId: storeProject parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" - requestBody: - description: "The payment request" - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/Payment" responses: 200: - description: "Returns the saved Payment object" + description: "Returns the saved project object" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -10888,7 +10970,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Payment" + $ref: "#/components/schemas/Project" 401: $ref: "#/components/responses/401" 403: @@ -10901,21 +10983,20 @@ paths: description: 'Server error' default: $ref: "#/components/responses/default" - - "/api/v1/payments/{id}": + "/api/v1/projects/{id}": get: tags: - - payments - summary: "Show payment" - description: "Displays an Payment by id" - operationId: showPayment + - projects + summary: "Show project" + description: "Displays a project by id" + operationId: showProject parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" - name: id in: path - description: "The Payment Hashed ID" + description: "The Project Hashed ID" required: true schema: type: string @@ -10923,7 +11004,7 @@ paths: example: D2J234DFA responses: 200: - description: "Returns the Payment object" + description: "Returns the expense object" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -10934,7 +11015,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Payment" + $ref: "#/components/schemas/Project" 401: $ref: "#/components/responses/401" 403: @@ -10949,17 +11030,17 @@ paths: $ref: "#/components/responses/default" put: tags: - - payments - summary: "Update payment" - description: "Handles the updating of an Payment by id" - operationId: updatePayment + - projects + summary: "Update project" + description: "Handles the updating of a project by id" + operationId: updateProject parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" - name: id in: path - description: "The Payment Hashed ID" + description: "The Project Hashed ID" required: true schema: type: string @@ -10967,7 +11048,7 @@ paths: example: D2J234DFA responses: 200: - description: "Returns the Payment object" + description: "Returns the project object" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -10978,7 +11059,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Payment" + $ref: "#/components/schemas/Project" 401: $ref: "#/components/responses/401" 403: @@ -10993,17 +11074,17 @@ paths: $ref: "#/components/responses/default" delete: tags: - - payments - summary: "Delete payment" - description: "Handles the deletion of an Payment by id" - operationId: deletePayment + - projects + summary: "Delete project" + description: "Handles the deletion of a project by id" + operationId: deleteProject parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" - name: id in: path - description: "The Payment Hashed ID" + description: "The Project Hashed ID" required: true schema: type: string @@ -11031,20 +11112,20 @@ paths: description: 'Server error' default: $ref: "#/components/responses/default" - "/api/v1/payments/{id}/edit": + "/api/v1/projects/{id}/edit": get: tags: - - payments - summary: "Edit payment" - description: "Displays an Payment by id" - operationId: editPayment + - projects + summary: "Edit project" + description: "Displays a project by id" + operationId: editProject parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" - name: id in: path - description: "The Payment Hashed ID" + description: "The Project Hashed ID" required: true schema: type: string @@ -11052,7 +11133,7 @@ paths: example: D2J234DFA responses: 200: - description: "Returns the Payment object" + description: "Returns the project object" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -11063,7 +11144,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Payment" + $ref: "#/components/schemas/Project" 401: $ref: "#/components/responses/401" 403: @@ -11076,20 +11157,20 @@ paths: description: 'Server error' default: $ref: "#/components/responses/default" - /api/v1/payments/create: + /api/v1/projects/create: get: tags: - - payments - summary: "Blank payment" + - projects + summary: "Blank project" description: "Returns a blank object with default values" - operationId: getPaymentsCreate + operationId: getProjectsCreate parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" responses: 200: - description: "A blank Payment object" + description: "A blank project object" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -11100,7 +11181,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Payment" + $ref: "#/components/schemas/Project" 401: $ref: "#/components/responses/401" 403: @@ -11113,57 +11194,13 @@ paths: description: 'Server error' default: $ref: "#/components/responses/default" - /api/v1/payments/refund: + /api/v1/projects/bulk: post: tags: - - payments - summary: "Refund payment" - description: "Adds an Refund to the system" - operationId: storeRefund - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - requestBody: - description: "The refund request" - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/Payment" - responses: - 200: - description: "Returns the saved Payment object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/Payment" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - /api/v1/payments/bulk: - post: - tags: - - payments - summary: "Bulk payment actions" + - projects + summary: "Bulk project actions" description: "" - operationId: bulkPayments + operationId: bulkProjects parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" @@ -11181,7 +11218,7 @@ paths: example: "[0,1,2,3]" responses: 200: - description: "The Payment response" + description: "The Project User response" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -11192,7 +11229,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Payment" + $ref: "#/components/schemas/Project" 401: $ref: "#/components/responses/401" 403: @@ -11205,75 +11242,20 @@ paths: description: 'Server error' default: $ref: "#/components/responses/default" - "/api/v1/payments/{id}/{action}": - get: - deprecated: true - tags: - - payments - summary: "Custom payment actions" - description: "Performs a custom action on an Payment.\n\n The current range of actions are as follows\n - clone_to_Payment\n - clone_to_quote\n - history\n - delivery_note\n - mark_paid\n - download\n - archive\n - delete\n - email" - operationId: actionPayment - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: id - in: path - description: "The Payment Hashed ID" - required: true - schema: - type: string - format: string - example: D2J234DFA - - name: action - in: path - description: "The action string to be performed" - required: true - schema: - type: string - format: string - example: clone_to_quote - responses: - 200: - description: "Returns the Payment object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/Payment" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - - "/api/v1/payments/{id}/upload": + "/api/v1/projects/{id}/upload": post: tags: - - payments - summary: "Upload a payment document" - description: "Handles the uploading of a document to a payment" - operationId: uploadPayment + - projects + summary: "Uploads a project document" + description: "Handles the uploading of a document to a project" + operationId: uploadProject parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" - name: id in: path - description: "The Payment Hashed ID" + description: "The Project Hashed ID" required: true schema: type: string @@ -11298,7 +11280,7 @@ paths: format: binary responses: 200: - description: "Returns the Payment object" + description: "Returns the Project object" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -11309,1282 +11291,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Payment" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - /api/v1/invoices: - get: - tags: - - invoices - summary: "List invoices" - description: | - Lists invoices with the option to chain multiple query parameters allowing fine grained filtering of the list. - - operationId: getInvoices - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - $ref: "#/components/parameters/status" - - $ref: "#/components/parameters/client_id" - - $ref: "#/components/parameters/created_at" - - $ref: "#/components/parameters/updated_at" - - $ref: "#/components/parameters/is_deleted" - - $ref: "#/components/parameters/filter_deleted_clients" - - $ref: "#/components/parameters/vendor_id" - - name: client_status - in: query - description: | - A comma separated list of invoice status strings. Valid options include: - - all - - paid - - unpaid - - overdue - required: false - schema: - type: string - example: ?client_status=paid,unpaid - - name: number - in: query - description: | - Search invoices by invoice number - required: false - schema: - type: string - example: ?number=INV-001 - - name: filter - in: query - description: | - Searches across a range of columns including: - - number - - po_number - - date - - amount - - balance - - custom_value1 - - custom_value2 - - custom_value3 - - custom_value4 - required: false - schema: - type: string - example: ?filter=bob - - name: without_deleted_clients - in: query - description: | - Returns the invoice list without the invoices of deleted clients. - required: false - schema: - type: string - example: ?without_deleted_clients= - - name: overdue - in: query - description: | - Returns the list of invoices that are overdue - required: false - schema: - type: string - example: ?over_due= - - name: payable - in: query - description: | - Returns the invoice list that are payable for a defined client. Please note, you must pass the client_id as the value for this query parameter - required: false - schema: - type: string - example: ?payable={client_id} - - name: sort - in: query - description: Returns the list sorted by column in ascending or descending order. - required: false - schema: - type: string - example: id|desc number|desc balance|asc - - name: private_notes - in: query - description: | - Searches on the private_notes field of the invoices - required: false - schema: - type: string - example: ?private_notes=super secret - responses: - 200: - description: "A list of invoices" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/Invoice' - meta: - type: object - $ref: '#/components/schemas/Meta' - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - post: - tags: - - invoices - summary: "Create invoice" - description: | - Adds a invoice to a company - - Triggered actions are available when updating or creating an invoice. - These are query parameters that can be chained in order to perform additional actions on the entity, these include: - - ``` - ?send_email=true [Saves and sends the invoice] - ?mark_sent=true [Saves and marks the invoice as sent] - ?paid=true [Saves and marks the invoice as paid] - ?amount_paid=100 [Saves and marks the invoice as paid with the given amount] - ?cancel=true [Saves and marks the invoice as cancelled] - ?save_default_footer=true [Saves the current footer as the default footer] - ?save_default_terms=true [Saves the current terms as the default terms] - ``` - - operationId: storeInvoice - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/InvoiceRequest" - responses: - 200: - description: "Returns the saved invoice entity" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/Invoice" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - - "/api/v1/invoices/{id}": - get: - tags: - - invoices - summary: "Show invoice" - description: "Displays an invoice by id" - operationId: showInvoice - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: id - in: path - description: "The Invoice Hashed ID" - required: true - schema: - type: string - format: string - example: D2J234DFA - responses: - 200: - description: "Returns the invoice object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/Invoice" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - - put: - tags: - - invoices - summary: "Update invoice" - description: | - Handles the updating of an invoice by id. - - Triggered actions are available when updating or creating an invoice. - These are query parameters that can be chained in order to perform additional actions on the entity, these include: - - ``` - ?send_email=true [Saves and sends the invoice] - ?mark_sent=true [Saves and marks the invoice as sent] - ?paid=true [Saves and marks the invoice as paid] - ?amount_paid=100 [Saves and marks the invoice as paid with the given amount] - ?cancel=true [Saves and marks the invoice as cancelled] - ?save_default_footer=true [Saves the current footer as the default footer] - ?save_default_terms=true [Saves the current terms as the default terms] - ``` - - operationId: updateInvoice - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: id - in: path - description: "The Invoice Hashed ID" - required: true - schema: - type: string - format: string - example: D2J234DFA - responses: - 200: - description: "Returns the invoice object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/Invoice" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - delete: - tags: - - invoices - summary: "Delete invoice" - description: "Handles the deletion of an invoice by id" - operationId: deleteInvoice - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: id - in: path - description: "The Invoice Hashed ID" - required: true - schema: - type: string - format: string - example: D2J234DFA - responses: - 200: - description: "Returns a HTTP status" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - "/api/v1/invoices/{id}/edit": - get: - tags: - - invoices - summary: "Edit invoice" - description: "Displays an invoice by id for editting" - operationId: editInvoice - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: id - in: path - description: "The Invoice Hashed ID" - required: true - schema: - type: string - format: string - example: D2J234DFA - responses: - 200: - description: "Returns the invoice object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/Invoice" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - - /api/v1/invoices/create: - get: - tags: - - invoices - summary: "Blank invoice" - description: "Returns a blank object with default values" - operationId: getInvoicesCreate - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - responses: - 200: - description: "A blank invoice object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/Invoice" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - - /api/v1/invoices/bulk: - post: - tags: - - invoices - summary: "Bulk invoice actions" - description: | - There are multiple actions that are available including: - - operationId: bulkInvoices - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/index" - requestBody: - description: "Bulk action details" - required: true - content: - application/json: - schema: - type: object - properties: - action: - required: true - type: string - description: | - The action to be performed, options include: - - `bulk_download` - Bulk download an array of invoice PDFs (These are sent to the admin via email.) - - `download` - Download a single PDF. (Returns a single PDF object) - - `bulk_print` - Merges an array of Invoice PDFs for easy one click printing. - - `auto_bill` - Attempts to automatically bill the invoices with the payment method on file. - - `clone_to_invoice` - Returns a clone of the invoice. - - `clone_to_quote` - Returns a quote cloned using the properties of the given invoice. - - `mark_paid` - Marks an array of invoices as paid. - - `mark_sent` - Marks an array of invoices as sent. - - `restore` - Restores an array of invoices - - `delete` - Deletes an array of invoices - - `archive` - Archives an array of invoices - - `cancel` - Cancels an array of invoices - - `email` - Emails an array of invoices - - `send_email` - Emails an array of invoices. Requires additional properties to be sent. `email_type` - ids: - required: true - type: array - items: - description: "Array of hashed IDs to be bulk 'actioned - ['D2J234DFA','D2J234DFA','D2J234DFA']" - type: string - example: - action: bulk_download - ids: "['D2J234DFA','D2J234DFA','D2J234DFA']" - - responses: - 200: - description: "The Bulk Action response" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - - "/api/v1/invoices/{id}/{action}": - get: - deprecated: true - tags: - - invoices - summary: "Custom invoice action" - description: | - Performs a custom action on an invoice. - The current range of actions are as follows - - clone_to_invoice - - clone_to_quote - - history - - delivery_note - - mark_paid - - download - - archive - - delete - - email - operationId: actionInvoice - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: id - in: path - description: "The Invoice Hashed ID" - required: true - schema: - type: string - format: string - example: D2J234DFA - - name: action - in: path - description: "The action string to be performed" - required: true - schema: - type: string - format: string - example: clone_to_quote - responses: - 200: - description: "Returns the invoice object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/Invoice" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - "/api/v1/invoice/{invitation_key}/download": - get: - tags: - - invoices - summary: "Download invoice PDF" - description: "Downloads a specific invoice" - operationId: downloadInvoice - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: invitation_key - in: path - description: "The Invoice Invitation Key" - required: true - schema: - type: string - format: string - example: D2J234DFA - responses: - 200: - description: "Returns the invoice pdf" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - "/api/v1/invoices/{id}/delivery_note": - get: - tags: - - invoices - summary: "Download delivery note" - description: "Downloads a specific invoice delivery notes" - operationId: deliveryNote - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: id - in: path - description: "The Invoice Hahsed Id" - required: true - schema: - type: string - format: string - example: D2J234DFA - responses: - 200: - description: "Returns the invoice delivery note pdf" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - "/api/v1/invoices/{id}/upload": - post: - tags: - - invoices - summary: "Add invoice document" - description: "Handles the uploading of a document to a invoice" - operationId: uploadInvoice - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: id - in: path - description: "The Invoice Hashed ID" - required: true - schema: - type: string - format: string - example: D2J234DFA - requestBody: - description: "File Upload Body" - required: true - content: - multipart/form-data: - schema: - type: object - properties: - _method: - type: string - example: PUT - documents: - type: array - items: - description: "Array of binary documents for upload" - type: string - format: binary - responses: - 200: - description: "Returns the Invoice object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/Invoice" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - /api/v1/recurring_invoices: - get: - tags: - - Recurring Invoices - summary: "List recurring invoices" - description: | - Lists invoices with the option to chain multiple query parameters allowing fine grained filtering of the list. - - operationId: getRecurringInvoices - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - $ref: "#/components/parameters/client_id" - - $ref: "#/components/parameters/created_at" - - $ref: "#/components/parameters/updated_at" - - $ref: "#/components/parameters/is_deleted" - - $ref: "#/components/parameters/filter_deleted_clients" - - $ref: "#/components/parameters/vendor_id" - - name: filter - in: query - description: | - Searches across a range of columns including: - - custom_value1 - - custom_value2 - - custom_value3 - - custom_value4 - required: false - schema: - type: string - example: ?filter=bob - - name: client_status - in: query - description: | - A comma separated list of invoice status strings. Valid options include: - - all - - active - - paused - - completed - required: false - schema: - type: string - example: ?client_status=active,paused - - name: sort - in: query - description: Returns the list sorted by column in ascending or descending order. - required: false - schema: - type: string - example: id|desc number|desc balance|asc - responses: - 200: - description: "A list of recurring_invoices" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/RecurringInvoice' - meta: - type: object - $ref: '#/components/schemas/Meta' - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - post: - tags: - - Recurring Invoices - summary: "Create recurring invoice" - description: "Adds a Recurring Invoice to the system" - operationId: storeRecurringInvoice - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - responses: - 200: - description: "Returns the saved RecurringInvoice object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/RecurringInvoice" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - - "/api/v1/recurring_invoices/{id}": - get: - tags: - - Recurring Invoices - summary: "Show recurring invoice" - description: "Displays an RecurringInvoice by id" - operationId: showRecurringInvoice - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: id - in: path - description: "The RecurringInvoice Hashed ID" - required: true - schema: - type: string - format: string - example: D2J234DFA - responses: - 200: - description: "Returns the RecurringInvoice object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/RecurringInvoice" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - put: - tags: - - Recurring Invoices - summary: "Update recurring invoice" - description: "Handles the updating of an RecurringInvoice by id" - operationId: updateRecurringInvoice - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: id - in: path - description: "The RecurringInvoice Hashed ID" - required: true - schema: - type: string - format: string - example: D2J234DFA - responses: - 200: - description: "Returns the RecurringInvoice object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/RecurringInvoice" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - delete: - tags: - - Recurring Invoices - summary: "Delete recurring invoice" - description: "Handles the deletion of an RecurringInvoice by id" - operationId: deleteRecurringInvoice - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: id - in: path - description: "The RecurringInvoice Hashed ID" - required: true - schema: - type: string - format: string - example: D2J234DFA - responses: - 200: - description: "Returns a HTTP status" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - "/api/v1/recurring_invoices/{id}/edit": - get: - tags: - - Recurring Invoices - summary: "Edit recurring invoice" - description: "Displays an RecurringInvoice by id" - operationId: editRecurringInvoice - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: id - in: path - description: "The RecurringInvoice Hashed ID" - required: true - schema: - type: string - format: string - example: D2J234DFA - responses: - 200: - description: "Returns the RecurringInvoice object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/RecurringInvoice" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - - /api/v1/recurring_invoices/create: - get: - tags: - - Recurring Invoices - summary: "Blank recurring invoice" - description: "Returns a blank object with default values" - operationId: getRecurringInvoicesCreate - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - responses: - 200: - description: "A blank RecurringInvoice object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/RecurringInvoice" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - /api/v1/recurring_invoices/bulk: - post: - tags: - - Recurring Invoices - summary: "Bulk recurring invoice actions" - description: | - There are multiple actions that are available including: - - operationId: bulkRecurringInvoices - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/index" - requestBody: - description: "Bulk action details" - required: true - content: - application/json: - schema: - type: object - properties: - action: - type: string - description: | - The action to be performed, options include: - - `start` - Starts (or restarts) the recurring invoice. **note** if the recurring invoice has been stopped for a long time, it will attempt to catch back up firing a new Invoice every hour per interval that has been missed. - If you do not wish to have the recurring invoice catch up, you should set the next_send_date to the correct date you wish the recurring invoice to commence from. - - `stop` - Stops the recurring invoice. - - `send_now` - Force sends the recurring invoice - this option is only available when the recurring invoice is in a draft state. - - `restore` - Restores the recurring invoice from an archived or deleted state. - - `archive` - Archives the recurring invoice. The recurring invoice will not fire in this state. - - `delete` - Deletes a recurring invoice. - ids: - type: array - items: - description: "Array of hashed IDs to be bulk 'actioned - ['D2J234DFA','D2J234DFA','D2J234DFA']" - type: string - example: - action: start - ids: "['D2J234DFA','D2J234DFA','D2J234DFA']" - responses: - 200: - description: "The RecurringInvoice response" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/RecurringInvoice" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - "/api/v1/recurring_invoices/{id}/{action}": - get: - deprecated: true - tags: - - Recurring Invoices - summary: "Custom recurring invoice action" - description: "Performs a custom action on an RecurringInvoice.\n\n The current range of actions are as follows\n - clone_to_RecurringInvoice\n - clone_to_quote\n - history\n - delivery_note\n - mark_paid\n - download\n - archive\n - delete\n - email" - operationId: actionRecurringInvoice - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: id - in: path - description: "The RecurringInvoice Hashed ID" - required: true - schema: - type: string - format: string - example: D2J234DFA - - name: action - in: path - description: "The action string to be performed" - required: true - schema: - type: string - format: string - example: clone_to_quote - responses: - 200: - description: "Returns the RecurringInvoice object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/RecurringInvoice" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - "/api/v1/recurring_invoice/{invitation_key}/download": - get: - tags: - - Recurring Invoices - summary: "Download recurring invoice PDF" - description: "Downloads a specific invoice" - operationId: downloadRecurringInvoice - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: invitation_key - in: path - description: "The Recurring Invoice Invitation Key" - required: true - schema: - type: string - format: string - example: D2J234DFA - responses: - 200: - description: "Returns the recurring invoice pdf" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - 401: - $ref: "#/components/responses/401" - 403: - $ref: "#/components/responses/403" - 422: - $ref: '#/components/responses/422' - 429: - $ref: '#/components/responses/429' - 5XX: - description: 'Server error' - default: - $ref: "#/components/responses/default" - "/api/v1/recurring_invoices/{id}/upload": - post: - tags: - - Recurring Invoices - summary: "Add recurring invoice document" - description: "Handles the uploading of a document to a recurring_invoice" - operationId: uploadRecurringInvoice - parameters: - - $ref: "#/components/parameters/X-API-TOKEN" - - $ref: "#/components/parameters/X-Requested-With" - - $ref: "#/components/parameters/include" - - name: id - in: path - description: "The RecurringInvoice Hashed ID" - required: true - schema: - type: string - format: string - example: D2J234DFA - requestBody: - description: "File Upload Body" - required: true - content: - multipart/form-data: - schema: - type: object - properties: - _method: - type: string - example: PUT - documents: - type: array - items: - description: "Array of binary documents for upload" - type: string - format: binary - responses: - 200: - description: "Returns the RecurringInvoice object" - headers: - X-MINIMUM-CLIENT-VERSION: - $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" - X-RateLimit-Remaining: - $ref: "#/components/headers/X-RateLimit-Remaining" - X-RateLimit-Limit: - $ref: "#/components/headers/X-RateLimit-Limit" - content: - application/json: - schema: - $ref: "#/components/schemas/RecurringInvoice" + $ref: "#/components/schemas/Project" 401: $ref: "#/components/responses/401" 403: @@ -13143,6 +11850,1262 @@ paths: description: 'Server error' default: $ref: "#/components/responses/default" + /api/v1/invoices: + get: + tags: + - invoices + summary: "List invoices" + description: | + Lists invoices with the option to chain multiple query parameters allowing fine grained filtering of the list. + + operationId: getInvoices + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - $ref: "#/components/parameters/status" + - $ref: "#/components/parameters/client_id" + - $ref: "#/components/parameters/created_at" + - $ref: "#/components/parameters/updated_at" + - $ref: "#/components/parameters/is_deleted" + - $ref: "#/components/parameters/filter_deleted_clients" + - $ref: "#/components/parameters/vendor_id" + - name: client_status + in: query + description: | + A comma separated list of invoice status strings. Valid options include: + - all + - paid + - unpaid + - overdue + required: false + schema: + type: string + example: ?client_status=paid,unpaid + - name: number + in: query + description: | + Search invoices by invoice number + required: false + schema: + type: string + example: ?number=INV-001 + - name: filter + in: query + description: | + Searches across a range of columns including: + - number + - po_number + - date + - amount + - balance + - custom_value1 + - custom_value2 + - custom_value3 + - custom_value4 + required: false + schema: + type: string + example: ?filter=bob + - name: without_deleted_clients + in: query + description: | + Returns the invoice list without the invoices of deleted clients. + required: false + schema: + type: string + example: ?without_deleted_clients= + - name: overdue + in: query + description: | + Returns the list of invoices that are overdue + required: false + schema: + type: string + example: ?over_due= + - name: payable + in: query + description: | + Returns the invoice list that are payable for a defined client. Please note, you must pass the client_id as the value for this query parameter + required: false + schema: + type: string + example: ?payable={client_id} + - name: sort + in: query + description: Returns the list sorted by column in ascending or descending order. + required: false + schema: + type: string + example: id|desc number|desc balance|asc + - name: private_notes + in: query + description: | + Searches on the private_notes field of the invoices + required: false + schema: + type: string + example: ?private_notes=super secret + responses: + 200: + description: "A list of invoices" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/Invoice' + meta: + type: object + $ref: '#/components/schemas/Meta' + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + post: + tags: + - invoices + summary: "Create invoice" + description: | + Adds a invoice to a company + + Triggered actions are available when updating or creating an invoice. + These are query parameters that can be chained in order to perform additional actions on the entity, these include: + + ``` + ?send_email=true [Saves and sends the invoice] + ?mark_sent=true [Saves and marks the invoice as sent] + ?paid=true [Saves and marks the invoice as paid] + ?amount_paid=100 [Saves and marks the invoice as paid with the given amount] + ?cancel=true [Saves and marks the invoice as cancelled] + ?save_default_footer=true [Saves the current footer as the default footer] + ?save_default_terms=true [Saves the current terms as the default terms] + ``` + + operationId: storeInvoice + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/InvoiceRequest" + responses: + 200: + description: "Returns the saved invoice entity" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Invoice" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + + "/api/v1/invoices/{id}": + get: + tags: + - invoices + summary: "Show invoice" + description: "Displays an invoice by id" + operationId: showInvoice + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: id + in: path + description: "The Invoice Hashed ID" + required: true + schema: + type: string + format: string + example: D2J234DFA + responses: + 200: + description: "Returns the invoice object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Invoice" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + + put: + tags: + - invoices + summary: "Update invoice" + description: | + Handles the updating of an invoice by id. + + Triggered actions are available when updating or creating an invoice. + These are query parameters that can be chained in order to perform additional actions on the entity, these include: + + ``` + ?send_email=true [Saves and sends the invoice] + ?mark_sent=true [Saves and marks the invoice as sent] + ?paid=true [Saves and marks the invoice as paid] + ?amount_paid=100 [Saves and marks the invoice as paid with the given amount] + ?cancel=true [Saves and marks the invoice as cancelled] + ?save_default_footer=true [Saves the current footer as the default footer] + ?save_default_terms=true [Saves the current terms as the default terms] + ``` + + operationId: updateInvoice + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: id + in: path + description: "The Invoice Hashed ID" + required: true + schema: + type: string + format: string + example: D2J234DFA + responses: + 200: + description: "Returns the invoice object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Invoice" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + delete: + tags: + - invoices + summary: "Delete invoice" + description: "Handles the deletion of an invoice by id" + operationId: deleteInvoice + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: id + in: path + description: "The Invoice Hashed ID" + required: true + schema: + type: string + format: string + example: D2J234DFA + responses: + 200: + description: "Returns a HTTP status" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + "/api/v1/invoices/{id}/edit": + get: + tags: + - invoices + summary: "Edit invoice" + description: "Displays an invoice by id for editting" + operationId: editInvoice + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: id + in: path + description: "The Invoice Hashed ID" + required: true + schema: + type: string + format: string + example: D2J234DFA + responses: + 200: + description: "Returns the invoice object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Invoice" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + + /api/v1/invoices/create: + get: + tags: + - invoices + summary: "Blank invoice" + description: "Returns a blank object with default values" + operationId: getInvoicesCreate + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + responses: + 200: + description: "A blank invoice object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Invoice" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + + /api/v1/invoices/bulk: + post: + tags: + - invoices + summary: "Bulk invoice actions" + description: | + There are multiple actions that are available including: + + operationId: bulkInvoices + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/index" + requestBody: + description: "Bulk action details" + required: true + content: + application/json: + schema: + type: object + properties: + action: + type: string + description: | + The action to be performed, options include: + - `bulk_download` + Bulk download an array of invoice PDFs (These are sent to the admin via email.) + - `download` + Download a single PDF. (Returns a single PDF object) + - `bulk_print` + Merges an array of Invoice PDFs for easy one click printing. + - `auto_bill` + Attempts to automatically bill the invoices with the payment method on file. + - `clone_to_invoice` + Returns a clone of the invoice. + - `clone_to_quote` + Returns a quote cloned using the properties of the given invoice. + - `mark_paid` + Marks an array of invoices as paid. + - `mark_sent` + Marks an array of invoices as sent. + - `restore` + Restores an array of invoices + - `delete` + Deletes an array of invoices + - `archive` + Archives an array of invoices + - `cancel` + Cancels an array of invoices + - `email` + Emails an array of invoices + - `send_email` + Emails an array of invoices. Requires additional properties to be sent. `email_type` + ids: + type: array + items: + description: "Array of hashed IDs to be bulk 'actioned - ['D2J234DFA','D2J234DFA','D2J234DFA']" + type: string + example: + action: bulk_download + ids: "['D2J234DFA','D2J234DFA','D2J234DFA']" + + responses: + 200: + description: "The Bulk Action response" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + + "/api/v1/invoices/{id}/{action}": + get: + deprecated: true + tags: + - invoices + summary: "Custom invoice action" + description: | + Performs a custom action on an invoice. + The current range of actions are as follows + - clone_to_invoice + - clone_to_quote + - history + - delivery_note + - mark_paid + - download + - archive + - delete + - email + operationId: actionInvoice + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: id + in: path + description: "The Invoice Hashed ID" + required: true + schema: + type: string + format: string + example: D2J234DFA + - name: action + in: path + description: "The action string to be performed" + required: true + schema: + type: string + format: string + example: clone_to_quote + responses: + 200: + description: "Returns the invoice object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Invoice" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + "/api/v1/invoice/{invitation_key}/download": + get: + tags: + - invoices + summary: "Download invoice PDF" + description: "Downloads a specific invoice" + operationId: downloadInvoice + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: invitation_key + in: path + description: "The Invoice Invitation Key" + required: true + schema: + type: string + format: string + example: D2J234DFA + responses: + 200: + description: "Returns the invoice pdf" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + "/api/v1/invoices/{id}/delivery_note": + get: + tags: + - invoices + summary: "Download delivery note" + description: "Downloads a specific invoice delivery notes" + operationId: deliveryNote + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: id + in: path + description: "The Invoice Hahsed Id" + required: true + schema: + type: string + format: string + example: D2J234DFA + responses: + 200: + description: "Returns the invoice delivery note pdf" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + "/api/v1/invoices/{id}/upload": + post: + tags: + - invoices + summary: "Add invoice document" + description: "Handles the uploading of a document to a invoice" + operationId: uploadInvoice + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: id + in: path + description: "The Invoice Hashed ID" + required: true + schema: + type: string + format: string + example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary + responses: + 200: + description: "Returns the Invoice object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Invoice" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + /api/v1/payments: + get: + tags: + - payments + summary: "List payments" + description: "Lists payments, search and filters allow fine grained lists to be generated.\n\n Query parameters can be added to performed more fine grained filtering of the payments, these are handled by the PaymentFilters class which defines the methods available" + operationId: getPayments + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - $ref: "#/components/parameters/status" + - $ref: "#/components/parameters/client_id" + - $ref: "#/components/parameters/created_at" + - $ref: "#/components/parameters/updated_at" + - $ref: "#/components/parameters/is_deleted" + - $ref: "#/components/parameters/filter_deleted_clients" + - $ref: "#/components/parameters/vendor_id" + - name: filter + in: query + description: | + Searches across a range of columns including: + - amount + - date + - custom_value1 + - custom_value2 + - custom_value3 + - custom_value4 + required: false + schema: + type: string + example: ?filter=10 + - name: number + in: query + description: | + Search payments by payment number + required: false + schema: + type: string + example: ?number=0001 + - name: sort + in: query + description: Returns the list sorted by column in ascending or descending order. + required: false + schema: + type: string + example: id|desc number|desc balance|asc + responses: + 200: + description: "A list of payments" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/Payment' + meta: + type: object + $ref: '#/components/schemas/Meta' + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + post: + tags: + - payments + summary: "Create payment" + description: "Adds an Payment to the system" + operationId: storePayment + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + requestBody: + description: "The payment request" + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Payment" + responses: + 200: + description: "Returns the saved Payment object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Payment" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + + "/api/v1/payments/{id}": + get: + tags: + - payments + summary: "Show payment" + description: "Displays an Payment by id" + operationId: showPayment + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: id + in: path + description: "The Payment Hashed ID" + required: true + schema: + type: string + format: string + example: D2J234DFA + responses: + 200: + description: "Returns the Payment object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Payment" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + put: + tags: + - payments + summary: "Update payment" + description: "Handles the updating of an Payment by id" + operationId: updatePayment + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: id + in: path + description: "The Payment Hashed ID" + required: true + schema: + type: string + format: string + example: D2J234DFA + responses: + 200: + description: "Returns the Payment object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Payment" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + delete: + tags: + - payments + summary: "Delete payment" + description: "Handles the deletion of an Payment by id" + operationId: deletePayment + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: id + in: path + description: "The Payment Hashed ID" + required: true + schema: + type: string + format: string + example: D2J234DFA + responses: + 200: + description: "Returns a HTTP status" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + "/api/v1/payments/{id}/edit": + get: + tags: + - payments + summary: "Edit payment" + description: "Displays an Payment by id" + operationId: editPayment + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: id + in: path + description: "The Payment Hashed ID" + required: true + schema: + type: string + format: string + example: D2J234DFA + responses: + 200: + description: "Returns the Payment object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Payment" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + /api/v1/payments/create: + get: + tags: + - payments + summary: "Blank payment" + description: "Returns a blank object with default values" + operationId: getPaymentsCreate + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + responses: + 200: + description: "A blank Payment object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Payment" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + /api/v1/payments/refund: + post: + tags: + - payments + summary: "Refund payment" + description: "Adds an Refund to the system" + operationId: storeRefund + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + requestBody: + description: "The refund request" + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Payment" + responses: + 200: + description: "Returns the saved Payment object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Payment" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + /api/v1/payments/bulk: + post: + tags: + - payments + summary: "Bulk payment actions" + description: "" + operationId: bulkPayments + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/index" + requestBody: + description: "User credentials" + required: true + content: + application/json: + schema: + type: array + items: + description: "Array of hashed IDs to be bulk 'actioned" + type: integer + example: "[0,1,2,3]" + responses: + 200: + description: "The Payment response" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Payment" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + "/api/v1/payments/{id}/{action}": + get: + deprecated: true + tags: + - payments + summary: "Custom payment actions" + description: "Performs a custom action on an Payment.\n\n The current range of actions are as follows\n - clone_to_Payment\n - clone_to_quote\n - history\n - delivery_note\n - mark_paid\n - download\n - archive\n - delete\n - email" + operationId: actionPayment + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: id + in: path + description: "The Payment Hashed ID" + required: true + schema: + type: string + format: string + example: D2J234DFA + - name: action + in: path + description: "The action string to be performed" + required: true + schema: + type: string + format: string + example: clone_to_quote + responses: + 200: + description: "Returns the Payment object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Payment" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + + "/api/v1/payments/{id}/upload": + post: + tags: + - payments + summary: "Upload a payment document" + description: "Handles the uploading of a document to a payment" + operationId: uploadPayment + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + - name: id + in: path + description: "The Payment Hashed ID" + required: true + schema: + type: string + format: string + example: D2J234DFA + requestBody: + description: "File Upload Body" + required: true + content: + multipart/form-data: + schema: + type: object + properties: + _method: + type: string + example: PUT + documents: + type: array + items: + description: "Array of binary documents for upload" + type: string + format: binary + responses: + 200: + description: "Returns the Payment object" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + content: + application/json: + schema: + $ref: "#/components/schemas/Payment" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" /api/v1/purchase_orders: get: tags: @@ -13639,13 +13602,13 @@ paths: description: 'Server error' default: $ref: "#/components/responses/default" - /api/v1/vendors: + /api/v1/tasks: get: tags: - - vendors - summary: "List vendors" - description: "Lists vendors, search and filters allow fine grained lists to be generated.\n\n Query parameters can be added to performed more fine grained filtering of the vendors, these are handled by the VendorFilters class which defines the methods available" - operationId: getVendors + - tasks + summary: "List tasks" + description: "Lists tasks, search and filters allow fine grained lists to be generated.\n *\n * Query parameters can be added to performed more fine grained filtering of the tasks, these are handled by the TaskFilters class which defines the methods available" + operationId: getTasks parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" @@ -13653,7 +13616,7 @@ paths: - $ref: "#/components/parameters/index" responses: 200: - description: "A list of vendors" + description: "A list of tasks" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -13669,7 +13632,7 @@ paths: data: type: array items: - $ref: '#/components/schemas/Vendor' + $ref: '#/components/schemas/Task' meta: type: object $ref: '#/components/schemas/Meta' @@ -13687,17 +13650,17 @@ paths: $ref: "#/components/responses/default" post: tags: - - vendors - summary: "Create vendor" - description: "Adds a vendor to a company" - operationId: storeVendor + - tasks + summary: "Create task" + description: "Adds an task to a company" + operationId: storeTask parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" responses: 200: - description: "Returns the saved clivendorent object" + description: "Returns the saved task object" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -13708,7 +13671,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Vendor" + $ref: "#/components/schemas/Task" 401: $ref: "#/components/responses/401" 403: @@ -13721,20 +13684,20 @@ paths: description: 'Server error' default: $ref: "#/components/responses/default" - "/api/v1/vendors/{id}": + "/api/v1/tasks/{id}": get: tags: - - vendors - summary: "Show vendor" - description: "Displays a vendor by id" - operationId: showVendor + - tasks + summary: "Show task" + description: "Displays a task by id" + operationId: showTask parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" - name: id in: path - description: "The vendor Hashed ID" + description: "The Task Hashed ID" required: true schema: type: string @@ -13742,7 +13705,7 @@ paths: example: D2J234DFA responses: 200: - description: "Returns the vendor object" + description: "Returns the task object" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -13753,7 +13716,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Vendor" + $ref: "#/components/schemas/Task" 401: $ref: "#/components/responses/401" 403: @@ -13768,17 +13731,17 @@ paths: $ref: "#/components/responses/default" put: tags: - - vendors - summary: "Update vendor" - description: "Handles the updating of a vendor by id" - operationId: updateVendor + - tasks + summary: "Update task" + description: "Handles the updating of a task by id" + operationId: updateTask parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" - name: id in: path - description: "The Vendor Hashed ID" + description: "The task Hashed ID" required: true schema: type: string @@ -13786,7 +13749,7 @@ paths: example: D2J234DFA responses: 200: - description: "Returns the vendor object" + description: "Returns the task object" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -13797,7 +13760,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Vendor" + $ref: "#/components/schemas/Task" 401: $ref: "#/components/responses/401" 403: @@ -13812,17 +13775,17 @@ paths: $ref: "#/components/responses/default" delete: tags: - - vendors - summary: "Delete vendor" - description: "Handles the deletion of a vendor by id" - operationId: deleteVendor + - tasks + summary: "Delete task" + description: "Handles the deletion of a task by id" + operationId: deleteTask parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" - name: id in: path - description: "The Vendor Hashed ID" + description: "The Task Hashed ID" required: true schema: type: string @@ -13850,20 +13813,20 @@ paths: description: 'Server error' default: $ref: "#/components/responses/default" - "/api/v1/vendors/{id}/edit": + "/api/v1/tasks/{id}/edit": get: tags: - - vendors - summary: "Edit vendor" - description: "Displays a vendor by id" - operationId: editVendor + - tasks + summary: "Edit task" + description: "Displays a task by id" + operationId: editTask parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" - name: id in: path - description: "The Vendor Hashed ID" + description: "The Task Hashed ID" required: true schema: type: string @@ -13871,7 +13834,7 @@ paths: example: D2J234DFA responses: 200: - description: "Returns the vendor object" + description: "Returns the client object" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -13882,7 +13845,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Vendor" + $ref: "#/components/schemas/Task" 401: $ref: "#/components/responses/401" 403: @@ -13895,20 +13858,20 @@ paths: description: 'Server error' default: $ref: "#/components/responses/default" - /api/v1/vendors/create: + /api/v1/tasks/create: get: tags: - - vendors - summary: "Blank vendor" - description: "Returns a blank vendor with default values" - operationId: getVendorsCreate + - tasks + summary: "Blank task" + description: "Returns a blank task with default values" + operationId: getTasksCreate parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" responses: 200: - description: "A blank vendor object" + description: "A blank task object" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -13919,7 +13882,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Vendor" + $ref: "#/components/schemas/Task" 401: $ref: "#/components/responses/401" 403: @@ -13932,13 +13895,13 @@ paths: description: 'Server error' default: $ref: "#/components/responses/default" - /api/v1/vendors/bulk: + /api/v1/tasks/bulk: post: tags: - - vendors - summary: "Bulk vendor actions" + - tasks + summary: "Bulk task actions" description: "" - operationId: bulkVendors + operationId: bulkTasks parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" @@ -13956,7 +13919,7 @@ paths: example: "[0,1,2,3]" responses: 200: - description: "The Vendor User response" + description: "The Task User response" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -13967,7 +13930,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Vendor" + $ref: "#/components/schemas/Task" 401: $ref: "#/components/responses/401" 403: @@ -13980,20 +13943,20 @@ paths: description: 'Server error' default: $ref: "#/components/responses/default" - "/api/v1/vendors/{id}/upload": + "/api/v1/tasks/{id}/upload": post: tags: - - vendors - summary: "Uploads a vendor document" - description: "Handles the uploading of a document to a vendor" - operationId: uploadVendor + - tasks + summary: "Uploads a task document" + description: "Handles the uploading of a document to a task" + operationId: uploadTask parameters: - $ref: "#/components/parameters/X-API-TOKEN" - $ref: "#/components/parameters/X-Requested-With" - $ref: "#/components/parameters/include" - name: id in: path - description: "The Vendor Hashed ID" + description: "The Task Hashed ID" required: true schema: type: string @@ -14018,7 +13981,7 @@ paths: format: binary responses: 200: - description: "Returns the Vendor object" + description: "Returns the Task object" headers: X-MINIMUM-CLIENT-VERSION: $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" @@ -14029,7 +13992,40 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Vendor" + $ref: "#/components/schemas/Task" + 401: + $ref: "#/components/responses/401" + 403: + $ref: "#/components/responses/403" + 422: + $ref: '#/components/responses/422' + 429: + $ref: '#/components/responses/429' + 5XX: + description: 'Server error' + default: + $ref: "#/components/responses/default" + /api/v1/tasks/sort: + post: + tags: + - tasks + summary: "Sort tasks on KanBan" + description: "Sorts tasks after drag and drop on the KanBan." + operationId: sortTasks + parameters: + - $ref: "#/components/parameters/X-API-TOKEN" + - $ref: "#/components/parameters/X-Requested-With" + - $ref: "#/components/parameters/include" + responses: + 200: + description: "Returns an Ok, 200 HTTP status" + headers: + X-MINIMUM-CLIENT-VERSION: + $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" 401: $ref: "#/components/responses/401" 403: @@ -14056,122 +14052,130 @@ components: description: 'The total number of requests in a given time window.' schema: type: integer - components: securitySchemes: ApiKeyAuth: type: apiKey in: header name: X-API-TOKEN + #examples: + # Client: + # $ref: '#/components/schemas/Client' + + # Client: + # id: Opnel5aKBz + # user_id: Ua6Rw4pVbS + # assigned_user_id: Ua6Rw4pVbS + # company_id: Co7Vn3yLmW + # name: "Jim's Housekeeping" + # website: https://www.jims-housekeeping.com + # private_notes: Client prefers email communication over phone calls + # client_hash: asdfkjhk342hjhbfdvmnfb1 + # industry_id: 5 + # size_id: 2 + # address1: 123 Main St + # address2: Apt 4B + # city: Beverly Hills + # state: California + # postal_code: 90210 + # phone: 555-3434-3434 + # country_id: 1 + # custom_value1: Email + # custom_value2: John Doe + # custom_value3: Yes + # custom_value4: $50,000 + # vat_number: VAT123456 + # id_number: ID123456 + # number: CL-0001 + # shipping_address1: 5 Wallaby Way + # shipping_address2: Suite 5 + # shipping_city: Perth + # shipping_state: Western Australia + # shipping_postal_code: 6110 + # shipping_country_id: 4 + # is_deleted: false + # balance: 500.00 + # paid_to_date: 2000.00 + # credit_balance: 100.00 + # last_login: 1628686031 + # created_at: 1617629031 + # updated_at: 1628445631 + # group_settings_id: Opnel5aKBz + # routing_id: Opnel5aKBz3489-dfkiu-2239-sdsd + # is_tax_exempt: false + # has_valid_vat_number: false + # payment_balance: 100 + # contacts: + # id: Opnel5aKBz + # first_name: John + # last_name: Doe + # email: jim@gmail.com + # phone: 555-3434-3434 + # send_invoice: true + # custom_value1: Email + # custom_value2: John Doe + # custom_value3: Yes + # custom_value4: $50,000 + # is_primary: true + # created_at: 1617629031 + # updated_at: 1628445631 + # deleted_at: 1628445631 + # Meta: + # value: + # pagination: + # total: 1 + # count: 1 + # per_page: 20 + # current_page: 1 + # total_pages: 1 + # links: + # - first: https://invoicing.co/api/v1/invoices?page=1 + # - last: https://invoicing.co/api/v1/invoices?page=1 + # - prev: null + # - next: null responses: - examples: - Client: - - id: Opnel5aKBz - user_id: Ua6Rw4pVbS - assigned_user_id: Ua6Rw4pVbS - company_id: Co7Vn3yLmW - name: "Jim's Housekeeping" - website: https://www.jims-housekeeping.com - private_notes: Client prefers email communication over phone calls - client_hash: asdfkjhk342hjhbfdvmnfb1 - industry_id: 5 - size_id: 2 - address1: 123 Main St - address2: Apt 4B - city: Beverly Hills - state: California - postal_code: 90210 - phone: 555-3434-3434 - country_id: 1 - custom_value1: Email - custom_value2: John Doe - custom_value3: Yes - custom_value4: $50,000 - vat_number: VAT123456 - id_number: ID123456 - number: CL-0001 - shipping_address1: 5 Wallaby Way - shipping_address2: Suite 5 - shipping_city: Perth - shipping_state: Western Australia - shipping_postal_code: 6110 - shipping_country_id: 4 - is_deleted: false - balance: 500.00 - paid_to_date: 2000.00 - credit_balance: 100.00 - last_login: 1628686031 - created_at: 1617629031 - updated_at: 1628445631 - group_settings_id: Opnel5aKBz - routing_id: Opnel5aKBz3489-dfkiu-2239-sdsd - is_tax_exempt: false - has_valid_vat_number: false - payment_balance: 100 - contacts: - - id: Opnel5aKBz - first_name: John - last_name: Doe - email: jim@gmail.com - phone: 555-3434-3434 - send_invoice: true - custom_value1: Email - custom_value2: John Doe - custom_value3: Yes - custom_value4: $50,000 - is_primary: true - created_at: 1617629031 - updated_at: 1628445631 - deleted_at: 1628445631 - Meta: - value: - pagination: - total: 1 - count: 1 - per_page: 20 - current_page: 1 - total_pages: 1 - links: - - first: https://invoicing.co/api/v1/invoices?page=1 - - last: https://invoicing.co/api/v1/invoices?page=1 - - prev: null - - next: null - 429: - description: 'Rate Limit Exceeded' + 500: + description: 'Gateway Error' content: application/json: schema: - $ref: '#/components/schemas/RateLimiterError' - + $ref: '#/components/schemas/Error' 403: description: 'Authorization error' content: application/json: schema: - $ref: '#components/schemas/AuthorizationError' - 422: - description: 'Validation error' - content: - application/json: - schema: - $ref: '#/components/schemas/ValidationError' + $ref: '#/components/schemas/AuthorizationError' + default: description: 'Unexpected Error' content: application/json: schema: $ref: '#/components/schemas/Error' - 400: - description: 'Invalid user input' + 429: + description: 'Rate Limit Exceeded' content: application/json: schema: - $ref: '#components/schemas/InvalidInputError' + $ref: '#/components/schemas/RateLimiterError' + 422: + description: 'Validation error' + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' 401: description: 'Authentication error' content: application/json: schema: - $ref: '#components/schemas/AuthenticationError' + $ref: '#/components/schemas/AuthenticationError' + 400: + description: 'Invalid user input' + content: + application/json: + schema: + $ref: '#/components/schemas/InvalidInputError' parameters: X-API-SECRET: name: X-API-SECRET @@ -14313,7 +14317,7 @@ components: description: The number of records to return for each request, default is 20 required: false schema: - type: int + type: integer example: 20 page_meta: name: page @@ -14321,7 +14325,7 @@ components: description: The page number to return for this request (when performing pagination), default is 1 required: false schema: - type: int + type: integer example: 1 include: name: include @@ -14411,7 +14415,7 @@ components: Filters the entity list by entities that have been deleted. required: false schema: - type: booleans + type: boolean example: ?is_deleted=true vendor_id: name: vendor_id @@ -14747,7 +14751,245 @@ components: type: string example: JSON type: object - Product: + Credit: + properties: + id: + description: "The unique hashed ID of the credit" + type: string + example: Opnel5aKBz + user_id: + description: "The unique hashed ID of the user associated with the credit" + type: string + example: 1a2b3c4d5e + assigned_user_id: + description: "The unique hashed ID of the assigned user responsible for the credit" + type: string + example: 6f7g8h9i0j + company_id: + description: "The unique hashed ID of the company associated with the credit" + type: string + example: k1l2m3n4o5 + client_id: + description: "The unique hashed ID of the client associated with the credit" + type: string + example: p1q2r3s4t5 + status_id: + description: "The ID representing the current status of the credit" + type: string + example: 3 + invoice_id: + description: "The unique hashed ID of the linked invoice to which the credit is applied" + type: string + example: u1v2w3x4y5 + number: + description: "The unique alphanumeric credit number per company" + type: string + example: QUOTE_101 + po_number: + description: "The purchase order number referred to by the credit" + type: string + example: PO_12345 + terms: + description: "The terms associated with the credit" + type: string + example: "Net 30" + public_notes: + description: "Public notes for the credit" + type: string + example: "Thank you for your business." + private_notes: + description: "Private notes for internal use, not visible to the client" + type: string + example: "Client is requesting a discount." + footer: + description: "The footer text for the credit" + type: string + example: "Footer text goes here." + custom_value1: + description: "Custom value 1 for additional credit information" + type: string + example: "Custom data 1" + custom_value2: + description: "Custom value 2 for additional credit information" + type: string + example: "Custom data 2" + custom_value3: + description: "Custom value 3 for additional credit information" + type: string + example: "Custom data 3" + custom_value4: + description: "Custom value 4 for additional credit information" + type: string + example: "Custom data 4" + tax_name1: + description: "The name of the first tax applied to the credit" + type: string + example: "VAT" + tax_name2: + description: "The name of the second tax applied to the credit" + type: string + example: "GST" + tax_rate1: + description: "The rate of the first tax applied to the credit" + type: number + format: float + example: 10.00 + tax_rate2: + description: "The rate of the second tax applied to the credit" + type: number + format: float + example: 5.00 + tax_name3: + description: "The name of the third tax applied to the credit" + type: string + example: "PST" + tax_rate3: + description: "The rate of the third tax applied to the credit" + type: number + format: float + example: 8.00 + total_taxes: + description: "The total amount of taxes for the credit" + type: number + format: float + example: 23.00 + line_items: + type: array + description: 'An array of objects which define the line items of the credit' + items: + $ref: '#/components/schemas/InvoiceItem' + amount: + description: "The total amount of the credit" + type: number + format: float + example: 100.00 + balance: + description: "The outstanding balance of the credit" + type: number + format: float + example: 50.00 + paid_to_date: + description: "The total amount paid to date for the credit" + type: number + format: float + example: 50.00 + discount: + description: "The discount applied to the credit" + type: number + format: float + example: 10.00 + partial: + description: "The partial amount applied to the credit" + type: number + format: float + example: 20.00 + is_amount_discount: + description: "Indicates whether the discount applied is a fixed amount or a percentage" + type: boolean + example: true + is_deleted: + description: "Indicates whether the credit has been deleted" + type: boolean + example: false + uses_inclusive_taxes: + description: "Indicates whether the tax rates applied to the credit are inclusive or exclusive" + type: boolean + example: true + date: + description: "The date the credit was issued" + type: string + format: date + example: "1994-07-30" + last_sent_date: + description: "The date the credit was last sent out" + type: string + format: date + example: "1994-07-30" + next_send_date: + description: "The next scheduled date for sending a credit reminder" + type: string + format: date + example: "1994-07-30" + partial_due_date: + description: "The due date for the partial amount of the credit" + type: string + format: date + example: "1994-07-30" + due_date: + description: "The due date for the total amount of the credit" + type: string + format: date + example: "1994-07-30" + settings: + $ref: "#/components/schemas/CompanySettings" + last_viewed: + description: "The timestamp of the last time the credit was viewed" + type: number + format: integer + example: 1434342123 + updated_at: + description: "The timestamp of the last time the credit was updated" + type: number + format: integer + example: 1434342123 + archived_at: + description: "The timestamp of the last time the credit was archived" + type: number + format: integer + example: 1434342123 + custom_surcharge1: + description: "First custom surcharge amount" + type: number + format: float + example: 10.00 + custom_surcharge2: + description: 'Second Custom Surcharge' + type: number + format: float + example: '10.00' + custom_surcharge3: + description: 'Third Custom Surcharge' + type: number + format: float + example: '10.00' + custom_surcharge4: + description: 'Fourth Custom Surcharge' + type: number + format: float + example: '10.00' + custom_surcharge_tax1: + description: 'Toggles charging taxes on custom surcharge amounts' + type: boolean + example: true + custom_surcharge_tax2: + description: 'Toggles charging taxes on custom surcharge amounts' + type: boolean + example: true + custom_surcharge_tax3: + description: 'Toggles charging taxes on custom surcharge amounts' + type: boolean + example: true + custom_surcharge_tax4: + description: 'Toggles charging taxes on custom surcharge amounts' + type: boolean + example: true + type: object + + GenericBulkAction: + properties: + action: + type: string + example: archive + description: 'The action to perform ie. archive / restore / delete' + ids: + type: array + items: + format: string + type: string + example: 2J234DFA,D2J234DFA,D2J234DFA + description: string array of client hashed ids + type: object + ProductRequest: type: object properties: id: @@ -14755,142 +14997,140 @@ components: description: 'The hashed product ID.' example: eP01N readOnly: true - company_id: - type: string - description: 'The hashed ID of the company that owns this product.' - example: eP01N - readOnly: true - user_id: - type: string - description: 'The hashed ID of the user that created this product.' - example: n30m4 - readOnly: true assigned_user_id: type: string description: 'The hashed ID of the user assigned to this product.' example: pR0j3 + project_id: type: string description: 'The hashed ID of the project that this product is associated with.' example: pR0j3 + vendor_id: type: string description: 'The hashed ID of the vendor that this product is associated with.' example: pR0j3 + custom_value1: type: string description: 'Custom value field 1.' example: 'Custom value 1' + custom_value2: type: string description: 'Custom value field 2.' example: 'Custom value 2' + custom_value3: type: string description: 'Custom value field 3.' example: 'Custom value 3' + custom_value4: type: string description: 'Custom value field 4.' example: 'Custom value 4' + product_key: type: string description: 'The product key.' example: '1234' + notes: type: string description: 'Notes about the product.' example: 'These are some notes about the product.' + cost: type: number format: double - description: 'The cost of the product. (Your purchase price for this product)' + description: 'The cost of the product.' example: 10.0 + price: type: number format: double - description: 'The price of the product that you are charging.' + description: 'The price of the product.' example: 20.0 + quantity: type: number format: double - description: 'The quantity of the product. (used as a default)' + description: 'The quantity of the product.' example: 5.0 + + default: 1 tax_name1: type: string description: 'The name of tax 1.' example: 'Tax 1' + tax_rate1: type: number format: double description: 'The rate of tax 1.' example: 10.0 + tax_name2: type: string description: 'The name of tax 2.' example: 'Tax 2' + tax_rate2: type: number format: double description: 'The rate of tax 2.' example: 5.0 + tax_name3: type: string description: 'The name of tax 3.' example: 'Tax 3' + tax_rate3: type: number format: double description: 'The rate of tax 3.' example: 0.0 - archived_at: - type: integer - format: timestamp - description: 'The timestamp when the product was archived.' - example: '2022-03-18T15:00:00Z' - readOnly: true - created_at: - type: integer - format: timestamp - description: 'The timestamp when the product was created.' - example: '2022-03-18T15:00:00Z' - readOnly: true - updated_at: - description: Timestamp - type: integer - format: timestamp - example: '2022-03-18T12:34:56.789Z' - readOnly: true - is_deleted: - type: boolean - description: 'Boolean flag determining if the product has been deleted' - example: false - readOnly: true + in_stock_quantity: type: integer format: int32 - description: The quantity of the product that is currently in stock + description: | + The quantity of the product that is currently in stock. + + **note** this field is not mutable without passing an extra query parameter which will allow modification of this value. + + The query parameter ?update_in_stock_quantity=true **MUST** be passed if you wish to update this value manually. + default: 0 + stock_notification: type: boolean description: Indicates whether stock notifications are enabled for this product default: true + stock_notification_threshold: type: integer format: int32 description: The minimum quantity threshold for which stock notifications will be triggered default: 0 + max_quantity: type: integer format: int32 description: The maximum quantity that can be ordered for this product + product_image: type: string description: The URL of the product image format: uri-reference + tax_id: type: string default: '1' + description: | The tax category id for this product.' @@ -14909,6 +15149,1111 @@ components: ``` example: '1' + CompanyLedger: + properties: + entity_id: + description: 'This field will reference one of the following entity hashed ID payment_id, invoice_id or credit_id' + type: string + example: AS3df3A + notes: + description: 'The notes which reference this entry of the ledger' + type: string + example: 'Credit note for invoice #3212' + balance: + description: 'The client balance' + type: number + format: float + example: '10.00' + adjustment: + description: 'The amount the client balance is adjusted by' + type: number + format: float + example: '10.00' + updated_at: + description: Timestamp + type: number + format: integer + example: '1434342123' + created_at: + description: Timestamp + type: number + format: integer + example: '1434342123' + type: object + Invoice: + properties: + id: + description: 'The invoice hashed id' + type: string + example: Opnel5aKBz + readOnly: true + user_id: + description: 'The user hashed id' + type: string + example: Opnel5aKBz + readOnly: true + assigned_user_id: + description: 'The assigned user hashed id' + type: string + example: Opnel5aKBz + company_id: + description: 'The company hashed id' + type: string + example: Opnel5aKBz + readOnly: true + client_id: + description: 'The client hashed id' + type: string + example: Opnel5aKBz + status_id: + description: 'The invoice status variable' + type: string + example: '4' + number: + description: 'The invoice number - is a unique alpha numeric number per invoice per company' + type: string + example: INV_101 + po_number: + description: 'The purchase order associated with this invoice' + type: string + example: PO-1234 + terms: + description: 'The invoice terms' + type: string + example: 'These are invoice terms' + public_notes: + description: 'The public notes of the invoice' + type: string + example: 'These are some public notes' + private_notes: + description: 'The private notes of the invoice' + type: string + example: 'These are some private notes' + footer: + description: 'The invoice footer notes' + type: string + example: '' + custom_value1: + description: 'A custom field value' + type: string + example: '2022-10-01' + custom_value2: + description: 'A custom field value' + type: string + example: 'Something custom' + custom_value3: + description: 'A custom field value' + type: string + example: '' + custom_value4: + description: 'A custom field value' + type: string + example: '' + tax_name1: + description: 'The tax name' + type: string + example: '' + tax_name2: + description: 'The tax name' + type: string + example: '' + tax_rate1: + description: 'The tax rate' + type: number + format: float + example: '10.00' + tax_rate2: + description: 'The tax rate' + type: number + format: float + example: '10.00' + tax_name3: + description: 'The tax name' + type: string + example: '' + tax_rate3: + description: 'The tax rate' + type: number + format: float + example: '10.00' + total_taxes: + description: 'The total taxes for the invoice' + type: number + format: float + example: '10.00' + line_items: + type: array + description: 'An array of objects which define the line items of the invoice' + items: + $ref: '#/components/schemas/InvoiceItem' + invitations: + type: array + description: 'An array of objects which define the invitations of the invoice' + items: + $ref: '#/components/schemas/InvoiceInvitation' + amount: + description: 'The invoice amount' + type: number + format: float + example: '10.00' + balance: + description: 'The invoice balance' + type: number + format: float + example: '10.00' + paid_to_date: + description: 'The amount paid on the invoice to date' + type: number + format: float + example: '10.00' + discount: + description: 'The invoice discount, can be an amount or a percentage' + type: number + format: float + example: '10.00' + partial: + description: 'The deposit/partial amount' + type: number + format: float + example: '10.00' + is_amount_discount: + description: 'Flag determining if the discount is an amount or a percentage' + type: boolean + example: true + is_deleted: + description: 'Defines if the invoice has been deleted' + type: boolean + example: true + uses_inclusive_taxes: + description: 'Defines the type of taxes used as either inclusive or exclusive' + type: boolean + example: true + date: + description: 'The Invoice Date' + type: string + format: date + example: '1994-07-30' + last_sent_date: + description: 'The last date the invoice was sent out' + type: string + format: date + example: '1994-07-30' + next_send_date: + description: 'The Next date for a reminder to be sent' + type: string + format: date + example: '1994-07-30' + partial_due_date: + description: 'The due date for the deposit/partial amount' + type: string + format: date + example: '1994-07-30' + due_date: + description: 'The due date of the invoice' + type: string + format: date + example: '1994-07-30' + last_viewed: + description: Timestamp + type: number + format: integer + example: '1434342123' + updated_at: + description: Timestamp + type: number + format: integer + example: '1434342123' + archived_at: + description: Timestamp + type: number + format: integer + example: '1434342123' + custom_surcharge1: + description: 'First Custom Surcharge' + type: number + format: float + example: '10.00' + custom_surcharge2: + description: 'Second Custom Surcharge' + type: number + format: float + example: '10.00' + custom_surcharge3: + description: 'Third Custom Surcharge' + type: number + format: float + example: '10.00' + custom_surcharge4: + description: 'Fourth Custom Surcharge' + type: number + format: float + example: '10.00' + custom_surcharge_tax1: + description: 'Toggles charging taxes on custom surcharge amounts' + type: boolean + example: true + custom_surcharge_tax2: + description: 'Toggles charging taxes on custom surcharge amounts' + type: boolean + example: true + custom_surcharge_tax3: + description: 'Toggles charging taxes on custom surcharge amounts' + type: boolean + example: true + custom_surcharge_tax4: + description: 'Toggles charging taxes on custom surcharge amounts' + type: boolean + example: true + project_id: + description: 'The project associated with this invoice' + type: string + example: Opnel5aKBz + auto_bill_tries: + description: 'The number of times the invoice has attempted to be auto billed' + type: integer + example: '1' + readOnly: true + auto_bill_enabled: + description: 'Boolean flag determining if the invoice is set to auto bill' + type: boolean + example: true + subscription_id: + description: 'The subscription associated with this invoice' + type: string + example: Opnel5aKBz + + type: object + Company: + properties: + id: + description: "The unique hashed identifier for the company" + type: string + example: WJxbojagwO + size_id: + description: "The unique identifier representing the company's size category" + type: string + example: '2' + industry_id: + description: "The unique identifier representing the company's industry category" + type: string + example: '5' + slack_webhook_url: + description: "The URL for the company's Slack webhook notifications" + type: string + example: 'https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX' + google_analytics_key: + description: "The company's Google Analytics tracking ID" + type: string + example: 'UA-123456789-1' + portal_mode: + description: "The mode determining how client-facing URLs are structured (e.g., subdomain, domain, or iframe)" + type: string + example: subdomain + subdomain: + description: "The subdomain prefix for the company's domain (e.g., 'acme' in acme.domain.com)" + type: string + example: acme + portal_domain: + description: "The fully qualified domain used for client-facing URLs" + type: string + example: 'https://subdomain.invoicing.co' + enabled_tax_rates: + description: "The number of tax rates used per entity" + type: integer + example: '2' + fill_products: + description: "A flag determining whether to auto-fill product descriptions based on the product key" + type: boolean + example: true + convert_products: + description: "A flag determining whether to convert products between different types or units" + type: boolean + example: true + update_products: + description: "A flag determining whether to update product descriptions when the description changes" + type: boolean + example: true + show_product_details: + description: "A flag determining whether to display product details in the user interface" + type: boolean + example: true + show_product_cost: + description: "A flag determining whether to display product cost is shown in the user interface" + type: boolean + example: true + custom_fields: + description: "A mapping of custom fields for various objects within the company" + type: object + enable_product_cost: + description: "A flag determining whether to show or hide the product cost field in the user interface" + type: boolean + example: true + enable_product_quantity: + description: "A flag determining whether to show or hide the product quantity field in the user interface" + type: boolean + example: true + default_quantity: + description: "A flag determining whether to use a default quantity for products" + type: boolean + example: true + custom_surcharge_taxes1: + description: "A flag determining whether to apply taxes on custom surcharge amounts for the first custom surcharge field" + type: boolean + example: true + custom_surcharge_taxes2: + description: "A flag determining whether to apply taxes on custom surcharge amounts for the second custom surcharge field" + type: boolean + example: true + custom_surcharge_taxes3: + description: "A flag determining whether to apply taxes on custom surcharge amounts for the third custom surcharge field" + type: boolean + example: true + custom_surcharge_taxes4: + description: "A flag determining whether to apply taxes on custom surcharge amounts for the fourth custom" + logo: + description: "The company logo file in binary format" + type: string + format: binary + example: logo.png + company_key: + description: "The static company key hash used to identify the Company" + readOnly: true + type: string + example: "Vnb14bRlwiFjc5ckte6cfbygTRkn5IMQ" + client_can_register: + description: "A flag determining whether clients can register for the client portal" + type: boolean + example: true + enabled_modules: + type: integer + description: | + Bitmask representation of the modules that are enabled in the application + + ``` + self::ENTITY_RECURRING_INVOICE => 1, + self::ENTITY_CREDIT => 2, + self::ENTITY_QUOTE => 4, + self::ENTITY_TASK => 8, + self::ENTITY_EXPENSE => 16, + self::ENTITY_PROJECT => 32, + self::ENTITY_VENDOR => 64, + self::ENTITY_TICKET => 128, + self::ENTITY_PROPOSAL => 256, + self::ENTITY_RECURRING_EXPENSE => 512, + self::ENTITY_RECURRING_TASK => 1024, + self::ENTITY_RECURRING_QUOTE => 2048, + ``` + + The default per_page value is 20. + + example: 2048 + db: + readOnly: true + type: string + example: 'db-ninja-01' + first_day_of_week: + description: "The first day of the week for the company" + type: string + example: '1' + first_month_of_year: + description: "The first month for the company financial year" + type: string + example: '1' + enabled_item_tax_rates: + description: "The number of tax rates used per item" + type: integer + example: 2 + is_large: + description: "A flag determining whether the company is considered large" + type: boolean + example: true + default_auto_bill: + type: string + example: 'always' + description: | + A flag determining whether to auto-bill clients by default + + values: + + - always - Always auto bill + - disabled - Never auto bill + - optin - Allow the client to select their auto bill status with the default being disabled + - optout -Allow the client to select their auto bill status with the default being enabled + mark_expenses_invoiceable: + description: "A flag determining whether to mark expenses as invoiceable by default" + type: boolean + example: true + mark_expenses_paid: + description: "A flag determining whether to mark expenses as paid by default" + type: boolean + example: true + invoice_expense_documents: + description: "A flag determining whether to include expense documents on invoices by default" + type: boolean + example: true + auto_start_tasks: + description: "A flag determining whether to auto-start tasks by default" + type: boolean + example: true + invoice_task_timelog: + description: "A flag determining whether to include task time logs on invoices by default" + type: boolean + example: true + invoice_task_documents: + description: "A flag determining whether to include task documents on invoices by default" + type: boolean + example: true + show_tasks_table: + description: "A flag determining whether to show the tasks table on invoices by default" + type: boolean + example: true + is_disabled: + description: "A flag determining whether the company is disabled" + type: boolean + example: true + default_task_is_date_based: + description: "A flag determining whether to default tasks to be date-based" + type: boolean + example: true + enable_product_discount: + description: "A flag determining whether to show or hide the product discount field in the user interface" + type: boolean + example: true + calculate_expense_tax_by_amount: + description: "A flag determining whether to calculate expense taxes by amount" + type: boolean + example: true + expense_inclusive_taxes: + description: "A flag determining whether to include taxes in the expense amount" + type: boolean + example: true + session_timeout: + description: "The session timeout for the company" + type: integer + example: 60 + oauth_password_required: + description: "A flag determining whether to require a password for `dangerous` actions when using OAuth" + type: boolean + example: true + invoice_task_datelog: + description: "A flag determining whether to include task date logs on invoices by default" + type: boolean + example: true + default_password_timeout: + description: "The default password timeout for the company" + type: integer + example: 60 + show_task_end_date: + description: "A flag determining whether to show the task end date on invoices by default" + type: boolean + example: true + markdown_enabled: + description: "A flag determining whether markdown is enabled for the company" + type: boolean + example: true + report_include_drafts: + description: "A flag determining whether to include draft invoices in reports" + type: boolean + example: true + client_registration_fields: + description: "The client registration fields for the company" + type: object + stop_on_unpaid_recurring: + description: "A flag determining whether to stop recurring invoices when they are unpaid" + type: boolean + example: true + use_quote_terms_on_conversion: + description: "A flag determining whether to use quote terms on conversion to an invoice" + type: boolean + example: true + enable_applying_payments: + description: "A flag determining whether to enable applying payments to invoices" + type: boolean + example: true + track_inventory: + description: "A flag determining whether to track inventory for the company" + type: boolean + example: true + inventory_notification_threshold: + description: "The inventory notification threshold for the company" + type: integer + example: 60 + stock_notification: + description: "A flag determining whether to send stock notifications for the company" + type: boolean + example: true + matomo_url: + description: "The Matomo URL for the company" + type: string + example: 'https://matomo.example.com' + matomo_id: + description: "The Matomo ID for the company" + type: string + example: '1' + enabled_expense_tax_rates: + description: "The number of tax rates used per expense" + type: integer + example: 2 + invoice_task_project: + description: "A flag determining whether to include the project on invoices by default" + type: boolean + example: true + report_include_deleted: + description: "A flag determining whether to include deleted invoices in reports" + type: boolean + example: true + invoice_task_lock: + description: "A flag determining whether to lock tasks when invoiced" + type: boolean + example: true + convert_payment_currency: + description: "A flag determining whether to convert the payment currency" + type: boolean + example: true + convert_expense_currency: + description: "A flag determining whether to convert the expense currency" + type: boolean + example: true + notify_vendor_when_paid: + description: "A flag determining whether to notify the vendor when an expense is paid" + type: boolean + example: true + invoice_task_hours: + description: "A flag determining whether to include the task hours on invoices by default" + type: boolean + example: true + calculate_taxes: + description: "A flag determining whether to calculate taxes for the company" + type: boolean + example: true + tax_data: + description: "The tax data for the company" + type: object + e_invoice_certificate: + description: "The e-invoice certificate for the company" + type: string + example: '-----BEGIN CERTIFICATE-----' + e_invoice_certificate_passphrase: + description: "The e-invoice certificate passphrase for the company" + type: string + example: 'secret' + origin_tax_data: + description: "The origin tax data for the company" + type: object + invoice_task_project_header: + description: "A flag determining whether to include the project header on invoices by default" + type: boolean + example: true + invoice_task_item_description: + description: "A flag determining whether to include the item description on invoices by default" + type: boolean + example: true + + settings: + $ref: '#/components/schemas/CompanySettings' + type: object + InvoiceRequest: + required: + - client_id + properties: + id: + description: 'The invoice hashed id' + type: string + example: Opnel5aKBz + readOnly: true + user_id: + description: 'The user hashed id' + type: string + example: Opnel5aKBz + assigned_user_id: + description: 'The assigned user hashed id' + type: string + example: Opnel5aKBz + company_id: + description: 'The company hashed id' + type: string + example: Opnel5aKBz + readOnly: true + client_id: + description: 'The client hashed id' + type: string + example: Opnel5aKBz + status_id: + description: 'The invoice status variable' + type: string + example: '4' + readOnly: true + number: + description: 'The invoice number - is a unique alpha numeric number per invoice per company' + type: string + example: INV_101 + po_number: + description: 'The purchase order associated with this invoice' + type: string + example: PO-1234 + terms: + description: 'The invoice terms' + type: string + example: 'These are invoice terms' + public_notes: + description: 'The public notes of the invoice' + type: string + example: 'These are some public notes' + private_notes: + description: 'The private notes of the invoice' + type: string + example: 'These are some private notes' + footer: + description: 'The invoice footer notes' + type: string + example: '' + custom_value1: + description: 'A custom field value' + type: string + example: '2022-10-01' + custom_value2: + description: 'A custom field value' + type: string + example: 'Something custom' + custom_value3: + description: 'A custom field value' + type: string + example: '' + custom_value4: + description: 'A custom field value' + type: string + example: '' + tax_name1: + description: 'The tax name' + type: string + example: '' + tax_name2: + description: 'The tax name' + type: string + example: '' + tax_rate1: + description: 'The tax rate' + type: number + format: float + example: '10.00' + tax_rate2: + description: 'The tax rate' + type: number + format: float + example: '10.00' + tax_name3: + description: 'The tax name' + type: string + example: '' + tax_rate3: + description: 'The tax rate' + type: number + format: float + example: '10.00' + total_taxes: + description: 'The total taxes for the invoice' + type: number + format: float + example: '10.00' + readOnly: true + line_items: + type: array + description: 'An array of objects which define the line items of the invoice' + items: + $ref: '#/components/schemas/InvoiceItem' + invitations: + type: array + description: 'An array of objects which define the invitations of the invoice' + items: + $ref: '#/components/schemas/InvoiceInvitationRequest' + amount: + description: 'The invoice amount' + type: number + format: float + example: '10.00' + readOnly: true + balance: + description: 'The invoice balance' + type: number + format: float + example: '10.00' + readOnly: true + paid_to_date: + description: 'The amount paid on the invoice to date' + type: number + format: float + example: '10.00' + readOnly: true + discount: + description: 'The invoice discount, can be an amount or a percentage' + type: number + format: float + example: '10.00' + partial: + description: 'The deposit/partial amount' + type: number + format: float + example: '10.00' + is_amount_discount: + description: 'Flag determining if the discount is an amount or a percentage' + type: boolean + example: true + is_deleted: + description: 'Defines if the invoice has been deleted' + type: boolean + example: true + readOnly: true + uses_inclusive_taxes: + description: 'Defines the type of taxes used as either inclusive or exclusive' + type: boolean + example: true + date: + description: 'The Invoice Date' + type: string + format: date + example: '1994-07-30' + last_sent_date: + description: 'The last date the invoice was sent out' + type: string + format: date + example: '1994-07-30' + readOnly: true + next_send_date: + description: 'The Next date for a reminder to be sent' + type: string + format: date + example: '1994-07-30' + readOnly: true + partial_due_date: + description: 'The due date for the deposit/partial amount' + type: string + format: date + example: '1994-07-30' + due_date: + description: 'The due date of the invoice' + type: string + format: date + example: '1994-07-30' + last_viewed: + description: Timestamp + type: number + format: integer + example: '1434342123' + readOnly: true + updated_at: + description: Timestamp + type: number + format: integer + example: '1434342123' + readOnly: true + archived_at: + description: Timestamp + type: number + format: integer + example: '1434342123' + readOnly: true + custom_surcharge1: + description: 'First Custom Surcharge' + type: number + format: float + example: '10.00' + custom_surcharge2: + description: 'Second Custom Surcharge' + type: number + format: float + example: '10.00' + custom_surcharge3: + description: 'Third Custom Surcharge' + type: number + format: float + example: '10.00' + custom_surcharge4: + description: 'Fourth Custom Surcharge' + type: number + format: float + example: '10.00' + custom_surcharge_tax1: + description: 'Toggles charging taxes on custom surcharge amounts' + type: boolean + example: true + custom_surcharge_tax2: + description: 'Toggles charging taxes on custom surcharge amounts' + type: boolean + example: true + custom_surcharge_tax3: + description: 'Toggles charging taxes on custom surcharge amounts' + type: boolean + example: true + custom_surcharge_tax4: + description: 'Toggles charging taxes on custom surcharge amounts' + type: boolean + example: true + project_id: + description: 'The project associated with this invoice' + type: string + example: Opnel5aKBz + type: object + SystemLog: + properties: + id: + description: 'The account hashed id' + type: string + example: AS3df3A + company_id: + description: 'The company hashed id' + type: string + example: AS3df3A + user_id: + description: 'The user_id hashed id' + type: string + example: AS3df3A + client_id: + description: 'The client_id hashed id' + type: string + example: AS3df3A + event_id: + description: 'The Log Type ID' + type: integer + example: 1 + category_id: + description: 'The Category Type ID' + type: integer + example: 1 + type_id: + description: 'The Type Type ID' + type: integer + example: 1 + log: + description: 'The json object of the error' + type: object + example: '{''key'':''value''}' + updated_at: + description: Timestamp + type: string + example: '2' + created_at: + description: Timestamp + type: string + example: '2' + type: object + Expense: + properties: + id: + description: 'The expense hashed id' + type: string + example: 'Opnel5aKBz' + user_id: + description: 'The user hashed id' + type: string + example: 'Opnel5aKBz' + assigned_user_id: + description: 'The assigned user hashed id' + type: string + example: 'Opnel5aKBz' + project_id: + description: 'The associated project_id' + type: string + example: 'Opnel5aKBz' + company_id: + description: 'The company hashed id' + type: string + example: 'Opnel5aKBz' + client_id: + description: 'The client hashed id' + type: string + example: 'Opnel5aKBz' + invoice_id: + description: 'The related invoice hashed id' + type: string + example: 'Opnel5aKBz' + bank_id: + description: 'The bank id related to this expense' + type: string + example: '' + invoice_currency_id: + description: 'The currency id of the related invoice' + type: string + example: '1' + currency_id: + description: 'The currency id of the expense' + type: string + example: '2' + invoice_category_id: + description: 'The invoice category id' + type: string + example: 'Opnel5aKBz' + payment_type_id: + description: 'The payment type id' + type: string + example: '' + recurring_expense_id: + description: 'The related recurring expense this expense was created from' + type: string + example: 'Opnel5aKBz' + private_notes: + description: 'The private notes of the expense' + type: string + example: '' + public_notes: + description: 'The public notes of the expense' + type: string + example: '' + transaction_reference: + description: 'The transaction references of the expense' + type: string + example: '' + transcation_id: + description: 'The transaction id of the expense' + type: string + example: '' + custom_value1: + description: 'A custom value' + type: string + example: '' + custom_value2: + description: 'A custom value' + type: string + example: '' + custom_value3: + description: 'A custom value' + type: string + example: '' + custom_value4: + description: 'A custom value' + type: string + example: '' + tax_amount: + description: 'The tax amount' + type: number + example: 10.00 + tax_name1: + description: 'Tax Name 1' + type: string + example: 'GST' + tax_name2: + description: 'Tax Name 2' + type: string + example: 'VAT' + tax_name3: + description: 'Tax Name 3' + type: string + example: 'IVA' + tax_rate1: + description: 'Tax rate 1' + type: number + format: float + example: '10.00' + tax_rate2: + description: 'Tax rate 2' + type: number + format: float + example: '10.00' + tax_rate3: + description: 'Tax rate 3' + type: number + format: float + example: '10.00' + amount: + description: 'The total expense amont' + type: number + format: float + example: '10.00' + foreign_amount: + description: 'The total foreign amount of the expense' + type: number + format: float + example: '10.00' + exchange_rate: + description: 'The exchange rate at the time of the expense' + type: number + format: float + example: '0.80' + date: + description: 'The expense date format Y-m-d' + type: string + example: '2022-12-01' + payment_date: + description: 'The date of payment for the expense, format Y-m-d' + type: string + example: '2022-12-01' + should_be_invoiced: + description: 'Flag whether the expense should be invoiced' + type: boolean + example: true + is_deleted: + description: 'Boolean determining whether the expense has been deleted' + type: boolean + example: true + invoice_documents: + description: 'Passing the expense documents over to the invoice' + type: boolean + example: true + updated_at: + description: Timestamp + type: number + format: integer + example: '1434342123' + archived_at: + description: Timestamp + type: number + format: integer + example: '1434342123' + type: object + BankTransaction: + properties: + id: + description: 'The bank integration hashed id' + type: string + example: AS3df3A + company_id: + description: 'The company hashed id' + type: string + example: AS3df3A + user_id: + description: 'The user hashed id' + type: string + example: AS3df3A + transaction_id: + description: 'The id of the transaction rule' + type: integer + example: 343434 + amount: + description: 'The transaction amount' + type: number + example: 10 + currency_id: + description: 'The currency ID of the currency' + type: string + example: '1' + account_type: + description: 'The account type' + type: string + example: creditCard + description: + description: 'The description of the transaction' + type: string + example: 'Potato purchases for kevin' + category_id: + description: 'The category id' + type: integer + example: 1 + category_type: + description: 'The category description' + type: string + example: Expenses + base_type: + description: 'Either CREDIT or DEBIT' + type: string + example: CREDIT + date: + description: 'The date of the transaction' + type: string + example: '2022-09-01' + bank_account_id: + description: 'The ID number of the bank account' + type: integer + example: '1' + type: object ExpenseCategory: properties: id: @@ -14936,345 +16281,10 @@ components: type: integer example: '2' type: object - ProductRequest: - type: object + BankIntegration: properties: id: - type: string - description: 'The hashed product ID.' - example: eP01N - readOnly: true - assigned_user_id: - type: string - description: 'The hashed ID of the user assigned to this product.' - example: pR0j3 - required: false - project_id: - type: string - description: 'The hashed ID of the project that this product is associated with.' - example: pR0j3 - required: false - vendor_id: - type: string - description: 'The hashed ID of the vendor that this product is associated with.' - example: pR0j3 - required: false - custom_value1: - type: string - description: 'Custom value field 1.' - example: 'Custom value 1' - required: false - custom_value2: - type: string - description: 'Custom value field 2.' - example: 'Custom value 2' - required: false - custom_value3: - type: string - description: 'Custom value field 3.' - example: 'Custom value 3' - required: false - custom_value4: - type: string - description: 'Custom value field 4.' - example: 'Custom value 4' - required: false - product_key: - type: string - description: 'The product key.' - example: '1234' - required: false - notes: - type: string - description: 'Notes about the product.' - example: 'These are some notes about the product.' - required: false - cost: - type: number - format: double - description: 'The cost of the product.' - example: 10.0 - required: false - price: - type: number - format: double - description: 'The price of the product.' - example: 20.0 - required: false - quantity: - type: number - format: double - description: 'The quantity of the product.' - example: 5.0 - required: false - default: 1 - tax_name1: - type: string - description: 'The name of tax 1.' - example: 'Tax 1' - required: false - tax_rate1: - type: number - format: double - description: 'The rate of tax 1.' - example: 10.0 - required: false - tax_name2: - type: string - description: 'The name of tax 2.' - example: 'Tax 2' - required: false - tax_rate2: - type: number - format: double - description: 'The rate of tax 2.' - example: 5.0 - required: false - tax_name3: - type: string - description: 'The name of tax 3.' - example: 'Tax 3' - required: false - tax_rate3: - type: number - format: double - description: 'The rate of tax 3.' - example: 0.0 - required: false - in_stock_quantity: - type: integer - format: int32 - description: | - The quantity of the product that is currently in stock. - - **note** this field is not mutable without passing an extra query parameter which will allow modification of this value. - - The query parameter ?update_in_stock_quantity=true **MUST** be passed if you wish to update this value manually. - - default: 0 - required: false - stock_notification: - type: boolean - description: Indicates whether stock notifications are enabled for this product - default: true - required: false - stock_notification_threshold: - type: integer - format: int32 - description: The minimum quantity threshold for which stock notifications will be triggered - default: 0 - required: false - max_quantity: - type: integer - format: int32 - description: The maximum quantity that can be ordered for this product - required: false - product_image: - type: string - description: The URL of the product image - format: uri-reference - required: false - tax_id: - type: string - default: '1' - required: false - description: | - The tax category id for this product.' - - The following constants are available (default = '1') - - ``` - PRODUCT_TYPE_PHYSICAL = '1' - PRODUCT_TYPE_SERVICE = '2' - PRODUCT_TYPE_DIGITAL = '3' - PRODUCT_TYPE_SHIPPING = '4' - PRODUCT_TYPE_EXEMPT = '5' - PRODUCT_TYPE_REDUCED_TAX = '6' - PRODUCT_TYPE_OVERRIDE_TAX = '7' - PRODUCT_TYPE_ZERO_RATED = '8' - PRODUCT_TYPE_REVERSE_TAX = '9' - ``` - example: '1' - - CompanyToken: - properties: - name: - description: 'The token name' - type: string - example: 'Token Name' - token: - description: 'The token value' - type: string - example: AS3df3jUUH765fhfd9KJuidj3JShjA - is_system: - description: 'Determines whether the token is created by the system rather than a user' - type: boolean - example: 'true' - type: object - Document: - properties: - id: - description: 'The document hashed id' - type: string - example: AS3df3A - user_id: - description: 'The user hashed id' - type: string - example: '' - assigned_user_id: - description: 'The assigned user hashed id' - type: string - example: '' - project_id: - description: 'The project associated with this document' - type: string - example: '' - vendor_id: - description: 'The vendor associated with this documents' - type: string - example: '' - name: - description: 'The document name' - type: string - example: Beauty - url: - description: 'The document url' - type: string - example: Beauty - preview: - description: 'The document preview url' - type: string - example: Beauty - type: - description: 'The document type' - type: string - example: Beauty - disk: - description: 'The document disk' - type: string - example: Beauty - hash: - description: 'The document hashed' - type: string - example: Beauty - is_deleted: - description: 'Flag to determine if the document is deleted' - type: boolean - example: true - is_default: - description: 'Flag to determine if the document is a default doc' - type: boolean - example: true - created_at: - description: Timestamp - type: number - format: integer - example: '134341234234' - updated_at: - description: Timestamp - type: number - format: integer - example: '134341234234' - deleted_at: - description: Timestamp - type: number - format: integer - example: '134341234234' - type: object - Payment: - properties: - id: - description: 'The payment hashed id' - type: string - example: Opnel5aKBz - client_id: - description: 'The client hashed id' - type: string - example: Opnel5aKBz - invitation_id: - description: 'The invitation hashed id' - type: string - example: Opnel5aKBz - client_contact_id: - description: 'The client contact hashed id' - type: string - example: Opnel5aKBz - user_id: - description: 'The user hashed id' - type: string - example: Opnel5aKBz - type_id: - description: 'The Payment Type ID' - type: string - example: '1' - date: - description: 'The Payment date' - type: string - example: 1-1-2014 - transaction_reference: - description: 'The transaction reference as defined by the payment gateway' - type: string - example: xcsSxcs124asd - assigned_user_id: - description: 'The assigned user hashed id' - type: string - example: Opnel5aKBz - private_notes: - description: 'The private notes of the payment' - type: string - example: 'The payment was refunded due to error' - is_manual: - description: 'Flags whether the payment was made manually or processed via a gateway' - type: boolean - example: true - is_deleted: - description: 'Defines if the payment has been deleted' - type: boolean - example: true - amount: - description: 'The amount of this payment' - type: number - example: 10 - refunded: - description: 'The refunded amount of this payment' - type: number - example: 10 - updated_at: - description: Timestamp - type: number - format: integer - example: '1434342123' - archived_at: - description: Timestamp - type: number - format: integer - example: '1434342123' - company_gateway_id: - description: 'The company gateway id' - type: string - example: '3' - paymentables: - $ref: '#/components/schemas/Paymentable' - invoices: - description: '' - type: array - items: - $ref: '#/components/schemas/InvoicePaymentable' - credits: - description: '' - type: array - items: - $ref: '#/components/schemas/CreditPaymentable' - number: - description: 'The payment number - is a unique alpha numeric number per payment per company' - type: string - example: PAY_101 - type: object - - BankTransactionRule: - properties: - id: - description: 'The bank transaction rules hashed id' + description: 'The bank integration hashed id' type: string example: AS3df3A company_id: @@ -15285,39 +16295,273 @@ components: description: 'The user hashed id' type: string example: AS3df3A - name: - description: 'The name of the transaction' + provider_bank_name: + description: 'The providers bank name' type: string - example: 'Rule 1' - rules: - description: 'A mapped collection of the sub rules for the BankTransactionRule' - type: array - items: - $ref: '#/components/schemas/BTRules' - auto_convert: - description: 'Flags whether the rule converts the transaction automatically' - type: boolean - example: true - matches_on_all: - description: 'Flags whether all subrules are required for the match' - type: boolean - example: true - applies_to: - description: 'Flags whether the rule applies to a CREDIT or DEBIT' + example: 'Chase Bank' + bank_account_id: + description: 'The bank account id' + type: integer + example: '1233434' + bank_account_name: + description: 'The name of the account' type: string - example: CREDIT + example: 'My Checking Acc' + bank_account_number: + description: 'The account number' + type: string + example: '111 234 2332' + bank_account_status: + description: 'The status of the bank account' + type: string + example: ACTIVE + bank_account_type: + description: 'The type of account' + type: string + example: CREDITCARD + balance: + description: 'The current bank balance if available' + type: number + example: '1000000' + currency: + description: 'iso_3166_3 code' + type: string + example: USD + type: object + Subscription: + properties: + id: + description: Unique identifier for the subscription + type: string + example: Opnel5aKBz + user_id: + description: Unique identifier for the user associated with the subscription + type: string + example: Ua6Rw4pVbS + product_id: + description: Unique identifier for the product associated with the subscription + type: string + example: Pr5Ft7yBmC + company_id: + description: Unique identifier for the company associated with the subscription + type: string + example: Co7Vn3yLmW + recurring_invoice_id: + description: Unique identifier for the recurring invoice associated with the subscription + type: string + example: Ri2Yt8zJkP + is_recurring: + description: Indicates whether the subscription is recurring + type: boolean + example: 'true' + frequency_id: + description: 'integer const representation of the frequency' + type: string + example: '1' + auto_bill: + description: 'enum setting' + type: string + example: always + promo_code: + description: Promotional code applied to the subscription + type: string + example: PROMOCODE4U + promo_discount: + description: Discount percentage or amount applied to the subscription + type: number + example: 10 + is_amount_discount: + description: Indicates whether the discount is a fixed amount + type: boolean + example: 'true' + allow_cancellation: + description: Indicates whether the subscription can be cancelled + type: boolean + example: 'true' + per_seat_enabled: + description: Indicates whether the subscription pricing is per seat + type: boolean + example: 'true' + currency_id: + description: Unique identifier for the currency used in the subscription + type: integer + example: '1' + max_seats_limit: + description: Maximum number of seats allowed for the subscription + type: integer + example: '100' + trial_enabled: + description: Indicates whether the subscription has a trial period + type: boolean + example: 'true' + trial_duration: + description: Duration of the trial period in days + type: integer + example: '14' + allow_query_overrides: + description: Indicates whether query overrides are allowed for the subscription + type: boolean + example: 'true' + allow_plan_changes: + description: Indicates whether plan changes are allowed for the subscription + type: boolean + example: 'true' + refund_period: + description: Number of days within which refunds can be requested + type: integer + example: '30' + webhook_configuration: + description: Webhook configuration for the subscription + type: string + example: 'expand reference for this' + is_deleted: + description: Indicates whether the subscription has been deleted + type: boolean + example: 'false' + archived_at: + description: Timestamp + type: number + format: integer + example: '1434342123' + created_at: + description: Timestamp + type: number + format: integer + example: '134341234234' + updated_at: + description: Timestamp + type: number + format: integer + example: '134341234234' + type: object + BulkAction: + type: array + items: + type: integer + example: '[0,1,2,3,]' + FillableInvoice: + properties: + assigned_user_id: + description: "The assigned user's hashed ID" + type: string + example: 'a1b2c3d4' client_id: - description: 'The client hashed id' + description: "The client's hashed ID" type: string - example: AS3df3A - vendor_id: - description: 'The vendor hashed id' + example: 'x1y2z3a4' + number: + description: "The unique alphanumeric invoice number for each invoice per company" type: string - example: AS3df3A - category_id: - description: 'The category hashed id' + example: INV_101 + po_number: + description: "The purchase order number associated with the invoice" type: string - example: AS3df3A + example: 'PO12345' + terms: + description: "The terms and conditions for the invoice" + type: string + example: 'Net 30' + public_notes: + description: "Public notes visible to the client on the invoice" + type: string + example: 'Thank you for your business.' + private_notes: + description: "Private notes for internal use only" + type: string + example: 'Client is a slow payer.' + footer: + description: "The footer text displayed on the invoice" + type: string + example: 'Authorized Signature' + custom_value1: + description: "First custom value for additional information" + type: string + example: 'Project ABC' + custom_value2: + description: "Second custom value for additional information" + type: string + example: 'Department XYZ' + custom_value3: + description: "Third custom value for additional information" + type: string + example: 'Location 123' + custom_value4: + description: "Fourth custom value for additional information" + type: string + example: 'Currency USD' + tax_name1: + description: "Name of the first tax applied to the invoice" + type: string + example: 'VAT' + tax_name2: + description: "Name of the second tax applied to the invoice" + type: string + example: 'GST' + tax_rate1: + description: "Rate of the first tax applied to the invoice" + type: number + example: 10.00 + tax_rate2: + description: "Rate of the second tax applied to the invoice" + type: number + example: 5.00 + tax_name3: + description: "Name of the third tax applied to the invoice" + type: string + example: 'PST' + tax_rate3: + description: "Rate of the third tax applied to the invoice" + type: number + example: 8.00 + line_items: + type: array + description: 'An array of objects which define the line items of the invoice' + items: + $ref: '#/components/schemas/InvoiceItem' + discount: + description: "The discount applied to the invoice" + type: number + example: 10.00 + partial: + description: "The partial amount applied to the invoice" + type: number + example: 20.00 + is_amount_discount: + description: "Indicates whether the discount applied is a fixed amount or a percentage" + type: boolean + example: true + uses_inclusive_taxes: + description: "Indicates whether the tax rates applied to the invoice are inclusive or exclusive" + type: boolean + example: true + date: + description: "The date the invoice was issued" + type: string + example: '1994-07-30' + partial_due_date: + description: "The due date for the partial payment" + type: string + example: '1994-08-15' + due_date: + description: "The due date for the invoice" + type: string + example: '1994-08-30' + custom_surcharge1: + description: "First custom surcharge applied to the invoice" + type: number + example: 10.00 + custom_surcharge2: + description: "Second custom surcharge applied to the invoice" + type: number + example: 15.00 + custom_surcharge3: + description: "Third custom surcharge applied to the invoice" + type: number + example: 5.00 + custom_surcharge4: + description: "Fourth custom surcharge applied to the invoice" + type: number + example: 20.00 type: object RecurringQuote: properties: @@ -15545,6 +16789,1837 @@ components: type: boolean example: true type: object + Paymentable: + properties: + id: + description: 'The paymentable hashed id' + type: string + example: AS3df3A + invoice_id: + description: 'The invoice hashed id' + type: string + example: AS3df3A + credit_id: + description: 'The credit hashed id' + type: string + example: AS3df3A + refunded: + description: 'The amount that has been refunded for this payment' + type: number + format: float + example: '10.00' + amount: + description: 'The amount that has been applied to the payment' + type: number + format: float + example: '10.00' + updated_at: + description: Timestamp + type: number + format: integer + example: '1434342123' + created_at: + description: Timestamp + type: number + format: integer + example: '1434342123' + type: object + Meta: + properties: + pagination: + $ref: '#/components/schemas/Pagination' + Pagination: + type: object + properties: + total: + type: integer + description: 'The total number of items' + example: 1 + readOnly: true + count: + type: integer + description: 'The number of items per page' + example: 1 + readOnly: true + per_page: + type: integer + description: 'The number of items per page' + example: 1 + readOnly: true + current_page: + type: integer + description: 'The current page number' + example: 1 + readOnly: true + total_pages: + type: integer + description: 'The total number of pages' + example: 1 + readOnly: true + links: + type: object + description: 'The pagination links' + readOnly: true + Project: + type: object + properties: + id: + description: 'The project hashed id' + type: string + example: Opnel5aKBz + user_id: + description: 'The user hashed id' + type: string + example: Opnel5aKBz + assigned_user_id: + description: The assigned user identifier associated with the project + type: string + example: Opnel5aKBz + client_id: + type: string + example: Opnel5aKBz + description: The client identifier associated with the project + name: + type: string + description: The name of the project + example: 'New Project' + task_rate: + type: number + format: float + example: 10 + description: The default rate per task for the project + due_date: + type: string + format: date + example: '2019-01-01' + description: The due date for the project + private_notes: + type: string + description: Private notes associated with the project + budgeted_hours: + type: number + format: float + description: The number of budgeted hours for the project + custom_value1: + type: string + description: Custom value field 1 + custom_value2: + type: string + description: Custom value field 2 + custom_value3: + type: string + description: Custom value field 3 + custom_value4: + type: string + description: Custom value field 4 + created_at: + type: number + format: integer + example: 134341234234 + description: The timestamp of the project creation + updated_at: + type: number + format: integer + example: 134341234234 + description: The timestamp of the last project update + archived_at: + type: number + format: integer + example: 134341234234 + description: The timestamp of the project deletion + public_notes: + type: string + description: Public notes associated with the project + is_deleted: + type: boolean + description: A flag indicating if the project is deleted + number: + type: string + description: The project number + color: + type: string + description: The color associated with the project + required: + - id + - user_id + - company_id + - name + - task_rate + - budgeted_hours + - is_deleted + - color + + Client: + properties: + id: + description: 'The unique identifier of the client' + type: string + example: Opnel5aKBz + readOnly: true + contacts: + type: array + items: + $ref: '#/components/schemas/ClientContact' + user_id: + description: 'The unique identifier of the user who created the client' + type: string + example: Ua6Rw4pVbS + readOnly: true + assigned_user_id: + description: 'The unique identifier of the user who has been assigned the client' + type: string + example: Ua6Rw4pVbS + company_id: + description: 'The unique identifier of the company the client belongs to' + type: string + example: Co7Vn3yLmW + readOnly: true + name: + description: 'The name of the client company or organization' + type: string + example: "Jim's Housekeeping" + website: + description: 'The website URL of the client company or organization' + type: string + example: 'https://www.jims-housekeeping.com' + private_notes: + description: 'Notes that are only visible to the user who created the client' + type: string + example: 'Client prefers email communication over phone calls' + client_hash: + description: 'A unique hash value for the client' + type: string + example: asdfkjhk342hjhbfdvmnfb1 + readOnly: true + industry_id: + description: 'The unique identifier of the industry the client operates in' + type: number + example: '5' + size_id: + description: 'The unique identifier for the size category of the client company or organization' + type: number + example: '2' + address1: + description: "First line of the client's address" + type: string + example: '123 Main St' + address2: + description: "Second line of the client's address, if needed" + type: string + example: 'Apt 4B' + city: + description: 'The city the client is located in' + type: string + example: 'Beverly Hills' + state: + description: 'The state, province, or locality the client is located in' + type: string + example: 'California' + postal_code: + description: 'The postal code or ZIP code of the client' + type: string + example: '90210' + phone: + description: "The client's phone number" + type: string + example: '555-3434-3434' + country_id: + description: "The unique identifier of the client's country" + type: number + format: integer + example: '1' + custom_value1: + description: 'A custom field for storing additional information' + type: string + example: 'Preferred contact: Email' + custom_value2: + description: 'A custom field for storing additional information' + type: string + example: 'Account manager: John Doe' + custom_value3: + description: 'A custom field for storing additional information' + type: string + example: 'VIP client: Yes' + custom_value4: + description: 'A custom field for storing additional information' + type: string + example: 'Annual contract value: $50,000' + vat_number: + description: "The client's VAT (Value Added Tax) number, if applicable" + type: string + example: 'VAT123456' + id_number: + description: 'A unique identification number for the client, such as a tax ID or business registration number' + type: string + number: + description: 'A system-assigned unique number for the client, typically used for invoicing purposes' + type: string + example: 'CL-0001' + shipping_address1: + description: "First line of the client's shipping address" + type: string + example: '5 Wallaby Way' + shipping_address2: + description: "Second line of the client's shipping address, if needed" + type: string + example: 'Suite 5' + shipping_city: + description: "The city of the client's shipping address" + type: string + example: 'Perth' + shipping_state: + description: "The state, province, or locality of the client's shipping address" + type: string + example: 'Western Australia' + shipping_postal_code: + description: "The postal code or ZIP code of the client's shipping address" + type: string + example: '6110' + shipping_country_id: + description: "The unique identifier of the country for the client's shipping address" + type: number + format: integer + example: '4' + is_deleted: + description: 'A boolean value indicating whether the client has been deleted or not' + type: boolean + example: false + readOnly: true + balance: + description: 'The outstanding balance the client owes' + type: number + format: float + example: '500.00' + readOnly: true + paid_to_date: + description: 'The total amount the client has paid to date' + type: number + format: float + example: '2000.00' + readOnly: true + credit_balance: + description: 'The available credit balance for the client to use on future purchases' + type: number + format: float + example: '100.00' + readOnly: true + last_login: + description: "The timestamp of the client's last login" + type: number + format: integer + example: '1628686031' + readOnly: true + created_at: + description: 'The timestamp when the client was created' + type: number + format: integer + example: '1617629031' + readOnly: true + updated_at: + description: 'The timestamp when the client was last updated' + type: number + format: integer + example: '1628445631' + readOnly: true + group_settings_id: + description: 'The group settings assigned to the client' + type: string + example: Opnel5aKBz + routing_id: + description: 'The routing address id for e-invoicing for this client' + type: string + example: Opnel5aKBz3489-dfkiu-2239-sdsd + is_tax_exempt: + description: 'Flag which defines if the client is exempt from taxes' + type: boolean + example: false + has_valid_vat_number: + description: 'Flag which defines if the client has a valid VAT number' + type: boolean + example: false + readOnly: true + payment_balance: + description: 'Defines the payment balance the client has on file (pre payments / over payments / unapplied amounts)' + type: number + example: 100 + readOnly: true + settings: + $ref: '#/components/schemas/ClientSettings' + type: object + Vendor: + properties: + id: + description: 'The hashed id of the vendor. This is a unique identifier for the vendor.' + type: string + example: Opnel5aKBz + readOnly: true + user_id: + description: 'The hashed id of the user who created the vendor. This is a unique identifier for the user.' + type: string + example: Opnel5aKBz + assigned_user_id: + description: 'The hashed id of the assigned user to this vendor. This is a unique identifier for the user.' + type: string + example: Opnel5aKBz + company_id: + description: 'The hashed id of the company. This is a unique identifier for the company.' + type: string + example: Opnel5aKBz + contacts: + type: array + items: + $ref: '#/components/schemas/VendorContact' + description: 'An array of contacts associated with the vendor.' + name: + description: 'The name of the vendor.' + type: string + example: 'Harry cafe de wheels' + classification: + description: 'The classification of the vendor.' + type: string + example: 'individual' + website: + description: 'The website of the vendor.' + type: string + example: www.harry.com + private_notes: + description: 'The private notes of the vendor. These notes are only visible to users with appropriate permissions.' + type: string + example: 'Shhh, do not tell the vendor' + industry_id: + description: 'The industry id of the vendor. This is a unique identifier for the industry.' + type: string + example: '1' + size_id: + description: 'The size id of the vendor. This is a unique identifier for the size of the vendor.' + type: string + example: '' + address1: + description: 'The first line of the vendor''s address.' + type: string + example: '' + address2: + description: 'The second line of the vendor''s address.' + type: string + example: '' + city: + description: 'The city of the vendor''s address.' + type: string + example: '' + state: + description: 'The state of the vendor''s address.' + type: string + example: '' + postal_code: + description: 'The postal code of the vendor''s address.' + type: string + example: '' + phone: + description: 'The phone number of the vendor.' + type: string + example: 555-3434-3434 + country_id: + description: 'The country id of the vendor. This is a unique identifier for the country.' + type: string + example: '' + currency_id: + description: 'The currency id of the vendor. This is a unique identifier for the currency.' + type: string + example: '4' + custom_value1: + description: 'The value of the first custom field for the vendor.' + type: string + example: '' + custom_value2: + description: 'The value of the second custom field for the vendor.' + type: string + example: '' + custom_value3: + description: 'The value of the third custom field for the vendor.' + type: string + example: '' + custom_value4: + description: 'The value of the fourth custom field for the vendor.' + type: string + example: '' + vat_number: + description: 'The VAT number of the vendor.' + type: string + example: '' + id_number: + description: 'The ID number of the vendor.' + type: string + example: '' + number: + description: 'The number of the vendor' + type: string + example: '11234' + is_deleted: + description: 'Boolean flag determining if the vendor has been deleted' + type: boolean + example: true + language_id: + description: 'The language id of the vendor. This is a unique identifier for the language.' + type: string + example: '1' + vendor_hash: + description: 'The vendor hash of the vendor. This is a unique identifier for the vendor.' + type: string + example: 'aaa-sss-www' + readOnly: true + transaction_name: + description: 'The transaction name of the vendor.' + type: string + example: 'aaa-sss-www' + last_login: + description: Timestamp + type: number + format: integer + example: '134341234234' + readOnly: true + created_at: + description: Timestamp + type: number + format: integer + example: '134341234234' + readOnly: true + updated_at: + description: Timestamp + type: number + format: integer + example: '134341234234' + readOnly: true + display_name: + description: 'The display name of the vendor.' + type: string + example: 'Bob the vendor' + readOnly: true + type: object + VendorContact: + properties: + id: + description: 'The hashed id of the vendor contact' + type: string + example: Opnel5aKBz + readOnly: true + user_id: + description: 'The hashed id of the user id' + type: string + example: Opnel5aKBz + readOnly: true + company_id: + description: 'The hashed id of the company' + type: string + example: Opnel5aKBz + readOnly: true + vendor_id: + description: 'The hashed id of the vendor' + type: string + example: Opnel5aKBz + readOnly: true + first_name: + description: 'The first name of the contact' + type: string + example: Harry + last_name: + description: 'The last name of the contact' + type: string + example: Windsor + contact_key: + description: 'A unique identifier for the contact' + type: string + example: JD0X52bkfZlJRiroCJ0tcSiAjsJTntZ5uqKdiZ0a + readOnly: true + confirmation_code: + description: 'The confirmation code used to authenticate the contacts email address' + type: string + example: 333-sdjkh34gbasd + readOnly: true + phone: + description: 'The contacts phone number' + type: string + example: 555-123-1234 + custom_value1: + description: 'A custom value' + type: string + example: '2022-10-10' + custom_value2: + description: 'A custom value' + type: string + example: $1000 + custom_value3: + description: 'A custom value' + type: string + example: '' + custom_value4: + description: 'A custom value' + type: string + example: '' + email: + description: 'The contact email address' + type: string + example: harry@windsor.com + email_verified_at: + description: 'The date which the contact confirmed their email' + type: number + format: integer + example: '134341234234' + readOnly: true + password: + description: 'The hashed password of the contact' + type: string + example: '*****' + is_primary: + description: 'Boolean flag determining if the contact is the primary contact for the vendor' + type: boolean + example: true + created_at: + description: Timestamp + type: number + format: integer + example: '134341234234' + readOnly: true + updated_at: + description: Timestamp + type: number + format: integer + example: '134341234234' + readOnly: true + deleted_at: + description: Timestamp + type: number + format: integer + example: '134341234234' + readOnly: true + type: object + Quote: + properties: + id: + description: 'The unique hashed identifier for the quote' + type: string + example: Opnel5aKBz + user_id: + description: 'The unique hashed identifier for the user who created the quote' + type: string + example: '' + assigned_user_id: + description: 'The unique hashed identifier for the user assigned to the quote' + type: string + example: '' + company_id: + description: 'The unique hashed identifier for the company associated with the quote' + type: string + example: '' + client_id: + description: 'The unique hashed identifier for the client associated with the quote' + type: string + example: '' + status_id: + description: 'The status of the quote represented by a unique identifier' + type: string + example: '' + number: + description: 'The unique alpha-numeric quote number for the quote per company' + type: string + example: QUOTE_101 + po_number: + description: 'The purchase order number associated with the quote' + type: string + example: PO-1234 + terms: + description: 'The terms and conditions for the quote' + type: string + example: 'These are some quote terms. Valid for 14 days.' + public_notes: + description: 'Publicly visible notes associated with the quote' + type: string + example: 'These are public notes which the client may see' + private_notes: + description: 'Privately visible notes associated with the quote, not disclosed to the client' + type: string + example: 'These are private notes, not to be disclosed to the client' + footer: + description: 'The footer text of the quote' + type: string + example: 'The text goes in the footer of the quote' + custom_value1: + description: 'First custom value field for additional information' + type: string + example: 'A custom value' + custom_value2: + description: 'Second custom value field for additional information' + type: string + example: 'A custom value' + custom_value3: + description: 'Third custom value field for additional information' + type: string + example: 'A custom value' + custom_value4: + description: 'Fourth custom value field for additional information' + type: string + example: 'A custom value' + tax_name1: + description: 'The name of the first tax applied to the quote' + type: string + example: GST + tax_name2: + description: 'The name of the second tax applied to the quote' + type: string + example: VAT + tax_rate1: + description: 'The rate of the first tax applied to the quote' + type: number + format: float + example: 10.00 + tax_rate2: + description: 'The rate of the second tax applied to the quote' + type: number + format: float + example: 10.00 + tax_name3: + description: 'The name of the third tax applied to the quote' + type: string + example: '' + tax_rate3: + description: 'The rate of the third tax applied to the quote' + type: number + format: float + example: 10.00 + total_taxes: + description: 'The total amount of taxes for the quote' + type: number + format: float + example: 10.00 + line_items: + type: array + description: 'An array of objects which define the line items of the quote' + items: + $ref: '#/components/schemas/InvoiceItem' + amount: + description: 'The total amount of the quote before taxes and discounts' + type: number + format: float + example: 10.00 + balance: + description: 'The balance due for the quote after accounting for payments' + type: number + format: float + example: 10.00 + paid_to_date: + description: 'The total amount paid on the quote so far' + type: number + format: float + example: 10.00 + discount: + description: 'The discount amount or percentage applied to the quote' + type: number + format: float + example: 10.00 + partial: + description: 'The partial or deposit amount for the quote' + type: number + format: float + example: 10.00 + is_amount_discount: + description: 'Boolean flag indicating if the discount is a fixed amount or a percentage' + type: boolean + example: true + is_deleted: + description: 'Boolean flag indicating if the quote has been deleted' + type: boolean + example: false + uses_inclusive_taxes: + description: 'Boolean flag indicating if the taxes used are inclusive or exclusive' + type: boolean + example: true + date: + description: 'The date the quote was created' + type: string + format: date + example: '1994-07-30' + last_sent_date: + description: 'The last date the quote was sent to the client' + type: string + format: date + example: '1994-07-30' + next_send_date: + description: 'The next scheduled date for sending a reminder for the quote' + type: string + format: date + example: '1994-07-30' + partial_due_date: + description: 'The due date for the partial or deposit amount' + type: string + format: date + example: '1994-07-30' + due_date: + description: 'The due date for the total amount of the quote' + type: string + format: date + example: '1994-07-30' + settings: + $ref: '#/components/schemas/CompanySettings' + last_viewed: + description: 'The timestamp of the last time the quote was viewed' + type: number + format: integer + example: 1434342123 + updated_at: + description: 'The timestamp of the last update to the quote' + type: number + format: integer + example: 1434342123 + archived_at: + description: 'The timestamp of when the quote was archived' + type: number + format: integer + example: 1434342123 + custom_surcharge1: + description: 'First custom surcharge amount for the quote' + type: number + format: float + example: 10.00 + custom_surcharge2: + description: 'Second custom surcharge amount for the quote' + type: number + format: float + example: 10.00 + custom_surcharge3: + description: 'Third custom surcharge amount for the quote' + type: number + format: float + example: 10.00 + custom_surcharge4: + description: 'Fourth custom surcharge amount for the quote' + type: number + format: float + example: 10.00 + custom_surcharge_tax1: + description: 'Boolean flag indicating if taxes are charged on the first custom surcharge amount' + type: boolean + example: true + custom_surcharge_tax2: + description: 'Boolean flag indicating if taxes are charged on the second custom surcharge amount' + type: boolean + example: true + custom_surcharge_tax3: + description: 'Boolean flag indicating if taxes are charged on the third custom surcharge amount' + type: boolean + example: true + custom_surcharge_tax4: + description: 'Boolean flag indicating if taxes are charged on the fourth custom surcharge amount' + type: boolean + example: true + type: object + Payment: + properties: + id: + description: 'The payment hashed id' + type: string + example: Opnel5aKBz + client_id: + description: 'The client hashed id' + type: string + example: Opnel5aKBz + invitation_id: + description: 'The invitation hashed id' + type: string + example: Opnel5aKBz + client_contact_id: + description: 'The client contact hashed id' + type: string + example: Opnel5aKBz + user_id: + description: 'The user hashed id' + type: string + example: Opnel5aKBz + type_id: + description: 'The Payment Type ID' + type: string + example: '1' + date: + description: 'The Payment date' + type: string + example: 1-1-2014 + transaction_reference: + description: 'The transaction reference as defined by the payment gateway' + type: string + example: xcsSxcs124asd + assigned_user_id: + description: 'The assigned user hashed id' + type: string + example: Opnel5aKBz + private_notes: + description: 'The private notes of the payment' + type: string + example: 'The payment was refunded due to error' + is_manual: + description: 'Flags whether the payment was made manually or processed via a gateway' + type: boolean + example: true + is_deleted: + description: 'Defines if the payment has been deleted' + type: boolean + example: true + amount: + description: 'The amount of this payment' + type: number + example: 10 + refunded: + description: 'The refunded amount of this payment' + type: number + example: 10 + updated_at: + description: Timestamp + type: number + format: integer + example: '1434342123' + archived_at: + description: Timestamp + type: number + format: integer + example: '1434342123' + company_gateway_id: + description: 'The company gateway id' + type: string + example: '3' + paymentables: + $ref: '#/components/schemas/Paymentable' + invoices: + description: '' + type: array + items: + $ref: '#/components/schemas/InvoicePaymentable' + credits: + description: '' + type: array + items: + $ref: '#/components/schemas/CreditPaymentable' + number: + description: 'The payment number - is a unique alpha numeric number per payment per company' + type: string + example: PAY_101 + type: object + + Task: + properties: + id: + description: 'The hashed id of the task' + type: string + example: Opnel5aKBz + user_id: + description: 'The hashed id of the user who created the task' + type: string + example: Opnel5aKBz + assigned_user_id: + description: 'The assigned user of the task' + type: string + example: Opnel5aKBz + company_id: + description: 'The hashed id of the company' + type: string + example: Opnel5aKBz + client_id: + description: 'The hashed if of the client' + type: string + example: Opnel5aKBz + invoice_id: + description: 'The hashed id of the invoice associated with the task' + type: string + example: Opnel5aKBz + project_id: + description: 'The hashed id of the project associated with the task' + type: string + example: Opnel5aKBz + number: + description: 'The number of the task' + type: string + example: TASK-123 + time_log: + description: 'An array of unix time stamps defining the start and end times of the task' + type: string + example: '[[1,2],[3,4]]' + is_running: + description: 'Determines if the task is still running' + type: boolean + example: true + is_deleted: + description: 'Boolean flag determining if the task has been deleted' + type: boolean + example: true + task_status_id: + description: 'The hashed id of the task status' + type: string + example: Opnel5aKBz + description: + description: 'The task description' + type: string + example: 'A wonder task to work on' + duration: + description: 'The task duration in seconds' + type: integer + example: '3600' + task_status_order: + description: 'The order of the task' + type: integer + example: '4' + rate: + description: 'The task rate' + type: number + example: 10.00 + custom_value1: + description: 'A custom value' + type: string + example: '2022-10-10' + custom_value2: + description: 'A custom value' + type: string + example: $1100 + custom_value3: + description: 'A custom value' + type: string + example: 'I need help' + custom_value4: + description: 'A custom value' + type: string + example: INV-3343 + is_date_based: + description: 'Boolean flag determining if the task is date based' + type: boolean + example: true + calculated_start_date: + description: 'The calculated start date of the task' + type: string + example: '2022-10-10' + readOnly: true + invoice_documents: + description: "Boolean flags which determines whether to include the task documents on the invoice" + type: boolean + example: true + created_at: + description: Timestamp + type: number + format: integer + example: '1434342123' + readOnly: true + updated_at: + description: Timestamp + type: number + format: integer + example: '1434342123' + readOnly: true + archived_at: + description: Timestamp + type: number + format: integer + example: '1434342123' + readOnly: true + type: object + RecurringInvoice: + properties: + id: + description: 'The hashed id of the recurring invoice' + type: string + example: Opnel5aKBz + user_id: + description: 'The user hashed id' + type: string + example: Opnel5aKBz + assigned_user_id: + description: 'The assigned user hashed id' + type: string + example: Opnel5aKBz + company_id: + description: 'The company hashed id' + type: string + example: Opnel5aKBz + client_id: + description: 'The client hashed id' + type: string + example: Opnel5aKBz + status_id: + description: 'The invoice status variable' + type: string + example: '4' + frequency_id: + description: 'The recurring invoice frequency' + type: number + example: '4' + remaining_cycles: + description: 'The number of invoices left to be generated' + type: number + example: '4' + number: + description: 'The recurringinvoice number - is a unique alpha numeric number per invoice per company' + type: string + example: INV_101 + po_number: + description: 'The purchase order associated with this recurring invoice' + type: string + example: PO-1234 + terms: + description: 'The invoice terms' + type: string + example: 'These are invoice terms' + public_notes: + description: 'The public notes of the invoice' + type: string + example: 'These are some public notes' + private_notes: + description: 'The private notes of the invoice' + type: string + example: 'These are some private notes' + footer: + description: 'The invoice footer notes' + type: string + example: '' + custom_value1: + description: 'A custom field value' + type: string + example: '2022-10-01' + custom_value2: + description: 'A custom field value' + type: string + example: 'Something custom' + custom_value3: + description: 'A custom field value' + type: string + example: '' + custom_value4: + description: 'A custom field value' + type: string + example: '' + tax_name1: + description: 'The tax name' + type: string + example: '' + tax_name2: + description: 'The tax name' + type: string + example: '' + tax_rate1: + description: 'The tax rate' + type: number + format: float + example: '10.00' + tax_rate2: + description: 'The tax rate' + type: number + format: float + example: '10.00' + tax_name3: + description: 'The tax name' + type: string + example: '' + tax_rate3: + description: 'The tax rate' + type: number + format: float + example: '10.00' + total_taxes: + description: 'The total taxes for the invoice' + type: number + format: float + example: '10.00' + line_items: + description: 'An array of objects which define the line items of the invoice' + type: object + example: '' + amount: + description: 'The invoice amount' + type: number + format: float + example: '10.00' + balance: + description: 'The invoice balance' + type: number + format: float + example: '10.00' + paid_to_date: + description: 'The amount paid on the invoice to date' + type: number + format: float + example: '10.00' + discount: + description: 'The invoice discount, can be an amount or a percentage' + type: number + format: float + example: '10.00' + partial: + description: 'The deposit/partial amount' + type: number + format: float + example: '10.00' + is_amount_discount: + description: 'Flag determining if the discount is an amount or a percentage' + type: boolean + example: true + is_deleted: + description: 'Defines if the invoice has been deleted' + type: boolean + example: true + uses_inclusive_taxes: + description: 'Defines the type of taxes used as either inclusive or exclusive' + type: boolean + example: true + date: + description: 'The Invoice Date' + type: string + format: date + example: '1994-07-30' + last_sent_date: + description: 'The last date the invoice was sent out' + type: string + format: date + example: '1994-07-30' + next_send_date: + description: 'The Next date for a reminder to be sent' + type: string + format: date + example: '1994-07-30' + partial_due_date: + description: 'The due date for the deposit/partial amount' + type: string + format: date + example: '1994-07-30' + due_date: + description: 'The due date of the invoice' + type: string + format: date + example: '1994-07-30' + settings: + $ref: '#/components/schemas/CompanySettings' + last_viewed: + description: Timestamp + type: number + format: integer + example: '1434342123' + updated_at: + description: Timestamp + type: number + format: integer + example: '1434342123' + archived_at: + description: Timestamp + type: number + format: integer + example: '1434342123' + custom_surcharge1: + description: 'First Custom Surcharge' + type: number + format: float + example: '10.00' + custom_surcharge2: + description: 'Second Custom Surcharge' + type: number + format: float + example: '10.00' + custom_surcharge3: + description: 'Third Custom Surcharge' + type: number + format: float + example: '10.00' + custom_surcharge4: + description: 'Fourth Custom Surcharge' + type: number + format: float + example: '10.00' + custom_surcharge_tax1: + description: 'Toggles charging taxes on custom surcharge amounts' + type: boolean + example: true + custom_surcharge_tax2: + description: 'Toggles charging taxes on custom surcharge amounts' + type: boolean + example: true + custom_surcharge_tax3: + description: 'Toggles charging taxes on custom surcharge amounts' + type: boolean + example: true + custom_surcharge_tax4: + description: 'Toggles charging taxes on custom surcharge amounts' + type: boolean + example: true + type: object + + InvoiceItem: + type: object + properties: + quantity: + type: number + example: 1 + description: 'The quantity of the product offered for this line item' + cost: + type: number + format: float + example: 10.00 + description: 'The cost of the product offered for this line item' + product_key: + type: string + example: 'Product key' + description: 'The product key of the product offered for this line item (Referred to as Product in the product tab)' + product_cost: + type: number + format: float + example: 10.00 + description: 'The cost of the product offered for this line item (Referred to as Cost in the product tab)' + notes: + type: string + example: 'Item notes' + description: 'The notes/description for the product offered for this line item' + discount: + type: number + format: float + example: 5.00 + description: 'The discount applied to the product offered for this line item' + is_amount_discount: + type: boolean + example: false + description: 'Indicates whether the discount applied to the product offered for this line item is a fixed amount or a percentage' + tax_name1: + type: string + example: 'GST' + description: 'The name of the first tax applied to the product offered for this line item' + tax_rate1: + type: number + format: float + example: 10.00 + description: 'The rate of the first tax applied to the product offered for this line item' + tax_name2: + type: string + example: 'VAT' + description: 'The name of the second tax applied to the product offered for this line item' + tax_rate2: + type: number + format: float + example: 5.00 + description: 'The rate of the second tax applied to the product offered for this line item' + tax_name3: + type: string + example: 'CA Sales Tax' + description: 'The name of the third tax applied to the product offered for this line item' + tax_rate3: + type: number + format: float + example: 3.00 + description: 'The rate of the third tax applied to the product offered for this line item' + sort_id: + type: string + example: '0' + description: 'Deprecated' + deprecated: true + line_total: + type: number + format: float + example: 10.00 + description: 'The total amount of the product offered for this line item' + readOnly: true + gross_line_total: + type: number + format: float + example: 15.00 + description: 'The total amount of the product offered for this line item before discounts' + readOnly: true + tax_amount: + type: number + format: float + example: 1.00 + description: 'The total amount of tax applied to the product offered for this line item' + readOnly: true + date: + type: string + format: date-time + example: '2023-03-19T00:00:00Z' + description: 'Deprecated' + deprecated: true + custom_value1: + type: string + example: 'Custom value 1' + description: 'The first custom value of the product offered for this line item' + custom_value2: + type: string + example: 'Custom value 2' + description: 'The second custom value of the product offered for this line item' + custom_value3: + type: string + example: 'Custom value 3' + description: 'The third custom value of the product offered for this line item' + custom_value4: + type: string + example: 'Custom value 4' + description: 'The fourth custom value of the product offered for this line item' + type_id: + type: string + example: '1' + description: '1 = product, 2 = service, 3 unpaid gateway fee, 4 paid gateway fee, 5 late fee, 6 expense' + default: '1' + tax_id: + type: string + example: '1' + default: '1' + description: 'The tax ID of the product: 1 product, 2 service, 3 digital, 4 shipping, 5 exempt, 5 reduced tax, 7 override, 8 zero rate, 9 reverse tax' + Activity: + properties: + id: + description: 'The id field of the activity' + type: string + example: Opnel5aKBz + activity_type_id: + description: 'The activity type id' + type: string + example: Opnel5aKBz + client_id: + description: 'The client hashed id' + type: string + example: Opnel5aKBz + company_id: + description: 'The company hashed id' + type: string + example: Opnel5aKBz + user_id: + description: 'The user hashed id' + type: string + example: Opnel5aKBz + invoice_id: + description: 'The invoice hashed id' + type: string + example: Opnel5aKBz + payment_id: + description: 'The payment hashed id' + type: string + example: Opnel5aKBz + credit_id: + description: 'The credit hashed id' + type: string + example: Opnel5aKBz + updated_at: + description: 'Unixtimestamp the last time the record was updated' + type: integer + example: '343421434' + expense_id: + description: 'The expense hashed id' + type: string + example: Opnel5aKBz + is_system: + description: 'Defines is the activity was performed by the system' + type: boolean + example: true + contact_id: + description: 'The contact hashed id' + type: string + example: Opnel5aKBz + task_id: + description: 'The task hashed id' + type: string + example: Opnel5aKBz + notes: + description: 'Activity Notes' + type: string + example: Opnel5aKBz + token_id: + description: 'The hashed ID of the token who performed the action' + type: string + example: Opnel5aKBz + ip: + description: 'The IP Address of the user who performed the action' + type: string + example: 192.168.1.252 + user: + $ref: '#/components/schemas/User' + client: + $ref: '#/components/schemas/Client' + contact: + $ref: '#/components/schemas/ClientContact' + recurring_invoice: + $ref: '#/components/schemas/RecurringInvoice' + invoice: + $ref: '#/components/schemas/Invoice' + credit: + $ref: '#/components/schemas/Credit' + quote: + $ref: '#/components/schemas/Quote' + payment: + $ref: '#/components/schemas/Payment' + expense: + $ref: '#/components/schemas/Expense' + task: + $ref: '#/components/schemas/Task' + purchase_order: + $ref: '#/components/schemas/PurchaseOrder' + vendor: + $ref: '#/components/schemas/Vendor' + vendor_contact: + $ref: '#/components/schemas/VendorContact' + type: object + + ProductBulkAction: + required: + - action + - ids + properties: + action: + type: string + example: archive + description: 'The action to perform ie. archive / restore / delete / set_tax_id' + ids: + type: array + items: + format: string + type: string + example: 2J234DFA,D2J234DFA,D2J234DFA + description: string array of client hashed ids + tax_id: + type: string + example: '1' + description: | + The tax rate id to set on the list of products + + The following constants are available (default = '1') + + ``` + PRODUCT_TYPE_PHYSICAL = '1' + PRODUCT_TYPE_SERVICE = '2' + PRODUCT_TYPE_DIGITAL = '3' + PRODUCT_TYPE_SHIPPING = '4' + PRODUCT_TYPE_EXEMPT = '5' + PRODUCT_TYPE_REDUCED_TAX = '6' + PRODUCT_TYPE_OVERRIDE_TAX = '7' + PRODUCT_TYPE_ZERO_RATED = '8' + PRODUCT_TYPE_REVERSE_TAX = '9' + ``` + type: object + RecurringExpense: + properties: + id: + description: 'The hashed id of the recurring expense' + type: string + example: Opnel5aKBz + user_id: + description: 'The hashed id of the user who created the recurring expense' + type: string + example: Opnel5aKBz + assigned_user_id: + description: 'The hashed id of the user assigned to this recurring expense' + type: string + example: Opnel5aKBz + company_id: + description: 'The hashed id of the company' + type: string + example: Opnel5aKBz + client_id: + description: 'The hashed id of the client' + type: string + example: Opnel5aKBz + invoice_id: + description: 'The hashed id of the invoice' + type: string + example: Opnel5aKBz + bank_id: + description: 'The id of the bank associated with this recurring expense' + type: string + example: '22' + invoice_currency_id: + description: 'The currency id of the invoice associated with this recurring expense' + type: string + example: '1' + expense_currency_id: + description: 'The currency id of the expense associated with this recurring expense' + type: string + example: '1' + invoice_category_id: + description: 'The category id of the invoice' + type: string + example: '1' + payment_type_id: + description: 'The payment type id' + type: string + example: '1' + private_notes: + description: 'The recurring expense private notes' + type: string + example: 'Private and confidential' + public_notes: + description: 'The recurring expense public notes' + type: string + example: 'This is the best client in the world' + transaction_reference: + description: 'The recurring expense transaction reference' + type: string + example: EXP-1223-2333 + transcation_id: + description: 'The transaction id of the recurring expense' + type: string + example: '1233312312' + custom_value1: + description: 'Custom value field' + type: string + example: $1000 + custom_value2: + description: 'Custom value field' + type: string + example: '2022-10-10' + custom_value3: + description: 'Custom value field' + type: string + example: 'short text' + custom_value4: + description: 'Custom value field' + type: string + example: 'very long text' + tax_name1: + description: 'The tax name' + type: string + example: GST + tax_name2: + description: 'The tax name' + type: string + example: VAT + tax_rate1: + description: 'The tax rate' + type: number + format: float + example: '10.00' + tax_rate2: + description: 'The tax rate' + type: number + format: float + example: '10.00' + tax_name3: + description: 'The tax name' + type: string + example: '' + tax_rate3: + description: 'The tax rate' + type: number + format: float + example: '10.00' + amount: + description: 'The total amount of the recurring expense' + type: number + format: float + example: '10.00' + frequency_id: + description: 'The frequency this recurring expense fires' + type: number + format: int + example: '1' + remaining_cycles: + description: 'The number of remaining cycles for this recurring expense' + type: number + format: int + example: '1' + foreign_amount: + description: 'The foreign currency amount of the recurring expense' + type: number + format: float + example: '10.00' + exchange_rate: + description: 'The exchange rate for the expernse' + type: number + format: float + example: '0.80' + date: + description: 'The date of the expense' + type: string + example: '' + payment_date: + description: 'The date the expense was paid' + type: string + example: '' + should_be_invoiced: + description: 'Boolean flag determining if the expense should be invoiced' + type: boolean + example: true + is_deleted: + description: 'Boolean flag determining if the recurring expense is deleted' + type: boolean + example: true + last_sent_date: + description: 'The Date it was sent last' + type: string + format: date + example: '1994-07-30' + next_send_date: + description: 'The next send date' + type: string + format: date + example: '1994-07-30' + invoice_documents: + description: 'Boolean flag determining if the documents associated with this expense should be passed onto the invoice if it is converted to an invoice' + type: boolean + example: true + updated_at: + description: Timestamp + type: number + format: integer + example: '1434342123' + archived_at: + description: Timestamp + type: number + format: integer + example: '1434342123' + type: object + PaymentTerm: + properties: + num_days: + description: 'The payment term length in days' + type: integer + example: '1' + name: + description: 'The payment term length in string format' + type: string + example: 'NET 1' + created_at: + description: Timestamp + type: number + format: integer + example: '134341234234' + updated_at: + description: Timestamp + type: number + format: integer + example: '134341234234' + archived_at: + description: Timestamp + type: number + format: integer + example: '134341234234' + type: object + ClientGatewayToken: + properties: + id: + description: 'The hashed id of the client gateway token' + type: string + example: Opnel5aKBz + company_id: + description: 'The hashed id of the company' + type: string + example: '2' + client_id: + description: 'The hashed_id of the client' + type: string + example: '2' + token: + description: 'The payment token' + type: string + example: '2' + routing_number: + description: 'THe bank account routing number' + type: string + example: '2' + company_gateway_id: + description: 'The hashed id of the company gateway' + type: string + example: '2' + is_default: + description: 'Flag determining if the token is the default payment method' + type: boolean + example: 'true' + type: object + User: + properties: + id: + description: 'The hashed id of the user' + type: string + example: Opnel5aKBz + readOnly: true + first_name: + description: 'The first name of the user' + type: string + example: Brad + last_name: + description: 'The last name of the user' + type: string + example: Pitt + email: + description: 'The users email address' + type: string + example: brad@pitt.com + phone: + description: 'The users phone number' + type: string + example: 555-1233-23232 + signature: + description: 'The users sign off signature' + type: string + example: 'Have a nice day!' + avatar: + description: 'The users avatar' + type: string + example: 'https://url.to.your/avatar.png' + accepted_terms_version: + description: 'The version of the invoice ninja terms that has been accepted by the user' + type: string + example: 1.0.1 + readOnly: true + oauth_user_id: + description: 'The provider id of the oauth entity' + type: string + example: jkhasdf789as6f675sdf768sdfs + readOnly: true + oauth_provider_id: + description: 'The oauth entity id' + type: string + example: google + readOnly: true + language_id: + description: 'The language id of the user' + type: string + example: 1 + verified_phone_number: + description: 'Boolean flag if the user has their phone verified. Required to settings up 2FA' + type: boolean + example: true + readOnly: true + sms_verification_code: + description: 'The sms verification code for the user. Required to settings up 2FA' + type: string + example: '123456' + readOnly: true + oauth_user_token_expiry: + description: 'The expiry date of the oauth token' + type: string + example: '2022-10-10' + readOnly: true + has_password: + description: 'Boolean flag determining if the user has a password' + type: boolean + example: true + readOnly: true + last_confirmed_email_address: + description: 'The last confirmed email address of the user' + type: string + example: 'bob@gmail.com' + readOnly: true + custom_value1: + description: 'A custom value' + type: string + example: 'Custom value 1' + custom_value2: + description: 'A custom value' + type: string + example: '$1000' + custom_value3: + description: 'A custom value' + type: string + example: 'Custom value 3' + custom_value4: + description: 'A custom value' + type: string + example: 'Custom value 4' + is_deleted: + description: 'Boolean flag determining if the user has been deleted' + type: boolean + example: true + readOnly: true + google_2fa_secret: + description: 'The google 2fa secret for the user' + type: string + example: '123456' + readOnly: true + company_user: + $ref: '#/components/schemas/CompanyUser' + type: object CompanyGateway: properties: id: @@ -15587,6 +18662,1512 @@ components: type: object + Document: + properties: + id: + description: 'The document hashed id' + type: string + example: AS3df3A + user_id: + description: 'The user hashed id' + type: string + example: '' + assigned_user_id: + description: 'The assigned user hashed id' + type: string + example: '' + project_id: + description: 'The project associated with this document' + type: string + example: '' + vendor_id: + description: 'The vendor associated with this documents' + type: string + example: '' + name: + description: 'The document name' + type: string + example: Beauty + url: + description: 'The document url' + type: string + example: Beauty + preview: + description: 'The document preview url' + type: string + example: Beauty + type: + description: 'The document type' + type: string + example: Beauty + disk: + description: 'The document disk' + type: string + example: Beauty + hash: + description: 'The document hashed' + type: string + example: Beauty + is_deleted: + description: 'Flag to determine if the document is deleted' + type: boolean + example: true + is_default: + description: 'Flag to determine if the document is a default doc' + type: boolean + example: true + created_at: + description: Timestamp + type: number + format: integer + example: '134341234234' + updated_at: + description: Timestamp + type: number + format: integer + example: '134341234234' + deleted_at: + description: Timestamp + type: number + format: integer + example: '134341234234' + type: object + PurchaseOrder: + properties: + id: + description: 'The unique hashed identifier for the purchase order' + type: string + example: Opnel5aKBz + user_id: + description: 'The unique hashed identifier for the user who created the purchase order' + type: string + example: '' + assigned_user_id: + description: 'The unique hashed identifier for the user assigned to the purchase order' + type: string + example: '' + company_id: + description: 'The unique hashed identifier for the company associated with the purchase order' + type: string + example: '' + vendor_id: + description: 'The unique hashed identifier for the vendor associated with the purchase order' + type: string + example: '' + status_id: + description: 'The status of the purchase order represented by a unique identifier' + type: string + example: '' + number: + description: 'The unique alpha-numeric purchase order number per company' + type: string + example: PO_101 + quote_number: + description: 'The quote number associated with this purchase order' + type: string + example: QUOTE_101 + terms: + description: 'The terms and conditions for the purchase order' + type: string + example: 'These are some purchase order terms. Valid for 14 days.' + public_notes: + description: 'Publicly visible notes associated with the purchase order' + type: string + example: 'These are public notes which the vendor may see' + private_notes: + description: 'Privately visible notes associated with the purchase order, not disclosed to the vendor' + type: string + example: 'These are private notes, not to be disclosed to the vendor' + footer: + description: 'The footer text of the purchase order' + type: string + example: 'The text goes in the footer of the purchase order' + custom_value1: + description: 'First custom value field for additional information' + type: string + example: 'A custom value' + custom_value2: + description: 'Second custom value field for additional information' + type: string + example: 'A custom value' + custom_value3: + description: 'Third custom value field for additional information' + type: string + example: 'A custom value' + custom_value4: + description: 'Fourth custom value field for additional information' + type: string + example: 'A custom value' + tax_name1: + description: 'The name of the first tax applied to the purchase order' + type: string + example: GST + tax_name2: + description: 'The name of the second tax applied to the purchase order' + type: string + example: VAT + tax_rate1: + description: 'The rate of the first tax applied to the purchase order' + type: number + format: float + example: 10.00 + tax_rate2: + description: 'The rate of the second tax applied to the purchase order' + type: number + format: float + example: 10.00 + tax_name3: + description: 'The name of the third tax applied to the purchase order' + type: string + example: '' + tax_rate3: + description: 'The rate of the third tax applied to the purchase order' + type: number + format: float + example: 10.00 + total_taxes: + description: 'The total amount of taxes applied to the purchase order' + type: number + format: float + example: 10.00 + line_items: + type: array + description: 'An array of objects which define the line items of the purchase order' + items: + $ref: '#/components/schemas/InvoiceItem' + amount: + description: 'The total amount of the purchase order before taxes and discounts' + type: number + format: float + example: 10.00 + balance: + description: 'The balance due for the purchase order after accounting for payments' + type: number + format: float + example: 10.00 + paid_to_date: + description: 'The total amount paid on the purchase order so far' + type: number + format: float + example: 10.00 + discount: + description: 'The discount amount or percentage applied to the purchase order' + type: number + format: float + example: 10.00 + partial: + description: 'The partial or deposit amount for the purchase order' + type: number + format: float + example: 10.00 + is_amount_discount: + description: 'Boolean flag indicating if the discount is a fixed amount or a percentage' + type: boolean + example: true + is_deleted: + description: 'Boolean flag indicating if the purchase order has been deleted' + type: boolean + example: false + uses_inclusive_taxes: + description: 'Boolean flag indicating if the taxes used are inclusive or exclusive' + type: boolean + example: true + date: + description: 'The date the purchase order was created' + type: string + format: date + example: '1994-07-30' + last_sent_date: + description: 'The last date the purchase order was sent to the vendor' + type: string + format: date + example: '1994-07-30' + next_send_date: + description: 'The next scheduled date for sending a reminder for the purchase order' + type: string + format: date + example: '1994-07-30' + partial_due_date: + description: 'The due date for the partial or deposit amount' + type: string + format: date + example: '1994-07-30' + due_date: + description: 'The due date for the total amount of the purchase order' + type: string + format: date + example: '1994-07-30' + settings: + $ref: '#/components/schemas/CompanySettings' + last_viewed: + description: Timestamp + type: number + format: integer + example: 1434342123 + updated_at: + description: Timestamp + type: number + format: integer + example: 1434342123 + archived_at: + description: Timestamp + type: number + format: integer + example: 1434342123 + custom_surcharge1: + description: 'First custom surcharge amount for the purchase order' + type: number + format: float + example: 10.00 + custom_surcharge2: + description: 'Second custom surcharge amount for the purchase order' + type: number + format: float + example: 10.00 + custom_surcharge3: + description: 'Third custom surcharge amount for the purchase order' + type: number + format: float + example: 10.00 + custom_surcharge4: + description: 'Fourth custom surcharge amount for the purchase order' + type: number + format: float + example: 10.00 + custom_surcharge_tax1: + description: 'Boolean flag indicating if taxes are charged on the first custom surcharge amount' + type: boolean + example: true + custom_surcharge_tax2: + description: 'Boolean flag indicating if taxes are charged on the second custom surcharge amount' + type: boolean + example: true + custom_surcharge_tax3: + description: 'Boolean flag indicating if taxes are charged on the third custom surcharge amount' + type: boolean + example: true + custom_surcharge_tax4: + description: 'Boolean flag indicating if taxes are charged on the fourth custom surcharge amount' + type: boolean + example: true + type: object + + + ClientSettings: + required: + - currency_id + properties: + currency_id: + description: 'The default currency id' + type: string + example: true + timezone_id: + description: 'The timezone id' + type: string + example: '15' + date_format_id: + description: 'The date format id' + type: string + example: '15' + military_time: + description: 'Toggles 12/24 hour time' + type: boolean + example: true + language_id: + description: 'The language id' + type: string + example: '1' + show_currency_code: + description: 'Toggles whether the currency symbol or code is shown' + type: boolean + example: true + payment_terms: + description: '-1 sets no payment term, 0 sets payment due immediately, positive integers indicates payment terms in days' + type: integer + example: '1' + company_gateway_ids: + description: 'A commad separate list of available gateways' + type: string + example: '1,2,3,4' + custom_value1: + description: 'A Custom Label' + type: string + example: 'Custom Label' + custom_value2: + description: 'A Custom Label' + type: string + example: 'Custom Label' + custom_value3: + description: 'A Custom Label' + type: string + example: 'Custom Label' + custom_value4: + description: 'A Custom Label' + type: string + example: 'Custom Label' + default_task_rate: + description: 'The default task rate' + type: number + format: float + example: '10.00' + send_reminders: + description: 'Toggles whether reminders are sent' + type: boolean + example: true + enable_client_portal_tasks: + description: 'Show/hide the tasks panel in the client portal' + type: boolean + example: true + email_style: + description: 'options include plain,light,dark,custom' + type: string + example: light + reply_to_email: + description: 'The reply to email address' + type: string + example: email@gmail.com + bcc_email: + description: 'A comma separate list of BCC emails' + type: string + example: 'email@gmail.com, contact@gmail.com' + pdf_email_attachment: + description: 'Toggles whether to attach PDF as attachment' + type: boolean + example: true + ubl_email_attachment: + description: 'Toggles whether to attach UBL as attachment' + type: boolean + example: true + email_style_custom: + description: 'The custom template' + type: string + example: '' + counter_number_applied: + description: 'enum when the invoice number counter is set, ie when_saved, when_sent, when_paid' + type: string + example: when_sent + quote_number_applied: + description: 'enum when the quote number counter is set, ie when_saved, when_sent' + type: string + example: when_sent + custom_message_dashboard: + description: 'A custom message which is displayed on the dashboard' + type: string + example: 'Please pay invoices immediately' + custom_message_unpaid_invoice: + description: 'A custom message which is displayed in the client portal when a client is viewing a unpaid invoice.' + type: string + example: 'Please pay invoices immediately' + custom_message_paid_invoice: + description: 'A custom message which is displayed in the client portal when a client is viewing a paid invoice.' + type: string + example: 'Thanks for paying this invoice!' + custom_message_unapproved_quote: + description: 'A custom message which is displayed in the client portal when a client is viewing a unapproved quote.' + type: string + example: 'Please approve quote' + lock_invoices: + description: 'Toggles whether invoices are locked once sent and cannot be modified further' + type: boolean + example: true + auto_archive_invoice: + description: 'Toggles whether a invoice is archived immediately following payment' + type: boolean + example: true + auto_archive_quote: + description: 'Toggles whether a quote is archived after being converted to a invoice' + type: boolean + example: true + auto_convert_quote: + description: 'Toggles whether a quote is converted to a invoice when approved' + type: boolean + example: true + inclusive_taxes: + description: 'Boolean flag determining whether inclusive or exclusive taxes are used' + type: boolean + example: true + task_number_pattern: + description: 'Allows customisation of the task number pattern' + type: string + example: '{$year}-{$counter}' + task_number_counter: + description: 'The incrementing counter for tasks' + type: integer + example: '1' + reminder_send_time: + description: 'Time from UTC +0 when the email will be sent to the client' + type: integer + example: '32400' + expense_number_pattern: + description: 'Allows customisation of the expense number pattern' + type: string + example: '{$year}-{$counter}' + expense_number_counter: + description: 'The incrementing counter for expenses' + type: integer + example: '1' + vendor_number_pattern: + description: 'Allows customisation of the vendor number pattern' + type: string + example: '{$year}-{$counter}' + vendor_number_counter: + description: 'The incrementing counter for vendors' + type: integer + example: '1' + ticket_number_pattern: + description: 'Allows customisation of the ticket number pattern' + type: string + example: '{$year}-{$counter}' + ticket_number_counter: + description: 'The incrementing counter for tickets' + type: integer + example: '1' + payment_number_pattern: + description: 'Allows customisation of the payment number pattern' + type: string + example: '{$year}-{$counter}' + payment_number_counter: + description: 'The incrementing counter for payments' + type: integer + example: '1' + invoice_number_pattern: + description: 'Allows customisation of the invoice number pattern' + type: string + example: '{$year}-{$counter}' + invoice_number_counter: + description: 'The incrementing counter for invoices' + type: integer + example: '1' + quote_number_pattern: + description: 'Allows customisation of the quote number pattern' + type: string + example: '{$year}-{$counter}' + quote_number_counter: + description: 'The incrementing counter for quotes' + type: integer + example: '1' + client_number_pattern: + description: 'Allows customisation of the client number pattern' + type: string + example: '{$year}-{$counter}' + client_number_counter: + description: 'The incrementing counter for clients' + type: integer + example: '1' + credit_number_pattern: + description: 'Allows customisation of the credit number pattern' + type: string + example: '{$year}-{$counter}' + credit_number_counter: + description: 'The incrementing counter for credits' + type: integer + example: '1' + recurring_invoice_number_prefix: + description: 'This string is prepended to the recurring invoice number' + type: string + example: R + reset_counter_frequency_id: + description: 'CONSTANT which is used to apply the frequency which the counters are reset' + type: integer + example: '1' + reset_counter_date: + description: 'The explicit date which is used to reset counters' + type: string + example: '2019-01-01' + counter_padding: + description: 'Pads the counter with leading zeros' + type: integer + example: '1' + shared_invoice_quote_counter: + description: 'Flags whether to share the counter for invoices and quotes' + type: boolean + example: true + update_products: + description: 'Determines if client fields are updated from third party APIs' + type: boolean + example: true + convert_products: + description: '' + type: boolean + example: true + fill_products: + description: 'Automatically fill products based on product_key' + type: boolean + example: true + invoice_terms: + description: 'The default invoice terms' + type: string + example: 'Invoice Terms are...' + quote_terms: + description: 'The default quote terms' + type: string + example: 'Quote Terms are...' + invoice_taxes: + description: 'Taxes can be applied to the invoice' + type: number + example: '1' + invoice_design_id: + description: 'The default design id (invoice, quote etc)' + type: string + example: '1' + quote_design_id: + description: 'The default design id (invoice, quote etc)' + type: string + example: '1' + invoice_footer: + description: 'The default invoice footer' + type: string + example: '1' + invoice_labels: + description: 'JSON string of invoice labels' + type: string + example: '1' + tax_rate1: + description: 'The tax rate (float)' + type: number + example: '10' + tax_name1: + description: 'The tax name' + type: string + example: GST + tax_rate2: + description: 'The tax rate (float)' + type: number + example: '10' + tax_name2: + description: 'The tax name' + type: string + example: GST + tax_rate3: + description: 'The tax rate (float)' + type: number + example: '10' + tax_name3: + description: 'The tax name' + type: string + example: GST + payment_type_id: + description: 'The default payment type id' + type: string + example: '1' + custom_fields: + description: 'JSON string of custom fields' + type: string + example: '{}' + email_footer: + description: 'The default email footer' + type: string + example: 'A default email footer' + email_sending_method: + description: 'The email driver to use to send email, options include default, gmail' + type: string + example: default + gmail_sending_user_id: + description: 'The hashed_id of the user account to send email from' + type: string + example: F76sd34D + email_subject_invoice: + description: '' + type: string + example: 'Your Invoice Subject' + email_subject_quote: + description: '' + type: string + example: 'Your Quote Subject' + email_subject_payment: + description: '' + type: string + example: 'Your Payment Subject' + email_template_invoice: + description: 'The full template for invoice emails' + type: string + example: '' + email_template_quote: + description: 'The full template for quote emails' + type: string + example: '' + email_template_payment: + description: 'The full template for payment emails' + type: string + example: '' + email_subject_reminder1: + description: 'Email subject for Reminder' + type: string + example: '' + email_subject_reminder2: + description: 'Email subject for Reminder' + type: string + example: '' + email_subject_reminder3: + description: 'Email subject for Reminder' + type: string + example: '' + email_subject_reminder_endless: + description: 'Email subject for endless reminders' + type: string + example: '' + email_template_reminder1: + description: 'The full template for Reminder 1' + type: string + example: '' + email_template_reminder2: + description: 'The full template for Reminder 2' + type: string + example: '' + email_template_reminder3: + description: 'The full template for Reminder 3' + type: string + example: '' + email_template_reminder_endless: + description: 'The full template for enless reminders' + type: string + example: '' + enable_portal_password: + description: 'Toggles whether a password is required to log into the client portal' + type: boolean + example: true + show_accept_invoice_terms: + description: 'Toggles whether the terms dialogue is shown to the client' + type: boolean + example: true + show_accept_quote_terms: + description: 'Toggles whether the terms dialogue is shown to the client' + type: boolean + example: true + require_invoice_signature: + description: 'Toggles whether a invoice signature is required' + type: boolean + example: true + require_quote_signature: + description: 'Toggles whether a quote signature is required' + type: boolean + example: true + name: + description: 'The company name' + type: string + example: 'Acme Co' + company_logo: + description: 'The company logo file' + type: object + example: logo.png + website: + description: 'The company website URL' + type: string + example: www.acme.com + address1: + description: 'The company address line 1' + type: string + example: 'Suite 888' + address2: + description: 'The company address line 2' + type: string + example: '5 Jimbo Way' + city: + description: 'The company city' + type: string + example: Sydney + state: + description: 'The company state' + type: string + example: Florisa + postal_code: + description: 'The company zip/postal code' + type: string + example: '90210' + phone: + description: 'The company phone' + type: string + example: 555-213-3948 + email: + description: 'The company email' + type: string + example: joe@acme.co + country_id: + description: 'The country ID' + type: string + example: '1' + vat_number: + description: 'The company VAT/TAX ID number' + type: string + example: '32 120 377 720' + page_size: + description: 'The default page size' + type: string + example: A4 + font_size: + description: 'The font size' + type: number + example: '9' + primary_font: + description: 'The primary font' + type: string + example: roboto + secondary_font: + description: 'The secondary font' + type: string + example: roboto + hide_paid_to_date: + description: 'Flags whether to hide the paid to date field' + type: boolean + example: false + embed_documents: + description: 'Toggled whether to embed documents in the PDF' + type: boolean + example: false + all_pages_header: + description: 'The header for the PDF' + type: boolean + example: false + all_pages_footer: + description: 'The footer for the PDF' + type: boolean + example: false + document_email_attachment: + description: 'Toggles whether to attach documents in the email' + type: boolean + example: false + enable_client_portal_password: + description: 'Toggles password protection of the client portal' + type: boolean + example: false + enable_email_markup: + description: 'Toggles the use of markdown in emails' + type: boolean + example: false + enable_client_portal_dashboard: + description: 'Toggles whether the client dashboard is shown in the client portal' + type: boolean + example: false + enable_client_portal: + description: 'Toggles whether the entire client portal is displayed to the client, or only the context' + type: boolean + example: false + email_template_statement: + description: 'The body of the email for statements' + type: string + example: 'template matter' + email_subject_statement: + description: 'The subject of the email for statements' + type: string + example: 'subject matter' + signature_on_pdf: + description: 'Toggles whether the signature (if available) is displayed on the PDF' + type: boolean + example: false + quote_footer: + description: 'The default quote footer' + type: string + example: 'the quote footer' + email_subject_custom1: + description: 'Custom reminder template subject' + type: string + example: 'Custom Subject 1' + email_subject_custom2: + description: 'Custom reminder template subject' + type: string + example: 'Custom Subject 2' + email_subject_custom3: + description: 'Custom reminder template subject' + type: string + example: 'Custom Subject 3' + email_template_custom1: + description: 'Custom reminder template body' + type: string + example: '' + email_template_custom2: + description: 'Custom reminder template body' + type: string + example: '' + email_template_custom3: + description: 'Custom reminder template body' + type: string + example: '' + enable_reminder1: + description: 'Toggles whether this reminder is enabled' + type: boolean + example: false + enable_reminder2: + description: 'Toggles whether this reminder is enabled' + type: boolean + example: false + enable_reminder3: + description: 'Toggles whether this reminder is enabled' + type: boolean + example: false + num_days_reminder1: + description: 'The Reminder interval' + type: number + example: '9' + num_days_reminder2: + description: 'The Reminder interval' + type: number + example: '9' + num_days_reminder3: + description: 'The Reminder interval' + type: number + example: '9' + schedule_reminder1: + description: '(enum: after_invoice_date, before_due_date, after_due_date)' + type: string + example: after_invoice_date + schedule_reminder2: + description: '(enum: after_invoice_date, before_due_date, after_due_date)' + type: string + example: after_invoice_date + schedule_reminder3: + description: '(enum: after_invoice_date, before_due_date, after_due_date)' + type: string + example: after_invoice_date + late_fee_amount1: + description: 'The late fee amount for reminder 1' + type: number + example: 10 + late_fee_amount2: + description: 'The late fee amount for reminder 2' + type: number + example: 20 + late_fee_amount3: + description: 'The late fee amount for reminder 2' + type: number + example: 100 + endless_reminder_frequency_id: + description: 'The frequency id of the endless reminder' + type: string + example: '1' + client_online_payment_notification: + description: 'Determines if a client should receive the notification for a online payment' + type: boolean + example: false + client_manual_payment_notification: + description: 'Determines if a client should receive the notification for a manually entered payment' + type: boolean + example: false + enable_e_invoice: + description: 'Determines if e-invoicing is enabled' + type: boolean + example: false + default_expense_payment_type_id: + description: 'The default payment type for expenses' + type: string + example: '0' + e_invoice_type: + description: 'The e-invoice type' + type: string + example: 'EN16931' + mailgun_endpoint: + description: 'The mailgun endpoint - used to determine whether US or EU endpoints are used' + type: string + example: 'api.mailgun.net or api.eu.mailgun.net' + client_initiated_payments: + description: 'Determines if clients can initiate payments directly from the client portal' + type: boolean + example: false + client_initiated_payments_minimum: + description: 'The minimum amount a client can pay' + type: number + example: 10 + sync_invoice_quote_columns: + description: 'Determines if invoice and quote columns are synced for the PDF rendering, or if they use their own columns' + type: boolean + example: false + show_task_item_description: + description: 'Determines if the task item description is shown on the invoice' + type: boolean + example: false + allow_billable_task_items: + description: 'Determines if task items can be marked as billable' + type: boolean + example: false + accept_client_input_quote_approval: + description: 'Determines if clients can approve quotes and also pass through a PO Number reference' + type: boolean + example: false + custom_sending_email: + description: 'When using Mailgun or Postmark, the FROM email address can be customized using this setting.' + type: string + example: 'bob@gmail.com' + show_paid_stamp: + description: 'Determines if the PAID stamp is shown on the invoice' + type: boolean + example: false + show_shipping_address: + description: 'Determines if the shipping address is shown on the invoice' + type: boolean + example: false + company_logo_size: + description: 'The size of the company logo on the PDF - percentage value between 0 and 100' + type: number + example: 100 + show_email_footer: + description: 'Determines if the email footer is shown on emails' + type: boolean + example: false + email_alignment: + description: 'The alignment of the email body text, options include left / center / right' + type: string + example: 'left' + auto_bill_standard_invoices: + description: 'Determines if standard invoices are automatically billed when they are created or due' + type: boolean + example: false + postmark_secret: + description: 'The Postmark secret API key' + type: string + example: '123456' + mailgun_secret: + description: 'The Mailgun secret API key' + type: string + example: '123456' + mailgun_domain: + description: 'The Mailgun domain' + type: string + example: 'sandbox123456.mailgun.org' + send_email_on_mark_paid: + description: 'Determines if an email is sent when an invoice is marked as paid' + type: boolean + example: false + vendor_portal_enable_uploads: + description: 'Determines if vendors can upload files to the portal' + type: boolean + example: false + besr_id: + description: 'The BESR ID' + type: string + example: '123456' + qr_iban: + description: 'The IBAN for the QR code' + type: string + example: 'CH123456' + email_subject_purchase_order: + description: 'The email subject for purchase orders' + type: string + example: 'Purchase Order' + email_template_purchase_order: + description: 'The email template for purchase orders' + type: string + example: 'Please see attached your purchase order.' + require_purchase_order_signature: + description: 'Determines if a signature is required on purchase orders' + type: boolean + example: false + purchase_order_public_notes: + description: 'The public notes for purchase orders' + type: string + example: 'Please see attached your purchase order.' + purchase_order_terms: + description: 'The terms for purchase orders' + type: string + example: 'Please see attached your purchase order.' + purchase_order_footer: + description: 'The footer for purchase orders' + type: string + example: 'Please see attached your purchase order.' + purchase_order_design_id: + description: 'The design id for purchase orders' + type: string + example: 'hd677df' + purchase_order_number_pattern: + description: 'The pattern for purchase order numbers' + type: string + example: 'PO-000000' + purchase_order_number_counter: + description: 'The counter for purchase order numbers' + type: number + example: 1 + page_numbering_alignment: + description: 'The alignment for page numbering: options include left / center / right' + type: string + example: 'left' + page_numbering: + description: 'Determines if page numbering is enabled on Document PDFs' + type: boolean + example: false + auto_archive_invoice_cancelled: + description: 'Determines if invoices are automatically archived when they are cancelled' + type: boolean + example: false + email_from_name: + description: 'The FROM name for emails when using Custom emailers' + type: string + example: 'Bob Smith' + show_all_tasks_client_portal: + description: 'Determines if all tasks are shown on the client portal' + type: boolean + example: false + entity_send_time: + description: 'The time that emails are sent. The time is localized to the clients locale, integer values from 1 - 24' + type: integer + example: 9 + shared_invoice_credit_counter: + description: 'Determines if the invoice and credit counter are shared' + type: boolean + example: false + reply_to_name: + description: 'The reply to name for emails' + type: string + example: 'Bob Smith' + hide_empty_columns_on_pdf: + description: 'Determines if empty columns are hidden on PDFs' + type: boolean + example: false + enable_reminder_endless: + description: 'Determines if endless reminders are enabled' + type: boolean + example: false + use_credits_payment: + description: 'Determines if credits can be used as a payment method' + type: boolean + example: false + recurring_invoice_number_pattern: + description: 'The pattern for recurring invoice numbers' + type: string + example: 'R-000000' + recurring_invoice_number_counter: + description: 'The counter for recurring invoice numbers' + type: number + example: 1 + client_portal_under_payment_minimum: + description: 'The minimum payment payment' + type: number + example: 10 + auto_bill_date: + description: 'Determines when the invoices are auto billed, options are on_send_date (when the invoice is sent) or on_due_date (when the invoice is due))' + type: string + example: 'on_send_date' + primary_color: + description: 'The primary color for the client portal / document highlights' + type: string + example: '#ffffff' + secondary_color: + description: 'The secondary color for the client portal / document highlights' + type: string + example: '#ffffff' + client_portal_allow_under_payment: + description: 'Determines if clients can pay invoices under the invoice amount due' + type: boolean + example: false + client_portal_allow_over_payment: + description: 'Determines if clients can pay invoices over the invoice amount' + type: boolean + example: false + auto_bill: + description: 'Determines how autobilling is applied for recurring invoices. off (no auto billed), always (always auto bill), optin (The user must opt in to auto billing), optout (The user must opt out of auto billing' + type: string + example: 'off' + client_portal_terms: + description: 'The terms which are displayed on the client portal' + type: string + example: 'Please see attached your invoice.' + client_portal_privacy_policy: + description: 'The privacy policy which is displayed on the client portal' + type: string + example: 'These are the terms of use for using the client portal.' + client_can_register: + description: 'Determines if clients can register on the client portal' + type: boolean + example: false + portal_design_id: + description: 'The design id for the client portal' + type: string + example: 'hd677df' + late_fee_endless_percent: + description: 'The late fee percentage for endless late fees' + type: number + example: 10 + late_fee_endless_amount: + description: 'The late fee amount for endless late fees' + type: number + example: 10 + auto_email_invoice: + description: 'Determines if invoices are automatically emailed when they are created' + type: boolean + example: false + email_signature: + description: 'The email signature for emails' + type: string + example: 'Bob Smith' + type: object + Product: + type: object + properties: + id: + type: string + description: 'The hashed product ID.' + example: eP01N + readOnly: true + company_id: + type: string + description: 'The hashed ID of the company that owns this product.' + example: eP01N + readOnly: true + user_id: + type: string + description: 'The hashed ID of the user that created this product.' + example: n30m4 + readOnly: true + assigned_user_id: + type: string + description: 'The hashed ID of the user assigned to this product.' + example: pR0j3 + project_id: + type: string + description: 'The hashed ID of the project that this product is associated with.' + example: pR0j3 + vendor_id: + type: string + description: 'The hashed ID of the vendor that this product is associated with.' + example: pR0j3 + custom_value1: + type: string + description: 'Custom value field 1.' + example: 'Custom value 1' + custom_value2: + type: string + description: 'Custom value field 2.' + example: 'Custom value 2' + custom_value3: + type: string + description: 'Custom value field 3.' + example: 'Custom value 3' + custom_value4: + type: string + description: 'Custom value field 4.' + example: 'Custom value 4' + product_key: + type: string + description: 'The product key.' + example: '1234' + notes: + type: string + description: 'Notes about the product.' + example: 'These are some notes about the product.' + cost: + type: number + format: double + description: 'The cost of the product. (Your purchase price for this product)' + example: 10.0 + price: + type: number + format: double + description: 'The price of the product that you are charging.' + example: 20.0 + quantity: + type: number + format: double + description: 'The quantity of the product. (used as a default)' + example: 5.0 + tax_name1: + type: string + description: 'The name of tax 1.' + example: 'Tax 1' + tax_rate1: + type: number + format: double + description: 'The rate of tax 1.' + example: 10.0 + tax_name2: + type: string + description: 'The name of tax 2.' + example: 'Tax 2' + tax_rate2: + type: number + format: double + description: 'The rate of tax 2.' + example: 5.0 + tax_name3: + type: string + description: 'The name of tax 3.' + example: 'Tax 3' + tax_rate3: + type: number + format: double + description: 'The rate of tax 3.' + example: 0.0 + archived_at: + type: integer + format: timestamp + description: 'The timestamp when the product was archived.' + example: '2022-03-18T15:00:00Z' + readOnly: true + created_at: + type: integer + format: timestamp + description: 'The timestamp when the product was created.' + example: '2022-03-18T15:00:00Z' + readOnly: true + updated_at: + description: Timestamp + type: integer + format: timestamp + example: '2022-03-18T12:34:56.789Z' + readOnly: true + is_deleted: + type: boolean + description: 'Boolean flag determining if the product has been deleted' + example: false + readOnly: true + in_stock_quantity: + type: integer + format: int32 + description: The quantity of the product that is currently in stock + default: 0 + stock_notification: + type: boolean + description: Indicates whether stock notifications are enabled for this product + default: true + stock_notification_threshold: + type: integer + format: int32 + description: The minimum quantity threshold for which stock notifications will be triggered + default: 0 + max_quantity: + type: integer + format: int32 + description: The maximum quantity that can be ordered for this product + product_image: + type: string + description: The URL of the product image + format: uri-reference + tax_id: + type: string + default: '1' + description: | + The tax category id for this product.' + + The following constants are available (default = '1') + + ``` + PRODUCT_TYPE_PHYSICAL = '1' + PRODUCT_TYPE_SERVICE = '2' + PRODUCT_TYPE_DIGITAL = '3' + PRODUCT_TYPE_SHIPPING = '4' + PRODUCT_TYPE_EXEMPT = '5' + PRODUCT_TYPE_REDUCED_TAX = '6' + PRODUCT_TYPE_OVERRIDE_TAX = '7' + PRODUCT_TYPE_ZERO_RATED = '8' + PRODUCT_TYPE_REVERSE_TAX = '9' + ``` + example: '1' + + ClientContactRequest: + properties: + id: + description: 'The hashed if of the contact' + type: string + example: Opnel5aKBz + readOnly: true + first_name: + description: 'The first name of the contact' + type: string + example: John + last_name: + description: 'The last name of the contact' + type: string + example: Doe + phone: + description: 'The phone number of the contact' + type: string + example: 555-152-4524 + custom_value1: + description: 'A Custom field value' + type: string + example: '' + custom_value2: + description: 'A Custom field value' + type: string + example: '' + custom_value3: + description: 'A Custom field value' + type: string + example: '' + custom_value4: + description: 'A Custom field value' + type: string + example: '' + email: + description: 'The email of the contact' + type: string + example: '' + password: + description: 'The hashed password of the contact' + type: string + example: '*****' + send_email: + description: 'Boolean value determines is this contact should receive emails' + type: boolean + example: true + type: object + ClientRequest: + required: + - contacts + - country_id + properties: + id: + description: 'The unique identifier of the client' + type: string + example: Opnel5aKBz + readOnly: true + contacts: + type: array + description: 'A list of contacts associated with the client' + items: + $ref: '#/components/schemas/ClientContactRequest' + name: + description: 'The name of the client company or organization' + type: string + example: "Jim's Housekeeping" + website: + description: 'The website URL of the client company or organization' + type: string + example: 'https://www.jims-housekeeping.com' + private_notes: + description: 'Notes that are only visible to the user who created the client' + type: string + example: 'Client prefers email communication over phone calls' + industry_id: + description: 'The unique identifier of the industry the client operates in' + type: number + example: '5' + size_id: + description: 'The unique identifier for the size category of the client company or organization' + type: number + example: '2' + address1: + description: "First line of the client's address" + type: string + example: '123 Main St' + address2: + description: "Second line of the client's address, if needed" + type: string + example: 'Apt 4B' + city: + description: 'The city the client is located in' + type: string + example: 'Beverly Hills' + state: + description: 'The state, province, or locality the client is located in' + type: string + example: 'California' + postal_code: + description: 'The postal code or ZIP code of the client' + type: string + example: '90210' + phone: + description: "The client's phone number" + type: string + example: '555-3434-3434' + country_id: + description: "The unique identifier of the client's country" + type: number + format: integer + example: '1' + custom_value1: + description: 'A custom field for storing additional information' + type: string + example: 'Preferred contact: Email' + custom_value2: + description: 'A custom field for storing additional information' + type: string + example: 'Account manager: John Doe' + custom_value3: + description: 'A custom field for storing additional information' + type: string + example: 'VIP client: Yes' + custom_value4: + description: 'A custom field for storing additional information' + type: string + example: 'Annual contract value: $50,000' + vat_number: + description: "The client's VAT (Value Added Tax) number, if applicable" + type: string + example: 'VAT123456' + id_number: + description: 'A unique identification number for the client, such as a tax ID or business registration number' + type: string + number: + description: 'A system-assigned unique number for the client, typically used for invoicing purposes' + type: string + example: 'CL-0001' + shipping_address1: + description: "First line of the client's shipping address" + type: string + example: '5 Wallaby Way' + shipping_address2: + description: "Second line of the client's shipping address, if needed" + type: string + example: 'Suite 5' + shipping_city: + description: "The city of the client's shipping address" + type: string + example: 'Perth' + shipping_state: + description: "The state, province, or locality of the client's shipping address" + type: string + example: 'Western Australia' + shipping_postal_code: + description: "The postal code or ZIP code of the client's shipping address" + type: string + example: '6110' + shipping_country_id: + description: "The unique identifier of the country for the client's shipping address" + type: number + format: integer + example: '4' + is_deleted: + description: 'A boolean value indicating whether the client has been deleted or not' + type: boolean + example: false + readOnly: true + group_settings_id: + description: 'The group settings assigned to the client' + type: string + example: Opnel5aKBz + routing_id: + description: 'The routing address id for e-invoicing for this client' + type: string + example: Opnel5aKBz3489-dfkiu-2239-sdsd + is_tax_exempt: + description: 'Flag which defines if the client is exempt from taxes' + type: boolean + example: false + has_valid_vat_number: + description: 'Flag which defines if the client has a valid VAT number' + type: boolean + example: false + readOnly: true + classification: + description: 'The classification of the client' + type: string + example: 'individual' + settings: + $ref: '#/components/schemas/ClientSettings' + type: object + Error: + properties: + message: + description: 'Something terrible went wrong' + type: string + example: 'Unexpected error' + code: + description: 'The HTTP error code, ie 5xx 4xx' + type: integer + example: '500' + type: object + BTRules: + properties: + data_key: + description: 'The key to search' + type: string + example: 'description,amount' + operator: + description: 'The operator flag of the search' + type: string + example: '>' + value: + description: 'The value to search for' + type: string + example: bob + type: object CompanySettings: required: - currency_id @@ -16429,1630 +21010,6 @@ components: type: string example: 'individual' type: object - SystemLog: - properties: - id: - description: 'The account hashed id' - type: string - example: AS3df3A - company_id: - description: 'The company hashed id' - type: string - example: AS3df3A - user_id: - description: 'The user_id hashed id' - type: string - example: AS3df3A - client_id: - description: 'The client_id hashed id' - type: string - example: AS3df3A - event_id: - description: 'The Log Type ID' - type: integer - example: 1 - category_id: - description: 'The Category Type ID' - type: integer - example: 1 - type_id: - description: 'The Type Type ID' - type: integer - example: 1 - log: - description: 'The json object of the error' - type: object - example: '{''key'':''value''}' - updated_at: - description: Timestamp - type: string - example: '2' - created_at: - description: Timestamp - type: string - example: '2' - type: object - ClientGatewayToken: - properties: - id: - description: 'The hashed id of the client gateway token' - type: string - example: Opnel5aKBz - company_id: - description: 'The hashed id of the company' - type: string - example: '2' - client_id: - description: 'The hashed_id of the client' - type: string - example: '2' - token: - description: 'The payment token' - type: string - example: '2' - routing_number: - description: 'THe bank account routing number' - type: string - example: '2' - company_gateway_id: - description: 'The hashed id of the company gateway' - type: string - example: '2' - is_default: - description: 'Flag determining if the token is the default payment method' - type: boolean - example: 'true' - type: object - - GenericBulkAction: - properties: - action: - type: string - example: archive - description: 'The action to perform ie. archive / restore / delete' - ids: - type: array - items: - format: string - type: string - example: 2J234DFA,D2J234DFA,D2J234DFA - description: string array of client hashed ids - type: object - InvoiceInvitationRequest: - required: - - client_contact_id - properties: - id: - description: 'The entity invitation hashed id' - type: string - example: Opnel5aKBz - readOnly: true - client_contact_id: - description: 'The client contact hashed id' - type: string - example: Opnel5aKBz - key: - description: 'The invitation key' - type: string - example: Opnel5aKBz4343343566236gvbb - readOnly: true - link: - description: 'The invitation link' - type: string - example: 'https://www.example.com/invitations/Opnel5aKBz4343343566236gvbb' - readOnly: true - sent_date: - description: 'The invitation sent date' - type: string - format: date-time - readOnly: true - viewed_date: - description: 'The invitation viewed date' - type: string - format: date-time - readOnly: true - opened_date: - description: 'The invitation opened date' - type: string - format: date-time - readOnly: true - updated_at: - description: 'Timestamp' - type: number - format: integer - example: '1434342123' - readOnly: true - archived_at: - description: 'Timestamp' - type: number - format: integer - example: '1434342123' - readOnly: true - email_error: - description: 'The email error' - type: string - example: 'The email error' - readOnly: true - email_status: - description: 'The email status' - type: string - readOnly: true - - Client: - properties: - id: - description: 'The unique identifier of the client' - type: string - example: Opnel5aKBz - readOnly: true - contacts: - type: array - items: - $ref: '#/components/schemas/ClientContact' - user_id: - description: 'The unique identifier of the user who created the client' - type: string - example: Ua6Rw4pVbS - readOnly: true - assigned_user_id: - description: 'The unique identifier of the user who has been assigned the client' - type: string - example: Ua6Rw4pVbS - company_id: - description: 'The unique identifier of the company the client belongs to' - type: string - example: Co7Vn3yLmW - readOnly: true - name: - description: 'The name of the client company or organization' - type: string - example: "Jim's Housekeeping" - website: - description: 'The website URL of the client company or organization' - type: string - example: 'https://www.jims-housekeeping.com' - private_notes: - description: 'Notes that are only visible to the user who created the client' - type: string - example: 'Client prefers email communication over phone calls' - client_hash: - description: 'A unique hash value for the client' - type: string - example: asdfkjhk342hjhbfdvmnfb1 - readOnly: true - industry_id: - description: 'The unique identifier of the industry the client operates in' - type: number - example: '5' - size_id: - description: 'The unique identifier for the size category of the client company or organization' - type: number - example: '2' - address1: - description: "First line of the client's address" - type: string - example: '123 Main St' - address2: - description: "Second line of the client's address, if needed" - type: string - example: 'Apt 4B' - city: - description: 'The city the client is located in' - type: string - example: 'Beverly Hills' - state: - description: 'The state, province, or locality the client is located in' - type: string - example: 'California' - postal_code: - description: 'The postal code or ZIP code of the client' - type: string - example: '90210' - phone: - description: "The client's phone number" - type: string - example: '555-3434-3434' - country_id: - description: "The unique identifier of the client's country" - type: number - format: integer - example: '1' - custom_value1: - description: 'A custom field for storing additional information' - type: string - example: 'Preferred contact: Email' - custom_value2: - description: 'A custom field for storing additional information' - type: string - example: 'Account manager: John Doe' - custom_value3: - description: 'A custom field for storing additional information' - type: string - example: 'VIP client: Yes' - custom_value4: - description: 'A custom field for storing additional information' - type: string - example: 'Annual contract value: $50,000' - vat_number: - description: "The client's VAT (Value Added Tax) number, if applicable" - type: string - example: 'VAT123456' - id_number: - description: 'A unique identification number for the client, such as a tax ID or business registration number' - type: string - number: - description: 'A system-assigned unique number for the client, typically used for invoicing purposes' - type: string - example: 'CL-0001' - shipping_address1: - description: "First line of the client's shipping address" - type: string - example: '5 Wallaby Way' - shipping_address2: - description: "Second line of the client's shipping address, if needed" - type: string - example: 'Suite 5' - shipping_city: - description: "The city of the client's shipping address" - type: string - example: 'Perth' - shipping_state: - description: "The state, province, or locality of the client's shipping address" - type: string - example: 'Western Australia' - shipping_postal_code: - description: "The postal code or ZIP code of the client's shipping address" - type: string - example: '6110' - shipping_country_id: - description: "The unique identifier of the country for the client's shipping address" - type: number - format: integer - example: '4' - is_deleted: - description: 'A boolean value indicating whether the client has been deleted or not' - type: boolean - example: false - readOnly: true - balance: - description: 'The outstanding balance the client owes' - type: number - format: float - example: '500.00' - readOnly: true - paid_to_date: - description: 'The total amount the client has paid to date' - type: number - format: float - example: '2000.00' - readOnly: true - credit_balance: - description: 'The available credit balance for the client to use on future purchases' - type: number - format: float - example: '100.00' - readOnly: true - last_login: - description: "The timestamp of the client's last login" - type: number - format: integer - example: '1628686031' - readOnly: true - created_at: - description: 'The timestamp when the client was created' - type: number - format: integer - example: '1617629031' - readOnly: true - updated_at: - description: 'The timestamp when the client was last updated' - type: number - format: integer - example: '1628445631' - readOnly: true - group_settings_id: - description: 'The group settings assigned to the client' - type: string - example: Opnel5aKBz - routing_id: - description: 'The routing address id for e-invoicing for this client' - type: string - example: Opnel5aKBz3489-dfkiu-2239-sdsd - is_tax_exempt: - description: 'Flag which defines if the client is exempt from taxes' - type: boolean - example: false - has_valid_vat_number: - description: 'Flag which defines if the client has a valid VAT number' - type: boolean - example: false - readOnly: true - payment_balance: - description: 'Defines the payment balance the client has on file (pre payments / over payments / unapplied amounts)' - type: number - example: 100 - readOnly: true - settings: - $ref: '#/components/schemas/ClientSettings' - type: object - CompanyUser: - properties: - permissions: - description: 'The company user permissions' - type: string - example: '[create_invoice]' - settings: - description: 'Settings that are used for the frontend applications to store user preferences / metadata' - type: object - example: 'json object' - react_settings: - description: 'Dedicated settings object for the react web application' - type: object' - example: 'json object' - is_owner: - description: 'Determines whether the user owns this company' - type: boolean - example: true - is_admin: - description: 'Determines whether the user is the admin of this company' - type: boolean - example: true - is_locked: - description: 'Determines whether the users access to this company has been locked' - type: boolean - example: true - updated_at: - description: 'The last time the record was modified, format Unix Timestamp' - type: integer - example: '1231232312321' - deleted_at: - description: 'Timestamp when the user was archived, format Unix Timestamp' - type: integer - example: '12312312321' - account: - $ref: '#/components/schemas/Account' - company: - $ref: '#/components/schemas/Company' - user: - $ref: '#/components/schemas/User' - token: - $ref: '#/components/schemas/CompanyToken' - type: object - Design: - properties: - id: - description: 'The design hashed id' - type: string - example: AS3df3A - name: - description: 'The design name' - type: string - example: Beauty - design: - description: 'The design HTML' - type: string - example: '' - is_custom: - description: 'Flag to determine if the design is a custom user design' - type: boolean - example: true - is_active: - description: 'Flag to determine if the design is available for use' - type: boolean - example: true - is_deleted: - description: 'Flag to determine if the design is deleted' - type: boolean - example: true - created_at: - description: Timestamp - type: number - format: integer - example: '134341234234' - updated_at: - description: Timestamp - type: number - format: integer - example: '134341234234' - deleted_at: - description: Timestamp - type: number - format: integer - example: '134341234234' - type: object - InvoiceRequest: - required: - - client_id - properties: - id: - description: 'The invoice hashed id' - type: string - example: Opnel5aKBz - readOnly: true - user_id: - description: 'The user hashed id' - type: string - example: Opnel5aKBz - assigned_user_id: - description: 'The assigned user hashed id' - type: string - example: Opnel5aKBz - company_id: - description: 'The company hashed id' - type: string - example: Opnel5aKBz - readOnly: true - client_id: - description: 'The client hashed id' - type: string - example: Opnel5aKBz - status_id: - description: 'The invoice status variable' - type: string - example: '4' - readOnly: true - number: - description: 'The invoice number - is a unique alpha numeric number per invoice per company' - type: string - example: INV_101 - po_number: - description: 'The purchase order associated with this invoice' - type: string - example: PO-1234 - terms: - description: 'The invoice terms' - type: string - example: 'These are invoice terms' - public_notes: - description: 'The public notes of the invoice' - type: string - example: 'These are some public notes' - private_notes: - description: 'The private notes of the invoice' - type: string - example: 'These are some private notes' - footer: - description: 'The invoice footer notes' - type: string - example: '' - custom_value1: - description: 'A custom field value' - type: string - example: '2022-10-01' - custom_value2: - description: 'A custom field value' - type: string - example: 'Something custom' - custom_value3: - description: 'A custom field value' - type: string - example: '' - custom_value4: - description: 'A custom field value' - type: string - example: '' - tax_name1: - description: 'The tax name' - type: string - example: '' - tax_name2: - description: 'The tax name' - type: string - example: '' - tax_rate1: - description: 'The tax rate' - type: number - format: float - example: '10.00' - tax_rate2: - description: 'The tax rate' - type: number - format: float - example: '10.00' - tax_name3: - description: 'The tax name' - type: string - example: '' - tax_rate3: - description: 'The tax rate' - type: number - format: float - example: '10.00' - total_taxes: - description: 'The total taxes for the invoice' - type: number - format: float - example: '10.00' - readOnly: - line_items: - type: array - description: 'An array of objects which define the line items of the invoice' - items: - $ref: '#/components/schemas/InvoiceItem' - invitations: - type: array - description: 'An array of objects which define the invitations of the invoice' - items: - $ref: '#/components/schemas/InvoiceInvitationRequest' - amount: - description: 'The invoice amount' - type: number - format: float - example: '10.00' - readOnly: true - balance: - description: 'The invoice balance' - type: number - format: float - example: '10.00' - readOnly: true - paid_to_date: - description: 'The amount paid on the invoice to date' - type: number - format: float - example: '10.00' - readOnly: true - discount: - description: 'The invoice discount, can be an amount or a percentage' - type: number - format: float - example: '10.00' - partial: - description: 'The deposit/partial amount' - type: number - format: float - example: '10.00' - is_amount_discount: - description: 'Flag determining if the discount is an amount or a percentage' - type: boolean - example: true - is_deleted: - description: 'Defines if the invoice has been deleted' - type: boolean - example: true - readOnly: true - uses_inclusive_taxes: - description: 'Defines the type of taxes used as either inclusive or exclusive' - type: boolean - example: true - date: - description: 'The Invoice Date' - type: string - format: date - example: '1994-07-30' - last_sent_date: - description: 'The last date the invoice was sent out' - type: string - format: date - example: '1994-07-30' - readOnly: true - next_send_date: - description: 'The Next date for a reminder to be sent' - type: string - format: date - example: '1994-07-30' - readOnly: true - partial_due_date: - description: 'The due date for the deposit/partial amount' - type: string - format: date - example: '1994-07-30' - due_date: - description: 'The due date of the invoice' - type: string - format: date - example: '1994-07-30' - last_viewed: - description: Timestamp - type: number - format: integer - example: '1434342123' - readOnly: true - updated_at: - description: Timestamp - type: number - format: integer - example: '1434342123' - readOnly: true - archived_at: - description: Timestamp - type: number - format: integer - example: '1434342123' - readOnly: true - custom_surcharge1: - description: 'First Custom Surcharge' - type: number - format: float - example: '10.00' - custom_surcharge2: - description: 'Second Custom Surcharge' - type: number - format: float - example: '10.00' - custom_surcharge3: - description: 'Third Custom Surcharge' - type: number - format: float - example: '10.00' - custom_surcharge4: - description: 'Fourth Custom Surcharge' - type: number - format: float - example: '10.00' - custom_surcharge_tax1: - description: 'Toggles charging taxes on custom surcharge amounts' - type: boolean - example: true - custom_surcharge_tax2: - description: 'Toggles charging taxes on custom surcharge amounts' - type: boolean - example: true - custom_surcharge_tax3: - description: 'Toggles charging taxes on custom surcharge amounts' - type: boolean - example: true - custom_surcharge_tax4: - description: 'Toggles charging taxes on custom surcharge amounts' - type: boolean - example: true - project_id: - description: 'The project associated with this invoice' - type: string - example: Opnel5aKBz - type: object - FillableInvoice: - properties: - assigned_user_id: - description: "The assigned user's hashed ID" - type: string - example: 'a1b2c3d4' - client_id: - description: "The client's hashed ID" - type: string - example: 'x1y2z3a4' - number: - description: "The unique alphanumeric invoice number for each invoice per company" - type: string - example: INV_101 - po_number: - description: "The purchase order number associated with the invoice" - type: string - example: 'PO12345' - terms: - description: "The terms and conditions for the invoice" - type: string - example: 'Net 30' - public_notes: - description: "Public notes visible to the client on the invoice" - type: string - example: 'Thank you for your business.' - private_notes: - description: "Private notes for internal use only" - type: string - example: 'Client is a slow payer.' - footer: - description: "The footer text displayed on the invoice" - type: string - example: 'Authorized Signature' - custom_value1: - description: "First custom value for additional information" - type: string - example: 'Project ABC' - custom_value2: - description: "Second custom value for additional information" - type: string - example: 'Department XYZ' - custom_value3: - description: "Third custom value for additional information" - type: string - example: 'Location 123' - custom_value4: - description: "Fourth custom value for additional information" - type: string - example: 'Currency USD' - tax_name1: - description: "Name of the first tax applied to the invoice" - type: string - example: 'VAT' - tax_name2: - description: "Name of the second tax applied to the invoice" - type: string - example: 'GST' - tax_rate1: - description: "Rate of the first tax applied to the invoice" - type: number - example: 10.00 - tax_rate2: - description: "Rate of the second tax applied to the invoice" - type: number - example: 5.00 - tax_name3: - description: "Name of the third tax applied to the invoice" - type: string - example: 'PST' - tax_rate3: - description: "Rate of the third tax applied to the invoice" - type: number - example: 8.00 - line_items: - type: array - description: 'An array of objects which define the line items of the invoice' - items: - $ref: '#/components/schemas/InvoiceItem' - discount: - description: "The discount applied to the invoice" - type: number - example: 10.00 - partial: - description: "The partial amount applied to the invoice" - type: number - example: 20.00 - is_amount_discount: - description: "Indicates whether the discount applied is a fixed amount or a percentage" - type: boolean - example: true - uses_inclusive_taxes: - description: "Indicates whether the tax rates applied to the invoice are inclusive or exclusive" - type: boolean - example: true - date: - description: "The date the invoice was issued" - type: string - example: '1994-07-30' - partial_due_date: - description: "The due date for the partial payment" - type: string - example: '1994-08-15' - due_date: - description: "The due date for the invoice" - type: string - example: '1994-08-30' - custom_surcharge1: - description: "First custom surcharge applied to the invoice" - type: number - example: 10.00 - custom_surcharge2: - description: "Second custom surcharge applied to the invoice" - type: number - example: 15.00 - custom_surcharge3: - description: "Third custom surcharge applied to the invoice" - type: number - example: 5.00 - custom_surcharge4: - description: "Fourth custom surcharge applied to the invoice" - type: number - example: 20.00 - type: object - Paymentable: - properties: - id: - description: 'The paymentable hashed id' - type: string - example: AS3df3A - invoice_id: - description: 'The invoice hashed id' - type: string - example: AS3df3A - credit_id: - description: 'The credit hashed id' - type: string - example: AS3df3A - refunded: - description: 'The amount that has been refunded for this payment' - type: number - format: float - example: '10.00' - amount: - description: 'The amount that has been applied to the payment' - type: number - format: float - example: '10.00' - updated_at: - description: Timestamp - type: number - format: integer - example: '1434342123' - created_at: - description: Timestamp - type: number - format: integer - example: '1434342123' - type: object - BankTransaction: - properties: - id: - description: 'The bank integration hashed id' - type: string - example: AS3df3A - company_id: - description: 'The company hashed id' - type: string - example: AS3df3A - user_id: - description: 'The user hashed id' - type: string - example: AS3df3A - transaction_id: - description: 'The id of the transaction rule' - type: integer - example: 343434 - amount: - description: 'The transaction amount' - type: number - example: 10 - currency_id: - description: 'The currency ID of the currency' - type: string - example: '1' - account_type: - description: 'The account type' - type: string - example: creditCard - description: - description: 'The description of the transaction' - type: string - example: 'Potato purchases for kevin' - category_id: - description: 'The category id' - type: integer - example: 1 - category_type: - description: 'The category description' - type: string - example: Expenses - base_type: - description: 'Either CREDIT or DEBIT' - type: string - example: CREDIT - date: - description: 'The date of the transaction' - type: string - example: '2022-09-01' - bank_account_id: - description: 'The ID number of the bank account' - type: integer - example: '1' - type: object - Meta: - properties: - pagination: - $ref: '#/components/schemas/Pagination' - Pagination: - type: object - properties: - total: - type: integer - description: 'The total number of items' - example: 1 - readOnly: true - count: - type: integer - description: 'The number of items per page' - example: 1 - readOnly: true - per_page: - type: integer - description: 'The number of items per page' - example: 1 - readOnly: true - current_page: - type: integer - description: 'The current page number' - example: 1 - readOnly: true - total_pages: - type: integer - description: 'The total number of pages' - example: 1 - readOnly: true - links: - type: array - description: 'The pagination links' - readOnly: true - - FeesAndLimits: - properties: - min_limit: - description: 'The minimum amount accepted for this gateway' - type: string - example: '2' - max_limit: - description: 'The maximum amount accepted for this gateway' - type: string - example: '2' - fee_amount: - description: 'The gateway fee amount' - type: number - format: float - example: '2.0' - fee_percent: - description: 'The gateway fee percentage' - type: number - format: float - example: '2.0' - fee_tax_name1: - description: 'Fee tax name' - type: string - example: GST - fee_tax_name2: - description: 'Fee tax name' - type: string - example: VAT - fee_tax_name3: - description: 'Fee tax name' - type: string - example: 'CA Sales Tax' - fee_tax_rate1: - description: 'The tax rate' - type: number - format: float - example: '10.0' - fee_tax_rate2: - description: 'The tax rate' - type: number - format: float - example: '17.5' - fee_tax_rate3: - description: 'The tax rate' - type: number - format: float - example: '25.0' - fee_cap: - description: 'If set the fee amount will be no higher than this amount' - type: number - format: float - example: '2.0' - adjust_fee_percent: - description: 'Adjusts the fee to match the exact gateway fee.' - type: boolean - example: true - type: object - InvoiceItem: - type: object - properties: - quantity: - type: number - example: 1 - description: 'The quantity of the product offered for this line item' - cost: - type: number - format: float - example: 10.00 - description: 'The cost of the product offered for this line item' - product_key: - type: string - example: 'Product key' - description: 'The product key of the product offered for this line item (Referred to as Product in the product tab)' - product_cost: - type: number - format: float - example: 10.00 - description: 'The cost of the product offered for this line item (Referred to as Cost in the product tab)' - notes: - type: string - example: 'Item notes' - description: 'The notes/description for the product offered for this line item' - discount: - type: number - format: float - example: 5.00 - description: 'The discount applied to the product offered for this line item' - is_amount_discount: - type: boolean - example: false - description: 'Indicates whether the discount applied to the product offered for this line item is a fixed amount or a percentage' - tax_name1: - type: string - example: 'GST' - description: 'The name of the first tax applied to the product offered for this line item' - tax_rate1: - type: number - format: float - example: 10.00 - description: 'The rate of the first tax applied to the product offered for this line item' - tax_name2: - type: string - example: 'VAT' - description: 'The name of the second tax applied to the product offered for this line item' - tax_rate2: - type: number - format: float - example: 5.00 - description: 'The rate of the second tax applied to the product offered for this line item' - tax_name3: - type: string - example: 'CA Sales Tax' - description: 'The name of the third tax applied to the product offered for this line item' - tax_rate3: - type: number - format: float - example: 3.00 - description: 'The rate of the third tax applied to the product offered for this line item' - sort_id: - type: string - example: '0' - description: 'Deprecated' - deprecated: true - line_total: - type: number - format: float - example: 10.00 - description: 'The total amount of the product offered for this line item' - readOnly: true - gross_line_total: - type: number - format: float - example: 15.00 - description: 'The total amount of the product offered for this line item before discounts' - readOnly: true - tax_amount: - type: number - format: float - example: 1.00 - description: 'The total amount of tax applied to the product offered for this line item' - readOnly: true - date: - type: string - format: date-time - example: '2023-03-19T00:00:00Z' - description: 'Deprecated' - deprecated: true - custom_value1: - type: string - example: 'Custom value 1' - description: 'The first custom value of the product offered for this line item' - custom_value2: - type: string - example: 'Custom value 2' - description: 'The second custom value of the product offered for this line item' - custom_value3: - type: string - example: 'Custom value 3' - description: 'The third custom value of the product offered for this line item' - custom_value4: - type: string - example: 'Custom value 4' - description: 'The fourth custom value of the product offered for this line item' - type_id: - type: string - example: '1' - description: '1 = product, 2 = service, 3 unpaid gateway fee, 4 paid gateway fee, 5 late fee, 6 expense' - default: '1' - tax_id: - type: string - example: '1' - default: '1' - description: 'The tax ID of the product: 1 product, 2 service, 3 digital, 4 shipping, 5 exempt, 5 reduced tax, 7 override, 8 zero rate, 9 reverse tax' - Project: - type: object - properties: - id: - description: 'The project hashed id' - type: string - example: Opnel5aKBz - user_id: - description: 'The user hashed id' - type: string - example: Opnel5aKBz - assigned_user_id: - description: The assigned user identifier associated with the project - type: string - example: Opnel5aKBz - client_id: - type: string - example: Opnel5aKBz - description: The client identifier associated with the project - name: - type: string - description: The name of the project - example: 'New Project' - task_rate: - type: number - format: float - example: 10 - description: The default rate per task for the project - due_date: - type: string - format: date - example: '2019-01-01' - description: The due date for the project - private_notes: - type: string - description: Private notes associated with the project - budgeted_hours: - type: number - format: float - description: The number of budgeted hours for the project - custom_value1: - type: string - description: Custom value field 1 - custom_value2: - type: string - description: Custom value field 2 - custom_value3: - type: string - description: Custom value field 3 - custom_value4: - type: string - description: Custom value field 4 - created_at: - type: number - format: integer - example: 134341234234 - description: The timestamp of the project creation - updated_at: - type: number - format: integer - example: 134341234234 - description: The timestamp of the last project update - archived_at: - type: number - format: integer - example: 134341234234 - description: The timestamp of the project deletion - public_notes: - type: string - description: Public notes associated with the project - is_deleted: - type: boolean - description: A flag indicating if the project is deleted - number: - type: string - description: The project number - color: - type: string - description: The color associated with the project - required: - - id - - user_id - - company_id - - name - - task_rate - - budgeted_hours - - is_deleted - - color - - PaymentTerm: - properties: - num_days: - description: 'The payment term length in days' - type: integer - example: '1' - name: - description: 'The payment term length in string format' - type: string - example: 'NET 1' - created_at: - description: Timestamp - type: number - format: integer - example: '134341234234' - updated_at: - description: Timestamp - type: number - format: integer - example: '134341234234' - archived_at: - description: Timestamp - type: number - format: integer - example: '134341234234' - type: object - BankIntegration: - properties: - id: - description: 'The bank integration hashed id' - type: string - example: AS3df3A - company_id: - description: 'The company hashed id' - type: string - example: AS3df3A - user_id: - description: 'The user hashed id' - type: string - example: AS3df3A - provider_bank_name: - description: 'The providers bank name' - type: string - example: 'Chase Bank' - bank_account_id: - description: 'The bank account id' - type: integer - example: '1233434' - bank_account_name: - description: 'The name of the account' - type: string - example: 'My Checking Acc' - bank_account_number: - description: 'The account number' - type: string - example: '111 234 2332' - bank_account_status: - description: 'The status of the bank account' - type: string - example: ACTIVE - bank_account_type: - description: 'The type of account' - type: string - example: CREDITCARD - balance: - description: 'The current bank balance if available' - type: number - example: '1000000' - currency: - description: 'iso_3166_3 code' - type: string - example: USD - type: object - PurchaseOrder: - properties: - id: - description: 'The unique hashed identifier for the purchase order' - type: string - example: Opnel5aKBz - user_id: - description: 'The unique hashed identifier for the user who created the purchase order' - type: string - example: '' - assigned_user_id: - description: 'The unique hashed identifier for the user assigned to the purchase order' - type: string - example: '' - company_id: - description: 'The unique hashed identifier for the company associated with the purchase order' - type: string - example: '' - vendor_id: - description: 'The unique hashed identifier for the vendor associated with the purchase order' - type: string - example: '' - status_id: - description: 'The status of the purchase order represented by a unique identifier' - type: string - example: '' - number: - description: 'The unique alpha-numeric purchase order number per company' - type: string - example: PO_101 - quote_number: - description: 'The quote number associated with this purchase order' - type: string - example: QUOTE_101 - terms: - description: 'The terms and conditions for the purchase order' - type: string - example: 'These are some purchase order terms. Valid for 14 days.' - public_notes: - description: 'Publicly visible notes associated with the purchase order' - type: string - example: 'These are public notes which the vendor may see' - private_notes: - description: 'Privately visible notes associated with the purchase order, not disclosed to the vendor' - type: string - example: 'These are private notes, not to be disclosed to the vendor' - footer: - description: 'The footer text of the purchase order' - type: string - example: 'The text goes in the footer of the purchase order' - custom_value1: - description: 'First custom value field for additional information' - type: string - example: 'A custom value' - custom_value2: - description: 'Second custom value field for additional information' - type: string - example: 'A custom value' - custom_value3: - description: 'Third custom value field for additional information' - type: string - example: 'A custom value' - custom_value4: - description: 'Fourth custom value field for additional information' - type: string - example: 'A custom value' - tax_name1: - description: 'The name of the first tax applied to the purchase order' - type: string - example: GST - tax_name2: - description: 'The name of the second tax applied to the purchase order' - type: string - example: VAT - tax_rate1: - description: 'The rate of the first tax applied to the purchase order' - type: number - format: float - example: 10.00 - tax_rate2: - description: 'The rate of the second tax applied to the purchase order' - type: number - format: float - example: 10.00 - tax_name3: - description: 'The name of the third tax applied to the purchase order' - type: string - example: '' - tax_rate3: - description: 'The rate of the third tax applied to the purchase order' - type: number - format: float - example: 10.00 - total_taxes: - description: 'The total amount of taxes applied to the purchase order' - type: number - format: float - example: 10.00 - line_items: - type: array - description: 'An array of objects which define the line items of the purchase order' - items: - $ref: '#/components/schemas/InvoiceItem' - amount: - description: 'The total amount of the purchase order before taxes and discounts' - type: number - format: float - example: 10.00 - balance: - description: 'The balance due for the purchase order after accounting for payments' - type: number - format: float - example: 10.00 - paid_to_date: - description: 'The total amount paid on the purchase order so far' - type: number - format: float - example: 10.00 - discount: - description: 'The discount amount or percentage applied to the purchase order' - type: number - format: float - example: 10.00 - partial: - description: 'The partial or deposit amount for the purchase order' - type: number - format: float - example: 10.00 - is_amount_discount: - description: 'Boolean flag indicating if the discount is a fixed amount or a percentage' - type: boolean - example: true - is_deleted: - description: 'Boolean flag indicating if the purchase order has been deleted' - type: boolean - example: false - uses_inclusive_taxes: - description: 'Boolean flag indicating if the taxes used are inclusive or exclusive' - type: boolean - example: true - date: - description: 'The date the purchase order was created' - type: string - format: date - example: '1994-07-30' - last_sent_date: - description: 'The last date the purchase order was sent to the vendor' - type: string - format: date - example: '1994-07-30' - next_send_date: - description: 'The next scheduled date for sending a reminder for the purchase order' - type: string - format: date - example: '1994-07-30' - partial_due_date: - description: 'The due date for the partial or deposit amount' - type: string - format: date - example: '1994-07-30' - due_date: - description: 'The due date for the total amount of the purchase order' - type: string - format: date - example: '1994-07-30' - settings: - $ref: '#/components/schemas/CompanySettings' - last_viewed: - description: Timestamp - type: number - format: integer - example: 1434342123 - updated_at: - description: Timestamp - type: number - format: integer - example: 1434342123 - archived_at: - description: Timestamp - type: number - format: integer - example: 1434342123 - custom_surcharge1: - description: 'First custom surcharge amount for the purchase order' - type: number - format: float - example: 10.00 - custom_surcharge2: - description: 'Second custom surcharge amount for the purchase order' - type: number - format: float - example: 10.00 - custom_surcharge3: - description: 'Third custom surcharge amount for the purchase order' - type: number - format: float - example: 10.00 - custom_surcharge4: - description: 'Fourth custom surcharge amount for the purchase order' - type: number - format: float - example: 10.00 - custom_surcharge_tax1: - description: 'Boolean flag indicating if taxes are charged on the first custom surcharge amount' - type: boolean - example: true - custom_surcharge_tax2: - description: 'Boolean flag indicating if taxes are charged on the second custom surcharge amount' - type: boolean - example: true - custom_surcharge_tax3: - description: 'Boolean flag indicating if taxes are charged on the third custom surcharge amount' - type: boolean - example: true - custom_surcharge_tax4: - description: 'Boolean flag indicating if taxes are charged on the fourth custom surcharge amount' - type: boolean - example: true - type: object - - - CompanyLedger: - properties: - entity_id: - description: 'This field will reference one of the following entity hashed ID payment_id, invoice_id or credit_id' - type: string - example: AS3df3A - notes: - description: 'The notes which reference this entry of the ledger' - type: string - example: 'Credit note for invoice #3212' - balance: - description: 'The client balance' - type: number - format: float - example: '10.00' - adjustment: - description: 'The amount the client balance is adjusted by' - type: number - format: float - example: '10.00' - updated_at: - description: Timestamp - type: number - format: integer - example: '1434342123' - created_at: - description: Timestamp - type: number - format: integer - example: '1434342123' - type: object - Task: - properties: - id: - description: 'The hashed id of the task' - type: string - example: Opnel5aKBz - user_id: - description: 'The hashed id of the user who created the task' - type: string - example: Opnel5aKBz - assigned_user_id: - description: 'The assigned user of the task' - type: string - example: Opnel5aKBz - company_id: - description: 'The hashed id of the company' - type: string - example: Opnel5aKBz - client_id: - description: 'The hashed if of the client' - type: string - example: Opnel5aKBz - invoice_id: - description: 'The hashed id of the invoice associated with the task' - type: string - example: Opnel5aKBz - project_id: - description: 'The hashed id of the project associated with the task' - type: string - example: Opnel5aKBz - number: - description: 'The number of the task' - type: string - example: TASK-123 - time_log: - description: 'An array of unix time stamps defining the start and end times of the task' - type: string - example: '[[1,2],[3,4]]' - is_running: - description: 'Determines if the task is still running' - type: boolean - example: true - is_deleted: - description: 'Boolean flag determining if the task has been deleted' - type: boolean - example: true - task_status_id: - description: 'The hashed id of the task status' - type: string - example: Opnel5aKBz - description: - description: 'The task description' - type: string - example: 'A wonder task to work on' - duration: - description: 'The task duration in seconds' - type: integer - example: '3600' - task_status_order: - description: 'The order of the task' - type: integer - example: '4' - rate: - description: 'The task rate' - type: number - example: 10.00 - custom_value1: - description: 'A custom value' - type: string - example: '2022-10-10' - custom_value2: - description: 'A custom value' - type: string - example: $1100 - custom_value3: - description: 'A custom value' - type: string - example: 'I need help' - custom_value4: - description: 'A custom value' - type: string - example: INV-3343 - is_date_based: - description: 'Boolean flag determining if the task is date based' - type: boolean - example: true - calculated_start_date: - description: 'The calculated start date of the task' - type: string - example: '2022-10-10' - readOnly: true - invoice_documents: - description: "Boolean flags which determines whether to include the task documents on the invoice" - type: boolean - example: true - created_at: - description: Timestamp - type: number - format: integer - example: '1434342123' - readOnly: true - updated_at: - description: Timestamp - type: number - format: integer - example: '1434342123' - readOnly: true - archived_at: - description: Timestamp - type: number - format: integer - example: '1434342123' - readOnly: true - type: object ClientContact: properties: id: @@ -18184,2861 +21141,239 @@ components: example: '134341234234' readOnly: true type: object - ClientContactRequest: + + FeesAndLimits: properties: - id: - description: 'The hashed if of the contact' + min_limit: + description: 'The minimum amount accepted for this gateway' type: string - example: Opnel5aKBz - readOnly: true - first_name: - description: 'The first name of the contact' + example: '2' + max_limit: + description: 'The maximum amount accepted for this gateway' type: string - example: John - last_name: - description: 'The last name of the contact' + example: '2' + fee_amount: + description: 'The gateway fee amount' + type: number + format: float + example: '2.0' + fee_percent: + description: 'The gateway fee percentage' + type: number + format: float + example: '2.0' + fee_tax_name1: + description: 'Fee tax name' type: string - example: Doe - phone: - description: 'The phone number of the contact' + example: GST + fee_tax_name2: + description: 'Fee tax name' type: string - example: 555-152-4524 - custom_value1: - description: 'A Custom field value' + example: VAT + fee_tax_name3: + description: 'Fee tax name' type: string - example: '' - custom_value2: - description: 'A Custom field value' - type: string - example: '' - custom_value3: - description: 'A Custom field value' - type: string - example: '' - custom_value4: - description: 'A Custom field value' - type: string - example: '' - email: - description: 'The email of the contact' - type: string - example: '' - password: - description: 'The hashed password of the contact' - type: string - example: '*****' - send_email: - description: 'Boolean value determines is this contact should receive emails' + example: 'CA Sales Tax' + fee_tax_rate1: + description: 'The tax rate' + type: number + format: float + example: '10.0' + fee_tax_rate2: + description: 'The tax rate' + type: number + format: float + example: '17.5' + fee_tax_rate3: + description: 'The tax rate' + type: number + format: float + example: '25.0' + fee_cap: + description: 'If set the fee amount will be no higher than this amount' + type: number + format: float + example: '2.0' + adjust_fee_percent: + description: 'Adjusts the fee to match the exact gateway fee.' type: boolean example: true type: object - VendorContact: + Account: properties: id: - description: 'The hashed id of the vendor contact' + description: 'The account hashed id' type: string - example: Opnel5aKBz - readOnly: true - user_id: - description: 'The hashed id of the user id' + example: AS3df3A + account_sms_verified: + description: 'Boolean flag if the account has been verified by sms' type: string - example: Opnel5aKBz - readOnly: true + example: true + type: object + BankTransactionRule: + properties: + id: + description: 'The bank transaction rules hashed id' + type: string + example: AS3df3A company_id: - description: 'The hashed id of the company' + description: 'The company hashed id' type: string - example: Opnel5aKBz - readOnly: true + example: AS3df3A + user_id: + description: 'The user hashed id' + type: string + example: AS3df3A + name: + description: 'The name of the transaction' + type: string + example: 'Rule 1' + rules: + description: 'A mapped collection of the sub rules for the BankTransactionRule' + type: array + items: + $ref: '#/components/schemas/BTRules' + auto_convert: + description: 'Flags whether the rule converts the transaction automatically' + type: boolean + example: true + matches_on_all: + description: 'Flags whether all subrules are required for the match' + type: boolean + example: true + applies_to: + description: 'Flags whether the rule applies to a CREDIT or DEBIT' + type: string + example: CREDIT + client_id: + description: 'The client hashed id' + type: string + example: AS3df3A vendor_id: - description: 'The hashed id of the vendor' + description: 'The vendor hashed id' type: string - example: Opnel5aKBz - readOnly: true - first_name: - description: 'The first name of the contact' + example: AS3df3A + category_id: + description: 'The category hashed id' type: string - example: Harry - last_name: - description: 'The last name of the contact' - type: string - example: Windsor - contact_key: - description: 'A unique identifier for the contact' - type: string - example: JD0X52bkfZlJRiroCJ0tcSiAjsJTntZ5uqKdiZ0a - readOnly: true - confirmation_code: - description: 'The confirmation code used to authenticate the contacts email address' - type: string - example: 333-sdjkh34gbasd - readOnly: true - phone: - description: 'The contacts phone number' - type: string - example: 555-123-1234 - custom_value1: - description: 'A custom value' - type: string - example: '2022-10-10' - custom_value2: - description: 'A custom value' - type: string - example: $1000 - custom_value3: - description: 'A custom value' - type: string - example: '' - custom_value4: - description: 'A custom value' - type: string - example: '' - email: - description: 'The contact email address' - type: string - example: harry@windsor.com - email_verified_at: - description: 'The date which the contact confirmed their email' - type: number - format: integer - example: '134341234234' - readOnly: true - password: - description: 'The hashed password of the contact' - type: string - example: '*****' - is_primary: - description: 'Boolean flag determining if the contact is the primary contact for the vendor' - type: boolean - example: true - created_at: - description: Timestamp - type: number - format: integer - example: '134341234234' - readOnly: true - updated_at: - description: Timestamp - type: number - format: integer - example: '134341234234' - readOnly: true - deleted_at: - description: Timestamp - type: number - format: integer - example: '134341234234' - readOnly: true + example: AS3df3A type: object - Subscription: + CompanyToken: properties: - id: - description: Unique identifier for the subscription - type: string - example: Opnel5aKBz - user_id: - description: Unique identifier for the user associated with the subscription - type: string - example: Ua6Rw4pVbS - product_id: - description: Unique identifier for the product associated with the subscription - type: string - example: Pr5Ft7yBmC - company_id: - description: Unique identifier for the company associated with the subscription - type: string - example: Co7Vn3yLmW - recurring_invoice_id: - description: Unique identifier for the recurring invoice associated with the subscription - type: string - example: Ri2Yt8zJkP - is_recurring: - description: Indicates whether the subscription is recurring - type: boolean - example: 'true' - frequency_id: - description: 'integer const representation of the frequency' - type: string - example: '1' - auto_bill: - description: 'enum setting' - type: string - example: always - promo_code: - description: Promotional code applied to the subscription - type: string - example: PROMOCODE4U - promo_discount: - description: Discount percentage or amount applied to the subscription - type: number - example: 10 - is_amount_discount: - description: Indicates whether the discount is a fixed amount - type: boolean - example: 'true' - allow_cancellation: - description: Indicates whether the subscription can be cancelled - type: boolean - example: 'true' - per_seat_enabled: - description: Indicates whether the subscription pricing is per seat - type: boolean - example: 'true' - currency_id: - description: Unique identifier for the currency used in the subscription - type: integer - example: '1' - max_seats_limit: - description: Maximum number of seats allowed for the subscription - type: integer - example: '100' - trial_enabled: - description: Indicates whether the subscription has a trial period - type: boolean - example: 'true' - trial_duration: - description: Duration of the trial period in days - type: integer - example: '14' - allow_query_overrides: - description: Indicates whether query overrides are allowed for the subscription - type: boolean - example: 'true' - allow_plan_changes: - description: Indicates whether plan changes are allowed for the subscription - type: boolean - example: 'true' - refund_period: - description: Number of days within which refunds can be requested - type: integer - example: '30' - webhook_configuration: - description: Webhook configuration for the subscription - type: string - example: 'expand reference for this' - is_deleted: - description: Indicates whether the subscription has been deleted - type: boolean - example: 'false' - archived_at: - description: Timestamp - type: number - format: integer - example: '1434342123' - created_at: - description: Timestamp - type: number - format: integer - example: '134341234234' - updated_at: - description: Timestamp - type: number - format: integer - example: '134341234234' - type: object - BulkAction: - type: array - items: - type: integer - example: '[0,1,2,3,]' - BTRules: - properties: - data_key: - description: 'The key to search' - type: string - example: 'description,amount' - operator: - description: 'The operator flag of the search' - type: string - example: '>' - value: - description: 'The value to search for' - type: string - example: bob - type: object - Company: - properties: - id: - description: "The unique hashed identifier for the company" - type: string - example: WJxbojagwO - size_id: - description: "The unique identifier representing the company's size category" - type: string - example: '2' - industry_id: - description: "The unique identifier representing the company's industry category" - type: string - example: '5' - slack_webhook_url: - description: "The URL for the company's Slack webhook notifications" - type: string - example: 'https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX' - google_analytics_key: - description: "The company's Google Analytics tracking ID" - type: string - example: 'UA-123456789-1' - portal_mode: - description: "The mode determining how client-facing URLs are structured (e.g., subdomain, domain, or iframe)" - type: string - example: subdomain - subdomain: - description: "The subdomain prefix for the company's domain (e.g., 'acme' in acme.domain.com)" - type: string - example: acme - portal_domain: - description: "The fully qualified domain used for client-facing URLs" - type: string - example: 'https://subdomain.invoicing.co' - enabled_tax_rates: - description: "The number of tax rates used per entity" - type: integer - example: '2' - fill_products: - description: "A flag determining whether to auto-fill product descriptions based on the product key" - type: boolean - example: true - convert_products: - description: "A flag determining whether to convert products between different types or units" - type: boolean - example: true - update_products: - description: "A flag determining whether to update product descriptions when the description changes" - type: boolean - example: true - show_product_details: - description: "A flag determining whether to display product details in the user interface" - type: boolean - example: true - show_product_cost: - description: "A flag determining whether to display product cost is shown in the user interface" - type: boolean - example: true - custom_fields: - description: "A mapping of custom fields for various objects within the company" - type: object - enable_product_cost: - description: "A flag determining whether to show or hide the product cost field in the user interface" - type: boolean - example: true - enable_product_quantity: - description: "A flag determining whether to show or hide the product quantity field in the user interface" - type: boolean - example: true - default_quantity: - description: "A flag determining whether to use a default quantity for products" - type: boolean - example: true - custom_surcharge_taxes1: - description: "A flag determining whether to apply taxes on custom surcharge amounts for the first custom surcharge field" - type: boolean - example: true - custom_surcharge_taxes2: - description: "A flag determining whether to apply taxes on custom surcharge amounts for the second custom surcharge field" - type: boolean - example: true - custom_surcharge_taxes3: - description: "A flag determining whether to apply taxes on custom surcharge amounts for the third custom surcharge field" - type: boolean - example: true - custom_surcharge_taxes4: - description: "A flag determining whether to apply taxes on custom surcharge amounts for the fourth custom" - logo: - description: "The company logo file in binary format" - type: string - format: binary - example: logo.png - company_key: - description: "The static company key hash used to identify the Company" - readOnly: true - type: string - example: "Vnb14bRlwiFjc5ckte6cfbygTRkn5IMQ" - client_can_register: - description: "A flag determining whether clients can register for the client portal" - type: boolean - example: true - enabled_modules: - type: integer - description: | - Bitmask representation of the modules that are enabled in the application - - ``` - self::ENTITY_RECURRING_INVOICE => 1, - self::ENTITY_CREDIT => 2, - self::ENTITY_QUOTE => 4, - self::ENTITY_TASK => 8, - self::ENTITY_EXPENSE => 16, - self::ENTITY_PROJECT => 32, - self::ENTITY_VENDOR => 64, - self::ENTITY_TICKET => 128, - self::ENTITY_PROPOSAL => 256, - self::ENTITY_RECURRING_EXPENSE => 512, - self::ENTITY_RECURRING_TASK => 1024, - self::ENTITY_RECURRING_QUOTE => 2048, - ``` - - The default per_page value is 20. - - example: 2048 - db: - readOnly: true - type: string - example: 'db-ninja-01' - first_day_of_week: - description: "The first day of the week for the company" - type: string - example: '1' - first_month_of_year: - description: "The first month for the company financial year" - type: string - example: '1' - enabled_item_tax_rates: - description: "The number of tax rates used per item" - type: integer - example: 2 - is_large: - description: "A flag determining whether the company is considered large" - type: boolean - example: true - default_auto_bill: - type: enum - example: 'always' - description: | - A flag determining whether to auto-bill clients by default - - values: - - - always - Always auto bill - - disabled - Never auto bill - - optin - Allow the client to select their auto bill status with the default being disabled - - optout -Allow the client to select their auto bill status with the default being enabled - mark_expenses_invoiceable: - description: "A flag determining whether to mark expenses as invoiceable by default" - type: boolean - example: true - mark_expenses_paid: - description: "A flag determining whether to mark expenses as paid by default" - type: boolean - example: true - invoice_expense_documents: - description: "A flag determining whether to include expense documents on invoices by default" - type: boolean - example: true - auto_start_tasks: - description: "A flag determining whether to auto-start tasks by default" - type: boolean - example: true - invoice_task_timelog: - description: "A flag determining whether to include task time logs on invoices by default" - type: boolean - example: true - invoice_task_documents: - description: "A flag determining whether to include task documents on invoices by default" - type: boolean - example: true - show_tasks_table: - description: "A flag determining whether to show the tasks table on invoices by default" - type: boolean - example: true - is_disabled: - description: "A flag determining whether the company is disabled" - type: boolean - example: true - default_task_is_date_based: - description: "A flag determining whether to default tasks to be date-based" - type: boolean - example: true - enable_product_discount: - description: "A flag determining whether to show or hide the product discount field in the user interface" - type: boolean - example: true - calculate_expense_tax_by_amount: - description: "A flag determining whether to calculate expense taxes by amount" - type: boolean - example: true - expense_inclusive_taxes: - description: "A flag determining whether to include taxes in the expense amount" - type: boolean - example: true - session_timeout: - description: "The session timeout for the company" - type: integer - example: 60 - oauth_password_required: - description: "A flag determining whether to require a password for `dangerous` actions when using OAuth" - type: boolean - example: true - invoice_task_datelog: - description: "A flag determining whether to include task date logs on invoices by default" - type: boolean - example: true - default_password_timeout: - description: "The default password timeout for the company" - type: integer - example: 60 - show_task_end_date: - description: "A flag determining whether to show the task end date on invoices by default" - type: boolean - example: true - markdown_enabled: - description: "A flag determining whether markdown is enabled for the company" - type: boolean - example: true - report_include_drafts: - description: "A flag determining whether to include draft invoices in reports" - type: boolean - example: true - client_registration_fields: - description: "The client registration fields for the company" - type: object - stop_on_unpaid_recurring: - description: "A flag determining whether to stop recurring invoices when they are unpaid" - type: boolean - example: true - use_quote_terms_on_conversion: - description: "A flag determining whether to use quote terms on conversion to an invoice" - type: boolean - example: true - enable_applying_payments: - description: "A flag determining whether to enable applying payments to invoices" - type: boolean - example: true - track_inventory: - description: "A flag determining whether to track inventory for the company" - type: boolean - example: true - inventory_notification_threshold: - description: "The inventory notification threshold for the company" - type: integer - example: 60 - stock_notification: - description: "A flag determining whether to send stock notifications for the company" - type: boolean - example: true - matomo_url: - description: "The Matomo URL for the company" - type: string - example: 'https://matomo.example.com' - matomo_id: - description: "The Matomo ID for the company" - type: string - example: '1' - enabled_expense_tax_rates: - description: "The number of tax rates used per expense" - type: integer - example: 2 - invoice_task_project: - description: "A flag determining whether to include the project on invoices by default" - type: boolean - example: true - report_include_deleted: - description: "A flag determining whether to include deleted invoices in reports" - type: boolean - example: true - invoice_task_lock: - description: "A flag determining whether to lock tasks when invoiced" - type: boolean - example: true - convert_payment_currency: - description: "A flag determining whether to convert the payment currency" - type: boolean - example: true - convert_expense_currency: - description: "A flag determining whether to convert the expense currency" - type: boolean - example: true - notify_vendor_when_paid: - description: "A flag determining whether to notify the vendor when an expense is paid" - type: boolean - example: true - invoice_task_hours: - description: "A flag determining whether to include the task hours on invoices by default" - type: boolean - example: true - calculate_taxes: - description: "A flag determining whether to calculate taxes for the company" - type: boolean - example: true - tax_data: - description: "The tax data for the company" - type: object - e_invoice_certificate: - description: "The e-invoice certificate for the company" - type: string - example: '-----BEGIN CERTIFICATE-----' - e_invoice_certificate_passphrase: - description: "The e-invoice certificate passphrase for the company" - type: string - example: 'secret' - origin_tax_data: - description: "The origin tax data for the company" - type: object - invoice_task_project_header: - description: "A flag determining whether to include the project header on invoices by default" - type: boolean - example: true - invoice_task_item_description: - description: "A flag determining whether to include the item description on invoices by default" - type: boolean - example: true - - settings: - $ref: '#/components/schemas/CompanySettings' - type: object - RecurringInvoice: - properties: - id: - description: 'The hashed id of the recurring invoice' - type: string - example: Opnel5aKBz - user_id: - description: 'The user hashed id' - type: string - example: Opnel5aKBz - assigned_user_id: - description: 'The assigned user hashed id' - type: string - example: Opnel5aKBz - company_id: - description: 'The company hashed id' - type: string - example: Opnel5aKBz - client_id: - description: 'The client hashed id' - type: string - example: Opnel5aKBz - status_id: - description: 'The invoice status variable' - type: string - example: '4' - frequency_id: - description: 'The recurring invoice frequency' - type: number - example: '4' - remaining_cycles: - description: 'The number of invoices left to be generated' - type: number - example: '4' - number: - description: 'The recurringinvoice number - is a unique alpha numeric number per invoice per company' - type: string - example: INV_101 - po_number: - description: 'The purchase order associated with this recurring invoice' - type: string - example: PO-1234 - terms: - description: 'The invoice terms' - type: string - example: 'These are invoice terms' - public_notes: - description: 'The public notes of the invoice' - type: string - example: 'These are some public notes' - private_notes: - description: 'The private notes of the invoice' - type: string - example: 'These are some private notes' - footer: - description: 'The invoice footer notes' - type: string - example: '' - custom_value1: - description: 'A custom field value' - type: string - example: '2022-10-01' - custom_value2: - description: 'A custom field value' - type: string - example: 'Something custom' - custom_value3: - description: 'A custom field value' - type: string - example: '' - custom_value4: - description: 'A custom field value' - type: string - example: '' - tax_name1: - description: 'The tax name' - type: string - example: '' - tax_name2: - description: 'The tax name' - type: string - example: '' - tax_rate1: - description: 'The tax rate' - type: number - format: float - example: '10.00' - tax_rate2: - description: 'The tax rate' - type: number - format: float - example: '10.00' - tax_name3: - description: 'The tax name' - type: string - example: '' - tax_rate3: - description: 'The tax rate' - type: number - format: float - example: '10.00' - total_taxes: - description: 'The total taxes for the invoice' - type: number - format: float - example: '10.00' - line_items: - description: 'An array of objects which define the line items of the invoice' - type: object - example: '' - amount: - description: 'The invoice amount' - type: number - format: float - example: '10.00' - balance: - description: 'The invoice balance' - type: number - format: float - example: '10.00' - paid_to_date: - description: 'The amount paid on the invoice to date' - type: number - format: float - example: '10.00' - discount: - description: 'The invoice discount, can be an amount or a percentage' - type: number - format: float - example: '10.00' - partial: - description: 'The deposit/partial amount' - type: number - format: float - example: '10.00' - is_amount_discount: - description: 'Flag determining if the discount is an amount or a percentage' - type: boolean - example: true - is_deleted: - description: 'Defines if the invoice has been deleted' - type: boolean - example: true - uses_inclusive_taxes: - description: 'Defines the type of taxes used as either inclusive or exclusive' - type: boolean - example: true - date: - description: 'The Invoice Date' - type: string - format: date - example: '1994-07-30' - last_sent_date: - description: 'The last date the invoice was sent out' - type: string - format: date - example: '1994-07-30' - next_send_date: - description: 'The Next date for a reminder to be sent' - type: string - format: date - example: '1994-07-30' - partial_due_date: - description: 'The due date for the deposit/partial amount' - type: string - format: date - example: '1994-07-30' - due_date: - description: 'The due date of the invoice' - type: string - format: date - example: '1994-07-30' - settings: - $ref: '#/components/schemas/CompanySettings' - last_viewed: - description: Timestamp - type: number - format: integer - example: '1434342123' - updated_at: - description: Timestamp - type: number - format: integer - example: '1434342123' - archived_at: - description: Timestamp - type: number - format: integer - example: '1434342123' - custom_surcharge1: - description: 'First Custom Surcharge' - type: number - format: float - example: '10.00' - custom_surcharge2: - description: 'Second Custom Surcharge' - type: number - format: float - example: '10.00' - custom_surcharge3: - description: 'Third Custom Surcharge' - type: number - format: float - example: '10.00' - custom_surcharge4: - description: 'Fourth Custom Surcharge' - type: number - format: float - example: '10.00' - custom_surcharge_tax1: - description: 'Toggles charging taxes on custom surcharge amounts' - type: boolean - example: true - custom_surcharge_tax2: - description: 'Toggles charging taxes on custom surcharge amounts' - type: boolean - example: true - custom_surcharge_tax3: - description: 'Toggles charging taxes on custom surcharge amounts' - type: boolean - example: true - custom_surcharge_tax4: - description: 'Toggles charging taxes on custom surcharge amounts' - type: boolean - example: true - type: object - - Quote: - properties: - id: - description: 'The unique hashed identifier for the quote' - type: string - example: Opnel5aKBz - user_id: - description: 'The unique hashed identifier for the user who created the quote' - type: string - example: '' - assigned_user_id: - description: 'The unique hashed identifier for the user assigned to the quote' - type: string - example: '' - company_id: - description: 'The unique hashed identifier for the company associated with the quote' - type: string - example: '' - client_id: - description: 'The unique hashed identifier for the client associated with the quote' - type: string - example: '' - status_id: - description: 'The status of the quote represented by a unique identifier' - type: string - example: '' - number: - description: 'The unique alpha-numeric quote number for the quote per company' - type: string - example: QUOTE_101 - po_number: - description: 'The purchase order number associated with the quote' - type: string - example: PO-1234 - terms: - description: 'The terms and conditions for the quote' - type: string - example: 'These are some quote terms. Valid for 14 days.' - public_notes: - description: 'Publicly visible notes associated with the quote' - type: string - example: 'These are public notes which the client may see' - private_notes: - description: 'Privately visible notes associated with the quote, not disclosed to the client' - type: string - example: 'These are private notes, not to be disclosed to the client' - footer: - description: 'The footer text of the quote' - type: string - example: 'The text goes in the footer of the quote' - custom_value1: - description: 'First custom value field for additional information' - type: string - example: 'A custom value' - custom_value2: - description: 'Second custom value field for additional information' - type: string - example: 'A custom value' - custom_value3: - description: 'Third custom value field for additional information' - type: string - example: 'A custom value' - custom_value4: - description: 'Fourth custom value field for additional information' - type: string - example: 'A custom value' - tax_name1: - description: 'The name of the first tax applied to the quote' - type: string - example: GST - tax_name2: - description: 'The name of the second tax applied to the quote' - type: string - example: VAT - tax_rate1: - description: 'The rate of the first tax applied to the quote' - type: number - format: float - example: 10.00 - tax_rate2: - description: 'The rate of the second tax applied to the quote' - type: number - format: float - example: 10.00 - tax_name3: - description: 'The name of the third tax applied to the quote' - type: string - example: '' - tax_rate3: - description: 'The rate of the third tax applied to the quote' - type: number - format: float - example: 10.00 - total_taxes: - description: 'The total amount of taxes for the quote' - type: number - format: float - example: 10.00 - line_items: - type: array - description: 'An array of objects which define the line items of the quote' - items: - $ref: '#/components/schemas/InvoiceItem' - amount: - description: 'The total amount of the quote before taxes and discounts' - type: number - format: float - example: 10.00 - balance: - description: 'The balance due for the quote after accounting for payments' - type: number - format: float - example: 10.00 - paid_to_date: - description: 'The total amount paid on the quote so far' - type: number - format: float - example: 10.00 - discount: - description: 'The discount amount or percentage applied to the quote' - type: number - format: float - example: 10.00 - partial: - description: 'The partial or deposit amount for the quote' - type: number - format: float - example: 10.00 - is_amount_discount: - description: 'Boolean flag indicating if the discount is a fixed amount or a percentage' - type: boolean - example: true - is_deleted: - description: 'Boolean flag indicating if the quote has been deleted' - type: boolean - example: false - uses_inclusive_taxes: - description: 'Boolean flag indicating if the taxes used are inclusive or exclusive' - type: boolean - example: true - date: - description: 'The date the quote was created' - type: string - format: date - example: '1994-07-30' - last_sent_date: - description: 'The last date the quote was sent to the client' - type: string - format: date - example: '1994-07-30' - next_send_date: - description: 'The next scheduled date for sending a reminder for the quote' - type: string - format: date - example: '1994-07-30' - partial_due_date: - description: 'The due date for the partial or deposit amount' - type: string - format: date - example: '1994-07-30' - due_date: - description: 'The due date for the total amount of the quote' - type: string - format: date - example: '1994-07-30' - settings: - $ref: '#/components/schemas/CompanySettings' - last_viewed: - description: 'The timestamp of the last time the quote was viewed' - type: number - format: integer - example: 1434342123 - updated_at: - description: 'The timestamp of the last update to the quote' - type: number - format: integer - example: 1434342123 - archived_at: - description: 'The timestamp of when the quote was archived' - type: number - format: integer - example: 1434342123 - custom_surcharge1: - description: 'First custom surcharge amount for the quote' - type: number - format: float - example: 10.00 - custom_surcharge2: - description: 'Second custom surcharge amount for the quote' - type: number - format: float - example: 10.00 - custom_surcharge3: - description: 'Third custom surcharge amount for the quote' - type: number - format: float - example: 10.00 - custom_surcharge4: - description: 'Fourth custom surcharge amount for the quote' - type: number - format: float - example: 10.00 - custom_surcharge_tax1: - description: 'Boolean flag indicating if taxes are charged on the first custom surcharge amount' - type: boolean - example: true - custom_surcharge_tax2: - description: 'Boolean flag indicating if taxes are charged on the second custom surcharge amount' - type: boolean - example: true - custom_surcharge_tax3: - description: 'Boolean flag indicating if taxes are charged on the third custom surcharge amount' - type: boolean - example: true - custom_surcharge_tax4: - description: 'Boolean flag indicating if taxes are charged on the fourth custom surcharge amount' - type: boolean - example: true - type: object - Invoice: - properties: - id: - description: 'The invoice hashed id' - type: string - example: Opnel5aKBz - readOnly: true - user_id: - description: 'The user hashed id' - type: string - example: Opnel5aKBz - readOnly: true - assigned_user_id: - description: 'The assigned user hashed id' - type: string - example: Opnel5aKBz - company_id: - description: 'The company hashed id' - type: string - example: Opnel5aKBz - readOnly: true - client_id: - description: 'The client hashed id' - type: string - example: Opnel5aKBz - status_id: - description: 'The invoice status variable' - type: string - example: '4' - number: - description: 'The invoice number - is a unique alpha numeric number per invoice per company' - type: string - example: INV_101 - po_number: - description: 'The purchase order associated with this invoice' - type: string - example: PO-1234 - terms: - description: 'The invoice terms' - type: string - example: 'These are invoice terms' - public_notes: - description: 'The public notes of the invoice' - type: string - example: 'These are some public notes' - private_notes: - description: 'The private notes of the invoice' - type: string - example: 'These are some private notes' - footer: - description: 'The invoice footer notes' - type: string - example: '' - custom_value1: - description: 'A custom field value' - type: string - example: '2022-10-01' - custom_value2: - description: 'A custom field value' - type: string - example: 'Something custom' - custom_value3: - description: 'A custom field value' - type: string - example: '' - custom_value4: - description: 'A custom field value' - type: string - example: '' - tax_name1: - description: 'The tax name' - type: string - example: '' - tax_name2: - description: 'The tax name' - type: string - example: '' - tax_rate1: - description: 'The tax rate' - type: number - format: float - example: '10.00' - tax_rate2: - description: 'The tax rate' - type: number - format: float - example: '10.00' - tax_name3: - description: 'The tax name' - type: string - example: '' - tax_rate3: - description: 'The tax rate' - type: number - format: float - example: '10.00' - total_taxes: - description: 'The total taxes for the invoice' - type: number - format: float - example: '10.00' - line_items: - type: array - description: 'An array of objects which define the line items of the invoice' - items: - $ref: '#/components/schemas/InvoiceItem' - invitations: - type: array - description: 'An array of objects which define the invitations of the invoice' - items: - $ref: '#/components/schemas/InvoiceInvitation' - amount: - description: 'The invoice amount' - type: number - format: float - example: '10.00' - balance: - description: 'The invoice balance' - type: number - format: float - example: '10.00' - paid_to_date: - description: 'The amount paid on the invoice to date' - type: number - format: float - example: '10.00' - discount: - description: 'The invoice discount, can be an amount or a percentage' - type: number - format: float - example: '10.00' - partial: - description: 'The deposit/partial amount' - type: number - format: float - example: '10.00' - is_amount_discount: - description: 'Flag determining if the discount is an amount or a percentage' - type: boolean - example: true - is_deleted: - description: 'Defines if the invoice has been deleted' - type: boolean - example: true - uses_inclusive_taxes: - description: 'Defines the type of taxes used as either inclusive or exclusive' - type: boolean - example: true - date: - description: 'The Invoice Date' - type: string - format: date - example: '1994-07-30' - last_sent_date: - description: 'The last date the invoice was sent out' - type: string - format: date - example: '1994-07-30' - next_send_date: - description: 'The Next date for a reminder to be sent' - type: string - format: date - example: '1994-07-30' - partial_due_date: - description: 'The due date for the deposit/partial amount' - type: string - format: date - example: '1994-07-30' - due_date: - description: 'The due date of the invoice' - type: string - format: date - example: '1994-07-30' - last_viewed: - description: Timestamp - type: number - format: integer - example: '1434342123' - updated_at: - description: Timestamp - type: number - format: integer - example: '1434342123' - archived_at: - description: Timestamp - type: number - format: integer - example: '1434342123' - custom_surcharge1: - description: 'First Custom Surcharge' - type: number - format: float - example: '10.00' - custom_surcharge2: - description: 'Second Custom Surcharge' - type: number - format: float - example: '10.00' - custom_surcharge3: - description: 'Third Custom Surcharge' - type: number - format: float - example: '10.00' - custom_surcharge4: - description: 'Fourth Custom Surcharge' - type: number - format: float - example: '10.00' - custom_surcharge_tax1: - description: 'Toggles charging taxes on custom surcharge amounts' - type: boolean - example: true - custom_surcharge_tax2: - description: 'Toggles charging taxes on custom surcharge amounts' - type: boolean - example: true - custom_surcharge_tax3: - description: 'Toggles charging taxes on custom surcharge amounts' - type: boolean - example: true - custom_surcharge_tax4: - description: 'Toggles charging taxes on custom surcharge amounts' - type: boolean - example: true - project_id: - description: 'The project associated with this invoice' - type: string - example: Opnel5aKBz - auto_bill_tries: - description: 'The number of times the invoice has attempted to be auto billed' - type: integer - example: '1' - readOnly: true - auto_bill_enabled: - description: 'Boolean flag determining if the invoice is set to auto bill' - type: boolean - example: true - subscription_id: - description: 'The subscription associated with this invoice' - type: string - example: Opnel5aKBz - - type: object - ClientRequest: - required: - - contacts - - country_id - properties: - id: - description: 'The unique identifier of the client' - type: string - example: Opnel5aKBz - readOnly: true - contacts: - type: array - description: 'A list of contacts associated with the client' - items: - $ref: '#/components/schemas/ClientContactRequest' name: - description: 'The name of the client company or organization' + description: 'The token name' type: string - example: "Jim's Housekeeping" - website: - description: 'The website URL of the client company or organization' + example: 'Token Name' + token: + description: 'The token value' type: string - example: 'https://www.jims-housekeeping.com' - private_notes: - description: 'Notes that are only visible to the user who created the client' - type: string - example: 'Client prefers email communication over phone calls' - industry_id: - description: 'The unique identifier of the industry the client operates in' - type: number - example: '5' - size_id: - description: 'The unique identifier for the size category of the client company or organization' - type: number - example: '2' - address1: - description: "First line of the client's address" - type: string - example: '123 Main St' - address2: - description: "Second line of the client's address, if needed" - type: string - example: 'Apt 4B' - city: - description: 'The city the client is located in' - type: string - example: 'Beverly Hills' - state: - description: 'The state, province, or locality the client is located in' - type: string - example: 'California' - postal_code: - description: 'The postal code or ZIP code of the client' - type: string - example: '90210' - phone: - description: "The client's phone number" - type: string - example: '555-3434-3434' - country_id: - description: "The unique identifier of the client's country" - type: number - format: integer - example: '1' - custom_value1: - description: 'A custom field for storing additional information' - type: string - example: 'Preferred contact: Email' - custom_value2: - description: 'A custom field for storing additional information' - type: string - example: 'Account manager: John Doe' - custom_value3: - description: 'A custom field for storing additional information' - type: string - example: 'VIP client: Yes' - custom_value4: - description: 'A custom field for storing additional information' - type: string - example: 'Annual contract value: $50,000' - vat_number: - description: "The client's VAT (Value Added Tax) number, if applicable" - type: string - example: 'VAT123456' - id_number: - description: 'A unique identification number for the client, such as a tax ID or business registration number' - type: string - number: - description: 'A system-assigned unique number for the client, typically used for invoicing purposes' - type: string - example: 'CL-0001' - shipping_address1: - description: "First line of the client's shipping address" - type: string - example: '5 Wallaby Way' - shipping_address2: - description: "Second line of the client's shipping address, if needed" - type: string - example: 'Suite 5' - shipping_city: - description: "The city of the client's shipping address" - type: string - example: 'Perth' - shipping_state: - description: "The state, province, or locality of the client's shipping address" - type: string - example: 'Western Australia' - shipping_postal_code: - description: "The postal code or ZIP code of the client's shipping address" - type: string - example: '6110' - shipping_country_id: - description: "The unique identifier of the country for the client's shipping address" - type: number - format: integer - example: '4' - is_deleted: - description: 'A boolean value indicating whether the client has been deleted or not' - type: boolean - example: false - readOnly: true - group_settings_id: - description: 'The group settings assigned to the client' - type: string - example: Opnel5aKBz - routing_id: - description: 'The routing address id for e-invoicing for this client' - type: string - example: Opnel5aKBz3489-dfkiu-2239-sdsd - is_tax_exempt: - description: 'Flag which defines if the client is exempt from taxes' - type: boolean - example: false - has_valid_vat_number: - description: 'Flag which defines if the client has a valid VAT number' - type: boolean - example: false - readOnly: true - classification: - description: 'The classification of the client' - type: string - example: 'individual' - settings: - $ref: '#/components/schemas/ClientSettings' - type: object - Vendor: - properties: - id: - description: 'The hashed id of the vendor. This is a unique identifier for the vendor.' - type: string - example: Opnel5aKBz - readOnly: true - user_id: - description: 'The hashed id of the user who created the vendor. This is a unique identifier for the user.' - type: string - example: Opnel5aKBz - assigned_user_id: - description: 'The hashed id of the assigned user to this vendor. This is a unique identifier for the user.' - type: string - example: Opnel5aKBz - company_id: - description: 'The hashed id of the company. This is a unique identifier for the company.' - type: string - example: Opnel5aKBz - contacts: - type: array - items: - $ref: '#/components/schemas/VendorContact' - description: 'An array of contacts associated with the vendor.' - name: - description: 'The name of the vendor.' - type: string - example: 'Harry cafe de wheels' - classification: - description: 'The classification of the vendor.' - type: string - example: 'individual' - website: - description: 'The website of the vendor.' - type: string - example: www.harry.com - private_notes: - description: 'The private notes of the vendor. These notes are only visible to users with appropriate permissions.' - type: string - example: 'Shhh, do not tell the vendor' - industry_id: - description: 'The industry id of the vendor. This is a unique identifier for the industry.' - type: string - example: '1' - size_id: - description: 'The size id of the vendor. This is a unique identifier for the size of the vendor.' - type: string - example: '' - address1: - description: 'The first line of the vendor''s address.' - type: string - example: '' - address2: - description: 'The second line of the vendor''s address.' - type: string - example: '' - city: - description: 'The city of the vendor''s address.' - type: string - example: '' - state: - description: 'The state of the vendor''s address.' - type: string - example: '' - postal_code: - description: 'The postal code of the vendor''s address.' - type: string - example: '' - phone: - description: 'The phone number of the vendor.' - type: string - example: 555-3434-3434 - country_id: - description: 'The country id of the vendor. This is a unique identifier for the country.' - type: string - example: '' - currency_id: - description: 'The currency id of the vendor. This is a unique identifier for the currency.' - type: string - example: '4' - custom_value1: - description: 'The value of the first custom field for the vendor.' - type: string - example: '' - custom_value2: - description: 'The value of the second custom field for the vendor.' - type: string - example: '' - custom_value3: - description: 'The value of the third custom field for the vendor.' - type: string - example: '' - custom_value4: - description: 'The value of the fourth custom field for the vendor.' - type: string - example: '' - vat_number: - description: 'The VAT number of the vendor.' - type: string - example: '' - id_number: - description: 'The ID number of the vendor.' - type: string - example: '' - number: - description: 'The number of the vendor' - type: string - example: '11234' - is_deleted: - description: 'Boolean flag determining if the vendor has been deleted' - type: boolean - example: true - language_id: - description: 'The language id of the vendor. This is a unique identifier for the language.' - type: string - example: '1' - vendor_hash: - description: 'The vendor hash of the vendor. This is a unique identifier for the vendor.' - type: string - example: 'aaa-sss-www' - readOnly: true - transaction_name: - description: 'The transaction name of the vendor.' - type: string - example: 'aaa-sss-www' - last_login: - description: Timestamp - type: number - format: integer - example: '134341234234' - readOnly: true - created_at: - description: Timestamp - type: number - format: integer - example: '134341234234' - readOnly: true - updated_at: - description: Timestamp - type: number - format: integer - example: '134341234234' - readOnly: true - display_name: - description: 'The display name of the vendor.' - type: string - example: 'Bob the vendor' - readOnly: true - type: object - ClientSettings: - required: - - currency_id - properties: - currency_id: - description: 'The default currency id' - type: string - example: true - timezone_id: - description: 'The timezone id' - type: string - example: '15' - date_format_id: - description: 'The date format id' - type: string - example: '15' - military_time: - description: 'Toggles 12/24 hour time' - type: boolean - example: true - language_id: - description: 'The language id' - type: string - example: '1' - show_currency_code: - description: 'Toggles whether the currency symbol or code is shown' - type: boolean - example: true - payment_terms: - description: '-1 sets no payment term, 0 sets payment due immediately, positive integers indicates payment terms in days' - type: integer - example: '1' - company_gateway_ids: - description: 'A commad separate list of available gateways' - type: string - example: '1,2,3,4' - custom_value1: - description: 'A Custom Label' - type: string - example: 'Custom Label' - custom_value2: - description: 'A Custom Label' - type: string - example: 'Custom Label' - custom_value3: - description: 'A Custom Label' - type: string - example: 'Custom Label' - custom_value4: - description: 'A Custom Label' - type: string - example: 'Custom Label' - default_task_rate: - description: 'The default task rate' - type: number - format: float - example: '10.00' - send_reminders: - description: 'Toggles whether reminders are sent' - type: boolean - example: true - enable_client_portal_tasks: - description: 'Show/hide the tasks panel in the client portal' - type: boolean - example: true - email_style: - description: 'options include plain,light,dark,custom' - type: string - example: light - reply_to_email: - description: 'The reply to email address' - type: string - example: email@gmail.com - bcc_email: - description: 'A comma separate list of BCC emails' - type: string - example: 'email@gmail.com, contact@gmail.com' - pdf_email_attachment: - description: 'Toggles whether to attach PDF as attachment' - type: boolean - example: true - ubl_email_attachment: - description: 'Toggles whether to attach UBL as attachment' - type: boolean - example: true - email_style_custom: - description: 'The custom template' - type: string - example: '' - counter_number_applied: - description: 'enum when the invoice number counter is set, ie when_saved, when_sent, when_paid' - type: string - example: when_sent - quote_number_applied: - description: 'enum when the quote number counter is set, ie when_saved, when_sent' - type: string - example: when_sent - custom_message_dashboard: - description: 'A custom message which is displayed on the dashboard' - type: string - example: 'Please pay invoices immediately' - custom_message_unpaid_invoice: - description: 'A custom message which is displayed in the client portal when a client is viewing a unpaid invoice.' - type: string - example: 'Please pay invoices immediately' - custom_message_paid_invoice: - description: 'A custom message which is displayed in the client portal when a client is viewing a paid invoice.' - type: string - example: 'Thanks for paying this invoice!' - custom_message_unapproved_quote: - description: 'A custom message which is displayed in the client portal when a client is viewing a unapproved quote.' - type: string - example: 'Please approve quote' - lock_invoices: - description: 'Toggles whether invoices are locked once sent and cannot be modified further' - type: boolean - example: true - auto_archive_invoice: - description: 'Toggles whether a invoice is archived immediately following payment' - type: boolean - example: true - auto_archive_quote: - description: 'Toggles whether a quote is archived after being converted to a invoice' - type: boolean - example: true - auto_convert_quote: - description: 'Toggles whether a quote is converted to a invoice when approved' - type: boolean - example: true - inclusive_taxes: - description: 'Boolean flag determining whether inclusive or exclusive taxes are used' - type: boolean - example: true - task_number_pattern: - description: 'Allows customisation of the task number pattern' - type: string - example: '{$year}-{$counter}' - task_number_counter: - description: 'The incrementing counter for tasks' - type: integer - example: '1' - reminder_send_time: - description: 'Time from UTC +0 when the email will be sent to the client' - type: integer - example: '32400' - expense_number_pattern: - description: 'Allows customisation of the expense number pattern' - type: string - example: '{$year}-{$counter}' - expense_number_counter: - description: 'The incrementing counter for expenses' - type: integer - example: '1' - vendor_number_pattern: - description: 'Allows customisation of the vendor number pattern' - type: string - example: '{$year}-{$counter}' - vendor_number_counter: - description: 'The incrementing counter for vendors' - type: integer - example: '1' - ticket_number_pattern: - description: 'Allows customisation of the ticket number pattern' - type: string - example: '{$year}-{$counter}' - ticket_number_counter: - description: 'The incrementing counter for tickets' - type: integer - example: '1' - payment_number_pattern: - description: 'Allows customisation of the payment number pattern' - type: string - example: '{$year}-{$counter}' - payment_number_counter: - description: 'The incrementing counter for payments' - type: integer - example: '1' - invoice_number_pattern: - description: 'Allows customisation of the invoice number pattern' - type: string - example: '{$year}-{$counter}' - invoice_number_counter: - description: 'The incrementing counter for invoices' - type: integer - example: '1' - quote_number_pattern: - description: 'Allows customisation of the quote number pattern' - type: string - example: '{$year}-{$counter}' - quote_number_counter: - description: 'The incrementing counter for quotes' - type: integer - example: '1' - client_number_pattern: - description: 'Allows customisation of the client number pattern' - type: string - example: '{$year}-{$counter}' - client_number_counter: - description: 'The incrementing counter for clients' - type: integer - example: '1' - credit_number_pattern: - description: 'Allows customisation of the credit number pattern' - type: string - example: '{$year}-{$counter}' - credit_number_counter: - description: 'The incrementing counter for credits' - type: integer - example: '1' - recurring_invoice_number_prefix: - description: 'This string is prepended to the recurring invoice number' - type: string - example: R - reset_counter_frequency_id: - description: 'CONSTANT which is used to apply the frequency which the counters are reset' - type: integer - example: '1' - reset_counter_date: - description: 'The explicit date which is used to reset counters' - type: string - example: '2019-01-01' - counter_padding: - description: 'Pads the counter with leading zeros' - type: integer - example: '1' - shared_invoice_quote_counter: - description: 'Flags whether to share the counter for invoices and quotes' - type: boolean - example: true - update_products: - description: 'Determines if client fields are updated from third party APIs' - type: boolean - example: true - convert_products: - description: '' - type: boolean - example: true - fill_products: - description: 'Automatically fill products based on product_key' - type: boolean - example: true - invoice_terms: - description: 'The default invoice terms' - type: string - example: 'Invoice Terms are...' - quote_terms: - description: 'The default quote terms' - type: string - example: 'Quote Terms are...' - invoice_taxes: - description: 'Taxes can be applied to the invoice' - type: number - example: '1' - invoice_design_id: - description: 'The default design id (invoice, quote etc)' - type: string - example: '1' - quote_design_id: - description: 'The default design id (invoice, quote etc)' - type: string - example: '1' - invoice_footer: - description: 'The default invoice footer' - type: string - example: '1' - invoice_labels: - description: 'JSON string of invoice labels' - type: string - example: '1' - tax_rate1: - description: 'The tax rate (float)' - type: number - example: '10' - tax_name1: - description: 'The tax name' - type: string - example: GST - tax_rate2: - description: 'The tax rate (float)' - type: number - example: '10' - tax_name2: - description: 'The tax name' - type: string - example: GST - tax_rate3: - description: 'The tax rate (float)' - type: number - example: '10' - tax_name3: - description: 'The tax name' - type: string - example: GST - payment_type_id: - description: 'The default payment type id' - type: string - example: '1' - custom_fields: - description: 'JSON string of custom fields' - type: string - example: '{}' - email_footer: - description: 'The default email footer' - type: string - example: 'A default email footer' - email_sending_method: - description: 'The email driver to use to send email, options include default, gmail' - type: string - example: default - gmail_sending_user_id: - description: 'The hashed_id of the user account to send email from' - type: string - example: F76sd34D - email_subject_invoice: - description: '' - type: string - example: 'Your Invoice Subject' - email_subject_quote: - description: '' - type: string - example: 'Your Quote Subject' - email_subject_payment: - description: '' - type: string - example: 'Your Payment Subject' - email_template_invoice: - description: 'The full template for invoice emails' - type: string - example: '' - email_template_quote: - description: 'The full template for quote emails' - type: string - example: '' - email_template_payment: - description: 'The full template for payment emails' - type: string - example: '' - email_subject_reminder1: - description: 'Email subject for Reminder' - type: string - example: '' - email_subject_reminder2: - description: 'Email subject for Reminder' - type: string - example: '' - email_subject_reminder3: - description: 'Email subject for Reminder' - type: string - example: '' - email_subject_reminder_endless: - description: 'Email subject for endless reminders' - type: string - example: '' - email_template_reminder1: - description: 'The full template for Reminder 1' - type: string - example: '' - email_template_reminder2: - description: 'The full template for Reminder 2' - type: string - example: '' - email_template_reminder3: - description: 'The full template for Reminder 3' - type: string - example: '' - email_template_reminder_endless: - description: 'The full template for enless reminders' - type: string - example: '' - enable_portal_password: - description: 'Toggles whether a password is required to log into the client portal' - type: boolean - example: true - show_accept_invoice_terms: - description: 'Toggles whether the terms dialogue is shown to the client' - type: boolean - example: true - show_accept_quote_terms: - description: 'Toggles whether the terms dialogue is shown to the client' - type: boolean - example: true - require_invoice_signature: - description: 'Toggles whether a invoice signature is required' - type: boolean - example: true - require_quote_signature: - description: 'Toggles whether a quote signature is required' - type: boolean - example: true - name: - description: 'The company name' - type: string - example: 'Acme Co' - company_logo: - description: 'The company logo file' - type: object - example: logo.png - website: - description: 'The company website URL' - type: string - example: www.acme.com - address1: - description: 'The company address line 1' - type: string - example: 'Suite 888' - address2: - description: 'The company address line 2' - type: string - example: '5 Jimbo Way' - city: - description: 'The company city' - type: string - example: Sydney - state: - description: 'The company state' - type: string - example: Florisa - postal_code: - description: 'The company zip/postal code' - type: string - example: '90210' - phone: - description: 'The company phone' - type: string - example: 555-213-3948 - email: - description: 'The company email' - type: string - example: joe@acme.co - country_id: - description: 'The country ID' - type: string - example: '1' - vat_number: - description: 'The company VAT/TAX ID number' - type: string - example: '32 120 377 720' - page_size: - description: 'The default page size' - type: string - example: A4 - font_size: - description: 'The font size' - type: number - example: '9' - primary_font: - description: 'The primary font' - type: string - example: roboto - secondary_font: - description: 'The secondary font' - type: string - example: roboto - hide_paid_to_date: - description: 'Flags whether to hide the paid to date field' - type: boolean - example: false - embed_documents: - description: 'Toggled whether to embed documents in the PDF' - type: boolean - example: false - all_pages_header: - description: 'The header for the PDF' - type: boolean - example: false - all_pages_footer: - description: 'The footer for the PDF' - type: boolean - example: false - document_email_attachment: - description: 'Toggles whether to attach documents in the email' - type: boolean - example: false - enable_client_portal_password: - description: 'Toggles password protection of the client portal' - type: boolean - example: false - enable_email_markup: - description: 'Toggles the use of markdown in emails' - type: boolean - example: false - enable_client_portal_dashboard: - description: 'Toggles whether the client dashboard is shown in the client portal' - type: boolean - example: false - enable_client_portal: - description: 'Toggles whether the entire client portal is displayed to the client, or only the context' - type: boolean - example: false - email_template_statement: - description: 'The body of the email for statements' - type: string - example: 'template matter' - email_subject_statement: - description: 'The subject of the email for statements' - type: string - example: 'subject matter' - signature_on_pdf: - description: 'Toggles whether the signature (if available) is displayed on the PDF' - type: boolean - example: false - quote_footer: - description: 'The default quote footer' - type: string - example: 'the quote footer' - email_subject_custom1: - description: 'Custom reminder template subject' - type: string - example: 'Custom Subject 1' - email_subject_custom2: - description: 'Custom reminder template subject' - type: string - example: 'Custom Subject 2' - email_subject_custom3: - description: 'Custom reminder template subject' - type: string - example: 'Custom Subject 3' - email_template_custom1: - description: 'Custom reminder template body' - type: string - example: '' - email_template_custom2: - description: 'Custom reminder template body' - type: string - example: '' - email_template_custom3: - description: 'Custom reminder template body' - type: string - example: '' - enable_reminder1: - description: 'Toggles whether this reminder is enabled' - type: boolean - example: false - enable_reminder2: - description: 'Toggles whether this reminder is enabled' - type: boolean - example: false - enable_reminder3: - description: 'Toggles whether this reminder is enabled' - type: boolean - example: false - num_days_reminder1: - description: 'The Reminder interval' - type: number - example: '9' - num_days_reminder2: - description: 'The Reminder interval' - type: number - example: '9' - num_days_reminder3: - description: 'The Reminder interval' - type: number - example: '9' - schedule_reminder1: - description: '(enum: after_invoice_date, before_due_date, after_due_date)' - type: string - example: after_invoice_date - schedule_reminder2: - description: '(enum: after_invoice_date, before_due_date, after_due_date)' - type: string - example: after_invoice_date - schedule_reminder3: - description: '(enum: after_invoice_date, before_due_date, after_due_date)' - type: string - example: after_invoice_date - late_fee_amount1: - description: 'The late fee amount for reminder 1' - type: number - example: 10 - late_fee_amount2: - description: 'The late fee amount for reminder 2' - type: number - example: 20 - late_fee_amount3: - description: 'The late fee amount for reminder 2' - type: number - example: 100 - endless_reminder_frequency_id: - description: 'The frequency id of the endless reminder' - type: string - example: '1' - client_online_payment_notification: - description: 'Determines if a client should receive the notification for a online payment' - type: boolean - example: false - client_manual_payment_notification: - description: 'Determines if a client should receive the notification for a manually entered payment' - type: boolean - example: false - enable_e_invoice: - description: 'Determines if e-invoicing is enabled' - type: boolean - example: false - default_expense_payment_type_id: - description: 'The default payment type for expenses' - type: string - example: '0' - e_invoice_type: - description: 'The e-invoice type' - type: string - example: 'EN16931' - mailgun_endpoint: - description: 'The mailgun endpoint - used to determine whether US or EU endpoints are used' - type: string - example: 'api.mailgun.net or api.eu.mailgun.net' - client_initiated_payments: - description: 'Determines if clients can initiate payments directly from the client portal' - type: boolean - example: false - client_initiated_payments_minimum: - description: 'The minimum amount a client can pay' - type: number - example: 10 - sync_invoice_quote_columns: - description: 'Determines if invoice and quote columns are synced for the PDF rendering, or if they use their own columns' - type: boolean - example: false - show_task_item_description: - description: 'Determines if the task item description is shown on the invoice' - type: boolean - example: false - allow_billable_task_items: - description: 'Determines if task items can be marked as billable' - type: boolean - example: false - accept_client_input_quote_approval: - description: 'Determines if clients can approve quotes and also pass through a PO Number reference' - type: boolean - example: false - custom_sending_email: - description: 'When using Mailgun or Postmark, the FROM email address can be customized using this setting.' - type: string - example: 'bob@gmail.com' - show_paid_stamp: - description: 'Determines if the PAID stamp is shown on the invoice' - type: boolean - example: false - show_shipping_address: - description: 'Determines if the shipping address is shown on the invoice' - type: boolean - example: false - company_logo_size: - description: 'The size of the company logo on the PDF - percentage value between 0 and 100' - type: number - example: 100 - show_email_footer: - description: 'Determines if the email footer is shown on emails' - type: boolean - example: false - email_alignment: - description: 'The alignment of the email body text, options include left / center / right' - type: string - example: 'left' - auto_bill_standard_invoices: - description: 'Determines if standard invoices are automatically billed when they are created or due' - type: boolean - example: false - postmark_secret: - description: 'The Postmark secret API key' - type: string - example: '123456' - mailgun_secret: - description: 'The Mailgun secret API key' - type: string - example: '123456' - mailgun_domain: - description: 'The Mailgun domain' - type: string - example: 'sandbox123456.mailgun.org' - send_email_on_mark_paid: - description: 'Determines if an email is sent when an invoice is marked as paid' - type: boolean - example: false - vendor_portal_enable_uploads: - description: 'Determines if vendors can upload files to the portal' - type: boolean - example: false - besr_id: - description: 'The BESR ID' - type: string - example: '123456' - qr_iban: - description: 'The IBAN for the QR code' - type: string - example: 'CH123456' - email_subject_purchase_order: - description: 'The email subject for purchase orders' - type: string - example: 'Purchase Order' - email_template_purchase_order: - description: 'The email template for purchase orders' - type: string - example: 'Please see attached your purchase order.' - require_purchase_order_signature: - description: 'Determines if a signature is required on purchase orders' - type: boolean - example: false - purchase_order_public_notes: - description: 'The public notes for purchase orders' - type: string - example: 'Please see attached your purchase order.' - purchase_order_terms: - description: 'The terms for purchase orders' - type: string - example: 'Please see attached your purchase order.' - purchase_order_footer: - description: 'The footer for purchase orders' - type: string - example: 'Please see attached your purchase order.' - purchase_order_design_id: - description: 'The design id for purchase orders' - type: string - example: 'hd677df' - purchase_order_number_pattern: - description: 'The pattern for purchase order numbers' - type: string - example: 'PO-000000' - purchase_order_number_counter: - description: 'The counter for purchase order numbers' - type: number - example: 1 - page_numbering_alignment: - description: 'The alignment for page numbering: options include left / center / right' - type: string - example: 'left' - page_numbering: - description: 'Determines if page numbering is enabled on Document PDFs' - type: boolean - example: false - auto_archive_invoice_cancelled: - description: 'Determines if invoices are automatically archived when they are cancelled' - type: boolean - example: false - email_from_name: - description: 'The FROM name for emails when using Custom emailers' - type: string - example: 'Bob Smith' - show_all_tasks_client_portal: - description: 'Determines if all tasks are shown on the client portal' - type: boolean - example: false - entity_send_time: - description: 'The time that emails are sent. The time is localized to the clients locale, integer values from 1 - 24' - type: integer - example: 9 - shared_invoice_credit_counter: - description: 'Determines if the invoice and credit counter are shared' - type: boolean - example: false - reply_to_name: - description: 'The reply to name for emails' - type: string - example: 'Bob Smith' - hide_empty_columns_on_pdf: - description: 'Determines if empty columns are hidden on PDFs' - type: boolean - example: false - enable_reminder_endless: - description: 'Determines if endless reminders are enabled' - type: boolean - example: false - use_credits_payment: - description: 'Determines if credits can be used as a payment method' - type: boolean - example: false - recurring_invoice_number_pattern: - description: 'The pattern for recurring invoice numbers' - type: string - example: 'R-000000' - recurring_invoice_number_counter: - description: 'The counter for recurring invoice numbers' - type: number - example: 1 - client_portal_under_payment_minimum: - description: 'The minimum payment payment' - type: number - example: 10 - auto_bill_date: - description: 'Determines when the invoices are auto billed, options are on_send_date (when the invoice is sent) or on_due_date (when the invoice is due))' - type: string - example: 'on_send_date' - primary_color: - description: 'The primary color for the client portal / document highlights' - type: string - example: '#ffffff' - secondary_color: - description: 'The secondary color for the client portal / document highlights' - type: string - example: '#ffffff' - client_portal_allow_under_payment: - description: 'Determines if clients can pay invoices under the invoice amount due' - type: boolean - example: false - client_portal_allow_over_payment: - description: 'Determines if clients can pay invoices over the invoice amount' - type: boolean - example: false - auto_bill: - description: 'Determines how autobilling is applied for recurring invoices. off (no auto billed), always (always auto bill), optin (The user must opt in to auto billing), optout (The user must opt out of auto billing' - type: string - example: 'off' - client_portal_terms: - description: 'The terms which are displayed on the client portal' - type: string - example: 'Please see attached your invoice.' - client_portal_privacy_policy: - description: 'The privacy policy which is displayed on the client portal' - type: string - example: 'These are the terms of use for using the client portal.' - client_can_register: - description: 'Determines if clients can register on the client portal' - type: boolean - example: false - portal_design_id: - description: 'The design id for the client portal' - type: string - example: 'hd677df' - late_fee_endless_percent: - description: 'The late fee percentage for endless late fees' - type: number - example: 10 - late_fee_endless_amount: - description: 'The late fee amount for endless late fees' - type: number - example: 10 - auto_email_invoice: - description: 'Determines if invoices are automatically emailed when they are created' - type: boolean - example: false - email_signature: - description: 'The email signature for emails' - type: string - example: 'Bob Smith' - type: object - RecurringExpense: - properties: - id: - description: 'The hashed id of the recurring expense' - type: string - example: Opnel5aKBz - user_id: - description: 'The hashed id of the user who created the recurring expense' - type: string - example: Opnel5aKBz - assigned_user_id: - description: 'The hashed id of the user assigned to this recurring expense' - type: string - example: Opnel5aKBz - company_id: - description: 'The hashed id of the company' - type: string - example: Opnel5aKBz - client_id: - description: 'The hashed id of the client' - type: string - example: Opnel5aKBz - invoice_id: - description: 'The hashed id of the invoice' - type: string - example: Opnel5aKBz - bank_id: - description: 'The id of the bank associated with this recurring expense' - type: string - example: '22' - invoice_currency_id: - description: 'The currency id of the invoice associated with this recurring expense' - type: string - example: '1' - expense_currency_id: - description: 'The currency id of the expense associated with this recurring expense' - type: string - example: '1' - invoice_category_id: - description: 'The category id of the invoice' - type: string - example: '1' - payment_type_id: - description: 'The payment type id' - type: string - example: '1' - private_notes: - description: 'The recurring expense private notes' - type: string - example: 'Private and confidential' - public_notes: - description: 'The recurring expense public notes' - type: string - example: 'This is the best client in the world' - transaction_reference: - description: 'The recurring expense transaction reference' - type: string - example: EXP-1223-2333 - transcation_id: - description: 'The transaction id of the recurring expense' - type: string - example: '1233312312' - custom_value1: - description: 'Custom value field' - type: string - example: $1000 - custom_value2: - description: 'Custom value field' - type: string - example: '2022-10-10' - custom_value3: - description: 'Custom value field' - type: string - example: 'short text' - custom_value4: - description: 'Custom value field' - type: string - example: 'very long text' - tax_name1: - description: 'The tax name' - type: string - example: GST - tax_name2: - description: 'The tax name' - type: string - example: VAT - tax_rate1: - description: 'The tax rate' - type: number - format: float - example: '10.00' - tax_rate2: - description: 'The tax rate' - type: number - format: float - example: '10.00' - tax_name3: - description: 'The tax name' - type: string - example: '' - tax_rate3: - description: 'The tax rate' - type: number - format: float - example: '10.00' - amount: - description: 'The total amount of the recurring expense' - type: number - format: float - example: '10.00' - frequency_id: - description: 'The frequency this recurring expense fires' - type: number - format: int - example: '1' - remaining_cycles: - description: 'The number of remaining cycles for this recurring expense' - type: number - format: int - example: '1' - foreign_amount: - description: 'The foreign currency amount of the recurring expense' - type: number - format: float - example: '10.00' - exchange_rate: - description: 'The exchange rate for the expernse' - type: number - format: float - example: '0.80' - date: - description: 'The date of the expense' - type: string - example: '' - payment_date: - description: 'The date the expense was paid' - type: string - example: '' - should_be_invoiced: - description: 'Boolean flag determining if the expense should be invoiced' - type: boolean - example: true - is_deleted: - description: 'Boolean flag determining if the recurring expense is deleted' - type: boolean - example: true - last_sent_date: - description: 'The Date it was sent last' - type: string - format: date - example: '1994-07-30' - next_send_date: - description: 'The next send date' - type: string - format: date - example: '1994-07-30' - invoice_documents: - description: 'Boolean flag determining if the documents associated with this expense should be passed onto the invoice if it is converted to an invoice' - type: boolean - example: true - updated_at: - description: Timestamp - type: number - format: integer - example: '1434342123' - archived_at: - description: Timestamp - type: number - format: integer - example: '1434342123' - type: object - Activity: - properties: - id: - description: 'The id field of the activity' - type: string - example: Opnel5aKBz - activity_type_id: - description: 'The activity type id' - type: string - example: Opnel5aKBz - client_id: - description: 'The client hashed id' - type: string - example: Opnel5aKBz - company_id: - description: 'The company hashed id' - type: string - example: Opnel5aKBz - user_id: - description: 'The user hashed id' - type: string - example: Opnel5aKBz - invoice_id: - description: 'The invoice hashed id' - type: string - example: Opnel5aKBz - payment_id: - description: 'The payment hashed id' - type: string - example: Opnel5aKBz - credit_id: - description: 'The credit hashed id' - type: string - example: Opnel5aKBz - updated_at: - description: 'Unixtimestamp the last time the record was updated' - type: integer - example: '343421434' - expense_id: - description: 'The expense hashed id' - type: string - example: Opnel5aKBz + example: AS3df3jUUH765fhfd9KJuidj3JShjA is_system: - description: 'Defines is the activity was performed by the system' + description: 'Determines whether the token is created by the system rather than a user' + type: boolean + example: 'true' + type: object + CompanyUser: + properties: + permissions: + description: 'The company user permissions' + type: string + example: '[create_invoice]' + settings: + description: 'Settings that are used for the frontend applications to store user preferences / metadata' + type: object + react_settings: + description: 'Dedicated settings object for the react web application' + type: object + is_owner: + description: 'Determines whether the user owns this company' type: boolean example: true - contact_id: - description: 'The contact hashed id' - type: string - example: Opnel5aKBz - task_id: - description: 'The task hashed id' - type: string - example: Opnel5aKBz - notes: - description: 'Activity Notes' - type: string - example: Opnel5aKBz - token_id: - description: 'The hashed ID of the token who performed the action' - type: string - example: Opnel5aKBz - ip: - description: 'The IP Address of the user who performed the action' - type: string - example: 192.168.1.252 + is_admin: + description: 'Determines whether the user is the admin of this company' + type: boolean + example: true + is_locked: + description: 'Determines whether the users access to this company has been locked' + type: boolean + example: true + updated_at: + description: 'The last time the record was modified, format Unix Timestamp' + type: integer + example: '1231232312321' + deleted_at: + description: 'Timestamp when the user was archived, format Unix Timestamp' + type: integer + example: '12312312321' + account: + $ref: '#/components/schemas/Account' + company: + $ref: '#/components/schemas/Company' user: $ref: '#/components/schemas/User' - client: - $ref: '#/components/schemas/Client' - contact: - $ref: '#/components/schemas/ClientContact' - recurring_invoice: - $ref: '#/components/schemas/RecurringInvoice' - invoice: - $ref: '#/components/schemas/Invoice' - credit: - $ref: '#/components/schemas/Credit' - quote: - $ref: '#/components/schemas/Quote' - payment: - $ref: '#/components/schemas/Payment' - expense: - $ref: '#/components/schemas/Expense' - task: - $ref: '#/components/schemas/Task' - purchase_order: - $ref: '#/components/schemas/PurchaseOrder' - vendor: - $ref: '#/components/schemas/Vendor' - vendor_contact: - $ref: '#/components/schemas/VendorContact' + token: + $ref: '#/components/schemas/CompanyToken' type: object - Expense: + InvoiceInvitationRequest: + required: + - client_contact_id properties: id: - description: 'The expense hashed id' + description: 'The entity invitation hashed id' type: string - example: 'Opnel5aKBz' - user_id: - description: 'The user hashed id' + example: Opnel5aKBz + readOnly: true + client_contact_id: + description: 'The client contact hashed id' type: string - example: 'Opnel5aKBz' - assigned_user_id: - description: 'The assigned user hashed id' + example: Opnel5aKBz + key: + description: 'The invitation key' type: string - example: 'Opnel5aKBz' - project_id: - description: 'The associated project_id' + example: Opnel5aKBz4343343566236gvbb + readOnly: true + link: + description: 'The invitation link' type: string - example: 'Opnel5aKBz' - company_id: - description: 'The company hashed id' + example: 'https://www.example.com/invitations/Opnel5aKBz4343343566236gvbb' + readOnly: true + sent_date: + description: 'The invitation sent date' type: string - example: 'Opnel5aKBz' - client_id: - description: 'The client hashed id' + format: date-time + readOnly: true + viewed_date: + description: 'The invitation viewed date' type: string - example: 'Opnel5aKBz' - invoice_id: - description: 'The related invoice hashed id' + format: date-time + readOnly: true + opened_date: + description: 'The invitation opened date' type: string - example: 'Opnel5aKBz' - bank_id: - description: 'The bank id related to this expense' - type: string - example: '' - invoice_currency_id: - description: 'The currency id of the related invoice' - type: string - example: '1' - currency_id: - description: 'The currency id of the expense' - type: string - example: '2' - invoice_category_id: - description: 'The invoice category id' - type: string - example: 'Opnel5aKBz' - payment_type_id: - description: 'The payment type id' - type: string - example: '' - recurring_expense_id: - description: 'The related recurring expense this expense was created from' - type: string - example: 'Opnel5aKBz' - private_notes: - description: 'The private notes of the expense' - type: string - example: '' - public_notes: - description: 'The public notes of the expense' - type: string - example: '' - transaction_reference: - description: 'The transaction references of the expense' - type: string - example: '' - transcation_id: - description: 'The transaction id of the expense' - type: string - example: '' - custom_value1: - description: 'A custom value' - type: string - example: '' - custom_value2: - description: 'A custom value' - type: string - example: '' - custom_value3: - description: 'A custom value' - type: string - example: '' - custom_value4: - description: 'A custom value' - type: string - example: '' - tax_amount: - description: 'The tax amount' - type: number - example: 10.00 - tax_name1: - description: 'Tax Name 1' - type: string - example: 'GST' - tax_name2: - description: 'Tax Name 2' - type: string - example: 'VAT' - tax_name3: - description: 'Tax Name 3' - type: string - example: 'IVA' - tax_rate1: - description: 'Tax rate 1' - type: number - format: float - example: '10.00' - tax_rate2: - description: 'Tax rate 2' - type: number - format: float - example: '10.00' - tax_rate3: - description: 'Tax rate 3' - type: number - format: float - example: '10.00' - amount: - description: 'The total expense amont' - type: number - format: float - example: '10.00' - foreign_amount: - description: 'The total foreign amount of the expense' - type: number - format: float - example: '10.00' - exchange_rate: - description: 'The exchange rate at the time of the expense' - type: number - format: float - example: '0.80' - date: - description: 'The expense date format Y-m-d' - type: string - example: '2022-12-01' - payment_date: - description: 'The date of payment for the expense, format Y-m-d' - type: string - example: '2022-12-01' - should_be_invoiced: - description: 'Flag whether the expense should be invoiced' - type: boolean - example: true - is_deleted: - description: 'Boolean determining whether the expense has been deleted' - type: boolean - example: true - invoice_documents: - description: 'Passing the expense documents over to the invoice' - type: boolean - example: true + format: date-time + readOnly: true updated_at: - description: Timestamp + description: 'Timestamp' type: number format: integer example: '1434342123' + readOnly: true archived_at: - description: Timestamp + description: 'Timestamp' type: number format: integer example: '1434342123' - type: object - Error: - properties: - message: - description: 'Something terrible went wrong' + readOnly: true + email_error: + description: 'The email error' type: string - example: 'Unexpected error' - code: - description: 'The HTTP error code, ie 5xx 4xx' - type: integer - example: '500' - type: object + example: 'The email error' + readOnly: true + email_status: + description: 'The email status' + type: string + readOnly: true + InvoiceInvitation: properties: id: @@ -21097,380 +21432,47 @@ components: type: string readOnly: true - - ProductBulkAction: - required: - - action - - ids - properties: - action: - type: string - example: archive - description: 'The action to perform ie. archive / restore / delete / set_tax_id' - ids: - type: array - items: - format: string - type: string - example: 2J234DFA,D2J234DFA,D2J234DFA - description: string array of client hashed ids - tax_id: - type: string - example: '1' - description: | - The tax rate id to set on the list of products - - The following constants are available (default = '1') - - ``` - PRODUCT_TYPE_PHYSICAL = '1' - PRODUCT_TYPE_SERVICE = '2' - PRODUCT_TYPE_DIGITAL = '3' - PRODUCT_TYPE_SHIPPING = '4' - PRODUCT_TYPE_EXEMPT = '5' - PRODUCT_TYPE_REDUCED_TAX = '6' - PRODUCT_TYPE_OVERRIDE_TAX = '7' - PRODUCT_TYPE_ZERO_RATED = '8' - PRODUCT_TYPE_REVERSE_TAX = '9' - ``` - type: object - User: + Design: properties: id: - description: 'The hashed id of the user' - type: string - example: Opnel5aKBz - readOnly: true - first_name: - description: 'The first name of the user' - type: string - example: Brad - last_name: - description: 'The last name of the user' - type: string - example: Pitt - email: - description: 'The users email address' - type: string - example: brad@pitt.com - phone: - description: 'The users phone number' - type: string - example: 555-1233-23232 - signature: - description: 'The users sign off signature' - type: string - example: 'Have a nice day!' - avatar: - description: 'The users avatar' - type: string - example: 'https://url.to.your/avatar.png' - accepted_terms_version: - description: 'The version of the invoice ninja terms that has been accepted by the user' - type: string - example: 1.0.1 - readOnly: true - oauth_user_id: - description: 'The provider id of the oauth entity' - type: string - example: jkhasdf789as6f675sdf768sdfs - readOnly: true - oauth_provider_id: - description: 'The oauth entity id' - type: string - example: google - readOnly: true - language_id: - description: 'The language id of the user' - type: string - example: 1 - verified_phone_number: - description: 'Boolean flag if the user has their phone verified. Required to settings up 2FA' - type: boolean - example: true - readOnly: true - sms_verification_code: - description: 'The sms verification code for the user. Required to settings up 2FA' - type: string - example: '123456' - readOnly: true - oauth_user_token_expiry: - description: 'The expiry date of the oauth token' - type: string - example: '2022-10-10' - readOnly: true - has_password: - description: 'Boolean flag determining if the user has a password' - type: boolean - example: true - readOnly: true - last_confirmed_email_address: - description: 'The last confirmed email address of the user' - type: string - example: 'bob@gmail.com' - readOnly: true - custom_value1: - description: 'A custom value' - type: string - example: 'Custom value 1' - custom_value2: - description: 'A custom value' - type: string - example: '$1000' - custom_value3: - description: 'A custom value' - type: string - example: 'Custom value 3' - custom_value4: - description: 'A custom value' - type: string - example: 'Custom value 4' - is_deleted: - description: 'Boolean flag determining if the user has been deleted' - type: boolean - example: true - readOnly: true - google_2fa_secret: - description: 'The google 2fa secret for the user' - type: string - example: '123456' - readOnly: true - company_user: - $ref: '#/components/schemas/CompanyUser' - type: object - Account: - properties: - id: - description: 'The account hashed id' + description: 'The design hashed id' type: string example: AS3df3A - account_sms_verified: - description: 'Boolean flag if the account has been verified by sms' + name: + description: 'The design name' type: string + example: Beauty + design: + description: 'The design HTML' + type: string + example: '' + is_custom: + description: 'Flag to determine if the design is a custom user design' + type: boolean example: true - type: object - Credit: - properties: - id: - description: "The unique hashed ID of the credit" - type: string - example: Opnel5aKBz - user_id: - description: "The unique hashed ID of the user associated with the credit" - type: string - example: 1a2b3c4d5e - assigned_user_id: - description: "The unique hashed ID of the assigned user responsible for the credit" - type: string - example: 6f7g8h9i0j - company_id: - description: "The unique hashed ID of the company associated with the credit" - type: string - example: k1l2m3n4o5 - client_id: - description: "The unique hashed ID of the client associated with the credit" - type: string - example: p1q2r3s4t5 - status_id: - description: "The ID representing the current status of the credit" - type: string - example: 3 - invoice_id: - description: "The unique hashed ID of the linked invoice to which the credit is applied" - type: string - example: u1v2w3x4y5 - number: - description: "The unique alphanumeric credit number per company" - type: string - example: QUOTE_101 - po_number: - description: "The purchase order number referred to by the credit" - type: string - example: PO_12345 - terms: - description: "The terms associated with the credit" - type: string - example: "Net 30" - public_notes: - description: "Public notes for the credit" - type: string - example: "Thank you for your business." - private_notes: - description: "Private notes for internal use, not visible to the client" - type: string - example: "Client is requesting a discount." - footer: - description: "The footer text for the credit" - type: string - example: "Footer text goes here." - custom_value1: - description: "Custom value 1 for additional credit information" - type: string - example: "Custom data 1" - custom_value2: - description: "Custom value 2 for additional credit information" - type: string - example: "Custom data 2" - custom_value3: - description: "Custom value 3 for additional credit information" - type: string - example: "Custom data 3" - custom_value4: - description: "Custom value 4 for additional credit information" - type: string - example: "Custom data 4" - tax_name1: - description: "The name of the first tax applied to the credit" - type: string - example: "VAT" - tax_name2: - description: "The name of the second tax applied to the credit" - type: string - example: "GST" - tax_rate1: - description: "The rate of the first tax applied to the credit" - type: number - format: float - example: 10.00 - tax_rate2: - description: "The rate of the second tax applied to the credit" - type: number - format: float - example: 5.00 - tax_name3: - description: "The name of the third tax applied to the credit" - type: string - example: "PST" - tax_rate3: - description: "The rate of the third tax applied to the credit" - type: number - format: float - example: 8.00 - total_taxes: - description: "The total amount of taxes for the credit" - type: number - format: float - example: 23.00 - line_items: - type: array - description: 'An array of objects which define the line items of the credit' - items: - $ref: '#/components/schemas/InvoiceItem' - amount: - description: "The total amount of the credit" - type: number - format: float - example: 100.00 - balance: - description: "The outstanding balance of the credit" - type: number - format: float - example: 50.00 - paid_to_date: - description: "The total amount paid to date for the credit" - type: number - format: float - example: 50.00 - discount: - description: "The discount applied to the credit" - type: number - format: float - example: 10.00 - partial: - description: "The partial amount applied to the credit" - type: number - format: float - example: 20.00 - is_amount_discount: - description: "Indicates whether the discount applied is a fixed amount or a percentage" + is_active: + description: 'Flag to determine if the design is available for use' type: boolean example: true is_deleted: - description: "Indicates whether the credit has been deleted" - type: boolean - example: false - uses_inclusive_taxes: - description: "Indicates whether the tax rates applied to the credit are inclusive or exclusive" + description: 'Flag to determine if the design is deleted' type: boolean example: true - date: - description: "The date the credit was issued" - type: string - format: date - example: "1994-07-30" - last_sent_date: - description: "The date the credit was last sent out" - type: string - format: date - example: "1994-07-30" - next_send_date: - description: "The next scheduled date for sending a credit reminder" - type: string - format: date - example: "1994-07-30" - partial_due_date: - description: "The due date for the partial amount of the credit" - type: string - format: date - example: "1994-07-30" - due_date: - description: "The due date for the total amount of the credit" - type: string - format: date - example: "1994-07-30" - settings: - $ref: "#/components/schemas/CompanySettings" - last_viewed: - description: "The timestamp of the last time the credit was viewed" + created_at: + description: Timestamp type: number format: integer - example: 1434342123 + example: '134341234234' updated_at: - description: "The timestamp of the last time the credit was updated" + description: Timestamp type: number format: integer - example: 1434342123 - archived_at: - description: "The timestamp of the last time the credit was archived" + example: '134341234234' + deleted_at: + description: Timestamp type: number format: integer - example: 1434342123 - custom_surcharge1: - description: "First custom surcharge amount" - type: number - format: float - example: 10.00 - custom_surcharge2: - description: 'Second Custom Surcharge' - type: number - format: float - example: '10.00' - custom_surcharge3: - description: 'Third Custom Surcharge' - type: number - format: float - example: '10.00' - custom_surcharge4: - description: 'Fourth Custom Surcharge' - type: number - format: float - example: '10.00' - custom_surcharge_tax1: - description: 'Toggles charging taxes on custom surcharge amounts' - type: boolean - example: true - custom_surcharge_tax2: - description: 'Toggles charging taxes on custom surcharge amounts' - type: boolean - example: true - custom_surcharge_tax3: - description: 'Toggles charging taxes on custom surcharge amounts' - type: boolean - example: true - custom_surcharge_tax4: - description: 'Toggles charging taxes on custom surcharge amounts' - type: boolean - example: true + example: '134341234234' type: object tags: - name: login @@ -21510,7 +21512,6 @@ tags: description: | Endpoint definitions for interacting with vendors. - name: Purchase Orders - summary: Purchase Orders description: | Endpoint definitions for interacting with purchase orders. - name: expenses diff --git a/openapi/components.yaml b/openapi/components.yaml index 6578264962..1472c39bed 100644 --- a/openapi/components.yaml +++ b/openapi/components.yaml @@ -12,7 +12,6 @@ components: description: 'The total number of requests in a given time window.' schema: type: integer - components: securitySchemes: ApiKeyAuth: type: apiKey diff --git a/openapi/components/examples.yaml b/openapi/components/examples.yaml index 626e4767c1..23213ab4f5 100644 --- a/openapi/components/examples.yaml +++ b/openapi/components/examples.yaml @@ -1,72 +1,75 @@ - examples: - Client: - - id: Opnel5aKBz - user_id: Ua6Rw4pVbS - assigned_user_id: Ua6Rw4pVbS - company_id: Co7Vn3yLmW - name: "Jim's Housekeeping" - website: https://www.jims-housekeeping.com - private_notes: Client prefers email communication over phone calls - client_hash: asdfkjhk342hjhbfdvmnfb1 - industry_id: 5 - size_id: 2 - address1: 123 Main St - address2: Apt 4B - city: Beverly Hills - state: California - postal_code: 90210 - phone: 555-3434-3434 - country_id: 1 - custom_value1: Email - custom_value2: John Doe - custom_value3: Yes - custom_value4: $50,000 - vat_number: VAT123456 - id_number: ID123456 - number: CL-0001 - shipping_address1: 5 Wallaby Way - shipping_address2: Suite 5 - shipping_city: Perth - shipping_state: Western Australia - shipping_postal_code: 6110 - shipping_country_id: 4 - is_deleted: false - balance: 500.00 - paid_to_date: 2000.00 - credit_balance: 100.00 - last_login: 1628686031 - created_at: 1617629031 - updated_at: 1628445631 - group_settings_id: Opnel5aKBz - routing_id: Opnel5aKBz3489-dfkiu-2239-sdsd - is_tax_exempt: false - has_valid_vat_number: false - payment_balance: 100 - contacts: - - id: Opnel5aKBz - first_name: John - last_name: Doe - email: jim@gmail.com - phone: 555-3434-3434 - send_invoice: true - custom_value1: Email - custom_value2: John Doe - custom_value3: Yes - custom_value4: $50,000 - is_primary: true - created_at: 1617629031 - updated_at: 1628445631 - deleted_at: 1628445631 - Meta: - value: - pagination: - total: 1 - count: 1 - per_page: 20 - current_page: 1 - total_pages: 1 - links: - - first: https://invoicing.co/api/v1/invoices?page=1 - - last: https://invoicing.co/api/v1/invoices?page=1 - - prev: null - - next: null \ No newline at end of file + #examples: + # Client: + # $ref: '#/components/schemas/Client' + + # Client: + # id: Opnel5aKBz + # user_id: Ua6Rw4pVbS + # assigned_user_id: Ua6Rw4pVbS + # company_id: Co7Vn3yLmW + # name: "Jim's Housekeeping" + # website: https://www.jims-housekeeping.com + # private_notes: Client prefers email communication over phone calls + # client_hash: asdfkjhk342hjhbfdvmnfb1 + # industry_id: 5 + # size_id: 2 + # address1: 123 Main St + # address2: Apt 4B + # city: Beverly Hills + # state: California + # postal_code: 90210 + # phone: 555-3434-3434 + # country_id: 1 + # custom_value1: Email + # custom_value2: John Doe + # custom_value3: Yes + # custom_value4: $50,000 + # vat_number: VAT123456 + # id_number: ID123456 + # number: CL-0001 + # shipping_address1: 5 Wallaby Way + # shipping_address2: Suite 5 + # shipping_city: Perth + # shipping_state: Western Australia + # shipping_postal_code: 6110 + # shipping_country_id: 4 + # is_deleted: false + # balance: 500.00 + # paid_to_date: 2000.00 + # credit_balance: 100.00 + # last_login: 1628686031 + # created_at: 1617629031 + # updated_at: 1628445631 + # group_settings_id: Opnel5aKBz + # routing_id: Opnel5aKBz3489-dfkiu-2239-sdsd + # is_tax_exempt: false + # has_valid_vat_number: false + # payment_balance: 100 + # contacts: + # id: Opnel5aKBz + # first_name: John + # last_name: Doe + # email: jim@gmail.com + # phone: 555-3434-3434 + # send_invoice: true + # custom_value1: Email + # custom_value2: John Doe + # custom_value3: Yes + # custom_value4: $50,000 + # is_primary: true + # created_at: 1617629031 + # updated_at: 1628445631 + # deleted_at: 1628445631 + # Meta: + # value: + # pagination: + # total: 1 + # count: 1 + # per_page: 20 + # current_page: 1 + # total_pages: 1 + # links: + # - first: https://invoicing.co/api/v1/invoices?page=1 + # - last: https://invoicing.co/api/v1/invoices?page=1 + # - prev: null + # - next: null \ No newline at end of file diff --git a/openapi/components/parameters.yaml b/openapi/components/parameters.yaml index b0cc208bd7..8da9f525df 100644 --- a/openapi/components/parameters.yaml +++ b/openapi/components/parameters.yaml @@ -139,7 +139,7 @@ description: The number of records to return for each request, default is 20 required: false schema: - type: int + type: integer example: 20 page_meta: name: page @@ -147,7 +147,7 @@ description: The page number to return for this request (when performing pagination), default is 1 required: false schema: - type: int + type: integer example: 1 include: name: include diff --git a/openapi/components/parameters/default_filters.yaml b/openapi/components/parameters/default_filters.yaml index a6a489a019..bd35f35ef7 100644 --- a/openapi/components/parameters/default_filters.yaml +++ b/openapi/components/parameters/default_filters.yaml @@ -45,7 +45,7 @@ Filters the entity list by entities that have been deleted. required: false schema: - type: booleans + type: boolean example: ?is_deleted=true vendor_id: name: vendor_id diff --git a/openapi/components/responses/400.yaml b/openapi/components/responses/400.yaml index 3b0c36da25..d88fce9e1f 100644 --- a/openapi/components/responses/400.yaml +++ b/openapi/components/responses/400.yaml @@ -3,4 +3,4 @@ content: application/json: schema: - $ref: '#components/schemas/InvalidInputError' \ No newline at end of file + $ref: '#/components/schemas/InvalidInputError' \ No newline at end of file diff --git a/openapi/components/responses/401.yaml b/openapi/components/responses/401.yaml index 6d28c573cd..5226132bb8 100644 --- a/openapi/components/responses/401.yaml +++ b/openapi/components/responses/401.yaml @@ -3,4 +3,4 @@ content: application/json: schema: - $ref: '#components/schemas/AuthenticationError' \ No newline at end of file + $ref: '#/components/schemas/AuthenticationError' \ No newline at end of file diff --git a/openapi/components/responses/403.yaml b/openapi/components/responses/403.yaml index 4006e9873b..dea1b01ae9 100644 --- a/openapi/components/responses/403.yaml +++ b/openapi/components/responses/403.yaml @@ -3,4 +3,4 @@ content: application/json: schema: - $ref: '#components/schemas/AuthorizationError' \ No newline at end of file + $ref: '#/components/schemas/AuthorizationError' \ No newline at end of file diff --git a/openapi/components/schemas/company.yaml b/openapi/components/schemas/company.yaml index d4d2d2099a..50f1c05a28 100644 --- a/openapi/components/schemas/company.yaml +++ b/openapi/components/schemas/company.yaml @@ -143,7 +143,7 @@ type: boolean example: true default_auto_bill: - type: enum + type: string example: 'always' description: | A flag determining whether to auto-bill clients by default diff --git a/openapi/components/schemas/company_user.yaml b/openapi/components/schemas/company_user.yaml index 5d67b726ad..b48d5e9c16 100644 --- a/openapi/components/schemas/company_user.yaml +++ b/openapi/components/schemas/company_user.yaml @@ -7,11 +7,9 @@ settings: description: 'Settings that are used for the frontend applications to store user preferences / metadata' type: object - example: 'json object' react_settings: description: 'Dedicated settings object for the react web application' - type: object' - example: 'json object' + type: object is_owner: description: 'Determines whether the user owns this company' type: boolean diff --git a/openapi/components/schemas/invoice_request.yaml b/openapi/components/schemas/invoice_request.yaml index 083d8e3c96..3998dfac64 100644 --- a/openapi/components/schemas/invoice_request.yaml +++ b/openapi/components/schemas/invoice_request.yaml @@ -101,7 +101,7 @@ type: number format: float example: '10.00' - readOnly: + readOnly: true line_items: type: array description: 'An array of objects which define the line items of the invoice' diff --git a/openapi/components/schemas/meta.yaml b/openapi/components/schemas/meta.yaml index 39d6abb991..66a559eeae 100644 --- a/openapi/components/schemas/meta.yaml +++ b/openapi/components/schemas/meta.yaml @@ -31,6 +31,6 @@ example: 1 readOnly: true links: - type: array + type: object description: 'The pagination links' readOnly: true \ No newline at end of file diff --git a/openapi/components/schemas/product_request.yaml b/openapi/components/schemas/product_request.yaml index c9d890263f..21c18f1d6f 100644 --- a/openapi/components/schemas/product_request.yaml +++ b/openapi/components/schemas/product_request.yaml @@ -10,99 +10,99 @@ type: string description: 'The hashed ID of the user assigned to this product.' example: pR0j3 - required: false + project_id: type: string description: 'The hashed ID of the project that this product is associated with.' example: pR0j3 - required: false + vendor_id: type: string description: 'The hashed ID of the vendor that this product is associated with.' example: pR0j3 - required: false + custom_value1: type: string description: 'Custom value field 1.' example: 'Custom value 1' - required: false + custom_value2: type: string description: 'Custom value field 2.' example: 'Custom value 2' - required: false + custom_value3: type: string description: 'Custom value field 3.' example: 'Custom value 3' - required: false + custom_value4: type: string description: 'Custom value field 4.' example: 'Custom value 4' - required: false + product_key: type: string description: 'The product key.' example: '1234' - required: false + notes: type: string description: 'Notes about the product.' example: 'These are some notes about the product.' - required: false + cost: type: number format: double description: 'The cost of the product.' example: 10.0 - required: false + price: type: number format: double description: 'The price of the product.' example: 20.0 - required: false + quantity: type: number format: double description: 'The quantity of the product.' example: 5.0 - required: false + default: 1 tax_name1: type: string description: 'The name of tax 1.' example: 'Tax 1' - required: false + tax_rate1: type: number format: double description: 'The rate of tax 1.' example: 10.0 - required: false + tax_name2: type: string description: 'The name of tax 2.' example: 'Tax 2' - required: false + tax_rate2: type: number format: double description: 'The rate of tax 2.' example: 5.0 - required: false + tax_name3: type: string description: 'The name of tax 3.' example: 'Tax 3' - required: false + tax_rate3: type: number format: double description: 'The rate of tax 3.' example: 0.0 - required: false + in_stock_quantity: type: integer format: int32 @@ -114,32 +114,32 @@ The query parameter ?update_in_stock_quantity=true **MUST** be passed if you wish to update this value manually. default: 0 - required: false + stock_notification: type: boolean description: Indicates whether stock notifications are enabled for this product default: true - required: false + stock_notification_threshold: type: integer format: int32 description: The minimum quantity threshold for which stock notifications will be triggered default: 0 - required: false + max_quantity: type: integer format: int32 description: The maximum quantity that can be ordered for this product - required: false + product_image: type: string description: The URL of the product image format: uri-reference - required: false + tax_id: type: string default: '1' - required: false + description: | The tax category id for this product.' diff --git a/openapi/misc/misc.yaml b/openapi/misc/misc.yaml index 163204ca13..6d7f3194ba 100644 --- a/openapi/misc/misc.yaml +++ b/openapi/misc/misc.yaml @@ -36,7 +36,6 @@ tags: description: | Endpoint definitions for interacting with vendors. - name: Purchase Orders - summary: Purchase Orders description: | Endpoint definitions for interacting with purchase orders. - name: expenses diff --git a/openapi/paths.yaml b/openapi/paths.yaml index d52ad7af00..21154dc1e9 100644 --- a/openapi/paths.yaml +++ b/openapi/paths.yaml @@ -2,8 +2,8 @@ paths: /api/v1/activities: get: tags: - - actvities - summary: "Returns a list of actvities" + - activities + summary: "Returns a list of activities" description: "Lists all activities related to this company" operationId: getActivities parameters: @@ -44,10 +44,10 @@ paths: $ref: "#/components/responses/422" default: $ref: "#/components/responses/default" - "/api/v1/actvities/download_entity/{activity_id}": + "/api/v1/activities/download_entity/{activity_id}": get: tags: - - actvities + - activities summary: "Returns a PDF for the given activity" description: "Returns a PDF for the given activity" operationId: getActivityHistoricalEntityPdf @@ -91,8 +91,6 @@ paths: summary: "Attempts authentication" description: "Returns a CompanyUser object on success" operationId: postLogin - security: - - [] parameters: - $ref: "#/components/parameters/X-API-SECRET" - $ref: "#/components/parameters/X-API-TOKEN" @@ -137,7 +135,7 @@ paths: 422: $ref: "#/components/responses/422" 5XX: - $ref: "#/components/responses/5XX" + description: 'Server error' default: $ref: "#/components/responses/default" /api/v1/refresh: @@ -149,7 +147,7 @@ paths: Refreshes the dataset. This endpoint can be used if you only need to access the most recent data from a certain point in time. - operationId: refresh + operationId: refresh parameters: - name: updated_at in: query diff --git a/openapi/paths/clients.yaml b/openapi/paths/clients.yaml index c9e79860d4..a511b005ef 100644 --- a/openapi/paths/clients.yaml +++ b/openapi/paths/clients.yaml @@ -125,12 +125,12 @@ items: $ref: '#/components/schemas/Client' example: - $ref: '#/components/examples/Client' + $ref: '#/components/schemas/Client' meta: type: object $ref: '#/components/schemas/Meta' example: - $ref: '#/components/examples/Meta' + $ref: '#/components/schemas/Meta' 401: $ref: '#/components/responses/401' 403: diff --git a/openapi/paths/invoices.yaml b/openapi/paths/invoices.yaml index 38a995e874..acd15c3da3 100644 --- a/openapi/paths/invoices.yaml +++ b/openapi/paths/invoices.yaml @@ -437,7 +437,6 @@ type: object properties: action: - required: true type: string description: | The action to be performed, options include: @@ -470,7 +469,6 @@ - `send_email` Emails an array of invoices. Requires additional properties to be sent. `email_type` ids: - required: true type: array items: description: "Array of hashed IDs to be bulk 'actioned - ['D2J234DFA','D2J234DFA','D2J234DFA']" diff --git a/resources/views/email/template/admin_premium.blade.php.enc b/resources/views/email/template/admin_premium.blade.php.enc new file mode 100644 index 0000000000..56fe343c6a --- /dev/null +++ b/res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mVHlGN1p1OE1MZlRQYmFwaStMdk9ZSVk2QzhMdlVVdnlnbkVJYTVJdFVGMU52T3Z5Q3Z3RStHMU1MM3AwcUdYVFgxT2ZFZEhKQlE5VTZra3BBRnhBNVl4UFV5QnNLN1RJUm5iOFlORFFWZjN3cUZPNkxZbDlmYSt5THU3RHBSZGI0c2gzSDRQbG01am92dW5jUkFHcWNaZnV6UnVIam9uVmY1NXVvcXl4N3U4NzZxUXhUZm00TlZsT0ZVUHNnTEtLNm9RR2dCM2tGWUdaSDVNelJMUTZtRE9mUHYrQS9ycGpYTUtqWXd5dVk1TEhKTkU4SVV4YlB0TGIvVk1aNWROOThGdFlLYm43N1pIOVFuYW1WNVdGYVBlVFphOW9uNE5jMStIbkx3bGtxTXdUNVB3ZkdDSVZpUlI4T3VxRkRldHFHY3pLaDhqbEVMVTNXRUs5eHBzVDVRZmlNSFRDbDkvekRTQVU0Q3plUURHRkxkdTU4Zm44aVIrM014UW5oMjc0ZzdjTnVCNUV4RG92Zkw2VmYwUTZxSWpwWFlwSEMzVmd1clh2Y0F6c1ExalZWNU5CTzFPK1RLaUpXQWJ6S3NVM3haQTNja2ZrNG5uVlJZcWpGRWxzdEU2SjkvZHJJODMzdVVtOHNLZ096QUdUQ0E9PSIsIm1hYyI6ImE2MGExZDgwZGE4YTAwNGMzYWI3NjM5NGZlYTE1NzlkNGVlZDkwZDhiZTA4Mzc0YTk5Y2M5MzVkMTk0MjdmOWQiLCJ0YWciOiIifQ== \ No newline at end of file diff --git a/resources/views/email/template/client_premium.blade.php.enc b/resources/views/email/template/client_premium.blade.php.enc new file mode 100644 index 0000000000..4de854848a --- /dev/null +++ b/resources/views/email/template/client_premium.blade.php.enc @@ -0,0 +1 @@ +eyJpdiI6ImgvQXJrQ0Q2L1F3STdEYWNmOVJqSUE9PSIsInZhbHVlIjoiNkFSMkJKOUNCeTFUczRnQzNKbEV1bS93RnYvWHVnanEwREF1YVJHSXhrM2dBRS84ZkhjZWZRTVNCR2Q5L2l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TjNITXpWVm5VaWtoUThuV0JZdnBDUHFvb3paUk9OQmNOenFpUitHVSsrdmc5czgwZUh1dDR5cjl6L1JYM1FtUUxMVXlaREdybG56eEI3NHBNSG15N29zTm5TVnkxM1d2c1c4dDAyMGNSQWtLZ2UvSTVGcU5aZFpiZ3hXRDNMY0Zza3lmYUdMT0ovc1pNVHhEMlVUb1d6Rk5yTlppc01TcmpJUWJDT3NHMW5xZEo2TndPOWtaVlhpN3VnUjZ2VjVXU0MrNWMyQWxEaW01ajBYZFpFL1VYbGV0a1liZGxJSDJrNVlpL1NTMituSktaNjUycVJCSlpsandnOHhiSFlUT2xBS2xNYWQ2Unk4L0prZkdKOWozNjZmNTNYRzFteFdTRGlsQ2hlR3V4cStrYWRjUk10UG5Xb0xzdnJVa2lHb2czb0tZWG5WME41c0xrSzVGWThEYXBvSUk5aWNEWXZsOGRmTUpVRWJPTEpnWk5NZFE0cWhIQWdQVWJOVlNjYTJWSGd2TDViVXNZRWc4NmpwdE5LRFlFRXdyWnNMSGxXVHZYRDNFejF4QjM1WUJYUEhKN2trbTNRS09hNUhEdXpYM2tJQy9GOGd3aVg3K3JFKzhqa1ZiUVQ0L0NLUVpxZ085SkNzc2xaKzgyRVNua25TSGpOZW9HVnlxMXpSbDNNd2V3NG56dTRla3VRNXlyQzdxbWtzVEl5SjBYNDZJOXBjME5RUEp4WTRoSE9BVkhCYmRYZmpsYWRmanA2c1Q3RDJEc2tYdlJ3PT0iLCJtYWMiOiI2OTA2NDkxNDRiNjljNDU1MjBlNTUzOTA5NTZlYTAzZWZjOGE2MDlmMTI5NDBhNGUzN2FiY2NlZWFjNGRkYWYxIiwidGFnIjoiIn0= \ No newline at end of file diff --git a/resources/views/portal/ninja2020/auth/login.blade.php b/resources/views/portal/ninja2020/auth/login.blade.php index 44fdaf5d39..81c8d48f25 100644 --- a/resources/views/portal/ninja2020/auth/login.blade.php +++ b/resources/views/portal/ninja2020/auth/login.blade.php @@ -21,7 +21,7 @@ @if($account && !$account->isPaid())
Invoice Ninja logo + class="border-b border-gray-100 h-18 pb-4" alt="Invoice Ninja logo" id="company_logo">
@elseif(isset($company) && !is_null($company))
diff --git a/resources/views/portal/ninja2020/components/html-viewer.blade.php b/resources/views/portal/ninja2020/components/html-viewer.blade.php index b91043c27c..18b2ea93cd 100644 --- a/resources/views/portal/ninja2020/components/html-viewer.blade.php +++ b/resources/views/portal/ninja2020/components/html-viewer.blade.php @@ -77,7 +77,7 @@ span {
- +

{!! $product['notes'] !!}

@if($show_quantity) @@ -170,7 +170,7 @@ span {

- {!! html_entity_decode($entity->public_notes) !!} + {!! html_entity_decode(e($entity->public_notes)) !!}
diff --git a/resources/views/portal/ninja2020/components/livewire/billing-portal-purchase.blade.php b/resources/views/portal/ninja2020/components/livewire/billing-portal-purchase.blade.php index 704a98323f..abd3117491 100644 --- a/resources/views/portal/ninja2020/components/livewire/billing-portal-purchase.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/billing-portal-purchase.blade.php @@ -138,6 +138,9 @@ + + + @if($steps['started_payment'] == false) @@ -174,7 +177,45 @@ {{ ctrans('texts.trial_call_to_action') }} + @elseif($steps['check_rff']) + @if($errors->any()) +
+ @foreach($errors->all() as $error) +

{{ $error }}

+ @endforeach +
+ @endif +
+ @csrf + + @if(strlen($contact->first_name) === 0) +
+ + +
+ @endif + + @if(strlen($contact->last_name) === 0) + + @endif + + @if(strlen($contact->email) === 0) + + @endif + + +
@else
@csrf diff --git a/resources/views/portal/ninja2020/components/livewire/subscription-plan-switch.blade.php b/resources/views/portal/ninja2020/components/livewire/subscription-plan-switch.blade.php index c1be68fc70..91520780ad 100644 --- a/resources/views/portal/ninja2020/components/livewire/subscription-plan-switch.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/subscription-plan-switch.blade.php @@ -1,9 +1,47 @@
- + @if($errors->any()) +
+ @foreach($errors->all() as $error) +

{{ $error }}

+ @endforeach +
+ @endif + + @if($state['show_rff']) +
+ @if(strlen(auth()->guard('contact')->user()->first_name) === 0) +
+ + +
+ @endif - @if($amount > 0) + @if(strlen(auth()->guard('contact')->user()->last_name) === 0) +
+ + +
+ @endif + + @if(strlen(auth()->guard('contact')->user()->email) === 0) +
+ + +
+ @endif + +
+ +
+
+ @endif + + + @if($amount > 0 && $state['show_rff'] == false)
@@ -33,6 +71,9 @@ + + + @@ -62,7 +103,7 @@ @endif
- @elseif($amount <= 0) + @elseif($amount <= 0 && $state['show_rff'] == false)

diff --git a/resources/views/portal/ninja2020/layout/clean.blade.php b/resources/views/portal/ninja2020/layout/clean.blade.php index fb4f165134..20ec023016 100644 --- a/resources/views/portal/ninja2020/layout/clean.blade.php +++ b/resources/views/portal/ninja2020/layout/clean.blade.php @@ -98,6 +98,11 @@ @livewireStyles + @if((bool) \App\Utils\Ninja::isSelfHost() && isset($company)) + + @endif diff --git a/routes/api.php b/routes/api.php index 8903843abe..904885c591 100644 --- a/routes/api.php +++ b/routes/api.php @@ -168,6 +168,7 @@ Route::group(['middleware' => ['throttle:api', 'api_db', 'token_auth', 'locale'] Route::post('clients/{client}/updateTaxData', [ClientController::class, 'updateTaxData'])->name('clients.update_tax_data')->middleware('throttle:3,1'); Route::post('clients/{client}/{mergeable_client}/merge', [ClientController::class, 'merge'])->name('clients.merge')->middleware('password_protected'); Route::post('clients/bulk', [ClientController::class, 'bulk'])->name('clients.bulk'); + Route::post('clients/{client}/documents', [ClientController::class, 'documents'])->name('clients.documents'); Route::post('reactivate_email/{bounce_id}', [ClientController::class, 'reactivateEmail'])->name('clients.reactivate_email'); diff --git a/tests/Feature/ClientApiTest.php b/tests/Feature/ClientApiTest.php index 9cb18a2dc2..882fd3cdd4 100644 --- a/tests/Feature/ClientApiTest.php +++ b/tests/Feature/ClientApiTest.php @@ -59,6 +59,148 @@ class ClientApiTest extends TestCase Model::reguard(); } + public function testClientDocumentQuery() + { + + $d = \App\Models\Document::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + ]); + + $this->invoice->documents()->save($d); + + $response = $this->withHeaders([ + 'X-API-TOKEN' => $this->token, + ])->postJson("/api/v1/clients/{$this->client->hashed_id}/documents") + ->assertStatus(200); + + $arr = $response->json(); + + $this->assertCount(1, $arr['data']); + + $d = \App\Models\Document::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + ]); + + $this->client->documents()->save($d); + + $response = $this->withHeaders([ + 'X-API-TOKEN' => $this->token, + ])->postJson("/api/v1/clients/{$this->client->hashed_id}/documents") + ->assertStatus(200); + + $arr = $response->json(); + + $this->assertCount(2, $arr['data']); + + + $d = \App\Models\Document::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + ]); + + $this->client->documents()->save($d); + + $response = $this->withHeaders([ + 'X-API-TOKEN' => $this->token, + ])->postJson("/api/v1/clients/{$this->client->hashed_id}/documents") + ->assertStatus(200); + + $arr = $response->json(); + + $this->assertCount(3, $arr['data']); + + $d = \App\Models\Document::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + ]); + + $this->quote->documents()->save($d); + + $response = $this->withHeaders([ + 'X-API-TOKEN' => $this->token, + ])->postJson("/api/v1/clients/{$this->client->hashed_id}/documents") + ->assertStatus(200); + + $arr = $response->json(); + + $this->assertCount(4, $arr['data']); + + + + $d = \App\Models\Document::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + ]); + + $this->credit->documents()->save($d); + + $response = $this->withHeaders([ + 'X-API-TOKEN' => $this->token, + ])->postJson("/api/v1/clients/{$this->client->hashed_id}/documents") + ->assertStatus(200); + + $arr = $response->json(); + + $this->assertCount(5, $arr['data']); + + + + $d = \App\Models\Document::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + ]); + + + $e = \App\Models\Expense::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'client_id' => $this->client->id, + 'amount' => 100 + ]); + + + $e->documents()->save($d); + + $response = $this->withHeaders([ + 'X-API-TOKEN' => $this->token, + ])->postJson("/api/v1/clients/{$this->client->hashed_id}/documents") + ->assertStatus(200); + + $arr = $response->json(); + + $this->assertCount(6, $arr['data']); + + +$d = \App\Models\Document::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, +]); + + +$t = \App\Models\Task::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'client_id' => $this->client->id, +]); + + +$t->documents()->save($d); + +$response = $this->withHeaders([ + 'X-API-TOKEN' => $this->token, +])->postJson("/api/v1/clients/{$this->client->hashed_id}/documents") +->assertStatus(200); + +$arr = $response->json(); + +$this->assertCount(7, $arr['data']); + + + + + } public function testCrossCompanyBulkActionsFail() { diff --git a/tests/Feature/PaymentLink/PaymentLinkTest.php b/tests/Feature/PaymentLink/PaymentLinkTest.php new file mode 100644 index 0000000000..9695b0d57e --- /dev/null +++ b/tests/Feature/PaymentLink/PaymentLinkTest.php @@ -0,0 +1,228 @@ +makeTestData(); + } + + public function testCalcUpgradePrice() + { + $subscription = Subscription::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'price' => 10, + ]); + + $target = Subscription::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'price' => 20, + ]); + + $recurring_invoice = RecurringInvoice::factory()->create([ + 'line_items' => $this->buildLineItems(), + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'client_id' => $this->client->id, + 'tax_rate1' => 0, + 'tax_name1' => '', + 'tax_rate2' => 0, + 'tax_name2' => '', + 'tax_rate3' => 0, + 'tax_name3' => '', + 'discount' => 0, + 'subscription_id' => $subscription->id, + 'date' => now()->subWeeks(2), + 'next_send_date_client' => now(), + ]); + + + $invoice = Invoice::factory()->create([ + 'line_items' => $this->buildLineItems(), + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'client_id' => $this->client->id, + 'tax_rate1' => 0, + 'tax_name1' => '', + 'tax_rate2' => 0, + 'tax_name2' => '', + 'tax_rate3' => 0, + 'tax_name3' => '', + 'discount' => 0, + 'subscription_id' => $subscription->id, + 'date' => now()->subWeeks(2), + 'recurring_id' => $recurring_invoice->id, + ]); + + $recurring_invoice = $recurring_invoice->calc()->getInvoice(); + $invoice = $invoice->calc()->getInvoice(); + $this->assertEquals(10, $invoice->amount); + $invoice->service()->markSent()->save(); + $this->assertEquals(10, $invoice->amount); + $this->assertEquals(10, $invoice->balance); + $invoice = $invoice->service()->markPaid()->save(); + $this->assertEquals(0, $invoice->balance); + $this->assertEquals(10, $invoice->paid_to_date); + + $status = $recurring_invoice + ->subscription + ->status($recurring_invoice); + + $this->assertFalse($status->is_trial); + $this->assertFalse($status->is_refundable); + $this->assertTrue($status->is_in_good_standing); + + $days = $recurring_invoice->subscription->service()->getDaysInFrequency(); + + $ratio = 1 - (14 / $days); + + $this->assertEquals($ratio, $status->getProRataRatio()); + + $price = $target->link_service()->calculateUpgradePriceV2($recurring_invoice, $target); + + $refund = round($invoice->paid_to_date*$ratio,2); + + $this->assertEquals(($target->price - $refund), $price); + + } + + // public function testProrataDiscountRatioPercentage() + // { + // $subscription = Subscription::factory()->create([ + // 'company_id' => $this->company->id, + // 'user_id' => $this->user->id, + // 'price' => 100, + // ]); + + // $item = InvoiceItemFactory::create(); + // $item->quantity = 1; + + // $item->cost = 100; + // $item->product_key = 'xyz'; + // $item->notes = 'test'; + // $item->custom_value1 = 'x'; + // $item->custom_value2 = 'x'; + // $item->custom_value3 = 'x'; + // $item->custom_value4 = 'x'; + + // $line_items[] = $item; + + // $invoice = Invoice::factory()->create([ + // 'line_items' => $line_items, + // 'company_id' => $this->company->id, + // 'user_id' => $this->user->id, + // 'client_id' => $this->client->id, + // 'tax_rate1' => 0, + // 'tax_name1' => '', + // 'tax_rate2' => 0, + // 'tax_name2' => '', + // 'tax_rate3' => 0, + // 'tax_name3' => '', + // 'discount' => 0, + // 'subscription_id' => $subscription->id, + // 'date' => '2021-01-01', + // 'discount' => 10, + // 'is_amount_discount' => false, + // 'status_id' => 1, + // ]); + + // $invoice = $invoice->calc()->getInvoice(); + // $this->assertEquals(90, $invoice->amount); + // $this->assertEquals(0, $invoice->balance); + + // $invoice->service()->markSent()->save(); + + // $this->assertEquals(90, $invoice->amount); + // $this->assertEquals(90, $invoice->balance); + + + // $ratio = $subscription->service()->calculateDiscountRatio($invoice); + + // $this->assertEquals(.1, $ratio); + // } + + // public function testProrataDiscountRatioAmount() + // { + // $subscription = Subscription::factory()->create([ + // 'company_id' => $this->company->id, + // 'user_id' => $this->user->id, + // 'price' => 100, + // ]); + + // $item = InvoiceItemFactory::create(); + // $item->quantity = 1; + + // $item->cost = 100; + // $item->product_key = 'xyz'; + // $item->notes = 'test'; + // $item->custom_value1 = 'x'; + // $item->custom_value2 = 'x'; + // $item->custom_value3 = 'x'; + // $item->custom_value4 = 'x'; + + // $line_items[] = $item; + + // $invoice = Invoice::factory()->create([ + // 'line_items' => $line_items, + // 'company_id' => $this->company->id, + // 'user_id' => $this->user->id, + // 'client_id' => $this->client->id, + // 'tax_rate1' => 0, + // 'tax_name1' => '', + // 'tax_rate2' => 0, + // 'tax_name2' => '', + // 'tax_rate3' => 0, + // 'tax_name3' => '', + // 'discount' => 0, + // 'subscription_id' => $subscription->id, + // 'date' => '2021-01-01', + // 'discount' => 20, + // 'is_amount_discount' => true, + // 'status_id' => 1, + // ]); + + // $invoice = $invoice->calc()->getInvoice(); + // $this->assertEquals(80, $invoice->amount); + // $this->assertEquals(0, $invoice->balance); + + // $invoice->service()->markSent()->save(); + + // $this->assertEquals(80, $invoice->amount); + // $this->assertEquals(80, $invoice->balance); + + + // $ratio = $subscription->service()->calculateDiscountRatio($invoice); + + // $this->assertEquals(.2, $ratio); + // } +}