1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 15:13:29 +01:00
invoiceninja/routes/api.php

265 lines
17 KiB
PHP
Raw Normal View History

2018-10-04 19:10:43 +02:00
<?php
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
2019-03-27 05:50:13 +01:00
use Illuminate\Support\Facades\Route;
Route::group(['middleware' => ['throttle:300,1', 'api_secret_check']], function () {
Route::post('api/v1/signup', 'AccountController@store')->name('signup.submit');
Route::post('api/v1/oauth_login', 'Auth\LoginController@oauthApiLogin');
});
2019-03-27 05:50:13 +01:00
2022-01-21 04:58:58 +01:00
Route::group(['middleware' => ['throttle:10,1','api_secret_check','email_db']], function () {
2022-05-11 14:38:19 +02:00
Route::post('api/v1/login', 'Auth\LoginController@apiLogin')->name('login.submit')->middleware('throttle:20,1');;
2020-10-20 23:04:19 +02:00
Route::post('api/v1/reset_password', 'Auth\ForgotPasswordController@sendResetLinkEmail');
});
2019-03-27 05:50:13 +01:00
2022-05-11 14:38:19 +02:00
Route::group(['middleware' => ['throttle:100,1', 'api_db', 'token_auth', 'locale'], 'prefix' => 'api/v1', 'as' => 'api.'], function () {
Route::put('accounts/{account}', 'AccountController@update')->name('account.update');
2021-03-22 21:09:42 +01:00
Route::post('check_subdomain', 'SubdomainController@index')->name('check_subdomain');
2020-07-02 12:14:19 +02:00
Route::get('ping', 'PingController@index')->name('ping');
2020-07-30 02:30:49 +02:00
Route::get('health_check', 'PingController@health')->name('health_check');
2020-08-12 02:01:27 +02:00
Route::get('activities', 'ActivityController@index');
2020-08-12 02:41:26 +02:00
Route::get('activities/download_entity/{activity}', 'ActivityController@downloadHistoricalEntity');
2019-03-27 05:50:13 +01:00
2022-01-21 02:00:32 +01:00
Route::post('charts/totals', 'ChartController@totals')->name('chart.totals');
2022-01-21 07:04:01 +01:00
Route::post('charts/chart_summary', 'ChartController@chart_summary')->name('chart.chart_summary');
2022-01-21 02:00:32 +01:00
Route::post('claim_license', 'LicenseController@index')->name('license.index');
Route::resource('clients', 'ClientController'); // name = (clients. index / create / show / update / destroy / edit
2021-05-31 07:27:26 +02:00
Route::put('clients/{client}/adjust_ledger', 'ClientController@adjustLedger')->name('clients.adjust_ledger');
2021-02-15 11:52:50 +01:00
Route::put('clients/{client}/upload', 'ClientController@upload')->name('clients.upload');
Route::post('clients/{client}/purge', 'ClientController@purge')->name('clients.purge')->middleware('password_protected');
Route::post('clients/bulk', 'ClientController@bulk')->name('clients.bulk');
2019-03-27 05:50:13 +01:00
2021-11-20 01:34:43 +01:00
Route::post('filters/{entity}', 'FilterController@index')->name('filters');
2022-05-19 00:34:09 +02:00
Route::resource('client_gateway_tokens', 'ClientGatewayTokenController');
2021-02-21 22:27:00 +01:00
Route::post('connected_account', 'ConnectedAccountController@index');
2021-03-21 22:06:26 +01:00
Route::post('connected_account/gmail', 'ConnectedAccountController@handleGmailOauth');
2021-02-21 22:27:00 +01:00
2021-08-24 13:18:32 +02:00
Route::post('client_statement', 'ClientStatementController@statement')->name('client.statement');
2019-03-27 10:38:28 +01:00
Route::post('companies/purge/{company}', 'MigrationController@purgeCompany')->middleware('password_protected');
Route::post('companies/purge_save_settings/{company}', 'MigrationController@purgeCompanySaveSettings')->middleware('password_protected');
2022-05-19 00:34:09 +02:00
Route::resource('companies', 'CompanyController'); // name = (companies. index / create / show / update / destroy / edit
2022-05-19 00:34:09 +02:00
Route::put('companies/{company}/upload', 'CompanyController@upload');
Route::post('companies/{company}/default', 'CompanyController@default');
2020-11-04 02:27:07 +01:00
Route::get('company_ledger', 'CompanyLedgerController@index')->name('company_ledger.index');
2019-03-27 05:50:13 +01:00
Route::resource('company_gateways', 'CompanyGatewayController');
Route::post('company_gateways/bulk', 'CompanyGatewayController@bulk')->name('company_gateways.bulk');
Route::put('company_users/{user}', 'CompanyUserController@update');
Route::resource('credits', 'CreditController'); // name = (credits. index / create / show / update / destroy / edit
2021-02-15 12:00:02 +01:00
Route::put('credits/{credit}/upload', 'CreditController@upload')->name('credits.upload');
Route::get('credits/{credit}/{action}', 'CreditController@action')->name('credits.action');
Route::post('credits/bulk', 'CreditController@bulk')->name('credits.bulk');
2019-04-03 02:09:22 +02:00
Route::resource('designs', 'DesignController'); // name = (payments. index / create / show / update / destroy / edit
Route::post('designs/bulk', 'DesignController@bulk')->name('designs.bulk');
Route::post('designs/set/default', 'DesignController@default')->name('designs.default');
2019-05-05 02:49:01 +02:00
Route::resource('documents', 'DocumentController'); // name = (documents. index / create / show / update / destroy / edit
Route::get('documents/{document}/download', 'DocumentController@download')->name('documents.download');
Route::post('documents/bulk', 'DocumentController@bulk')->name('documents.bulk');
2021-02-25 22:06:43 +01:00
Route::post('emails', 'EmailController@send')->name('email.send')->middleware('user_verified');
Route::resource('expenses', 'ExpenseController'); // name = (expenses. index / create / show / update / destroy / edit
2021-03-08 15:17:40 +01:00
Route::put('expenses/{expense}/upload', 'ExpenseController@upload');
Route::post('expenses/bulk', 'ExpenseController@bulk')->name('expenses.bulk');
2021-05-13 08:01:12 +02:00
Route::post('export', 'ExportController@index')->name('export.index');
2020-10-13 06:08:56 +02:00
Route::resource('expense_categories', 'ExpenseCategoryController'); // name = (expense_categories. index / create / show / update / destroy / edit
Route::post('expense_categories/bulk', 'ExpenseCategoryController@bulk')->name('expense_categories.bulk');
Route::resource('group_settings', 'GroupSettingController');
Route::post('group_settings/bulk', 'GroupSettingController@bulk');
Route::put('group_settings/{group_setting}/upload', 'GroupSettingController@upload')->name('group_settings.upload');
Route::post('import', 'ImportController@import')->name('import.import');
2021-05-30 13:26:43 +02:00
Route::post('import_json', 'ImportJsonController@import')->name('import.import_json');
Route::post('preimport', 'ImportController@preimport')->name('import.preimport');
2020-06-23 13:05:41 +02:00
Route::resource('invoices', 'InvoiceController'); // name = (invoices. index / create / show / update / destroy / edit
Route::get('invoices/{invoice}/delivery_note', 'InvoiceController@deliveryNote')->name('invoices.delivery_note');
Route::get('invoices/{invoice}/{action}', 'InvoiceController@action')->name('invoices.action');
Route::put('invoices/{invoice}/upload', 'InvoiceController@upload')->name('invoices.upload');
Route::get('invoice/{invitation_key}/download', 'InvoiceController@downloadPdf')->name('invoices.downloadPdf');
Route::post('invoices/bulk', 'InvoiceController@bulk')->name('invoices.bulk');
2022-05-17 13:03:07 +02:00
Route::post('invoices/update_reminders', 'InvoiceController@update_reminders')->name('invoices.update_reminders');
Route::post('logout', 'LogoutController@index')->name('logout');
Route::post('migrate', 'MigrationController@index')->name('migrate.start');
Route::post('migration/purge/{company}', 'MigrationController@purgeCompany')->middleware('password_protected');
Route::post('migration/purge_save_settings/{company}', 'MigrationController@purgeCompanySaveSettings')->middleware('password_protected');
Route::post('migration/start', 'MigrationController@startMigration');
2021-03-02 08:52:25 +01:00
Route::post('one_time_token', 'OneTimeTokenController@create');
Route::resource('payments', 'PaymentController'); // name = (payments. index / create / show / update / destroy / edit
Route::post('payments/refund', 'PaymentController@refund')->name('payments.refund');
Route::post('payments/bulk', 'PaymentController@bulk')->name('payments.bulk');
2021-03-08 15:17:40 +01:00
Route::put('payments/{payment}/upload', 'PaymentController@upload');
Route::resource('payment_terms', 'PaymentTermController'); // name = (payments. index / create / show / update / destroy / edit
Route::post('payment_terms/bulk', 'PaymentTermController@bulk')->name('payment_terms.bulk');
Route::post('preview', 'PreviewController@show')->name('preview.show');
2021-07-25 11:52:32 +02:00
Route::post('live_preview', 'PreviewController@live')->name('preview.live');
2019-06-12 06:22:05 +02:00
2022-06-29 03:37:40 +02:00
Route::post('preview/purchase_order', 'PreviewPurchaseOrderController@show')->name('preview_purchase_order.show');
Route::post('live_preview/purchase_order', 'PreviewPurchaseOrderController@live')->name('preview_purchase_order.live');
Route::resource('products', 'ProductController'); // name = (products. index / create / show / update / destroy / edit
Route::post('products/bulk', 'ProductController@bulk')->name('products.bulk');
2021-03-08 15:17:40 +01:00
Route::put('products/{product}/upload', 'ProductController@upload');
Route::resource('projects', 'ProjectController'); // name = (projects. index / create / show / update / destroy / edit
Route::post('projects/bulk', 'ProjectController@bulk')->name('projects.bulk');
Route::put('projects/{project}/upload', 'ProjectController@upload')->name('projects.upload');
2021-03-08 15:17:40 +01:00
Route::resource('quotes', 'QuoteController'); // name = (quotes. index / create / show / update / destroy / edit
Route::get('quotes/{quote}/{action}', 'QuoteController@action')->name('quotes.action');
Route::post('quotes/bulk', 'QuoteController@bulk')->name('quotes.bulk');
2021-03-08 15:17:40 +01:00
Route::put('quotes/{quote}/upload', 'QuoteController@upload');
2020-08-11 05:21:43 +02:00
2021-08-24 03:23:53 +02:00
Route::resource('recurring_expenses', 'RecurringExpenseController');
2021-08-24 03:29:56 +02:00
Route::post('recurring_expenses/bulk', 'RecurringExpenseController@bulk')->name('recurring_expenses.bulk');
Route::put('recurring_expenses/{recurring_expense}/upload', 'RecurringExpenseController@upload');
Route::resource('recurring_invoices', 'RecurringInvoiceController'); // name = (recurring_invoices. index / create / show / update / destroy / edit
Route::post('recurring_invoices/bulk', 'RecurringInvoiceController@bulk')->name('recurring_invoices.bulk');
2021-03-08 15:17:40 +01:00
Route::put('recurring_invoices/{recurring_invoice}/upload', 'RecurringInvoiceController@upload');
Route::resource('recurring_quotes', 'RecurringQuoteController'); // name = (recurring_invoices. index / create / show / update / destroy / edit
Route::post('recurring_quotes/bulk', 'RecurringQuoteController@bulk')->name('recurring_quotes.bulk');
2021-08-24 07:05:35 +02:00
Route::put('recurring_quotes/{recurring_quote}/upload', 'RecurringQuoteController@upload');
2020-07-13 01:31:07 +02:00
2022-06-10 00:20:40 +02:00
Route::post('refresh', 'Auth\LoginController@refresh')->middleware('throttle:150,3');
2019-10-03 05:21:24 +02:00
2022-04-06 12:14:54 +02:00
Route::post('reports/clients', 'Reports\ClientReportController');
2022-04-27 07:17:45 +02:00
Route::post('reports/contacts', 'Reports\ClientContactReportController');
2022-04-27 07:41:52 +02:00
Route::post('reports/credits', 'Reports\CreditReportController');
Route::post('reports/documents', 'Reports\DocumentReportController');
Route::post('reports/expenses', 'Reports\ExpenseReportController');
2022-04-27 08:29:38 +02:00
Route::post('reports/invoices', 'Reports\InvoiceReportController');
Route::post('reports/invoice_items', 'Reports\InvoiceItemReportController');
2022-04-27 08:33:30 +02:00
Route::post('reports/quotes', 'Reports\QuoteReportController');
2022-04-28 06:02:59 +02:00
Route::post('reports/quote_items', 'Reports\QuoteItemReportController');
2022-04-27 09:21:55 +02:00
Route::post('reports/recurring_invoices', 'Reports\RecurringInvoiceReportController');
2022-04-27 10:05:54 +02:00
Route::post('reports/payments', 'Reports\PaymentReportController');
2022-04-28 05:09:17 +02:00
Route::post('reports/products', 'Reports\ProductReportController');
2022-04-29 00:47:19 +02:00
Route::post('reports/tasks', 'Reports\TaskReportController');
2022-05-13 10:53:38 +02:00
Route::post('reports/profitloss', 'Reports\ProfitAndLossController');
2022-04-06 12:14:54 +02:00
2022-05-19 00:34:09 +02:00
Route::resource('task_scheduler', 'TaskSchedulerController')->except('edit')->parameters(['task_scheduler' => 'scheduler']);
2022-05-30 20:43:59 +02:00
2022-05-19 00:34:09 +02:00
Route::get('scheduler', 'SchedulerController@index');
Route::post('support/messages/send', 'Support\Messages\SendingController');
Route::post('self-update', 'SelfUpdateController@update')->middleware('password_protected');
Route::post('self-update/check_version', 'SelfUpdateController@checkVersion');
2020-06-04 00:18:27 +02:00
Route::resource('system_logs', 'SystemLogController');
2019-10-05 00:58:51 +02:00
Route::resource('tasks', 'TaskController'); // name = (tasks. index / create / show / update / destroy / edit
Route::post('tasks/bulk', 'TaskController@bulk')->name('tasks.bulk');
2021-03-08 15:17:40 +01:00
Route::put('tasks/{task}/upload', 'TaskController@upload');
2021-04-17 00:30:19 +02:00
Route::post('tasks/sort', 'TaskController@sort');
Route::resource('task_statuses', 'TaskStatusController'); // name = (task_statuses. index / create / show / update / destroy / edit
Route::post('task_statuses/bulk', 'TaskStatusController@bulk')->name('task_statuses.bulk');
2020-10-12 22:42:02 +02:00
Route::resource('tax_rates', 'TaxRateController'); // name = (tax_rates. index / create / show / update / destroy / edit
2020-07-13 01:29:44 +02:00
Route::post('tax_rates/bulk', 'TaxRateController@bulk')->name('tax_rates.bulk');
Route::post('templates', 'TemplateController@show')->name('templates.show');
Route::resource('tokens', 'TokenController'); // name = (tokens. index / create / show / update / destroy / edit
Route::post('tokens/bulk', 'TokenController@bulk')->name('tokens.bulk');
2021-02-20 01:45:20 +01:00
Route::get('settings/enable_two_factor', 'TwoFactorController@setupTwoFactor');
Route::post('settings/enable_two_factor', 'TwoFactorController@enableTwoFactor');
2021-06-06 11:21:05 +02:00
Route::post('settings/disable_two_factor', 'TwoFactorController@disableTwoFactor');
2021-02-20 01:45:20 +01:00
Route::resource('vendors', 'VendorController'); // name = (vendors. index / create / show / update / destroy / edit
Route::post('vendors/bulk', 'VendorController@bulk')->name('vendors.bulk');
2021-03-08 15:17:40 +01:00
Route::put('vendors/{vendor}/upload', 'VendorController@upload');
2022-05-29 04:06:51 +02:00
Route::resource('purchase_orders', 'PurchaseOrderController');
2022-06-07 00:12:06 +02:00
Route::post('purchase_orders/bulk', 'PurchaseOrderController@bulk')->name('purchase_orders.bulk');
Route::get('purchase_orders/{purchase_order}/{action}', 'PurchaseOrderController@action')->name('purchase_orders.action');
2022-05-29 04:06:51 +02:00
Route::get('users', 'UserController@index');
2022-06-27 08:37:18 +02:00
Route::get('users/create', 'UserController@create')->middleware('password_protected');
2021-12-20 11:24:05 +01:00
Route::get('users/{user}', 'UserController@show')->middleware('password_protected');
Route::put('users/{user}', 'UserController@update')->middleware('password_protected');
Route::post('users', 'UserController@store')->middleware('password_protected');
//Route::post('users/{user}/attach_to_company', 'UserController@attach')->middleware('password_protected');
2021-03-03 11:04:10 +01:00
Route::delete('users/{user}/detach_from_company', 'UserController@detach')->middleware('password_protected');
Route::post('users/bulk', 'UserController@bulk')->name('users.bulk')->middleware('password_protected');
2021-03-03 23:39:24 +01:00
Route::post('/users/{user}/invite', 'UserController@invite')->middleware('password_protected');
2021-03-10 10:16:44 +01:00
Route::post('/user/{user}/reconfirm', 'UserController@reconfirm');
Route::resource('webhooks', 'WebhookController');
Route::post('webhooks/bulk', 'WebhookController@bulk')->name('webhooks.bulk');
/*Subscription and Webhook routes */
2020-07-28 13:30:11 +02:00
// Route::post('hooks', 'SubscriptionController@subscribe')->name('hooks.subscribe');
// Route::delete('hooks/{subscription_id}', 'SubscriptionController@unsubscribe')->name('hooks.unsubscribe');
2020-07-06 13:22:36 +02:00
2021-05-17 06:02:43 +02:00
Route::post('stripe/update_payment_methods', 'StripeController@update')->middleware('password_protected')->name('stripe.update');
Route::post('stripe/import_customers', 'StripeController@import')->middleware('password_protected')->name('stripe.import');
2021-05-17 06:02:43 +02:00
2021-08-15 07:13:20 +02:00
Route::post('stripe/verify', 'StripeController@verify')->middleware('password_protected')->name('stripe.verify');
2021-10-09 09:07:05 +02:00
Route::post('stripe/disconnect/{company_gateway_id}', 'StripeController@disconnect')->middleware('password_protected')->name('stripe.disconnect');
2021-08-15 07:13:20 +02:00
Route::resource('subscriptions', 'SubscriptionController');
2021-04-11 05:52:37 +02:00
Route::post('subscriptions/bulk', 'SubscriptionController@bulk')->name('subscriptions.bulk');
2021-09-16 05:38:16 +02:00
Route::get('statics', 'StaticController');
2022-02-01 03:55:11 +01:00
// Route::post('apple_pay/upload_file','ApplyPayController@upload');
2021-04-11 05:52:37 +02:00
});
2020-12-19 13:11:42 +01:00
Route::match(['get', 'post'], 'payment_webhook/{company_key}/{company_gateway_id}', 'PaymentWebhookController')
2022-01-21 04:58:58 +01:00
->middleware(['throttle:1000,1','guest'])
2020-12-19 13:11:42 +01:00
->name('payment_webhook');
2021-07-05 00:59:52 +02:00
Route::match(['get', 'post'], 'payment_notification_webhook/{company_key}/{company_gateway_id}/{client}', 'PaymentNotificationWebhookController')
2022-01-21 04:58:58 +01:00
->middleware(['throttle:1000,1', 'guest'])
2021-07-05 00:59:52 +02:00
->name('payment_notification_webhook');
2022-01-21 04:58:58 +01:00
Route::post('api/v1/postmark_webhook', 'PostMarkController@webhook')->middleware('throttle:1000,1');
Route::get('token_hash_router', 'OneTimeTokenController@router')->middleware('throttle:100,1');
2022-01-30 00:46:39 +01:00
Route::get('webcron', 'WebCronController@index')->middleware('throttle:100,1');
Route::post('api/v1/get_migration_account', 'HostedMigrationController@getAccount')->middleware('guest')->middleware('throttle:100,1');
Route::post('api/v1/confirm_forwarding', 'HostedMigrationController@confirmForwarding')->middleware('guest')->middleware('throttle:100,1');
Route::post('api/v1/process_webhook', 'InAppPurchase\AppleController@process_webhook')->middleware('throttle:1000,1');
Route::post('api/v1/confirm_purchase', 'InAppPurchase\AppleController@confirm_purchase')->middleware('throttle:1000,1');
Route::fallback('BaseController@notFound');