1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Merge pull request #10083 from turbo124/v5-develop

Update API docs
This commit is contained in:
David Bomba 2024-10-06 13:36:13 +11:00 committed by GitHub
commit bb8b7879ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 6786 additions and 6563 deletions

View File

@ -84,6 +84,7 @@ class CreateCompany
'724' => $company = $this->spanishSetup($company), '724' => $company = $this->spanishSetup($company),
'36' => $company = $this->australiaSetup($company), '36' => $company = $this->australiaSetup($company),
'710' => $company = $this->southAfticaSetup($company), '710' => $company = $this->southAfticaSetup($company),
'554' => $company = $this->newZealandSetup($company),
default => $company->save(), default => $company->save(),
}; };
@ -131,6 +132,22 @@ class CreateCompany
} }
private function newZealandSetup($company): Company
{
$company->enabled_tax_rates = 1;
$settings = $company->settings;
$settings->currency_id = '15';
$settings->timezone_id = '113';
$company->settings = $settings;
$company->save();
return $company;
}
private function spanishSetup(Company $company): Company private function spanishSetup(Company $company): Company
{ {
try { try {

View File

@ -120,6 +120,8 @@ use Laracasts\Presenter\PresentableTrait;
* @property bool $inbound_mailbox_allow_unknown * @property bool $inbound_mailbox_allow_unknown
* @property string|null $inbound_mailbox_whitelist * @property string|null $inbound_mailbox_whitelist
* @property string|null $inbound_mailbox_blacklist * @property string|null $inbound_mailbox_blacklist
* @property string|null $e_invoice_certificate_passphrase
* @property string|null $e_invoice_certificate
* @property int $deleted_at * @property int $deleted_at
* @property string|null $smtp_username * @property string|null $smtp_username
* @property string|null $smtp_password * @property string|null $smtp_password

View File

@ -121,6 +121,7 @@ class ExpenseRepository extends BaseRepository
$exchange_rate = new CurrencyApi(); $exchange_rate = new CurrencyApi();
$expense->exchange_rate = $exchange_rate->exchangeRate($expense_currency, $company_currency, Carbon::parse($expense->date)); $expense->exchange_rate = $exchange_rate->exchangeRate($expense_currency, $company_currency, Carbon::parse($expense->date));
$expense->invoice_currency_id = $company_currency;
return $expense; return $expense;
} }

View File

@ -56,6 +56,9 @@ class CompanyService
case '724': // Spain case '724': // Spain
$taxes[] = ['name' => 'IVA', 'rate' => 21]; $taxes[] = ['name' => 'IVA', 'rate' => 21];
break; break;
case '554': // New Zealand
$taxes[] = ['name' => 'GST', 'rate' => 15];
break;
default: default:
return; return;

View File

@ -19,7 +19,7 @@ class PDF extends FPDI
public function Footer() public function Footer()
{ {
$this->SetXY(0, -6); $this->SetXY(config('ninja.pdf_page_numbering_x_alignment'), config('ninja.pdf_page_numbering_y_alignment'));
$this->SetFont('Arial', 'I', 9); $this->SetFont('Arial', 'I', 9);

View File

@ -255,4 +255,7 @@ return [
'storecove_api_key' => env('STORECOVE_API_KEY', false), 'storecove_api_key' => env('STORECOVE_API_KEY', false),
'qvalia_api_key' => env('QVALIA_API_KEY', false), 'qvalia_api_key' => env('QVALIA_API_KEY', false),
'qvalia_partner_number' => env('QVALIA_PARTNER_NUMBER', false), 'qvalia_partner_number' => env('QVALIA_PARTNER_NUMBER', false),
'pdf_page_numbering_x_alignment' => env('PDF_PAGE_NUMBER_X', 0),
'pdf_page_numbering_y_alignment' => env('PDF_PAGE_NUMBER_Y', -6),
]; ];

View File

@ -2361,7 +2361,7 @@ Lorsque les montant apparaîtront sur votre relevé, veuillez revenir sur cette
'currency_gold_troy_ounce' => 'Once troy d\'or', 'currency_gold_troy_ounce' => 'Once troy d\'or',
'currency_nicaraguan_córdoba' => 'Cordoba nicaraguayen', 'currency_nicaraguan_córdoba' => 'Cordoba nicaraguayen',
'currency_malagasy_ariary' => 'Ariary malgache', 'currency_malagasy_ariary' => 'Ariary malgache',
"currency_tongan_paanga" => "Pa'anga tongien", "currency_tongan_pa_anga" => "Pa'anga tongien",
'review_app_help' => 'Nous espérons que votre utilisation de cette application vous est agréable.<br/>Un commentaire de votre part serait grandement apprécié!', 'review_app_help' => 'Nous espérons que votre utilisation de cette application vous est agréable.<br/>Un commentaire de votre part serait grandement apprécié!',
'writing_a_review' => 'rédiger un commentaire', 'writing_a_review' => 'rédiger un commentaire',
@ -5353,7 +5353,8 @@ Développe automatiquement la section des notes dans le tableau de produits pour
'inbound_mailbox_allow_unknown' => 'Autoriser tous les envois', 'inbound_mailbox_allow_unknown' => 'Autoriser tous les envois',
'inbound_mailbox_allow_unknown_help' => 'Autoriser n\'importe qui à envoyer un courriel de dépenses pour traitement.', 'inbound_mailbox_allow_unknown_help' => 'Autoriser n\'importe qui à envoyer un courriel de dépenses pour traitement.',
'quick_actions' => 'Actions rapides', 'quick_actions' => 'Actions rapides',
'end_all_sessions_help' => 'Déconnecte tous les utilisateurs et oblige tous les utilisateurs actifs à se réauthentifier.' 'end_all_sessions_help' => 'Déconnecte tous les utilisateurs et oblige tous les utilisateurs actifs à se réauthentifier.',
'updated_records' => 'Enregistrements mis à jour',
); );
return $lang; return $lang;

File diff suppressed because it is too large Load Diff

View File

@ -135,7 +135,6 @@
description: 'Flag which defines if the client has a valid VAT number' description: 'Flag which defines if the client has a valid VAT number'
type: boolean type: boolean
example: false example: false
readOnly: true
classification: classification:
description: 'The classification of the client' description: 'The classification of the client'
type: string type: string

View File

@ -361,6 +361,81 @@
type: boolean type: boolean
example: true example: true
expense_mailbox:
description: "The email address for the expense mailbox"
type: string
example: "expenses@company.com"
expense_mailbox_active:
description: "Whether the expense mailbox is active"
type: boolean
example: true
inbound_mailbox_allow_company_users:
description: "Whether company users are allowed to use the inbound mailbox"
type: boolean
example: true
inbound_mailbox_allow_vendors:
description: "Whether vendors are allowed to use the inbound mailbox"
type: boolean
example: false
inbound_mailbox_allow_clients:
description: "Whether clients are allowed to use the inbound mailbox"
type: boolean
example: true
inbound_mailbox_allow_unknown:
description: "Whether unknown senders are allowed to use the inbound mailbox"
type: boolean
example: false
inbound_mailbox_whitelist:
description: "Comma-separated list of whitelisted email addresses for the inbound mailbox"
type: string
example: "user1@example.com,user2@example.com"
inbound_mailbox_blacklist:
description: "Comma-separated list of blacklisted email addresses for the inbound mailbox"
type: string
example: "spam@example.com,unwanted@example.com"
smtp_host:
description: "The SMTP host for sending emails"
type: string
example: "smtp.gmail.com"
smtp_port:
description: "The SMTP port for sending emails"
type: integer
example: 587
smtp_encryption:
description: "The encryption method for SMTP"
type: string
enum: [tls, ssl, null]
example: "tls"
smtp_local_domain:
description: "The local domain for SMTP"
type: string
example: "company.com"
smtp_verify_peer:
description: "Whether to verify the SMTP peer"
type: boolean
example: true
e_invoice:
description: "E-invoice settings for the company"
type: object
additionalProperties: true
legal_entity_id:
description: "The ID of the legal entity associated with the company"
type: integer
example: 1234
settings: settings:
$ref: '#/components/schemas/CompanySettings' $ref: '#/components/schemas/CompanySettings'
type: object type: object

View File

@ -113,8 +113,9 @@
example: "Please approve quote" example: "Please approve quote"
lock_invoices: lock_invoices:
description: "Toggles whether invoices are locked once sent and cannot be modified further" description: "Toggles whether invoices are locked once sent and cannot be modified further"
type: boolean type: enum
example: true enum: [off, when_sent, when_paid, end_of_month]
example: 'off'
auto_archive_invoice: auto_archive_invoice:
description: "Toggles whether a invoice is archived immediately following payment" description: "Toggles whether a invoice is archived immediately following payment"
type: boolean type: boolean
@ -252,7 +253,7 @@
type: string type: string
example: "Quote Terms are..." example: "Quote Terms are..."
invoice_taxes: invoice_taxes:
description: "Taxes can be applied to the invoice" description: "The number of Taxes that can be applied to the invoice"
type: number type: number
example: "1" example: "1"
invoice_design_id: invoice_design_id:
@ -310,7 +311,8 @@
email_sending_method: email_sending_method:
description: "The email driver to use to send email, options include default, gmail, client_postmark, client_mailgun, client_brevo, office365" description: "The email driver to use to send email, options include default, gmail, client_postmark, client_mailgun, client_brevo, office365"
type: string type: string
example: default enum: [default, gmail, office365, client_postmark, client_mailgun, mailgun, client_brevo]
example: 'default'
gmail_sending_user_id: gmail_sending_user_id:
description: "The hashed_id of the user account to send email from" description: "The hashed_id of the user account to send email from"
type: string type: string
@ -839,4 +841,13 @@
description: "The classification for the company" description: "The classification for the company"
type: string type: string
example: "individual" example: "individual"
valid_until:
description: 'Default validity period for quotes'
type: string
credit_terms:
description: 'Default terms for credit notes'
type: string
credit_footer:
description: 'Default footer for credit notes'
type: string
type: object type: object

View File

@ -3,53 +3,46 @@ info:
title: 'Invoice Ninja API Reference.' title: 'Invoice Ninja API Reference.'
description: | description: |
--- ---
![Invoice Ninja](https://invoicing.co/images/new_logo.png)
## Introduction ## Introduction
Welcome to the Invoice Ninja API documentation, your comprehensive guide to integrating Invoice Ninja's powerful features into your applications. Whether you're building a custom client, automating workflows, or integrating with other systems, our API provides the tools you need to streamline your invoicing and billing processes. Welcome to the Invoice Ninja API documentation, your comprehensive guide to integrating Invoice Ninja's powerful features into your applications. Whether you're building a custom client, automating workflows, or integrating with other systems, our API provides the tools you need to streamline your invoicing and billing processes.
### What is Invoice Ninja?
## What is Invoice Ninja?
Invoice Ninja is a robust source-available platform designed to simplify invoicing, billing, and payment management for freelancers, small businesses, and enterprises alike. With a user-friendly interface, customizable templates, and a suite of powerful features, Invoice Ninja empowers businesses to create professional invoices, track expenses, manage clients, and get paid faster. Invoice Ninja is a robust source-available platform designed to simplify invoicing, billing, and payment management for freelancers, small businesses, and enterprises alike. With a user-friendly interface, customizable templates, and a suite of powerful features, Invoice Ninja empowers businesses to create professional invoices, track expenses, manage clients, and get paid faster.
### Why use the Invoice Ninja API?
## Why use the Invoice Ninja API?
The Invoice Ninja API allows developers to extend the functionality of Invoice Ninja by programmatically accessing and manipulating data within their Invoice Ninja accounts. With the API, you can automate repetitive tasks, integrate with third-party services, and build custom solutions tailored to your specific business needs. The Invoice Ninja API allows developers to extend the functionality of Invoice Ninja by programmatically accessing and manipulating data within their Invoice Ninja accounts. With the API, you can automate repetitive tasks, integrate with third-party services, and build custom solutions tailored to your specific business needs.
### Getting Started
## Getting Started
To get started with the Invoice Ninja API, you'll need an active Invoice Ninja account (or your own self hosted installation) and API credentials. If you haven't already done so, sign up for an account at Invoice Ninja and generate your API keys from the settings section. To get started with the Invoice Ninja API, you'll need an active Invoice Ninja account (or your own self hosted installation) and API credentials. If you haven't already done so, sign up for an account at Invoice Ninja and generate your API keys from the settings section.
Once you have your API credentials, you can start exploring the API endpoints, authentication methods, request and response formats, and more using the documentation provided here. Once you have your API credentials, you can start exploring the API endpoints, authentication methods, request and response formats, and more using the documentation provided here.
### Explore the Documentation
## Explore the Documentation
This documentation is organized into sections to help you navigate and understand the various aspects of the Invoice Ninja API: This documentation is organized into sections to help you navigate and understand the various aspects of the Invoice Ninja API:
Authentication: Learn how to authenticate your requests to the API using API tokens. - Authentication: Learn how to authenticate your requests to the API using API tokens.
Endpoints: Explore the available API endpoints for managing invoices, clients, payments, expenses, and more. - Endpoints: Explore the available API endpoints for managing invoices, clients, payments, expenses, and more.
Request and Response Formats: Understand the structure of API requests and responses, including parameters, headers, and payloads. - Request and Response Formats: Understand the structure of API requests and responses, including parameters, headers, and payloads.
Error Handling: Learn about error codes, status messages, and best practices for handling errors gracefully. - Error Handling: Learn about error codes, status messages, and best practices for handling errors gracefully.
Code Examples: Find code examples and tutorials to help you get started with integrating the Invoice Ninja API into your applications. - Code Examples: Find code examples and tutorials to help you get started with integrating the Invoice Ninja API into your applications.
### Need Help?
## Need Help?
If you have any questions, encounter any issues, or need assistance with using the Invoice Ninja API, don't hesitate to reach out to our support team or join our community forums. We're here to help you succeed with Invoice Ninja and make the most of our API. If you have any questions, encounter any issues, or need assistance with using the Invoice Ninja API, don't hesitate to reach out to our support team or join our community forums. We're here to help you succeed with Invoice Ninja and make the most of our API.
Let's start building together! Let's start building together!
### Endpoints
## Endpoints
<div style="background-color: #2D394E; color: #fff padding: 20px; border-radius: 5px; border: 4px solid #212A3B; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);"> <div style="background-color: #2D394E; color: #fff padding: 20px; border-radius: 5px; border: 4px solid #212A3B; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);">
<p style="padding:10px; color: #DBDBDB;"">Production: https://invoicing.co</p> <p style="padding:10px; color: #DBDBDB;"">Production: https://invoicing.co</p>
<p style="padding:10px; color: #DBDBDB;">Demo: https://demo.invoiceninja.com</p> <p style="padding:10px; color: #DBDBDB;">Demo: https://demo.invoiceninja.com</p>
</div> </div>
## Client Libraries ### Client Libraries
PHP SDK can be found [here](https://github.com/invoiceninja/sdk-php) PHP SDK can be found [here](https://github.com/invoiceninja/sdk-php)
### Authentication:
## Authentication:
Invoice Ninja uses API tokens to authenticate requests. You can view and manage your API keys in Settings > Account Management > Integrations > API tokens Invoice Ninja uses API tokens to authenticate requests. You can view and manage your API keys in Settings > Account Management > Integrations > API tokens
API requests must be made over HTTPS. Calls made to HTTP will fail. API requests must be made over HTTPS. Calls made to HTTP will fail.
### Errors:
## Errors:
Invoice Ninja uses standard HTTP response codes to indicate the success or failure of a request. below is a table of standard status codes and responses Invoice Ninja uses standard HTTP response codes to indicate the success or failure of a request. below is a table of standard status codes and responses
@ -67,10 +60,9 @@ info:
| 422 | Unprocessable Entity: The request was well-formed but was unable to be followed due to semantic errors. | | 422 | Unprocessable Entity: The request was well-formed but was unable to be followed due to semantic errors. |
| 429 | Too Many Requests: The user has sent too many requests in a given amount of time ("rate limiting"). | | 429 | Too Many Requests: The user has sent too many requests in a given amount of time ("rate limiting"). |
| 500 | Internal Server Error: A generic error message, given when an unexpected condition was encountered and no more specific message is suitable. | | 500 | Internal Server Error: A generic error message, given when an unexpected condition was encountered and no more specific message is suitable. |
### Pagination
## Pagination When using index routes to retrieve lists of data, by default we limit the number of records returned to 20. You can using standard pagination to paginate results, ie: ?per_page=50
When using index routes to retrieve lists of data, by default we limit the number of records returned to 20. You can using standard pagination to paginate results, ie:
termsOfService: 'https://invoiceninja.github.io/docs/legal/terms_of_service/#page-content' termsOfService: 'https://invoiceninja.github.io/docs/legal/terms_of_service/#page-content'
contact: contact:
email: contact@invoiceninja.com email: contact@invoiceninja.com
@ -79,7 +71,7 @@ info:
license: license:
name: 'Elastic License' name: 'Elastic License'
url: 'https://www.elastic.co/licensing/elastic-license' url: 'https://www.elastic.co/licensing/elastic-license'
version: 5.9.2 version: 5.10.31
servers: servers:
- url: 'https://demo.invoiceninja.com' - url: 'https://demo.invoiceninja.com'
description: | description: |

View File

@ -1,14 +1,12 @@
tags: tags:
- name: login - name: login
description: | # description: |
Attempts to authenticate with the API using a email/password combination. # Attempts to authenticate with the API using a email/password combination.
externalDocs:
description: "Find out more"
url: "https://invoiceninja.github.io"
- name: clients - name: clients
x-tag-expanded: true x-tag-expanded: false
description: | # description: |
Endpoint definitions for interacting with clients. # Endpoint definitions for interacting with clients.
- name: products - name: products
description: | description: |
Endpoint definitions for interacting with products. Endpoint definitions for interacting with products.

View File

@ -3,17 +3,19 @@
tags: tags:
- clients - clients
summary: 'List clients' summary: 'List clients'
x-code-samples: x-codeSamples:
- lang: go - lang: php
label: php label: php
source: | source: |
$ninja = new InvoiceNinja("your_token"); $ninja = new InvoiceNinja("your_token");
$invoices = $ninja->clients->all(); $invoices = $ninja->clients->all();
x-custom-element: - lang: curl
type: markdown label: curl
value: | source: |
### Custom Response Description curl --request GET \
This is a custom description for the response returned by the `/example` endpoint. --url 'https://invoicing.co/api/v1/clients?per_page=10&page=1&sort=name&sort_dir=asc' \
--header 'X-API-TOKEN: YOUR_API_TOKEN_HERE' \
--header 'Accept: application/json'
description: | description: |
When retrieving a list of clients you can also chain query parameters in order to filter the dataset that is returned. For example, you can send a request to the following URL to retrieve clients that have a balance greater than 1000:\ When retrieving a list of clients you can also chain query parameters in order to filter the dataset that is returned. For example, you can send a request to the following URL to retrieve clients that have a balance greater than 1000:\
@ -129,19 +131,7 @@
content: content:
application/json: application/json:
schema: schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Client' $ref: '#/components/schemas/Client'
example:
$ref: '#/components/schemas/Client'
meta:
type: object
$ref: '#/components/schemas/Meta'
example:
$ref: '#/components/schemas/Meta'
401: 401:
$ref: '#/components/responses/401' $ref: '#/components/responses/401'
403: 403:
@ -410,7 +400,43 @@
tags: tags:
- clients - clients
summary: 'Bulk client actions' summary: 'Bulk client actions'
description: 'Archive / Restore / Delete in bulk' description: |
Bulk actions allow to make changes to multiple clients in a single request the following actions are supported
- archive
- restore
- delete
- template _requires template,template_id properties also_
- assign_group _requires group_settings_id also_
- bulk_update _ requires column,new_value also_
All of these actions require an array of client ids to perform the requested action on ie.
"ids":['id1','id2']
actions such as template, assign_group and bulk_update also require additional properties to be passed in the request
- template
The template bulk action allows the creation of a custom template using the provided template_id to be run against the array of clients provided.
- assign_group
Allows the setting of multiple clients to a single group
- bulk_update
Allows updating certain columns on the client model in bulk. the current list of supported columns that can be updated archived_at:
- public_notes
- industry_id
- size_id
- country_id
- custom_value1
- custom_value2
- custom_value3
- custom_value4
operationId: bulkClients operationId: bulkClients
parameters: parameters:
- $ref: '#/components/parameters/X-API-TOKEN' - $ref: '#/components/parameters/X-API-TOKEN'
@ -426,7 +452,7 @@
responses: responses:
200: 200:
description: 'The Client listresponse' description: 'The Client list Response of the updated clients that were bulk updated'
headers: headers:
X-MINIMUM-CLIENT-VERSION: X-MINIMUM-CLIENT-VERSION:
$ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION' $ref: '#/components/headers/X-MINIMUM-CLIENT-VERSION'
@ -511,7 +537,7 @@
- clients - clients
summary: 'Purge client' summary: 'Purge client'
description: | description: |
Handles purging a clients. Handles purging a client.
Please note this is a destructive action. Please note this is a destructive action.

View File

@ -3,7 +3,7 @@
tags: tags:
- products - products
summary: "List products" summary: "List products"
x-code-samples: x-codeSamples:
- lang: curl - lang: curl
label: Curl label: Curl
source: | source: |
@ -96,7 +96,7 @@
tags: tags:
- products - products
summary: "Create Product" summary: "Create Product"
x-code-samples: x-codeSamples:
- lang: curl - lang: curl
label: Curl label: Curl
source: | source: |
@ -159,7 +159,7 @@
tags: tags:
- products - products
summary: "Show product" summary: "Show product"
x-code-samples: x-codeSamples:
- lang: curl - lang: curl
label: Curl label: Curl
source: | source: |
@ -215,7 +215,7 @@
tags: tags:
- products - products
summary: "Update product" summary: "Update product"
x-code-samples: x-codeSamples:
- lang: curl - lang: curl
label: Curl label: Curl
source: | source: |
@ -287,7 +287,7 @@
tags: tags:
- products - products
summary: "Delete product" summary: "Delete product"
x-code-samples: x-codeSamples:
- lang: curl - lang: curl
label: Curl label: Curl
source: | source: |
@ -340,7 +340,7 @@
tags: tags:
- products - products
summary: "Edit product" summary: "Edit product"
x-code-samples: x-codeSamples:
- lang: curl - lang: curl
label: Curl label: Curl
source: | source: |
@ -435,7 +435,7 @@
tags: tags:
- products - products
summary: "Bulk product actions" summary: "Bulk product actions"
x-code-samples: x-codeSamples:
- lang: curl - lang: curl
label: Curl label: Curl
source: | source: |