openapi: 3.0.0 servers: - description: Production url: https://api.sinao.app/v1 - description: Staging url: https://api.sinao.dev/v1 - description: Development url: https://api.sinao.test/v1 info: description: Sinao API for account management, apps administration and network exploration version: "1.1.0" title: Sinao API contact: email: contact@sinao.fr license: name: Apache 2.0 url: "http://www.apache.org/licenses/LICENSE-2.0.html" paths: ############################### # # # Account - Shared data # # # ############################### # Authentication "/login": post: tags: [Authentication] summary: Login description: "User login by email and password. Used only on Sinao API. CloudAccounting API needs a different API key" operationId: auth.login parameters: - name: email in: query description: "Email for login" required: true schema: type: string format: email - name: password in: query description: "Password for login in clear text" required: true schema: type: string - name: code in: query description: "2FA code" schema: type: string responses: "200": description: Successful Operation "401": description: Invalid password "404": description: Email address not found "422": description: No password defined "/sendpassword": post: tags: [hidden] summary: Password recover by email description: Send a forgotten_password_token by email to recover password operationId: auth.sendpassword parameters: - name: email in: query description: "Email for login" required: true schema: type: string format: email responses: "200": description: Successful Operation "422": description: Email does not exists security: - is_logged: [] "/changepassword": post: tags: [hidden] summary: Change password description: Change password by email forgotten_password_token operationId: auth.changepassword parameters: - name: forgotten_password_token in: query required: true schema: type: string - name: password in: query description: Password for account required: true schema: type: string minimum: 8 responses: "200": description: Successful Operation "422": description: Unprocessable Entity security: - is_logged: [] "/logout": post: tags: [hidden] summary: Logout description: "Log the user out (Invalidate the token)" operationId: auth.logout responses: "200": description: Success security: - is_authenticated: [] "/login/send/2fa": post: tags: [hidden] summary: Send 2FA code description: "Send 2FA code" operationId: auth.send_2fa_code parameters: - name: email in: query description: "Email for login" required: true schema: type: string format: email - name: password in: query description: "Password for login in clear text" required: true schema: type: string responses: "200": description: Success "/refresh": get: tags: [Authentication] summary: Refresh a token description: "Refresh token without relogin" operationId: auth.refresh responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/JsonWebToken" security: - is_authenticated: [] # Account "/me": get: tags: [Account] summary: Get current user description: "Get current logged user, as `User` object" operationId: account.get responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/User" security: - is_authenticated: [] post: tags: [Account] summary: Update current user description: "Update current user informations" operationId: account.update parameters: - name: civility in: query schema: type: string minimum: 1 - name: firstname in: query schema: type: string minimum: 2 - name: lastname in: query schema: type: string minimum: 2 - name: password in: query schema: type: string minimum: 8 - name: email in: query schema: type: string format: email - name: image in: query schema: type: string format: binary - name: metadata in: query schema: type: array items: type: string nullable: true responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/User" security: - is_authenticated: [] - is_logged: [] "/register": post: tags: [hidden] # Summary summary: Create an User # Function description description: "Create a new `User` from the registration form. The user will be created without an application or access, there is nothing he can do without another step such as creating an application or inviting access" # Route name operationId: account.create parameters: - name: email description: "Email is the user's login, it must not have been registered" in: query required: true schema: type: string format: email - name: password in: query required: true schema: type: string minimum: 8 - name: cgu in: query description: "The user must have validated the T&Cs" required: true schema: type: boolean - name: firstname in: query schema: type: string minimum: 2 - name: lastname in: query schema: type: string minimum: 2 - name: metadata in: query schema: type: array items: type: string nullable: true responses: "200": description: Successful Operation "422": description: Unprocessable Entity security: - is_logged: [] # Applications "/apps": post: tags: [hidden] summary: Create an app description: "Create a new `App` with their organization profile" operationId: app.create parameters: - name: organization_name in: query description: "Organization name. Minimum 3 characters with 1 alpha" required: true schema: type: string pattern: "/^.*[a-z]+.*$/i" # minimum 1 letter minimum: 3 - name: organization_size in: query description: "Organization size" schema: type: string enum: [solo, small, medium] responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/App" "422": description: "The organization name format is invalid : minimum 3 characters with 1 alpha" security: - is_logged: [] - is_authenticated: [] - is_limited: [] get: tags: [Applications] summary: List apps description: "Get all apps" operationId: app.list parameters: - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: "search results" content: application/json: schema: type: array items: $ref: "#/components/schemas/App" "400": description: "bad input parameter" security: - is_authenticated: [] "/apps/{appId}": get: tags: [Applications] summary: Get an app description: "Get app informations" operationId: app.get parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/App" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] - always_allowed: [] "/apps/{appId}/ping": get: tags: [hidden] summary: Ping app web hostname description: "Try if a specific app is online" operationId: app.ping parameters: - $ref: "#/components/parameters/appId" responses: "200": description: "Success" "404": description: Not found "405": description: "Server error" security: - is_authenticated: [] - always_allowed: [] "/apps/{appId}/reset": post: tags: [hidden] summary: Reset all data description: Reset everything operationId: app.reset parameters: - $ref: "#/components/parameters/appId" responses: "200": description: "Success" "404": description: Not found "405": description: "Server error" security: - is_logged: [] - is_authenticated: [] - always_allowed: [] # API Keys for partners "/apps/{appId}/apikeys": get: tags: [Applications] summary: Get all api keys operationId: app.apikeys.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: object "404": description: "App not found" security: - is_authenticated: [] - is_admin: [] post: tags: [Applications] summary: Create new API key operationId: app.apikeys.create parameters: - $ref: "#/components/parameters/appId" - name: name description: "Key name" in: query required: true schema: type: string minimum: 3 - name: api_partner_id description: "Partner ID for official connexion" in: query schema: type: integer nullable: true responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "404": description: "App or key not found" security: - is_logged: [] - is_authenticated: [] - is_admin: [] "/apps/{appId}/apikeys/{id}": delete: tags: [Applications] summary: "Remove an api key" operationId: app.apikeys.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path required: true description: "Api key id" schema: type: integer responses: "200": description: Success "404": description: Not found security: - is_authenticated: [] - is_logged: [] - is_admin: [] # API partners "/apps/{appId}/apipartners": get: tags: [Applications] summary: Get all api parners operationId: app.apipartners.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: object "404": description: "App not found" security: - is_authenticated: [] # Settings "/apps/{appId}/settings": get: tags: [Applications] summary: Get app config description: "Get a configuration variable by key" operationId: app.settings.get parameters: - $ref: "#/components/parameters/appId" - name: key in: query schema: type: string responses: "200": description: Success content: application/json: schema: type: object "404": description: "App or key not found" security: - is_authenticated: [] post: tags: [Applications] summary: Update app config description: "General settings of an app. Can be modified in app" operationId: app.settings.update parameters: - $ref: "#/components/parameters/appId" - name: settings in: query schema: type: object additionalProperties: type: string example: accounting.template.color-primary: "#003B51" accounting.export.journals.VE: "VE" # OR - name: key in: query schema: type: string - name: value description: "Value can be a primitive or a file" in: query schema: type: string responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "404": description: "App or key not found" security: - is_logged: [] - is_authenticated: [] # Jobs "/apps/{appId}/jobs/{job}": get: tags: [Applications] summary: Get app job description: "Get a job" operationId: app.getJob parameters: - $ref: "#/components/parameters/appId" - name: job in: path schema: type: string responses: "200": description: Success content: application/json: schema: type: object "404": description: "App or key not found" security: - is_authenticated: [] # Templates "/apps/{appId}/templates": get: tags: [hidden] summary: Get templates description: "Get all templates" operationId: app.settings.templates.list parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success security: - is_authenticated: [] post: tags: [hidden] summary: Create a template description: "Create a template" operationId: app.settings.templates.create parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success security: - is_authenticated: [] - disable_sanitization: [] # document printable langs "/apps/{appId}/document-langs": get: tags: [Document, lang, translation] summary: Get document (invoice or quote) available printable langs description: "Get list of documents available printable langs" operationId: app.settings.getSalesDocumentLangs parameters: - $ref: "#/components/parameters/appId" - name: key in: query schema: type: string responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/Lang" "404": description: "App or key not found" security: - is_authenticated: [] "/apps/{appId}/templates/batch": post: tags: [hidden] summary: Create multiple templates description: "Create multiple templates" operationId: app.settings.templates.batch parameters: - $ref: "#/components/parameters/appId" - name: data description: "List of templates. With ID for update, without for insert" in: query required: true schema: type: array responses: "200": description: Success security: - is_authenticated: [] - disable_sanitization: [] "/apps/{appId}/templates/default": get: tags: [hidden] summary: Get default template description: "Get the default template" operationId: app.settings.templates.default_template parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success security: - is_authenticated: [] "/apps/{appId}/templates/{id}": get: tags: [hidden] summary: Get a template description: "Get a template" operationId: app.settings.templates.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path required: true schema: type: integer responses: "200": description: Success security: - is_authenticated: [] post: tags: [hidden] summary: Update a template description: "Update a template" operationId: app.settings.templates.update parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success security: - is_authenticated: [] - disable_sanitization: [] # Subscriptions "/apps/{appId}/subscription/plan/extra": get: # Obtenir le plan courant : GET tags: [hidden] summary: "Get current plan" operationId: app.subscription.plan_extra parameters: - $ref: "#/components/parameters/appId" - name: plan_nickname in: query required: true description: "users, invoices, purchases, ocrentries" schema: type: string responses: "200": description: Success content: application/json: schema: type: object properties: plans: type: array items: type: string extras: type: array items: type: string "404": description: Not found security: - is_authenticated: [] - always_allowed: [] # Subscriptions "/apps/{appId}/subscription/customer": get: tags: [hidden] summary: "Stripe Customer object" operationId: app.subscription.customer parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "404": description: Not found security: - is_logged: [] - is_authenticated: [] - always_allowed: [] post: tags: [hidden] summary: "Stripe Customer object" operationId: app.subscription.update_customer parameters: - $ref: "#/components/parameters/appId" - name: name in: query description: "Name of the customer" required: false schema: type: string example: "John Doe" - name: email in: query description: "Email of the customer" required: false schema: type: string example: "john.doe@example.com" - name: phone in: query description: "Phone number of the customer" required: false schema: type: string example: "+1234567890" - name: address[line1] in: query description: "Address line 1 of the customer" required: false schema: type: string example: "123 Main St" - name: address[line2] in: query description: "Address line 2 of the customer" required: false schema: type: string example: "Suite 5" - name: address[city] in: query description: "City of the customer's address" required: false schema: type: string example: "New York" - name: address[state] in: query description: "State of the customer's address" required: false schema: type: string example: "NY" - name: address[postal_code] in: query description: "Postal code of the customer's address" required: false schema: type: string example: "10001" - name: address[country] in: query description: "Country of the customer's address" required: false schema: type: string example: "US" responses: "200": description: Success "404": description: Not found security: - is_logged: [] - is_authenticated: [] - always_allowed: [] "/apps/{appId}/subscription/plan": get: # Obtenir le plan courant : GET tags: [hidden] summary: "Get current plan" operationId: app.subscription.get parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success content: application/json: schema: type: object properties: plans: type: array items: type: string extras: type: array items: type: string "404": description: Not found security: - is_authenticated: [] - always_allowed: [] delete: # Mettre fin à l'abonnement : DELETE tags: [hidden] summary: "End current plan" operationId: app.subscription.end parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "404": description: Not found security: - is_authenticated: [] - always_allowed: [] - is_logged: [] "/apps/{appId}/subscription/plans": get: # Obtenir les plans : GET tags: [hidden] summary: "Get plans" operationId: app.subscription.list parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success content: application/json: schema: type: object properties: plans: type: array items: type: string extras: type: array items: type: string "404": description: Not found security: - is_authenticated: [] - always_allowed: [] "/apps/{appId}/subscription/invoices": get: tags: [hidden] summary: "See all invoices" operationId: app.subscription.invoices parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "404": description: Not found security: - is_logged: [] - is_authenticated: [] - always_allowed: [] "/apps/{appId}/subscription/payment_methods": get: tags: [hidden] summary: "See all payment methods" operationId: app.subscription.payment_methods parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "404": description: Not found security: - is_logged: [] - is_authenticated: [] - always_allowed: [] "/apps/{appId}/subscription/extra/count": get: tags: [hidden] summary: "Count extra usage" operationId: app.subscription.extra_count parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "404": description: Not found security: - is_logged: [] - is_authenticated: [] - always_allowed: [] "/apps/{appId}/subscription/extra/{stripe_plan}": post: # Activer un plan extra : POST tags: [hidden] summary: "Enable plan" operationId: app.subscription.extra_enable parameters: - $ref: "#/components/parameters/appId" - name: stripe_plan in: path required: true description: "Stripe plan id to update invoice" schema: type: string responses: "200": description: Success "404": description: Not found security: - is_logged: [] - is_authenticated: [] - always_allowed: [] "/apps/{appId}/subscription/plans/{stripe_plan}": get: # Obtenir les informations de changement de plan à partir d'un nouveau plan : GET tags: [hidden] summary: "Simulate a plan" operationId: app.subscription.upcoming parameters: - $ref: "#/components/parameters/appId" - name: stripe_plan in: path required: true description: "Stripe plan id to simulate invoice" schema: type: string - name: stripe_coupon in: query description: "Stripe coupon id to simulate invoice" schema: nullable: true type: string responses: "200": description: Success "404": description: Not found security: - is_authenticated: [] - always_allowed: [] post: # Changer de plan et payer : POST tags: [hidden] summary: "Change plan" operationId: app.subscription.pay parameters: - $ref: "#/components/parameters/appId" - name: stripe_plan in: path required: true description: "Stripe plan id to update invoice" schema: type: string - name: stripe_source in: query description: "Stripe source to pay" schema: nullable: true type: string - name: stripe_coupon in: query description: "Stripe coupon id to apply" schema: nullable: true type: string responses: "200": description: Success "404": description: Not found security: - is_logged: [] - is_authenticated: [] - always_allowed: [] "/apps/{appId}/subscription/plans/{stripe_plan}/checkout": get: # Get payment link to Stripe Checkout tags: [hidden] summary: "Get payment link to Stripe Checkout" operationId: app.subscription.checkout parameters: - $ref: "#/components/parameters/appId" - name: stripe_plan in: path required: true description: "Stripe plan id to simulate invoice" schema: type: string - name: stripe_coupon in: query description: "Stripe coupon id to simulate invoice" schema: nullable: true type: string responses: "200": description: Success "404": description: Not found security: - is_authenticated: [] - always_allowed: [] "/apps/{appId}/subscription/checkout_session": get: tags: [hidden] summary: "Get Stripe Checkout Session id" operationId: app.subscription.get_checkout_session parameters: - $ref: "#/components/parameters/appId" - name: session_id in: query description: "Stripe Checkout Session id" schema: nullable: true type: string responses: "200": description: Success "404": description: Not found security: - is_authenticated: [] - always_allowed: [] "/apps/{appId}/subscription/checkout_add_source": get: # Get payment link to Stripe Checkout to add a payment tags: [hidden] summary: "Get payment link to Stripe Checkout" operationId: app.subscription.checkout_add_source parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "404": description: Not found security: - is_authenticated: [] - always_allowed: [] "/apps/{appId}/subscription/source": post: # Changer de moyen de paiement : POST tags: [hidden] summary: "Add creditcard or sepadebit" operationId: app.subscription.add_source parameters: - $ref: "#/components/parameters/appId" - name: stripe_source in: query required: true description: "Stripe source to pay" schema: type: string responses: "200": description: Success "404": description: Not found security: - is_logged: [] - is_authenticated: [] - always_allowed: [] delete: # Supprimer de moyen de paiement : DELETE tags: [hidden] summary: "Remove creditcard or sepadebit" operationId: app.subscription.remove_source parameters: - $ref: "#/components/parameters/appId" - name: stripe_source in: query required: true description: "Stripe source to pay" schema: type: string responses: "200": description: Success "404": description: Not found security: - is_authenticated: [] - always_allowed: [] "/apps/{appId}/subscription/source/default": post: # Changer de moyen de paiement : POST tags: [hidden] summary: "Change default source" operationId: app.subscription.set_default parameters: - $ref: "#/components/parameters/appId" - name: stripe_source in: query required: true description: "Stripe source to set as default source" schema: type: string responses: "200": description: Success "404": description: Not found security: - is_logged: [] - is_authenticated: [] - always_allowed: [] "/apps/{appId}/subscription/pay_all": post: tags: [hidden] summary: "Pay all due invoices" operationId: app.subscription.pay_all parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "404": description: Not found security: - is_logged: [] - is_authenticated: [] - always_allowed: [] "/apps/{appId}/subscription/cancel": post: tags: [hidden] summary: "Cancel the subscription now" operationId: app.subscription.cancel parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/subscription/extend_trial": post: tags: [hidden] summary: "Extend trial period" operationId: app.subscription.extend_trial parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "404": description: Not found security: - is_authenticated: [] - always_allowed: [] "/apps/{appId}/subscription/coupon": post: # Ajouter un coupon : POST tags: [hidden] summary: "Add coupon" operationId: app.subscription.coupon parameters: - $ref: "#/components/parameters/appId" - name: code in: query required: true schema: type: string responses: "200": description: Success "404": description: Not found security: - is_authenticated: [] - always_allowed: [] get: # Voir un coupon : GET tags: [hidden] summary: "See coupon" operationId: app.subscription.get_coupon parameters: - $ref: "#/components/parameters/appId" - name: code in: query required: true schema: type: string responses: "200": description: Success "404": description: Not found security: - is_authenticated: [] - always_allowed: [] "/apps/{appId}/subscription/anchordate": post: # Modifier la date de prélèvement à aujourd'hui : POST tags: [hidden] summary: "Update anchor date" operationId: app.subscription.anchordate parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "404": description: Not found security: - is_authenticated: [] - always_allowed: [] # Access "/apps/{appId}/access/profiles": get: tags: [hidden] summary: Get profiles description: "Get all profiles" operationId: app.policies.profiles.list parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/PolicyProfile" security: - is_authenticated: [] "/apps/{appId}/access/invite": post: tags: [hidden] summary: Invite an user description: "Invites a user to access the organization panel" operationId: app.policies.invitations.create parameters: - $ref: "#/components/parameters/appId" - name: email in: query description: "Email for invitation. Will be used to account creation or account matching with an existing user" required: true schema: type: string - name: policy_profile_id in: query description: "Profile for policies set" required: true schema: type: integer minimum: 0 - name: firstname in: query description: "First name of user before account creation / account link" schema: type: string - name: lastname in: query description: "Last name of user before account creation / account link" schema: type: string - name: civility in: query description: "Last name of user before account creation / account link" schema: type: string - name: password in: query description: "Password for new user" schema: type: string minimum: 8 - name: additionalsAppId in: query description: "If user is invited to more than one application, add here other apps id" required: false schema: type: array responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/AccessInvitation" "404": description: "App was not found" "403": description: "This user already exists, you can not set a password" security: - is_logged: [] - is_authenticated: [] - is_admin: [] - is_accountant: [] get: tags: [hidden] summary: List invitations description: "Get all sent invitations" operationId: app.policies.invitations.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/AccessInvitation" "404": description: "App was not found" security: - is_authenticated: [] "/apps/{appId}/access/invite/{id}": delete: tags: [hidden] summary: Delete an invitation description: Remove an invitation operationId: app.policies.invitations.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path required: true schema: type: integer responses: "200": description: successful operation content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "404": description: "Invitation was not found" security: - is_logged: [] - is_authenticated: [] - is_admin: [] - is_accountant: [] "/apps/{appId}/pennylane/refresh-token": get: tags: [Pennylane, Token, Bearer] summary: endpoint for Pennylane fesh bearer token description: endpoint for Pennylane fesh bearer token operationId: app.accounting.pennylane.setFreshToken parameters: - $ref: "#/components/parameters/appId" responses: "200": description: successful operation content: application/json: schema: type: object "404": description: "App or key not found" security: - is_logged: [] - is_authenticated: [] "/apps/access/invite/{accessToken}/register": post: tags: [hidden] summary: Create an User by invitation description: "Registration for an invited user" operationId: app.policies.registration.register parameters: - name: accessToken in: path required: true schema: type: string - name: password in: query description: "Password for account" required: true schema: type: string minimum: 8 - name: firstname in: query description: "First name of user before account creation / account link" schema: type: string - name: lastname in: query description: "Last name of user before account creation / account link" schema: type: string - name: cgu in: query description: "User has valided CGU ?" required: true schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/User" "400": description: "Bad parameters" "404": description: "Token not found" "401": description: "Token expired" security: - is_logged: [] "/apps/access/invite/{accessToken}": get: tags: [hidden] summary: Get invitation informations description: "Get infos of an invitation request. Returns an `AccessInvitation` object" operationId: app.policies.registration.get parameters: - name: accessToken in: path required: true schema: type: string responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/AccessInvitation" "404": description: "Invitation was not found" delete: tags: [hidden] summary: Delete an invitation from token description: Remove an invitation from token operationId: app.policies.registration.delete parameters: - name: accessToken in: path required: true schema: type: string responses: "200": description: successful operation content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "404": description: "Token was not found" "401": description: "Token expired" "/apps/access/accounting/policies/accounting/batch": post: tags: [ hidden ] summary: Create/update policies for a user description: "Create/update policies for the user user_id for apps apps_id" operationId: app.policies.accounting_batch parameters: - name: userId in: query required: true schema: type: integer - name: appId in: query required: false schema: type: array items: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/User" "400": description: "Bad parameters" security: - is_logged: [ ] "/apps/{appId}/access": get: tags: [hidden] summary: Get policies for an app description: "Get all policies for an app. Manage access for users" operationId: app.policies.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/PolicyProfile" "404": description: "App was not found" security: - is_authenticated: [] "/apps/{appId}/access/{userId}": get: tags: [hidden] summary: Get police for an user description: "Find policy profile for an user on an app" operationId: app.policies.get parameters: - $ref: "#/components/parameters/appId" - name: userId in: path required: true schema: type: string responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/PolicyProfile" "404": description: "App was not found" security: - is_authenticated: [] post: tags: [hidden] summary: Update police for an user description: "Update police for an user on an app" operationId: app.policies.update parameters: - $ref: "#/components/parameters/appId" - name: userId in: path required: true schema: type: string - name: policy_profile_id in: query required: true schema: type: integer minimum: 0 responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/PolicyProfile" "404": description: "App was not found" security: - is_logged: [] - is_authenticated: [] - is_admin: [] delete: tags: [hidden] summary: Delete police for an user description: "Cancel access for an user on an app" operationId: app.policies.delete parameters: - $ref: "#/components/parameters/appId" - name: userId in: path required: true schema: type: string responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "404": description: "App was not found" security: - is_logged: [] - is_authenticated: [] - is_admin: [] - is_accountant: [] # Organization "/apps/{appId}/organization": get: tags: [Organization profile] summary: "Get organization profile for current app" operationId: app.organization.get parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/SinaoOrganization" "404": description: Not found security: - is_authenticated: [] - always_allowed: [] post: tags: [Organization profile] summary: "Update organization profile for current app" operationId: app.organization.update parameters: - $ref: "#/components/parameters/appId" - name: name in: query description: "Company name visible on the app" schema: type: string pattern: "/^.*[a-z]+.*$/i" # minimum 1 letter minimum: 3 - name: billing_name in: query description: "Company name for billing" schema: type: string - name: logo in: query schema: oneOf: - type: string format: byte - type: string format: uri - name: legal_form in: query schema: type: string - name: country_iso2 in: query schema: type: string format: "ISO 3166-1 alpha-2" - name: founding_date in: query schema: type: string format: date - name: founding_location in: query schema: type: string - name: dissolution_date in: query schema: type: string format: date - name: closeaccounting_period in: query schema: type: string - name: national_id in: query description: "Unique National Id, format by country. **In France : [0-9]{9} with last number as security key.**" schema: type: string - name: trade_directory_registration in: query description: "France Directory Registration : Unique national ID SIRET [0-9]{9} + 'RM' + CMA identification number [0-9a-z]{2,}" schema: type: string - name: vat_id in: query description: "European VAT Id. **In France : FR [0-9]{2} [0-9]{9}**" schema: nullable: true type: string - name: code_naf in: query description: "French NAF Code" schema: nullable: true type: string pattern: "/^[0-9]+[a-z]$/i" - name: number_of_employees in: query schema: type: string - name: industry in: query schema: type: string - name: slogan in: query schema: type: string - name: rcs in: query description: "French. Registre du Commerce et des Sociétés" schema: type: string - name: greffe in: query description: "French. Tribunal de commerce" schema: type: string - name: sap_number_registration in: query description: "NOVA agreement/registration number" schema: nullable: true type: string pattern: "/^SAP[0-9]{9}$/i" - name: sap_activities in: query description: "Organisation activities displayed in annual taxes customer attestation" schema: nullable: true type: string - name: sap_date_registration in: query description: "NOVA agreement/registration date" schema: nullable: true type: string # pattern: "/^[0-9]{2}\\\/[0-9]{2}\\\/[0-9]{4}$/i" - name: capital in: query schema: type: integer nullable: true - $ref: "#/components/parameters/establishments" - $ref: "#/components/parameters/headquarters" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/SinaoOrganization" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] ######################################## # # # CloudPrivate data # # # ######################################## # # Contacts # # Organizations "/apps/{appId}/organizations": get: tags: [Organizations] summary: "List organizations" description: "List all organizations" operationId: app.contacts.organizations.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/ContactOrganization" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Organizations] summary: Create an organization description: "Create a contact organization. This organization will be automatically completed and updated by public data. The public profile will be automatically find by NationalID" operationId: app.contacts.organizations.create parameters: - $ref: "#/components/parameters/appId" - name: name in: query required: true description: "Company name visible on the app" schema: type: string pattern: "/^.*[a-z0-9]+.*$/i" # minimum 1 letter minimum: 2 - name: billing_name in: query description: "Company name for billing" schema: type: string - name: logo in: query schema: oneOf: - type: string format: byte - type: string format: uri - name: legal_form in: query schema: type: string - name: country_iso2 in: query schema: type: string format: "ISO 3166-1 alpha-2" - name: founding_date in: query schema: type: string format: date - name: founding_location in: query schema: type: string - name: dissolution_date in: query schema: type: string format: date - name: vat_system in: query schema: type: string - name: closeaccounting_period in: query schema: type: string - name: national_id in: query description: "Unique National Id, format by country. **In France : [0-9]{9} with last number as security key.**" schema: type: string - name: vat_id in: query description: "European VAT Id. **In France : FR [0-9]{2} [0-9]{9}**" schema: nullable: true type: string - name: code_naf in: query description: "French NAF Code" schema: nullable: true type: string pattern: "/^[0-9]{4}[a-z]$/i" - name: number_of_employees in: query schema: type: string - name: slogan in: query schema: type: string - name: rcs in: query description: "French. Registre du Commerce et des Sociétés" schema: type: string - name: greffe in: query description: "French. Tribunal de commerce" schema: type: string - name: capital in: query schema: type: integer - name: metadata in: query schema: type: array items: type: string nullable: true - $ref: "#/components/parameters/relationship" - $ref: "#/components/parameters/establishments" - $ref: "#/components/parameters/headquarters" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ContactOrganization" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/organizations/batch": post: tags: [Organizations] summary: Create multiple organizations description: "Create a contact organization. This organization will be automatically completed and updated by public data. The public profile will be automatically find by NationalID" operationId: app.contacts.organizations.batch parameters: - $ref: "#/components/parameters/appId" - name: data description: "List of invoices. With ID for update, without for insert" in: query required: true schema: type: array items: $ref: "#/components/schemas/ContactOrganization" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ContactOrganization" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/organizations/{id}": get: tags: [Organizations] summary: "Get an organization" description: "Get an organization by id" operationId: app.contacts.organizations.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of organization" required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ContactOrganization" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Organizations] summary: "Update an organization" description: "Update an organization by id" operationId: app.contacts.organizations.update parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of organization" required: true schema: type: integer - name: name in: query description: "Company name visible on the app" schema: type: string pattern: "/^.*[a-z]+.*$/i" # minimum 1 letter minimum: 2 - name: billing_name in: query description: "Company name for billing" schema: type: string - name: logo in: query schema: oneOf: - type: string format: byte - type: string format: uri - name: legal_form in: query schema: type: string - name: country_iso2 in: query schema: type: string format: "ISO 3166-1 alpha-2" - name: founding_date in: query schema: type: string format: date - name: founding_location in: query schema: type: string - name: dissolution_date in: query schema: type: string format: date - name: vat_system in: query schema: type: string - name: closeaccounting_period in: query schema: type: string - name: national_id in: query description: "Unique National Id, format by country. **In France : [0-9]{9} with last number as security key.**" schema: type: string - name: vat_id in: query description: "European VAT Id. **In France : FR [0-9]{2} [0-9]{9}**" schema: nullable: true type: string - name: code_naf in: query description: "French NAF Code" schema: nullable: true type: string pattern: "/^[0-9]{4}[a-z]$/i" - name: number_of_employees in: query schema: type: string - name: slogan in: query schema: type: string - name: rcs in: query description: "French. Registre du Commerce et des Sociétés" schema: type: string - name: greffe in: query description: "French. Tribunal de commerce" schema: type: string - name: capital in: query schema: type: integer - name: metadata in: query schema: type: array items: type: string nullable: true - $ref: "#/components/parameters/relationship" - $ref: "#/components/parameters/establishments" - $ref: "#/components/parameters/headquarters" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ContactOrganization" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] delete: tags: [Organizations] summary: Remove an organization description: "Remove an organization" operationId: app.contacts.organizations.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of organization" required: true schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/organizations/{id}/restore": get: tags: [Organizations] summary: "Restore an organization" description: "Restore an organization by id" operationId: app.contacts.organizations.restore parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of organization" required: true schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ContactOrganization" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/organizations/{id}/sepa/mandate": get: tags: [Organizations] summary: "Get sepa_mandate of a organizations" description: "Get sepa_mandate of a organizations by id" operationId: app.contacts.organizations.sepa_mandate parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of a organization" required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/organizations/delete/all": delete: tags: [Organizations] summary: "Remove all organizations" description: "Remove all organizations" operationId: app.contacts.organizations.deleteAll responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" security: - is_logged: [] - is_authenticated: [] # Persons "/apps/{appId}/persons": get: tags: [Persons] summary: "List persons" description: "Get all persons" operationId: app.contacts.persons.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/ContactPerson" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Persons] summary: "Create a person" description: "Create a new person. Represent a private contact" operationId: app.contacts.persons.create parameters: - $ref: "#/components/parameters/appId" - name: civility in: query description: "Civility is the lastname prefix" schema: type: string - name: lastname in: query required: true schema: type: string - name: firstname in: query schema: type: string - name: picture in: query schema: oneOf: - type: string format: byte - type: string format: uri - name: metadata in: query schema: type: array items: type: string nullable: true - $ref: "#/components/parameters/relationship" - $ref: "#/components/parameters/establishments" - $ref: "#/components/parameters/headquarters" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ContactPerson" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/persons/batch": post: tags: [Persons] summary: "Create multiple persons" description: "Create a new person. Represent a private contact" operationId: app.contacts.persons.batch parameters: - $ref: "#/components/parameters/appId" - name: data description: "List of persons. With ID for update, without for insert" in: query required: true schema: type: array items: $ref: "#/components/schemas/ContactPerson" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ContactPerson" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/persons/{id}": get: tags: [Persons] summary: "Get a person" description: "Get a person by id" operationId: app.contacts.persons.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of a person" required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ContactPerson" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Persons] summary: "Update a person" description: "Update a person by id" operationId: app.contacts.persons.update parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of a person" required: true schema: type: integer - name: civility in: query description: "Civility is the lastname prefix" schema: type: string nullable: true - name: lastname in: query schema: type: string - name: firstname in: query schema: type: string - name: picture in: query schema: oneOf: - type: string format: byte - type: string format: uri - name: metadata in: query schema: type: array items: type: string nullable: true - $ref: "#/components/parameters/relationship" - $ref: "#/components/parameters/establishments" - $ref: "#/components/parameters/headquarters" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ContactPerson" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] delete: tags: [Persons] summary: Remove a person description: "Remove an person" operationId: app.contacts.persons.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of person" required: true schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/persons/{id}/restore": get: tags: [Persons] summary: "Restore a person" description: "Restore a person by id" operationId: app.contacts.persons.restore parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of a person" required: true schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ContactPerson" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/persons/{id}/sepa/mandate": get: tags: [Persons] summary: "Get sepa_mandate of a person" description: "Get sepa_mandate of a person by id" operationId: app.contacts.persons.sepa_mandate parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of a person" required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/persons/delete/all": delete: tags: [Persons] summary: "Remove all persons" description: "Remove all persons" operationId: app.contacts.persons.deleteAll responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" security: - is_logged: [] - is_authenticated: [] # Establishments "/apps/{appId}/establishments/{id}": get: tags: [Establishments] summary: "Get an establishment" description: "Get an establishment by id" operationId: app.contacts.establishments.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of an establishment" required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/EstablishmentIdentity" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Establishments] summary: "Update an establishment" description: "Update an establishment by id" operationId: app.contacts.establishments.update parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of an establishment" required: true schema: type: integer - name: name in: query schema: type: string - name: phones in: query schema: type: array items: type: string - name: emails in: query schema: type: array items: type: string - name: nic in: query description: "Establishment number (french NIC)" schema: type: string pattern: "/^[0-9]{5}$/i" nullable: true - name: place in: query schema: type: object properties: latitude: type: integer longitude: type: integer street_number: type: string route: type: string route2: type: string locality: type: string sublocality: type: string administrative_area_level3: type: string administrative_area_level2: type: string administrative_area_level1: type: string country: type: string countryiso2: type: string postal_code: type: string formatted_address: description: "Address formatted for intelligent analysis by google maps" type: string responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/EstablishmentIdentity" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] delete: tags: [Establishments] summary: Remove an establishment description: "Remove an establishment" operationId: app.contacts.establishments.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of establishment" required: true schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] # Establishments Contact "/apps/{appId}/establishments/{establishment_id}/contact/{contact_id}": post: tags: [Establishments, Contact, Update] summary: "Update an establishment contact" description: "Update an establishment contact by establishment id and contact id" operationId: app.contacts.establishments.updateContact parameters: - $ref: "#/components/parameters/appId" - name: establishment_id in: path description: "ID of the establishment" required: true schema: type: integer - name: contact_id in: path description: "ID of the contact" required: true schema: type: integer - name: name in: query description: "Civility, name and firstname of the contact" schema: type: string - name: job in: query description: "Job / function / department of the contact" schema: type: string - name: phone in: query schema: type: string - name: email in: query schema: type: string responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/EstablishmentContact" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] delete: tags: [Establishments, Contact, Delete] summary: Remove an establishment contact description: "Remove an establishment contact" operationId: app.contacts.establishments.deleteContact parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of establishment" required: true schema: type: integer - name: establishment_id in: path description: "ID of the establishment" required: true schema: type: integer - name: contact_id in: path description: "ID of the contact" required: true schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] # Relationships "/apps/{appId}/relationships": get: tags: [Relationships] summary: "List relationships" description: "List all relationships" operationId: app.contacts.relationships.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/Relationship" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/relationships/{id}/attach": post: tags: [Relationships] summary: "Attach a file" description: "" operationId: app.contacts.relationships.attach parameters: - $ref: "#/components/parameters/appId" - name: id required: true in: path schema: type: integer - name: file description: File to attach in: query schema: type: string format: binary responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Relationships] summary: "Detach a file" description: "" operationId: app.contacts.relationships.detach parameters: - $ref: "#/components/parameters/appId" - name: id required: true in: path schema: type: integer - name: file_id description: File to detach in: query schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/relationships/{id}": get: tags: [Relationships] summary: "Get a relationship" description: "Get a relationship by id" operationId: app.contacts.relationships.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of Relationship" required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Relationship" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Relationships] summary: "Update a relationship" description: "Update a relationship by id" operationId: app.contacts.relationships.update parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of Relationship" required: true schema: type: integer - name: is_customer in: query schema: type: boolean - name: is_supplier in: query schema: type: boolean - name: is_prospect in: query schema: type: boolean - name: importance_level in: query schema: type: integer - name: rating in: query schema: type: integer - name: balance_initial_amount in: query schema: type: integer - name: is_notifying in: query schema: type: boolean - name: note in: query schema: type: string - name: reference description: "Accounting number if it's specific. No special chars accepted." in: query schema: type: string nullable: true pattern: "/^[0-9a-z]{1,}$/i" - name: tags in: query schema: type: string nullable: true - name: discount in: query schema: type: string nullable: true - name: details in: query schema: type: string nullable: true - name: metadata in: query schema: type: array items: type: string nullable: true responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Relationship" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/relationships/{id}/tag": post: tags: [Relationships, tags] summary: "Add a tag on a relationship" description: "" operationId: app.contacts.relationships.tag parameters: - $ref: "#/components/parameters/appId" - name: id description: Relationship id required: true in: path schema: type: integer - name: tag description: Tag to add in: query schema: type: string responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Relationships, tags] summary: "Delete a tag on a relationship" description: "" operationId: app.contacts.relationships.untag parameters: - $ref: "#/components/parameters/appId" - name: id description: Relationship id required: true in: path schema: type: integer - name: tag description: Tag to delete in: query schema: type: string responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] # Contacts - Special functions "/apps/{appId}/contacts/merge": post: tags: [hidden] summary: "Merge many contacts" description: "" operationId: app.contacts.transform.merge parameters: - $ref: "#/components/parameters/appId" - name: contacts required: true in: query schema: type: array nullable: true items: format: object properties: id: type: integer type: type: string enum: [organization, person] responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] # # Documents # # Invoices "/apps/{appId}/invoices": get: tags: [Invoices] summary: "List invoices" description: "Get list of invoices" operationId: app.documents.sales.invoices.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/Invoice" "404": description: Not found security: - is_authenticated: [] post: tags: [Invoices] summary: "Create an invoice" description: "Create a new invoice with an Organization or a Person. Relationship store notes, metadata and accounting settings parameters" operationId: app.documents.sales.invoices.create parameters: - $ref: "#/components/parameters/appId" - name: contact_infos in: query schema: type: object nullable: true properties: id: type: integer type: type: string enum: [organization, person] name: description: "Customer name obtained from customer object or set manually" type: string nullable: true address: description: "Customer addresss (street number and address) obtained from customer object or set manually" type: string nullable: true address2: description: "Customer address subline obtained from customer object or set manually" type: string nullable: true location: description: "Customer address location (city, postal code and country) obtained from customer object or set manually" type: string nullable: true details: type: string nullable: true - name: third_account in: query schema: type: object nullable: true properties: id: type: integer type: type: string enum: [organization, person] name: description: "Third account name obtained from customer object or set manually" type: string nullable: true address: description: "Third account addresss (street number and address) obtained from customer object or set manually" type: string nullable: true location: description: "Third account address location (city, postal code and country) obtained from customer object or set manually" type: string nullable: true - name: title in: query schema: type: string nullable: true - name: content in: query schema: type: array items: $ref: "#/components/schemas/SalesLine" - name: columns in: query description: "List columns to display" schema: type: object properties: designation: type: string quantity: type: string quantity_name: type: string info_total_quantity: type: string amount: type: string subtotal: type: string due: type: string vat_percent: type: string discount: type: string - name: reference in: query description: "Free variable not display in document" schema: type: string nullable: true - name: discount in: query schema: type: object properties: name: type: string amount: type: integer percent: type: integer - name: currency in: query schema: type: string - name: legal_notice description: "Legal mentions" in: query schema: type: string nullable: true - name: bank_details_id in: query schema: type: integer nullable: true - name: vat_exemption in: query schema: type: object properties: exempted: type: boolean description: "specify if exempted or not" reason: type: string description: "example : micro for microentrepreneur" nullable: true article: type: string nullable: true - name: tags in: query schema: type: array nullable: true items: format: string - name: metadata in: query schema: type: array items: type: string nullable: true - name: downpayments in: query schema: type: array nullable: true items: type: integer - name: downpayment_cash in: query schema: type: integer nullable: true - name: avoid_of in: query schema: type: integer nullable: true - name: delivered_at in: query schema: type: string format: date-time nullable: true - name: payment_period description: "Days count before considere this invoice as late" in: query schema: type: integer nullable: true default: 30 - name: expected_payment_deadline_at in: query schema: type: string format: date nullable: true - name: payment_methods description: "Accepted methods of payment for this invoice. Methods comma separated" in: query schema: type: string default: "virement bancaire, chèque" - name: number_from_other_software description: "Invoices imported from another software are not counted in the numbering and are not locked" in: query schema: type: string - name: is_auto_finalize description: "Automatically finalize the invoice when written_at is set" in: query schema: type: boolean - name: is_auto_send_email description: "Automatically send email when invoice is unpaid" in: query schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Invoice" "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/invoices/batch": post: tags: [Invoices] summary: Create or update many invoices description: "Create or update many invoices" operationId: app.documents.sales.invoices.batch parameters: - $ref: "#/components/parameters/appId" - name: data description: "List of invoices. With ID for update, without for insert" in: query required: true schema: type: array items: $ref: "#/components/schemas/Invoice" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Invoice" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Invoices] summary: Delete many invoices description: "Delete many invoices" operationId: app.documents.sales.invoices.batch_delete parameters: - $ref: "#/components/parameters/appId" - name: ids description: "List of invoices ID" in: query required: true schema: type: array items: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/invoices/nextnumber": get: tags: [Invoices] summary: "Get the next invoice number for preview" description: "" operationId: app.documents.sales.invoices.nextnumber parameters: - $ref: "#/components/parameters/appId" - name: written_at in: query description: "Write date" schema: type: string format: date-time responses: "200": description: Success "400": description: Bad request security: - is_authenticated: [] "/apps/{appId}/invoices/download": # download a list of invoices get: tags: [Invoices] summary: "Download a list of invoices in pdf into a .zip file" description: "" operationId: app.documents.sales.invoices.download parameters: - $ref: "#/components/parameters/appId" - name: ids in: query description: "Array of invoices id" required: true schema: type: array items: type: integer - name: template in: query description: Template name to generate document schema: type: string nullable: true enum: [delivery, command] responses: "200": description: Success content: application/zip: schema: type: string format: binary "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/invoices/statistics": # statistics of a list of invoices by filter get: tags: [Invoices] summary: "Obtain statistics about invoices" description: "" operationId: app.documents.sales.invoices.statistics parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" responses: "200": description: Success content: application/json: schema: type: object "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/invoices/fresh": post: tags: [Invoices] summary: "Regenerate pdf and recalcul amounts of invoice" description: "" operationId: app.documents.sales.invoices.fresh parameters: - $ref: "#/components/parameters/appId" - name: ids in: query description: "Array of invoices id" required: true schema: type: array items: type: integer responses: "200": description: Success content: application/json: schema: type: object "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/invoices/chorus-pro": post: tags: [ Invoices, Chorus-Pro ] summary: "Send selected invoices to Chorus-Pro" description: "" operationId: app.payments.choruspro.upload parameters: - $ref: "#/components/parameters/appId" - name: ids in: query description: "Array of invoices id" required: true schema: type: array items: type: integer responses: "200": description: Success content: application/json: schema: type: object "400": description: Bad request "404": description: Not found security: - is_authenticated: [ ] "/apps/{appId}/invoices/{id}": get: tags: [Invoices] summary: "Get an invoice" description: "Get an Sales/Invoice object by Id" operationId: app.documents.sales.invoices.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of invoice" required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Invoice" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Invoices] summary: Update an invoice description: "Update an invoice by id" operationId: app.documents.sales.invoices.update parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of invoice" required: true schema: type: integer - name: contact_infos in: query schema: type: object nullable: true properties: id: type: integer type: type: string enum: [organization, person] name: description: "Customer name obtained from customer object or set manually" type: string nullable: true address: description: "Customer addresss (street number and address) obtained from customer object or set manually" type: string nullable: true address2: description: "Customer address subline obtained from customer object or set manually" type: string nullable: true location: description: "Customer address location (city, postal code and country) obtained from customer object or set manually" type: string nullable: true details: type: string nullable: true - name: third_account in: query schema: type: object nullable: true properties: id: type: integer type: type: string enum: [organization, person] name: description: "Third account name obtained from customer object or set manually" type: string nullable: true address: description: "Third account addresss (street number and address) obtained from customer object or set manually" type: string nullable: true location: description: "Third account address location (city, postal code and country) obtained from customer object or set manually" type: string nullable: true - name: title in: query schema: type: string nullable: true - name: content in: query schema: type: array items: $ref: "#/components/schemas/SalesLine" - name: columns in: query description: "List columns to display" schema: type: object properties: designation: type: string quantity: type: string quantity_name: type: string info_total_quantity: type: string amount: type: string subtotal: type: string due: type: string vat_percent: type: string discount: type: string - name: reference in: query description: "Free variable not display in document" schema: type: string nullable: true - name: discount in: query schema: type: object properties: name: type: string amount: type: integer percent: type: integer - name: currency in: query schema: type: string - name: legal_notice description: "Legal mentions" in: query schema: type: string nullable: true - name: bank_details_id in: query schema: type: integer nullable: true - name: vat_exemption in: query schema: type: object properties: exempted: type: boolean description: "specify if exempted or not" reason: type: string description: "example : micro for microentrepreneur" nullable: true article: type: string nullable: true - name: tags in: query schema: type: array nullable: true items: format: string - name: metadata in: query schema: type: array items: type: string nullable: true - name: downpayments in: query schema: type: array nullable: true items: type: integer - name: downpayment_cash in: query schema: type: integer nullable: true - name: avoid_of in: query schema: type: integer nullable: true - name: delivered_at in: query schema: type: string format: date-time nullable: true - name: payment_period description: "Days count before considere this invoice as late" in: query schema: type: integer nullable: true default: 30 - name: expected_payment_deadline_at in: query schema: type: string format: date nullable: true - name: payment_methods description: "Accepted methods of payment for this invoice. Methods comma separated" in: query schema: type: string default: "virement bancaire, chèque" - name: author_user_id description: "Author id of the invoice" in: query schema: type: integer nullable: true - name: details in: query schema: type: string nullable: true - name: is_auto_finalize description: "Automatically finalize the invoice when written_at is set" in: query schema: type: boolean - name: is_auto_send_email description: "Automatically send email when invoice is unpaid" in: query schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Invoice" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] delete: tags: [Invoices] summary: Remove an invoice description: "Remove an invoice by id : only for draft" operationId: app.documents.sales.invoices.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of invoice" required: true schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/invoices/{id}/duplicate": post: tags: [Invoices] summary: "Duplicate an invoice" description: "" operationId: app.documents.sales.invoices.duplicate parameters: - $ref: "#/components/parameters/appId" - name: id description: Invoice id to duplicate required: true in: path schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/invoices/{id}/avoid": post: tags: [Invoices] summary: "Create a creditnote on an invoice" description: "" operationId: app.documents.sales.invoices.avoid parameters: - $ref: "#/components/parameters/appId" - name: id description: Invoice id to create a credit note required: true in: path schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/invoices/{id}/finalize": post: tags: [Invoices] summary: "Finalize an invoice" description: "" operationId: app.documents.sales.invoices.finalize parameters: - $ref: "#/components/parameters/appId" - name: id description: Invoice id to finalize required: true in: path schema: type: integer - name: force_date description: Automatically updates the date if earlier than the last invoice in: query schema: type: boolean responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/invoices/{id}/updatestatus": post: tags: [Invoices] summary: "Update the status of an invoice" description: "" operationId: app.documents.sales.invoices.updatestatus parameters: - $ref: "#/components/parameters/appId" - name: id description: Invoice id required: true in: path schema: type: integer - name: status description: Status to update in: query schema: type: string enum: [draft, final, paid] responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/invoices/{id}/attach": post: tags: [Invoices] summary: "Attach a file at an invoice" description: "" operationId: app.documents.sales.invoices.attach parameters: - $ref: "#/components/parameters/appId" - name: id required: true in: path schema: type: integer - name: file description: File to attach in: query schema: type: string format: binary responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Invoices] summary: "Detach a file at an invoice" description: "" operationId: app.documents.sales.invoices.detach parameters: - $ref: "#/components/parameters/appId" - name: id description: Invoice id required: true in: path schema: type: integer - name: file_id description: File to detach in: query schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/invoices/{id}/tag": post: tags: [Invoices] summary: "Add a tag on an invoice" description: "" operationId: app.documents.sales.invoices.tag parameters: - $ref: "#/components/parameters/appId" - name: id description: Invoice id required: true in: path schema: type: integer - name: tag description: Tag to add in: query schema: type: string responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Invoices] summary: "Delete a tag on an invoice" description: "" operationId: app.documents.sales.invoices.untag parameters: - $ref: "#/components/parameters/appId" - name: id description: Invoice id required: true in: path schema: type: integer - name: tag description: Tag to delete in: query schema: type: string responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/invoices/{id}/pdf": get: tags: [Invoices] summary: "Download the invoice as pdf" description: "" operationId: app.documents.sales.invoices.pdf parameters: - $ref: "#/components/parameters/appId" - name: id description: Invoice id to download required: true in: path schema: type: integer - name: template in: query description: Template name to generate document schema: type: string nullable: true enum: [delivery, command] responses: "200": description: Success content: application/pdf: schema: type: string format: binary "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/invoices/{id}/preview.jpg": get: tags: [Invoices] summary: "Download invoice as jpeg" description: "" operationId: app.documents.sales.invoices.preview parameters: - $ref: "#/components/parameters/appId" - name: id description: Invoice id to download required: true in: path schema: type: integer - name: template in: query description: Template name to generate document schema: type: string nullable: true - name: base64 in: query description: Get the image in base64 schema: type: boolean nullable: true responses: "200": description: Success content: application/jpeg: schema: type: string format: binary "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/invoice/{id}/link": get: tags: [Invoices] summary: "Generate an invoice link" description: "" operationId: app.documents.sales.exportinvoice.link parameters: - $ref: "#/components/parameters/appId" - name: id description: Invoice id to link required: true in: path schema: type: integer responses: "200": description: Success content: application/json: schema: type: string "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/invoice/batch/breakdown": post: tags: [Invoices] summary: "Update the breakdown of an invoice" description: "" operationId: app.documents.sales.invoices.update_breakdown parameters: - $ref: "#/components/parameters/appId" - name: invoices description: Key of array is the invoice id, value is the breakdown array in: query schema: type: array responses: "200": description: Success content: application/json: schema: type: string "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/invoice/token-validation/": get: tags: [Invoices] summary: "Validate an invoice token" description: "" operationId: app.documents.sales.exportinvoice.token_validation parameters: - name: token description: Token to validate required: true in: query schema: type: string - name: format in: query description: Format of the invoice schema: type: string nullable: true enum: [jpg, pdf] responses: "200": description: Success content: application/json: schema: type: object "400": description: Bad request "404": description: Not found "/invoice/download/fec/{token}": get: tags: [Invoices] summary: "Download .fec invoice" description: "" operationId: app.documents.sales.exportinvoice.download_invoice_fec parameters: - name: token description: Token to validate required: true in: path schema: type: string responses: "200": description: Success "404": description: Not found "/invoice/download/pdf/{token}": get: tags: [Invoices] summary: "Download pdf invoice" description: "" operationId: app.documents.sales.exportinvoice.download_invoice_pdf parameters: - name: token description: Token to validate required: true in: path schema: type: string responses: "200": description: Success "404": description: Not found "/apps/{appId}/invoices/delete/all": delete: tags: [Invoices] summary: "Remove all purchases" description: "Remove all purchases" operationId: app.documents.sales.invoices.deleteAll responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" security: - is_logged: [] - is_authenticated: [] # Quotes "/apps/{appId}/quotes": get: tags: [Quotes] summary: "List quotes" description: "Get list of quotes" operationId: app.documents.sales.quotes.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/Quote" "404": description: Not found security: - is_authenticated: [] post: tags: [Quotes] summary: "Create a quote" description: "Create a new quote with an Organization or a Person. Relationship store notes, metadata and accounting settings parameters" operationId: app.documents.sales.quotes.create parameters: - $ref: "#/components/parameters/appId" - name: contact_infos in: query schema: type: object nullable: true properties: id: type: integer type: type: string enum: [organization, person] name: description: "Customer name obtained from customer object or set manually" type: string nullable: true address: description: "Customer addresss (street number and address) obtained from customer object or set manually" type: string nullable: true address2: description: "Customer address subline obtained from customer object or set manually" type: string nullable: true location: description: "Customer address location (city, postal code and country) obtained from customer object or set manually" type: string nullable: true details: type: string nullable: true - name: third_account in: query schema: type: object nullable: true properties: id: type: integer type: type: string enum: [organization, person] name: description: "Third account name obtained from customer object or set manually" type: string nullable: true address: description: "Third account addresss (street number and address) obtained from customer object or set manually" type: string nullable: true location: description: "Third account address location (city, postal code and country) obtained from customer object or set manually" type: string nullable: true - name: title in: query schema: type: string - name: content in: query schema: type: array items: $ref: "#/components/schemas/SalesLine" - name: columns in: query description: "List columns to display" schema: type: object properties: designation: type: string quantity: type: string quantity_name: type: string info_total_quantity: type: string amount: type: string subtotal: type: string due: type: string vat_percent: type: string discount: type: string - name: reference in: query description: "Free variable not display in document" schema: type: string - name: discount in: query schema: type: object properties: name: type: string amount: type: integer percent: type: integer - name: currency in: query schema: type: string - name: legal_notice description: "Legal mentions" in: query schema: type: string - name: bank_details_id in: query schema: type: integer nullable: true - name: vat_exemption in: query schema: type: object properties: exempted: type: boolean reason: type: string article: type: string - name: tags in: query schema: type: array items: format: string - name: metadata in: query schema: type: array items: type: string nullable: true - name: downpayment_request in: query schema: type: object properties: amount: description: "Use downpayment request value for fix downpayment" type: integer percent: description: "Use downpayment request in percent for variable downpayment" type: integer - name: commercialvalidity_deadline in: query schema: type: string format: date-time nullable: true - name: number_from_other_software description: "Invoices imported from another software are not counted in the numbering and are not locked" in: query schema: type: string responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Quote" "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/quotes/batch": post: tags: [Quotes] summary: Create or update many quotes description: "Create or update many quotes" operationId: app.documents.sales.quotes.batch parameters: - $ref: "#/components/parameters/appId" - name: data description: "List of quotes. With ID for update, without for insert" in: query required: true schema: type: array items: $ref: "#/components/schemas/Quote" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Quote" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Quotes] summary: Delete many quotes description: "Delete many quotes" operationId: app.documents.sales.quotes.batch_delete parameters: - $ref: "#/components/parameters/appId" - name: ids description: "List of quotes ID" in: query required: true schema: type: array items: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/quotes/invoice": post: tags: [Quotes] summary: Create or update many quotes description: "Create or update many quotes" operationId: app.documents.sales.quotes.invoices parameters: - $ref: "#/components/parameters/appId" - name: ids in: query description: "Array of quotes id" required: true schema: type: array items: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Invoice" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/quotes/nextnumber": get: tags: [Quotes] summary: "Get the next quote number for preview" description: "" operationId: app.documents.sales.quotes.nextnumber parameters: - $ref: "#/components/parameters/appId" - name: written_at in: query description: "Write date" schema: type: string format: date-time responses: "200": description: Success "400": description: Bad request security: - is_authenticated: [] "/apps/{appId}/quotes/download": # download a list of invoices by filter get: tags: [Quotes] summary: "Download a list of quotes in pdf into a .zip file" description: "" operationId: app.documents.sales.quotes.download parameters: - $ref: "#/components/parameters/appId" - name: ids in: query description: "Array of quotes id" required: true schema: type: array items: type: integer - name: template in: query description: Template name to generate document schema: type: string nullable: true enum: [delivery, command] responses: "200": description: Success content: application/zip: schema: type: string format: binary "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/quotes/statistics": # statistics of a list of invoices by filter get: tags: [Quotes] summary: "Obtain statistics about quotes" description: "" operationId: app.documents.sales.quotes.statistics parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" responses: "200": description: Success content: application/json: schema: type: object "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/quotes/fresh": post: tags: [Quotes] summary: "Regenerate pdf and recalcul amounts of quote" description: "" operationId: app.documents.sales.quotes.fresh parameters: - $ref: "#/components/parameters/appId" - name: ids in: query description: "Array of quotes id" required: true schema: type: array items: type: integer responses: "200": description: Success content: application/json: schema: type: object "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/quotes/{id}": get: tags: [Quotes] summary: "Get a quote" description: "Get a Sales/Quote object by Id" operationId: app.documents.sales.quotes.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of quote" required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Quote" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Quotes] summary: Update a quote description: "Update a quote by id" operationId: app.documents.sales.quotes.update parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of quote" required: true schema: type: integer - name: contact_infos in: query schema: type: object nullable: true properties: id: type: integer type: type: string enum: [organization, person] name: description: "Customer name obtained from customer object or set manually" type: string nullable: true address: description: "Customer addresss (street number and address) obtained from customer object or set manually" type: string nullable: true address2: description: "Customer address subline obtained from customer object or set manually" type: string nullable: true location: description: "Customer address location (city, postal code and country) obtained from customer object or set manually" type: string nullable: true details: type: string nullable: true - name: third_account in: query schema: type: object nullable: true properties: id: type: integer type: type: string enum: [organization, person] name: description: "Third account name obtained from customer object or set manually" type: string nullable: true address: description: "Third account addresss (street number and address) obtained from customer object or set manually" type: string nullable: true location: description: "Third account address location (city, postal code and country) obtained from customer object or set manually" type: string nullable: true - name: title in: query schema: type: string - name: content in: query schema: type: array items: $ref: "#/components/schemas/SalesLine" - name: columns in: query description: "List columns to display" schema: type: object properties: designation: type: string quantity: type: string quantity_name: type: string info_total_quantity: type: string amount: type: string subtotal: type: string due: type: string vat_percent: type: string discount: type: string - name: reference in: query description: "Free variable not display in document" schema: type: string - name: discount in: query schema: type: object properties: name: type: string amount: type: integer percent: type: integer - name: currency in: query schema: type: string - name: legal_notice description: "Legal mentions" in: query schema: type: string - name: bank_details_id in: query schema: type: integer nullable: true - name: vat_exemption in: query schema: type: object properties: exempted: type: boolean reason: type: string article: type: string - name: tags in: query schema: type: array items: format: string - name: metadata in: query schema: type: array items: type: string nullable: true - name: downpayment_request in: query schema: type: object properties: amount: description: "Use downpayment request value for fix downpayment" type: integer percent: description: "Use downpayment request in percent for variable downpayment" type: integer - name: commercialvalidity_deadline in: query schema: type: string format: date-time nullable: true - name: author_user_id description: "Author id of the invoice" in: query schema: type: integer nullable: true responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Quote" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] delete: tags: [Quotes] summary: Remove a quote description: "Remove a quote by id : only for draft" operationId: app.documents.sales.quotes.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of quote" required: true schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/quotes/{id}/finalize": post: tags: [Quotes] summary: "Finalize a quote" description: "" operationId: app.documents.sales.quotes.finalize parameters: - $ref: "#/components/parameters/appId" - name: id description: Quote id to finalize required: true in: path schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/quotes/{id}/duplicate": post: tags: [Quotes] summary: "Duplicate a quote" description: "" operationId: app.documents.sales.quotes.duplicate parameters: - $ref: "#/components/parameters/appId" - name: id description: Quote id to duplicate required: true in: path schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Quote" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/quotes/{id}/invoice": post: tags: [Quotes] summary: "Transform the quote in invoice" description: "" operationId: app.documents.sales.quotes.invoice parameters: - $ref: "#/components/parameters/appId" - name: id description: Quote id to transform required: true in: path schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Invoice" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/quotes/{id}/situation_invoice": post: tags: [Quotes] summary: "Transform the quote into a situation invoice" description: "" operationId: app.documents.sales.quotes.situation_invoice parameters: - $ref: "#/components/parameters/appId" - name: id description: Quote id to transform required: true in: path schema: type: integer - name: progress description: "Percentage of progress in cents (100 = 1%)" required: true in: query schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Invoice" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/quotes/{id}/downpayment": post: tags: [Quotes] summary: "Transform the quote in a downpayment invoice" description: "" operationId: app.documents.sales.quotes.downpayment parameters: - $ref: "#/components/parameters/appId" - name: id required: true in: path schema: type: integer - name: percent description: "Percentage of downpayment in cents (100 = 1%)" required: true in: query schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Invoice" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/quotes/{id}/updatestatus": post: tags: [Quotes] summary: "Update the status of a quote" description: "" operationId: app.documents.sales.quotes.updatestatus parameters: - $ref: "#/components/parameters/appId" - name: id description: Invoice id to finalize required: true in: path schema: type: integer - name: status description: Status to update in: query schema: type: string enum: [ waiting, goodforagreement, refused, transformed, deleted, ] responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/quotes/{id}/attach": post: tags: [Quotes] summary: "Attach a file at a quote" description: "" operationId: app.documents.sales.quotes.attach parameters: - $ref: "#/components/parameters/appId" - name: id description: Quote id required: true in: path schema: type: integer - name: file description: File to attach in: query schema: type: string format: binary responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Quotes] summary: "Detach a file at a quote" description: "" operationId: app.documents.sales.quotes.detach parameters: - $ref: "#/components/parameters/appId" - name: id description: Quote id required: true in: path schema: type: integer - name: file_id description: File to detach in: query schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/quotes/{id}/tag": post: tags: [Quotes] summary: "Add a tag on an quote" description: "" operationId: app.documents.sales.quotes.tag parameters: - $ref: "#/components/parameters/appId" - name: id description: Quote id required: true in: path schema: type: integer - name: tag description: Tag to add in: query schema: type: string responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Quotes] summary: "Delete a tag on a quote" description: "" operationId: app.documents.sales.quotes.untag parameters: - $ref: "#/components/parameters/appId" - name: id description: Quote id required: true in: path schema: type: integer - name: tag description: Tag to delete in: query schema: type: string responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/quotes/{id}/pdf": get: tags: [Quotes] summary: "Download the quote as pdf" description: "" operationId: app.documents.sales.quotes.pdf parameters: - $ref: "#/components/parameters/appId" - name: id description: Quote id to download required: true in: path schema: type: integer - name: template in: query description: Template name to generate document schema: type: string nullable: true enum: [delivery, command] responses: "200": description: Success content: application/pdf: schema: type: string format: binary "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/quotes/{id}/preview.jpg": # idem get: tags: [Quotes] summary: "Download quote as jpeg" description: "" operationId: app.documents.sales.quotes.preview parameters: - $ref: "#/components/parameters/appId" - name: id description: Quote id to download required: true in: path schema: type: integer - name: template in: query description: Template name to generate document schema: type: string nullable: true enum: [delivery, command] responses: "200": description: Success content: application/jpeg: schema: type: string format: binary "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/quotes/{id}/yousign/preview.jpg": get: tags: [Quotes] summary: "Download quote as jpeg" description: "" operationId: app.documents.sales.quotes.yousign_preview parameters: - $ref: "#/components/parameters/appId" - name: id description: Quote id to download required: true in: path schema: type: integer - name: template in: query description: Template name to generate document schema: type: string nullable: true enum: [delivery, command] responses: "200": description: Success content: application/jpeg: schema: type: string format: binary "400": description: Bad request "404": description: Not found "/apps/{appId}/quotes/delete/all": delete: tags: [Quotes] summary: "Remove all quotes" description: "Remove all quotes" operationId: app.documents.sales.quotes.deleteAll responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" security: - is_logged: [] - is_authenticated: [] # Documents - Models "/apps/{appId}/salesdocumentmodels": # CRUD get: tags: [hidden] summary: "List sales documents models" description: "" operationId: app.documents.sales.models.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/SalesDocumentModel" "404": description: Not found security: - is_authenticated: [] post: tags: [hidden] summary: "Create a sales document model" description: "" operationId: app.documents.sales.models.create parameters: - $ref: "#/components/parameters/appId" - name: name in: query schema: type: string - name: title in: query schema: type: string - name: content in: query schema: type: array items: $ref: "#/components/schemas/SalesLine" - name: columns in: query description: "List columns to display" schema: type: object properties: designation: type: string quantity: type: string quantity_name: type: string info_total_quantity: type: string amount: type: string subtotal: type: string due: type: string vat_percent: type: string discount: type: string responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/SalesDocumentModel" "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/salesdocumentmodels/{id}": # CRUD get: tags: [hidden] summary: "Get a sales document model" description: "" operationId: app.documents.sales.models.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of SalesDocumentModel" required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/SalesDocumentModel" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [hidden] summary: Update a sales document model description: "" operationId: app.documents.sales.models.update parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of SalesDocumentModel" required: true schema: type: integer - name: name in: query schema: type: string - name: title in: query schema: type: string - name: content in: query schema: type: array items: $ref: "#/components/schemas/SalesLine" - name: columns in: query description: "List columns to display" schema: type: object properties: designation: type: string quantity: type: string quantity_name: type: string info_total_quantity: type: string amount: type: string subtotal: type: string due: type: string vat_percent: type: string discount: type: string responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/SalesDocumentModel" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] delete: tags: [hidden] summary: Remove a sales document model description: "" operationId: app.documents.sales.models.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of SalesDocumentModel" required: true schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] # Documents - Recurring invoices "/apps/{appId}/recurringinvoices": # CRUD get: tags: [hidden] summary: "List RecurringInvoice" description: "" operationId: app.documents.sales.recurringinvoices.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/RecurringInvoice" "404": description: Not found security: - is_authenticated: [] post: tags: [hidden] summary: "Create a RecurringInvoice" description: "" operationId: app.documents.sales.recurringinvoices.create parameters: - $ref: "#/components/parameters/appId" - name: contact_infos in: query schema: type: object nullable: true properties: id: type: integer type: type: string enum: [organization, person] name: description: "Customer name obtained from customer object or set manually" type: string nullable: true address: description: "Customer addresss (street number and address) obtained from customer object or set manually" type: string nullable: true address2: description: "Customer address subline obtained from customer object or set manually" type: string nullable: true location: description: "Customer address location (city, postal code and country) obtained from customer object or set manually" type: string nullable: true details: type: string nullable: true - name: title in: query schema: type: string nullable: true - name: content in: query schema: type: array nullable: true items: $ref: "#/components/schemas/SalesLine" - name: columns in: query description: "List columns to display" schema: type: object properties: designation: type: string quantity: type: string quantity_name: type: string info_total_quantity: type: string amount: type: string subtotal: type: string due: type: string vat_percent: type: string discount: type: string - name: currency in: query schema: type: string - name: legal_notice description: "Legal mentions" in: query schema: type: string nullable: true - name: bank_details_id in: query schema: type: integer nullable: true - name: vat_exemption in: query schema: type: object properties: exempted: type: boolean reason: type: string nullable: true article: type: string nullable: true - name: tags in: query schema: type: array nullable: true items: format: string - name: metadata in: query schema: type: array items: type: string nullable: true - name: payment_period description: "Days count before considere this invoice as late" in: query schema: type: integer default: 30 # recurring config - name: next_invoice_at in: query schema: type: string format: date-time nullable: true - name: end_at in: query schema: type: string format: date-time nullable: true - name: frequency_count in: query required: true schema: type: integer - name: frequency_duration in: query required: true schema: type: string enum: [day, week, month, trimester, semester, year] - name: discount in: query schema: type: integer - name: discount_mode in: query schema: type: string enum: [percent] nullable: true - name: discount_start_at in: query schema: type: string format: date-time nullable: true - name: discount_end_at in: query schema: type: string format: date-time nullable: true - name: details in: query schema: type: string nullable: true - name: orders_plan in: query schema: type: array nullable: true items: type: object properties: model: type: integer end_at: type: string format: date-time - name: recipient_emails in: query schema: type: array nullable: true items: type: string format: email - name: need_copy_bcc in: query schema: type: boolean nullable: false enum: [0, 1] responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/RecurringInvoice" "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/recurringinvoices/batch": post: tags: [hidden] summary: Create or update many RecurringInvoice description: "Create or update many RecurringInvoice" operationId: app.documents.sales.recurringinvoices.batch parameters: - $ref: "#/components/parameters/appId" - name: data description: "List of RecurringInvoice. With ID for update, without for insert" in: query required: true schema: type: array items: $ref: "#/components/schemas/RecurringInvoice" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/RecurringInvoice" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [hidden] summary: Delete many RecurringInvoice description: "Delete many RecurringInvoice" operationId: app.documents.sales.recurringinvoices.batch_delete parameters: - $ref: "#/components/parameters/appId" - name: ids description: "List of RecurringInvoice ID" in: query required: true schema: type: array items: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/recurringinvoices/periods": # CRUD get: tags: [hidden] summary: "Get json of periods_formats for a date." description: "Get json of periods_formats for a date. If request parameter date is null, returns periods_formats for today." operationId: app.documents.sales.recurringinvoices.getPeriods parameters: - $ref: "#/components/parameters/appId" - name: date in: query description: Date of the invoice required: false schema: type: string format: date-time nullable: true responses: "200": description: Success content: application/json: schema: type: array "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/recurringinvoices/{id}": #CRUD get: tags: [hidden] summary: "Get a RecurringInvoice" description: "" operationId: app.documents.sales.recurringinvoices.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of RecurringInvoice" required: true schema: type: integer format: RecurringInvoice - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/RecurringInvoice" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [hidden] summary: Update a RecurringInvoice description: "" operationId: app.documents.sales.recurringinvoices.update parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of RecurringInvoice" required: true schema: type: integer - name: contact_infos in: query schema: type: object nullable: true properties: id: type: integer type: type: string enum: [organization, person] name: description: "Customer name obtained from customer object or set manually" type: string nullable: true address: description: "Customer addresss (street number and address) obtained from customer object or set manually" type: string nullable: true address2: description: "Customer address subline obtained from customer object or set manually" type: string nullable: true location: description: "Customer address location (city, postal code and country) obtained from customer object or set manually" type: string nullable: true details: type: string nullable: true - name: title in: query schema: type: string nullable: true - name: content in: query schema: type: array nullable: true items: $ref: "#/components/schemas/SalesLine" - name: columns in: query description: "List columns to display" schema: type: object properties: designation: type: string quantity: type: string quantity_name: type: string info_total_quantity: type: string amount: type: string subtotal: type: string due: type: string vat_percent: type: string discount: type: string - name: currency in: query schema: type: string - name: legal_notice description: "Legal mentions" in: query schema: type: string nullable: true - name: bank_details_id in: query schema: type: integer nullable: true - name: vat_exemption in: query schema: type: object properties: exempted: type: boolean reason: type: string nullable: true article: type: string nullable: true - name: tags in: query schema: type: array nullable: true items: format: string - name: metadata in: query schema: type: array items: type: string nullable: true - name: payment_period description: "Days count before considere this invoice as late" in: query schema: type: integer default: 30 # recurring config - name: next_invoice_at in: query schema: type: string format: date-time nullable: true - name: end_at in: query schema: type: string format: date-time nullable: true - name: frequency_count in: query schema: type: integer - name: frequency_duration in: query schema: type: string enum: [day, week, month, trimester, semester, year] - name: discount in: query schema: type: integer - name: discount_mode in: query schema: type: string enum: [percent] nullable: true - name: discount_start_at in: query schema: type: string format: date-time nullable: true - name: discount_end_at in: query schema: type: string format: date-time nullable: true - name: details in: query schema: type: string nullable: true - name: orders_plan in: query schema: type: array nullable: true items: type: object properties: model: type: integer end_at: type: string format: date-time - name: recipient_emails in: query schema: type: array nullable: true items: type: string format: email - name: need_copy_bcc in: query schema: type: boolean nullable: false enum: [0, 1] responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/RecurringInvoice" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] delete: tags: [hidden] summary: Remove a RecurringInvoice description: "" operationId: app.documents.sales.recurringinvoices.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of RecurringInvoice" required: true schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/recurringinvoices/{id}/plan": get: tags: [hidden] summary: "Preview next invoices generations" description: "" operationId: app.documents.sales.recurringinvoices.plan parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: Recurring invoice id required: true schema: type: integer - name: until in: query description: Until date to generate plan required: true schema: type: string format: date-time responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/Invoice" "404": description: Not found security: - is_authenticated: [] # # Banks # "/apps/{appId}/bankdetails": # CRUD get: tags: [BankDetails] summary: "List BankDetails" description: "" operationId: app.documents.sales.bankdetails.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/BankDetails" "404": description: Not found security: - is_authenticated: [] post: tags: [BankDetails] summary: "Create a BankDetails" description: "" operationId: app.documents.sales.bankdetails.create parameters: - $ref: "#/components/parameters/appId" - name: name in: query schema: type: string - name: iban in: query schema: type: string - name: bic in: query schema: type: string responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/BankDetails" "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/bankdetails/{id}": # CRUD get: tags: [BankDetails] summary: "Get a BankDetails" description: "" operationId: app.documents.sales.bankdetails.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of BankDetails" required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/BankDetails" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [BankDetails] summary: Update a BankDetails description: "" operationId: app.documents.sales.bankdetails.update parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of BankDetails" required: true schema: type: integer - name: name in: query schema: type: string - name: iban in: query schema: type: string - name: bic in: query schema: type: string responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/BankDetails" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] delete: tags: [BankDetails] summary: Remove a BankDetails description: "" operationId: app.documents.sales.bankdetails.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of BankDetails" required: true schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] # # Emails # "/apps/{appId}/email/document": # send by email a list of documents [ content + attachments : { doc type, doc id } ... ] Attachments can be files or Sinao documents post: tags: [Emails] summary: "Send an email" description: "" operationId: app.contacts.email.send parameters: - $ref: "#/components/parameters/appId" - name: from in: query schema: type: string format: email - name: recipients in: query required: true schema: type: array items: type: string format: email - name: recipients_cc in: query schema: type: array items: type: string format: email - name: recipients_bcc in: query schema: type: array items: type: string format: email - name: title in: query schema: type: string - name: body in: query schema: type: string - name: documents in: query required: true schema: type: array items: type: object properties: type: type: string enum: [invoice, quote, attachment] id: type: integer - name: need_copy_bcc in: query schema: type: boolean default: false - name: attach_invoice in: query required: false schema: type: boolean default: false responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/email/batch": post: tags: [Emails] summary: "Send emails" description: "" operationId: app.contacts.email.batch parameters: - $ref: "#/components/parameters/appId" - name: from in: query schema: type: string format: email - name: messages in: query schema: type: array items: type: object properties: recipients: type: array items: type: string format: email recipients_cc: type: array items: type: string format: email recipients_bcc: type: array items: type: string format: email title: type: string content: type: string documents: type: array items: type: object properties: type: type: string enum: [invoice, quote, attachment] id: type: integer - name: need_copy_bcc in: query schema: type: boolean default: false - name: attach_invoice in: query required: false schema: type: boolean default: false responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] # # Purchases # "/apps/{appId}/purchases": get: tags: [Purchases] summary: "List purchases" description: "Get list of purchases" operationId: app.documents.purchases.purchases.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" - name: expand in: query schema: type: array items: type: string enum: [account, supplier, balance] responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/Purchase" "404": description: Not found security: - is_authenticated: [] post: tags: [Purchases] summary: "Create a purchase" description: "Create a new purchase with an Organization. Relationship store notes, metadata and accounting settings parameters" operationId: app.documents.purchases.purchases.create parameters: - $ref: "#/components/parameters/appId" - name: invoice description: Invoice or receipt file (pdf or image) in: query schema: type: string format: binary - name: account_id in: query schema: type: integer - name: supplier_organization_id in: query schema: type: integer - name: title in: query schema: type: string - name: supplier_name in: query schema: type: string - name: amount in: query schema: type: integer - name: amount_tax in: query schema: type: integer - name: amount_reverse_tax in: query schema: type: integer - name: currency in: query schema: type: string - name: vat_detail in: query schema: type: object - name: billed_at in: query schema: type: string format: date - name: comment in: query schema: type: integer - name: tags in: query schema: type: array items: format: string - name: vat_repayment in: query schema: type: string enum: [payment, billing] - name: payment_deadline_at in: query schema: type: string format: date nullable: true - name: expected_payment_deadline_at in: query schema: type: string format: date nullable: true - name: payment_account_number in: query schema: type: string nullable: true - name: payment_routing_number in: query schema: type: string nullable: true - name: payment_swift in: query schema: type: string nullable: true - name: payment_iban in: query schema: type: string nullable: true - name: amortization_period in: query schema: type: integer nullable: true - name: author_user_id in: query schema: type: integer nullable: true - name: completed_at in: query schema: type: string format: date nullable: true - name: employee_user_id description: "Employee id of the purchase" in: query schema: type: integer nullable: true - name: employee_name description: "Employee id of the purchase" in: query schema: type: string nullable: true - name: mileage_allowance_id description: "mileage allowance id of the purchase" in: query schema: type: integer nullable: true - name: is_expense_report in: query schema: type: boolean default: false responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Purchase" "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/purchases/statistics": # statistics of a list of purchases by filter get: tags: [Purchases] summary: "Obtain statistics about purchases" description: "" operationId: app.documents.purchases.purchases.statistics parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" responses: "200": description: Success content: application/json: schema: type: object "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/purchases/batch": post: tags: [Purchases] summary: Create or update many purchases description: "Create or update many purchases" operationId: app.documents.purchases.purchases.batch parameters: - $ref: "#/components/parameters/appId" - name: data description: "List of purchases. With ID for update, without for insert" in: query required: true schema: type: array items: $ref: "#/components/schemas/Purchase" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Purchase" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Purchases] summary: Delete many purchases description: "Delete many purchases" operationId: app.documents.purchases.purchases.batch_delete parameters: - $ref: "#/components/parameters/appId" - name: ids description: "List of purchases ID" in: query required: true schema: type: array items: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/purchases/download": # download a list of purchases get: tags: [Purchases] summary: "Download a list of purchases in pdf into a .zip file" description: "" operationId: app.documents.purchases.purchases.download parameters: - $ref: "#/components/parameters/appId" - name: ids in: query description: "Array of purchases id" required: true schema: type: array items: type: integer responses: "200": description: Success content: application/zip: schema: type: string format: binary "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/purchases/{id}": get: tags: [Purchases] summary: "Get a purchase" description: "Get an Purchase/Purchase object by Id" operationId: app.documents.purchases.purchases.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of purchase" required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Purchase" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Purchases] summary: Update a purchase description: "Update a purchase by id" operationId: app.documents.purchases.purchases.update parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of purchase" required: true schema: type: integer - name: account_id description: Auto-calculated by sales_lines total in: query schema: type: integer - name: supplier_organization_id in: query schema: type: integer - name: title in: query schema: type: string - name: supplier_name in: query schema: type: string - name: amount description: Auto-calculated by sales_lines total in: query schema: type: integer - name: amount_tax in: query schema: type: integer - name: amount_reverse_tax in: query schema: type: integer - name: currency in: query schema: type: string - name: vat_detail in: query schema: type: object - name: billed_at in: query schema: type: string format: date - name: comment in: query schema: type: integer - name: tags in: query schema: type: array items: format: string - name: vat_repayment in: query schema: type: string enum: [payment, billing] - name: payment_deadline_at in: query schema: type: string format: date nullable: true - name: expected_payment_deadline_at in: query schema: type: string format: date nullable: true - name: payment_account_number in: query schema: type: string nullable: true - name: payment_routing_number in: query schema: type: string nullable: true - name: payment_swift in: query schema: type: string nullable: true - name: payment_iban in: query schema: type: string nullable: true - name: amortization_period in: query schema: type: integer nullable: true - name: purchase_lines in: query schema: type: array items: format: object properties: account_id: type: integer amount: type: integer - name: author_user_id description: "Author id of the invoice" in: query schema: type: integer nullable: true - name: employee_user_id description: "Employee id of the purchase" in: query schema: type: integer nullable: true - name: employee_name description: "Employee id of the purchase" in: query schema: type: string nullable: true - name: mileage_allowance_id description: "mileage allowance id of the purchase" in: query schema: type: integer nullable: true - name: is_expense_report in: query schema: type: boolean default: false responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Purchase" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] delete: tags: [Purchases] summary: Remove a purchase description: "Remove a purchase by id" operationId: app.documents.purchases.purchases.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of purchase" required: true schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/purchases/{id}/updatestatus": post: tags: [Purchases] summary: "Update the status of an invoice" description: "" operationId: app.documents.purchases.purchases.updatestatus parameters: - $ref: "#/components/parameters/appId" - name: id description: "ID of purchase" required: true in: path schema: type: integer - name: status description: Status to update in: query schema: type: string enum: [completed, paid] responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/purchases/{id}/attach": post: tags: [Purchases] summary: "Attach a file at a purchase" description: "" operationId: app.documents.purchases.purchases.attach parameters: - $ref: "#/components/parameters/appId" - name: id description: Purchase id required: true in: path schema: type: integer - name: file description: File to attach in: query schema: type: string format: binary responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Purchases] summary: "Detach a file at a purchase" description: "" operationId: app.documents.purchases.purchases.detach parameters: - $ref: "#/components/parameters/appId" - name: id description: Purchase id required: true in: path schema: type: integer - name: file_id description: File to detach in: query schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/purchases/{id}/tag": post: tags: [Purchases] summary: "Add a tag on a purchase" description: "" operationId: app.documents.purchases.purchases.tag parameters: - $ref: "#/components/parameters/appId" - name: id description: Purchase id required: true in: path schema: type: integer - name: tag description: Tag to add in: query schema: type: string responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Purchases] summary: "Delete a tag on a purchase" description: "" operationId: app.documents.purchases.purchases.untag parameters: - $ref: "#/components/parameters/appId" - name: id description: Purchase id required: true in: path schema: type: integer - name: tag description: Tag to delete in: query schema: type: string responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/purchases/{id}/original": get: tags: [Purchases] summary: "Download the purchase as pdf" description: "" operationId: app.documents.purchases.purchases.original parameters: - $ref: "#/components/parameters/appId" - name: id description: Purchase id to download required: true in: path schema: type: integer responses: "200": description: Success content: application/pdf: schema: type: string format: binary "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/purchases/{id}/preview.jpg": get: tags: [Purchases] summary: "Download purchase as jpeg" description: "" operationId: app.documents.purchases.purchases.preview parameters: - $ref: "#/components/parameters/appId" - name: id description: Purchase id to download required: true in: path schema: type: integer responses: "200": description: Success content: application/jpeg: schema: type: string format: binary "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/purchases/{id}/thumbnail.jpg": get: tags: [Purchases] summary: "Show purchase thumbnail as jpeg" description: "" operationId: app.documents.purchases.purchases.thumbnail parameters: - $ref: "#/components/parameters/appId" - name: id description: Purchase id to download required: true in: path schema: type: integer responses: "200": description: Success content: application/jpeg: schema: type: string format: binary "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/purchases/delete/all": delete: tags: [Purchases] summary: "Remove all purchases" description: "Remove all purchases" operationId: app.documents.purchases.purchases.deleteAll responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/purchases/mileage_allowances/create": post: tags: [Purchases] summary: "Create a mileage allowance" description: "" operationId: app.documents.purchases.mileageAllowances.create parameters: - $ref: "#/components/parameters/appId" - name: start_address description: Start address of the trip in: query schema: type: string - name: arrived_address description: Arrived address of the trip in: query schema: type: string - name: kilometers_count description: Kilometers count of the trip in: query schema: type: integer - name: fiscal_power description: Fiscal power of the car in: query schema: type: integer enum: [3, 4, 5, 6, 7] responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/purchases/mileage_allowances/{id}": post: tags: [Purchases] summary: "Update a mileage allowance" description: "" operationId: app.documents.purchases.mileageAllowances.update parameters: - $ref: "#/components/parameters/appId" - name: id description: mileageAllowances id required: true in: path schema: type: integer - name: start_address description: Start address of the trip in: query schema: type: string - name: arrived_address description: Arrived address of the trip in: query schema: type: string - name: kilometers_count description: Kilometers count of the trip in: query schema: type: integer - name: fiscal_power description: Fiscal power of the car in: query schema: type: integer enum: [3, 4, 5, 6, 7] responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/purchases/create/demo": post: tags: [Purchases] summary: "Create a fake purchase for test purpose" description: "" operationId: app.documents.purchases.purchases.create_demo parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/accounts/employees": get: tags: [Accounts] summary: "Get accounting for all employees" description: "" operationId: app.accounting.employees.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Accounts] summary: "Create accounting for an employee" description: "" operationId: app.accounting.employees.create parameters: - $ref: "#/components/parameters/appId" - name: user_id description: "Employee id" in: query schema: type: integer - name: account_id in: query schema: type: string - name: fiscal_power description: Fiscal power of the car required: true in: query schema: type: integer enum: [3, 4, 5, 6, 7] responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/accounts/employees/{id}": get: tags: [Accounts] summary: "Get account for an employee" description: "" operationId: app.accounting.employees.get parameters: - $ref: "#/components/parameters/appId" - name: id description: Employee account id required: true in: path schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Accounts] summary: "Update account for an employee" description: "" operationId: app.accounting.employees.update parameters: - $ref: "#/components/parameters/appId" - name: id description: Employee account id required: true in: path schema: type: integer - name: fiscal_power description: Fiscal power of the car required: true in: query schema: type: integer enum: [3, 4, 5, 6, 7] responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Accounts] summary: "Delete account for an employee" description: "" operationId: app.accounting.employees.delete parameters: - $ref: "#/components/parameters/appId" - name: id description: Employee account id required: true in: path schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] # # Attachments # "/apps/{appId}/attachments": get: tags: [Attachments] summary: "List attachments" description: "Get list of attachments" operationId: app.attachments.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/Attachment" "404": description: Not found security: - is_authenticated: [] post: tags: [Attachments] summary: "Attach a file on an object" description: "" operationId: app.attachments.create parameters: - $ref: "#/components/parameters/appId" - name: type description: Object to attach file required: true in: query schema: type: string enum: [ none, purchase, invoice, quote, transaction, relationship, ] - name: attachable_id description: Object id in: query schema: type: integer - name: file description: File to attach in: query schema: type: string format: binary responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] put: tags: [Attachments] summary: "Recreate S.A.P attestations" description: "" operationId: app.sapAttestations.generateSapAttestations parameters: - $ref: "#/components/parameters/appId" - name: year description: year number to generate in: query schema: type: integer responses: "200": description: Success "422": description: Error "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/attachments/download": # download a list of attachments get: tags: [attachments] summary: "Download a list of attachments in pdf into a .zip file" description: "" operationId: app.attachments.download parameters: - $ref: "#/components/parameters/appId" - name: ids in: query description: "Array of attachments id" required: true schema: type: string items: type: integer - name: type in: query description: "Type of attachment" required: true schema: type: string enum: [sap] responses: "200": description: Success content: application/zip: schema: type: string format: binary "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/attachments/sap-download": # download a list of attachments get: tags: [attachments] summary: "Download a list of SAP attestations in pdf into a .zip file" description: "" operationId: app.sapAttestations.download parameters: - $ref: "#/components/parameters/appId" - name: ids in: query description: "Array of attachments id" required: true schema: type: string items: type: integer - name: type in: query description: "Type of attachment" required: true schema: type: string enum: [sap] responses: "200": description: Success content: application/zip: schema: type: string format: binary "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/attachments/{id}": get: tags: [Attachments] summary: "Get attachment by id" description: "" operationId: app.attachments.get parameters: - $ref: "#/components/parameters/appId" - name: id description: Attachment id required: true in: path schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Attachments] summary: "Detach a file from id" description: "" operationId: app.attachments.delete parameters: - $ref: "#/components/parameters/appId" - name: id description: Attachment id required: true in: path schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/attachments/{id}/pdf": get: tags: [attachments] summary: "Download the attachment as pdf" description: "" operationId: app.attachments.RedirectToPublicUrl parameters: - $ref: "#/components/parameters/appId" - name: id description: Attachment id to download required: true in: path schema: type: integer - name: random description: random number to force fresh pdf required: true in: query schema: type: integer responses: "200": description: Success content: application/pdf: schema: type: string format: binary "400": description: Bad request "404": description: Not found security: - is_authenticated: [] # # Catalog # # Products "/apps/{appId}/products": get: tags: [Products] summary: "List products" description: "Get list of products" operationId: app.catalog.products.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/Product" "404": description: Not found security: - is_authenticated: [] post: tags: [Products] summary: Create a product description: "Create a new product" operationId: app.catalog.products.create parameters: - $ref: "#/components/parameters/appId" - name: name in: query required: true schema: type: string - name: amount description: "Price without taxes in cents" in: query schema: type: integer - name: amount_accurately description: "Price without taxes in cents / 1000" in: query schema: type: integer - name: vat_percent description: "Taxe rate in cents" in: query schema: type: integer minimum: 0 - name: image in: query schema: oneOf: - type: string format: binary - type: string format: uri - name: lifetime description: "Product life time in seconds" in: query schema: type: integer - name: description description: "Product description" in: query schema: type: string - name: type description: "Is a service or a product ?" in: query schema: type: string enum: [product, service] - name: quantity_name description: "Name of the quantity: days, liters, m2, m3..." in: query schema: type: string - name: reference in: query schema: type: string - name: account_id in: query schema: type: string - name: tags in: query schema: type: array items: format: string - name: category_id in: query schema: type: integer - name: metadata in: query schema: type: array items: type: string nullable: true responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Product" "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/products/batch": post: tags: [Products] summary: Create multiple products description: "Create a new product" operationId: app.catalog.products.batch parameters: - $ref: "#/components/parameters/appId" - name: data description: "List of products. With ID for update, without for insert" in: query required: true schema: type: array items: $ref: "#/components/schemas/Product" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Product" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Products, delete] summary: Delete many products description: "Delete many products" operationId: app.catalog.products.batch_delete parameters: - $ref: "#/components/parameters/appId" - name: ids description: "List of products ID" in: query required: true schema: type: array items: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/products/{id}/attach": post: tags: [Products] summary: "Attach a file" description: "" operationId: app.catalog.products.attach parameters: - $ref: "#/components/parameters/appId" - name: id required: true in: path schema: type: integer - name: file description: File to attach in: query schema: type: string format: binary responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Products] summary: "Detach a file" description: "" operationId: app.catalog.products.detach parameters: - $ref: "#/components/parameters/appId" - name: id required: true in: path schema: type: integer - name: file_id description: File to detach in: query schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/products/{id}": get: tags: [Products] summary: "Get a product" description: "Get a Product object by Id" operationId: app.catalog.products.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of product" required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Product" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Products] summary: Update a product description: "Update a product by id" operationId: app.catalog.products.update parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of product" required: true schema: type: integer - name: name in: query schema: type: string - name: amount description: "Price without taxes in cents" in: query schema: type: integer - name: amount_accurately description: "Price without taxes in cents / 1000" in: query schema: type: integer - name: vat_percent description: "Taxe rate in cents" in: query schema: type: integer minimum: 0 - name: image in: query schema: oneOf: - type: string format: binary - type: string format: uri - name: lifetime description: "Product life time in seconds" in: query schema: type: integer - name: description description: "Product description" in: query schema: type: string - name: type description: "Is a service or a product ?" in: query schema: type: string enum: [product, service] - name: quantity_name description: "Name of the quantity: days, liters, m2, m3..." in: query schema: type: string - name: reference in: query schema: type: string - name: account_id in: query schema: type: string - name: tags in: query schema: type: array items: format: string - name: category_id in: query schema: type: integer - name: metadata in: query schema: type: array items: type: string nullable: true responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Product" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] delete: tags: [Products] summary: Remove a product description: "Remove a product by id" operationId: app.catalog.products.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of product" required: true schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/products/{id}/tag": post: tags: [Products, tags] summary: "Add a tag on a product" description: "" operationId: app.catalog.products.tag parameters: - $ref: "#/components/parameters/appId" - name: id description: Product id required: true in: path schema: type: integer - name: tag description: Tag to add in: query schema: type: string responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Products, tags] summary: "Delete a tag on a product" description: "" operationId: app.catalog.products.untag parameters: - $ref: "#/components/parameters/appId" - name: id description: Product id required: true in: path schema: type: integer - name: tag description: Tag to delete in: query schema: type: string responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/products/delete/all": delete: tags: [Products] summary: "Remove all products" description: "Remove all products" operationId: app.catalog.products.deleteAll responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" security: - is_logged: [] - is_authenticated: [] # Stocks "/apps/{appId}/productstocks": get: tags: [Stocks] summary: "List stocks" description: "Get list of stocks" operationId: app.catalog.stocks.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/ProductStock" "404": description: Not found security: - is_authenticated: [] post: tags: [Stocks] summary: Create a stocks description: "Create a new stocks" operationId: app.catalog.stocks.create parameters: - $ref: "#/components/parameters/appId" - name: product_id in: query description: "Parent object" required: true schema: type: integer - name: purchase_id in: query description: "Purchase that generated the stock if exists" schema: type: integer - name: quantity in: query description: "The initial quantity will no longer be modifiable. To change the quantity manually, use the `destruct` endpoint" schema: type: integer - name: bar_code in: query schema: type: string - name: location in: query schema: type: string - name: entered_at in: query schema: type: string format: date-time - name: expired_at in: query schema: type: string format: date-time - name: cost_amount in: query schema: type: integer - name: use_duration in: query description: "Use duration in seconds" schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ProductStock" "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/productstocks/{id}": get: tags: [Stocks] summary: "Get a stocks" description: "Get a Product object by Id" operationId: app.catalog.stocks.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of stocks" required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ProductStock" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Stocks] summary: Update a stocks description: "Update a stocks by id" operationId: app.catalog.stocks.update parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of stocks" required: true schema: type: integer - name: purchase_id in: query description: "Purchase that generated the stock if exists" schema: type: integer - name: bar_code in: query schema: type: string - name: location in: query schema: type: string - name: entered_at in: query schema: type: string format: date-time - name: expired_at in: query schema: type: string format: date-time - name: cost_amount in: query schema: type: integer - name: use_duration in: query description: "Use duration in seconds" schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ProductStock" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] delete: tags: [Stocks] summary: Remove a stocks description: "Remove a stocks by id" operationId: app.catalog.stocks.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of stocks" required: true schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/productstocks/{id}/destruct": post: tags: [Stocks] summary: Destruct a quantity of stock (forgotten, destructed, expirated stock...) description: "Update a stocks by id to reduce quantity of stocks" operationId: app.catalog.stocks.destruct parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of stocks" required: true schema: type: integer - name: quantity in: query description: "Quantity to destruct" schema: type: integer - name: comment in: query schema: type: string responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ProductStock" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/productstocks/{id}/rental/exit": post: tags: [Stocks] summary: Consider part of the stock as rented description: "Updates the quantity of available stocks and provides for a stocks return date" operationId: app.catalog.stocks.rental_exit parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of stocks" required: true schema: type: integer - name: quantity in: query description: "Quantity to rent" schema: type: integer - name: future_return_date in: query schema: type: string format: date-time - name: comment in: query schema: type: string responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ProductStock" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/productstocks/{id}/rental/back": post: tags: [Stocks] summary: Consider part of the stock as back description: "Update the amount of stocks available through the return of rented stocks" operationId: app.catalog.stocks.rental_back parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of stocks" required: true schema: type: integer - name: quantity in: query description: "Quantity to return in stocks" required: true schema: type: integer - name: current_return_date in: query schema: type: string format: date-time default: now - name: use_duration in: query description: "Usage duration in seconds" schema: type: integer default: 0 - name: comment in: query schema: type: string responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ProductStock" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] # Categories "/apps/{appId}/productcategory": get: tags: [hidden] summary: "List product categories" description: "Get list of product categories" operationId: app.catalog.categories.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/ProductCategory" "404": description: Not found security: - is_authenticated: [] post: tags: [hidden] summary: Create a product category description: "Create a new product category" operationId: app.catalog.categories.create parameters: - $ref: "#/components/parameters/appId" - name: name in: query required: true schema: type: string - name: image in: query schema: oneOf: - type: string format: binary - type: string format: uri - name: parent_category_id in: query schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ProductCategory" "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/productcategory/{id}": get: tags: [hidden] summary: "Get a product category" description: "Get a Product category object by Id" operationId: app.catalog.categories.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of product category" required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ProductCategory" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [hidden] summary: Update a product category description: "Update a product category by id" operationId: app.catalog.categories.update parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of product category" required: true schema: type: integer - name: name in: query required: true schema: type: string - name: image in: query schema: oneOf: - type: string format: binary - type: string format: uri - name: parent_category_id in: query schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ProductCategory" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [hidden] summary: Remove a product category description: "Remove a product category by id" operationId: app.catalog.categories.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of product category" required: true schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] # # Payments # # Reconciliation "/apps/{appId}/reconcile": post: tags: [Payments] summary: Reconcile a transaction or a document description: "Create a new payments and categorizations by one-to-many" operationId: app.payments.reconciliation.reconcile parameters: - $ref: "#/components/parameters/appId" - name: replace_all description: "Remove all previous reconciliations" in: query schema: type: boolean default: false - name: type description: "Object to pay with these payments and categorizations" in: query required: true schema: type: string enum: [transaction, sales, purchase] - name: id description: "Transaction, sales invoice or purchase invoice id to reconcile" in: query required: true schema: type: integer - name: movements in: query required: true schema: type: object description: "List of objects to reconcile with the parent object. The parent object and the children must be different, a transaction cannot be reconciled with another transaction. In this type of case, for example where a transaction was immediately refunded without going through an invoice, the transactions must be categorized in the same account" properties: type: type: string enum: [ account, purchase, sales, bank_entry, cashdesk_entry, waiting_entry, ] id: type: integer description: "Object id -- create object when null (usefull for cashdesk or waiting entries)" amount: type: integer description: "Payment amount in cents" - name: paid_at description: "Payment date for cashdesk or waiting entries" in: query schema: type: string format: date-time - name: rule description: "Create an auto-reconciliation rule" in: query schema: type: object properties: conditions: type: array description: "[ [property, comparator, value], ... ]" items: type: array description: "[property, comparator, value]" items: type: string on_event: description: "Event like model.event, event in [saved, created, updated, deleted]" type: string example: "transaction.created" parameter: type: string example: "account" value: type: string example: "64" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Payment" "404": description: Not found security: - is_logged: [] - is_authenticated: [] delete: tags: [Payments] summary: Remove payments by an object description: "Remove all payments of a parent object" operationId: app.payments.reconciliation.unreconcile parameters: - $ref: "#/components/parameters/appId" - name: type description: "Object to unpay with this payment" in: query required: true schema: type: string enum: [transaction, sales, purchase] - name: id description: "Transaction, sales invoice or purchase invoice id to unreconcile" in: query required: true schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/reconcile/batch": post: tags: [Payments] summary: Reconcile several transactions description: "Create new payments and categorizations by one-to-many" operationId: app.payments.reconciliation.batch parameters: - $ref: "#/components/parameters/appId" - name: data description: "array of reconciliation params" in: query required: true schema: type: array items: $ref: "#/components/schemas/Reconciliation" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Quote" "400": description: Bad request "404": description: Not found security: - api_key: [] # Payments "/apps/{appId}/payments": # CRD get: tags: [Payments] summary: "List payments" description: "Get list of payments" operationId: app.payments.payments.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/Payment" "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/payments/recipe_book": # CRD get: tags: [Payments] summary: "Get the recipe book" description: "Get a Payment object by Id" operationId: app.payments.payments.recipe_book parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/payments/{id}": get: tags: [Payments] summary: "Get a payment" description: "Get a Payment object by Id" operationId: app.payments.payments.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of payment" required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Payment" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Payments] summary: Remove a payment description: "Remove a payment by id" operationId: app.payments.payments.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of quote" required: true schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ApiResponse" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] # SEPA "/apps/{appId}/sepamandates/directdebit": # download direct debit file for an invoice list (get + post) get: tags: [Payments] summary: "Preview sepa direct debit file" description: "" operationId: app.payments.sepadirectdebit.preview parameters: - $ref: "#/components/parameters/appId" - name: invoices_ids in: query required: true schema: type: array items: type: integer responses: "200": description: Success content: application/json: schema: type: object "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Payments] summary: "Download sepa direct debit file" description: "" operationId: app.payments.sepadirectdebit.download parameters: - $ref: "#/components/parameters/appId" - name: invoices_ids in: query required: true schema: type: array items: type: integer - name: amounts description: "Optional array with amounts (keys must to correspond to invoices_ids)" in: query schema: type: array items: type: integer - name: creditor_name in: query schema: type: string - name: creditor_iban in: query schema: type: string - name: creditor_bic in: query schema: type: string - name: creditor_ics in: query schema: type: string - name: date in: query schema: type: string format: date-time responses: "200": description: Success content: application/xml: schema: type: string format: binary "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] # SEPA File "/apps/{appId}/sepamandates/credittransfer": # download credit transfer file for an purshase list (get + post) get: tags: [Payments] summary: "Preview sepa credit transfer file" description: "" operationId: app.payments.sepacredittransfer.preview parameters: - $ref: "#/components/parameters/appId" - name: ids in: query required: true schema: type: array items: type: integer responses: "200": description: Success content: application/json: schema: type: object "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Payments] summary: "Preview sepa credit transfer file" description: "" operationId: app.payments.sepacredittransfer.download parameters: - $ref: "#/components/parameters/appId" - name: ids in: query required: true schema: type: array items: type: integer - name: amounts description: "Optional array with amounts (keys must to correspond to ids)" in: query schema: type: array items: type: integer - name: debtor_name in: query schema: type: string - name: debtor_iban in: query schema: type: string - name: debtor_bic in: query schema: type: string - name: btchBookg in: query schema: type: integer responses: "200": description: Success content: application/xml: schema: type: string format: binary "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/sepamandates/": get: tags: [Payments] summary: "List SEPAMandate" description: "" operationId: app.payments.sepamandates.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/SEPAMandate" "404": description: Not found security: - is_authenticated: [] post: tags: [Payments] summary: "Create a SEPAMandate" description: "" operationId: app.payments.sepamandates.create parameters: - $ref: "#/components/parameters/appId" - name: customer_organization_id in: query schema: type: integer - name: customer_person_id in: query schema: type: integer - name: old_mandate_id in: query schema: type: integer - name: mandate_id in: query required: true schema: type: string - name: signed_at in: query required: true schema: type: string format: date-time - name: electronic_signature in: query schema: type: string - name: customer_name in: query schema: type: string - name: iban in: query required: true schema: type: string - name: bic in: query required: true schema: type: string - name: is_first in: query schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/SEPAMandate" "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/sepamandates/{id}": get: tags: [Payments] summary: "Get a SEPAMandate" description: "" operationId: app.payments.sepamandates.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of SEPAMandate" required: true schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/SEPAMandate" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Payments] summary: Update a SEPAMandate description: "" operationId: app.payments.sepamandates.update parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of SEPAMandate" required: true schema: type: integer - name: customer_organization_id in: query schema: type: integer - name: customer_person_id in: query schema: type: integer - name: old_mandate_id in: query schema: type: integer - name: mandate_id in: query schema: type: string - name: signed_at in: query schema: type: string format: date-time - name: electronic_signature in: query schema: type: string - name: customer_name in: query schema: type: string - name: iban in: query schema: type: string - name: bic in: query schema: type: string - name: is_first in: query schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/SEPAMandate" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] delete: tags: [Payments] summary: Remove a SEPAMandate description: "" operationId: app.payments.sepamandates.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of SEPAMandate" required: true schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] # URSSAF API Tiers de Prestation "/apps/{appId}/urssaf/preview": get: tags: [Payments] summary: "Preview URSSAF request payment" description: "" operationId: app.payments.urssaftiers.preview parameters: - $ref: "#/components/parameters/appId" - name: type in: query required: true schema: type: string enum: [invoice, quote, contact] - name: ids in: query required: true schema: type: array items: type: integer responses: "200": description: Success content: application/json: schema: type: object "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/urssaf/auth": post: tags: [Payments] summary: "Login URSSAF" description: "" operationId: app.payments.urssaftiers.auth parameters: - $ref: "#/components/parameters/appId" - name: client_id in: query required: true schema: type: string - name: client_secret in: query required: true schema: type: string responses: "200": description: Successfully logged, credentials has been saved "400": description: Bad request "404": description: App was not found "422": description: All fields are required "401": description: Invalid credentials security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/urssaf/register_customer": post: tags: [Payments] summary: "Register a person to URSSAF and create him a mandate" description: "" operationId: app.payments.urssaftiers.register_customer parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/urssaf/customer": post: tags: [Payments] summary: "Get person informations" description: "" operationId: app.payments.urssaftiers.customer parameters: - $ref: "#/components/parameters/appId" - name: contact_person_id in: query schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/urssaf/payment": get: tags: [Payments] summary: "Get status of a payment" description: "" operationId: app.payments.urssaftiers.get_status parameters: - $ref: "#/components/parameters/appId" - name: invoices_ids in: query required: true schema: type: array items: type: integer responses: "200": description: Success content: application/json: schema: type: object "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Payments] summary: "Send URSSAF request payment" description: "" operationId: app.payments.urssaftiers.send_payments parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success content: application/xml: schema: type: string format: binary "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] # # Cashflow # # Banks "/apps/{appId}/banks/": get: tags: [hidden] summary: "List banks connected to bankin" description: "" operationId: app.cashflow.banks.list parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success content: application/json: schema: type: object "404": description: Not found security: - is_authenticated: [] delete: tags: [hidden] summary: "Remove a Bankin synchronization" description: "The deletion of the account is irreversible, it will not be possible to resume synchronization as it is afterwards. - If transactions have been exported to accounting or used as payment, the CashflowSource will be left as it is. Resuming synchronization will remain impossible. If you re-import the account, a new CashflowSource will be created and transactions will therefore be duplicated. - Otherwise, if the CashflowSource was not used, it as well as its transactions will be deleted" operationId: app.cashflow.banks.delete parameters: - $ref: "#/components/parameters/appId" - name: item_id in: query required: true schema: type: integer responses: "200": description: Success content: application/json: schema: type: object "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/banks/connect": get: tags: [hidden] summary: "Get the link to the funnel to connect a bank with Sinao" description: "" operationId: app.cashflow.banks.connect parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success content: application/json: schema: type: object properties: url: type: string format: uri "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/banks/synchronize": # all or incremential + use "refresh" bridge endpoint post: tags: [hidden] summary: "Triggers synchronization at Bankin then synchronizes transactions with Sinao" description: "" operationId: app.cashflow.banks.synchronize parameters: - $ref: "#/components/parameters/appId" - name: id description: "Optional item id to refresh. If set, triggers a refresh at Bankin before synchronizing transactions" in: query schema: type: integer - name: is_incremential description: "The value 'false' triggers a non-incremental syncronization of the maximum possible duration. The value 'true' updates the transactions updated by Bankin since a certain date" in: query schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/CashflowSource" "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/banks/{id}/funnel/sync": get: tags: [hidden] summary: "Get the link to the funnel to start manually a synchronization (SCA)" description: "" operationId: app.cashflow.banks.url_sync parameters: - $ref: "#/components/parameters/appId" - name: id in: path required: true schema: type: integer responses: "200": description: Success content: application/json: schema: type: object properties: url: type: string format: uri "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/banks/{id}/funnel/edit": get: tags: [hidden] summary: "Get the link to the funnel to edit password" description: "" operationId: app.cashflow.banks.url_edit parameters: - $ref: "#/components/parameters/appId" - name: id in: path required: true schema: type: integer responses: "200": description: Success content: application/json: schema: type: object properties: url: type: string format: uri "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/banks/{id}/funnel/validate": get: tags: [hidden] summary: "Get the link to the funnel to validate a pro item (SCA)" description: "" operationId: app.cashflow.banks.url_validate parameters: - $ref: "#/components/parameters/appId" - name: id in: path required: true schema: type: integer responses: "200": description: Success content: application/json: schema: type: object properties: url: type: string format: uri "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/banks/{id}/select_accounts": post: tags: [hidden] summary: "Select accounts to synchronize" description: "" operationId: app.cashflow.banks.select_accounts parameters: - $ref: "#/components/parameters/appId" - name: id in: path required: true schema: type: integer - name: bank_account_ids description: "List of enables accounts" in: query schema: type: array nullable: true items: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/CashflowSource" "404": description: Not found security: - is_logged: [] - is_authenticated: [] # Sources "/apps/{appId}/cashflowsources/": get: tags: [Sources] summary: "List CashflowSource" description: "" operationId: app.cashflow.cashflowsources.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/CashflowSource" "404": description: Not found security: - is_authenticated: [] post: tags: [Sources] summary: "Create a CashflowSource" description: "" operationId: app.cashflow.cashflowsources.create parameters: - $ref: "#/components/parameters/appId" - name: name in: query schema: type: string - name: identifiant in: query schema: type: string - name: type in: query schema: type: string enum: [bank, cashdesk, waiting] - name: balance_amount in: query schema: type: integer - name: account_type in: query schema: type: string enum: [ checking, card, savings, special, securities, loan, life_insurance, unknown, pending, share_savings_plan, ] - name: parent_cashflow_source_id in: query schema: type: integer - name: disabled in: query schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/CashflowSource" "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/cashflowsources/{id}": get: tags: [Sources] summary: "Get a CashflowSource" description: "" operationId: app.cashflow.cashflowsources.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of CashflowSource" required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/CashflowSource" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Sources] summary: Update a CashflowSource description: "" operationId: app.cashflow.cashflowsources.update parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of CashflowSource" required: true schema: type: integer - name: name in: query schema: type: string - name: identifiant in: query schema: type: string - name: type in: query schema: type: string enum: [bank, cashdesk, waiting] - name: balance_amount in: query schema: type: integer - name: account_type in: query schema: type: string enum: [ checking, card, savings, special, securities, loan, life_insurance, unknown, pending, share_savings_plan, ] - name: parent_cashflow_source_id in: query schema: type: integer nullable: true - name: disabled in: query schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/CashflowSource" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Sources] summary: Remove a CashflowSource description: "" operationId: app.cashflow.cashflowsources.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of CashflowSource" required: true schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] # Logs auto reconcile "/apps/{appId}/logs/autoreconcile/": get: tags: [hidden] summary: "List autoreconciliation logs" description: "" operationId: app.cashflow.logsautoreconciliations.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success "404": description: Not found security: - is_authenticated: [] post: tags: [hidden] summary: "Start force autoreconciliation" description: "" operationId: app.cashflow.logsautoreconciliations.start parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "404": description: Not found security: - is_authenticated: [] delete: tags: [hidden] summary: "Clear autoreconciliation logs" description: "" operationId: app.cashflow.logsautoreconciliations.clear parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "404": description: Not found security: - is_authenticated: [] # Transactions "/apps/{appId}/transactions/": get: tags: [Transactions] summary: "List Transaction" description: "" operationId: app.cashflow.transactions.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/Transaction" "404": description: Not found security: - is_authenticated: [] post: tags: [Transactions] summary: "Create a Transaction" description: "" operationId: app.cashflow.transactions.create parameters: - $ref: "#/components/parameters/appId" - name: contact_organization_id in: query schema: type: integer - name: contact_person_id in: query schema: type: integer - name: account_id in: query schema: type: integer - name: cashflow_source_id in: query required: true schema: type: integer - name: contact_name in: query schema: type: string - name: amount in: query required: true schema: type: integer - name: method in: query schema: type: string enum: [ check, transfer, cash, creditcard, automatic_debit, creditnote, ] - name: received_at in: query required: true schema: type: string format: date-time - name: label in: query schema: type: string - name: details in: query schema: type: string - name: tags in: query schema: type: string - name: metadata in: query schema: type: array items: type: string nullable: true responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Transaction" "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/transactions/batch": post: tags: [Transactions] summary: "Create multiple transactions" description: "" operationId: app.cashflow.transactions.batch parameters: - $ref: "#/components/parameters/appId" - name: data description: "List of transactions. With ID for update, without for insert" in: query required: true schema: type: array items: $ref: "#/components/schemas/Transaction" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Transaction" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/transactions/{id}/attach": post: tags: [Transactions] summary: "Attach a file" description: "" operationId: app.cashflow.transactions.attach parameters: - $ref: "#/components/parameters/appId" - name: id required: true in: path schema: type: integer - name: file description: File to attach in: query schema: type: string format: binary responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Transactions] summary: "Detach a file" description: "" operationId: app.cashflow.transactions.detach parameters: - $ref: "#/components/parameters/appId" - name: id required: true in: path schema: type: integer - name: file_id description: File to detach in: query schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/transactions/{id}": # can't edit a synchronized transaction get: tags: [Transactions] summary: "Get a Transaction" description: "" operationId: app.cashflow.transactions.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of Transaction" required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Transaction" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Transactions] summary: Update a Transaction description: "" operationId: app.cashflow.transactions.update parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of Transaction" required: true schema: type: integer - name: contact_organization_id in: query schema: type: integer - name: contact_person_id in: query schema: type: integer - name: account_id in: query schema: type: integer - name: cashflow_source_id in: query schema: type: integer - name: contact_name in: query schema: type: string - name: amount in: query schema: type: integer - name: method in: query schema: type: string enum: [ check, transfer, cash, creditcard, automatic_debit, creditnote, ] - name: received_at in: query schema: type: string format: date-time - name: label in: query schema: type: string - name: details in: query schema: type: string - name: tags in: query schema: type: string - name: metadata in: query schema: type: array items: type: string nullable: true responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Transaction" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Transactions] summary: Remove a Transaction description: "" operationId: app.cashflow.transactions.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of Transaction" required: true schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/transactions/{id}/tag": post: tags: [Transactions] summary: "Add a tag on a transaction" description: "" operationId: app.cashflow.transactions.tag parameters: - $ref: "#/components/parameters/appId" - name: id description: Transaction id required: true in: path schema: type: integer - name: tag description: Tag to add in: query schema: type: string responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Transactions] summary: "Delete a tag on a transaction" description: "" operationId: app.cashflow.transactions.untag parameters: - $ref: "#/components/parameters/appId" - name: id description: Transaction id required: true in: path schema: type: integer - name: tag description: Tag to delete in: query schema: type: string responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] # Rules "/apps/{appId}/rules/": get: tags: [hidden] summary: "List rules" description: "" operationId: app.rules.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/Rule" "404": description: Not found security: - is_authenticated: [] post: tags: [hidden] summary: "Create a rule" description: "" operationId: app.rules.create parameters: - $ref: "#/components/parameters/appId" - name: conditions in: query schema: type: array description: "[ [property, comparator, value], ... ]" items: type: array description: "[property, comparator, value]" items: type: string - name: on_event in: query description: "Event like model.event, event in [saved, created, updated, deleted]" schema: type: string example: "transaction.created" - name: parameter in: query schema: type: string example: "account" - name: value in: query schema: type: string example: "64" - name: priority in: query schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Rule" "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/rules/execute_on": post: tags: [hidden] summary: "Execute all rules" description: "" operationId: app.rules.execute_on parameters: - $ref: "#/components/parameters/appId" - name: model in: query schema: type: string example: "transaction" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Rule" "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/rules/{id}": get: tags: [hidden] summary: "Get a rule" description: "" operationId: app.rules.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Rule" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [hidden] summary: Update a rule description: "" operationId: app.rules.update parameters: - $ref: "#/components/parameters/appId" - name: id in: path required: true schema: type: integer - name: conditions in: query schema: type: array description: "[ [property, comparator, value], ... ]" items: type: array description: "[property, comparator, value]" items: type: string - name: on_event in: query schema: type: string example: "transaction.creating" - name: parameter in: query schema: type: string example: "account" - name: value in: query schema: type: string example: "64" - name: priority in: query schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Rule" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [hidden] summary: Remove a rule description: "" operationId: app.rules.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path required: true schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] # # Accounting # # Accounts "/apps/{appId}/accounts/": # CRUD PCG get: tags: [Accounts] summary: "List Account" description: "" operationId: app.accounting.accounts.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/Account" "404": description: Not found security: - is_authenticated: [] post: tags: [Accounts] summary: "Create a Account" description: "" operationId: app.accounting.accounts.create parameters: - $ref: "#/components/parameters/appId" - name: journalcode in: query schema: type: string - name: name in: query schema: type: string - name: description in: query schema: type: string - name: keywords in: query schema: type: string - name: accounting_number in: query schema: type: string - name: is_cashflow in: query schema: type: boolean - name: is_sales in: query schema: type: boolean - name: is_purchase in: query schema: type: boolean - name: is_various in: query schema: type: boolean - name: is_associate in: query schema: type: boolean - name: initiale_balance in: query description: Integer for example for initiale balance amount of 10.50, 10.50 x 100 = 1050 schema: type: number responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Account" "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/accounts/batch": post: tags: [hidden] summary: Create many accounts description: "Create many accounts" operationId: app.accounting.accounts.batch parameters: - $ref: "#/components/parameters/appId" - name: data description: "List of accounts. Without ID for insert" in: query required: true schema: type: array items: $ref: "#/components/schemas/Account" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Account" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/accounts/{id}": # CRUD PCG get: tags: [Accounts] summary: "Get a Account" description: "" operationId: app.accounting.accounts.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of Account" required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Account" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Accounts] summary: Update a Account description: "" operationId: app.accounting.accounts.update parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of Account" required: true schema: type: integer - name: journalcode in: query schema: type: string - name: name in: query schema: type: string - name: description in: query schema: type: string - name: keywords in: query schema: type: string - name: accounting_number in: query schema: type: string - name: is_cashflow in: query schema: type: boolean - name: is_sales in: query schema: type: boolean - name: is_purchase in: query schema: type: boolean - name: is_various in: query schema: type: boolean - name: initiale_balance in: query description: Integer for example for initiale balance amount of 10.50, 10.50 x 100 = 1050 schema: type: number responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Account" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] delete: tags: [Accounts] summary: Remove a Account description: "" operationId: app.accounting.accounts.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of Account" required: true schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/accounts/{delete_account_id}/replace": # CRUD PCG post: tags: [hidden] summary: "Delete an account and replace relatives by replacement account id" description: "" operationId: app.accounting.accounts.replaceAndDelete parameters: - $ref: "#/components/parameters/appId" - name: delete_account_id in: path description: "ID of Account to delete" required: true schema: type: integer - name: replacement_account_id in: query description: "ID of Account to delete" required: true schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Account" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] # Forecast accounting "/apps/{appId}/forecast/elements": get: tags: [Forecast] summary: "Get all forecast elements" description: "" operationId: app.accounting.forecastelement.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Account" "404": description: Not found security: - is_authenticated: [] post: tags: [Forecast] summary: "Create a forecast element" description: "" operationId: app.accounting.forecastelement.create parameters: - $ref: "#/components/parameters/appId" - name: name in: query schema: type: string required: true - name: amount in: query schema: type: integer - name: category_id in: query schema: type: integer required: true - name: deducted_budget in: query schema: type: integer - name: date in: query schema: type: string format: date-time security: - is_authenticated: [] delete: tags: [Forecast] summary: "Remove a forecast element" description: "" operationId: app.accounting.forecastelement.delete_with_name parameters: - $ref: "#/components/parameters/appId" - name: name in: query schema: type: string required: true - name: category_id in: query schema: type: integer required: true security: - is_authenticated: [] "/apps/{appId}/forecast/elements/{id}": post: tags: [Forecast] summary: "Create a forecast element" description: "" operationId: app.accounting.forecastelement.update parameters: - $ref: "#/components/parameters/appId" - name: name in: query schema: type: string required: true - name: amount in: query schema: type: integer - name: category_id in: query schema: type: integer required: true - name: deducted_budget in: query schema: type: integer - name: date in: query schema: type: string format: date-time security: - is_authenticated: [] delete: tags: [Forecast] summary: Remove a forecast element description: "" operationId: app.accounting.forecastelement.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID" required: true schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/forecast/turnover": get: tags: [Forecast] summary: "Get all sales_lines grouped by account" description: "" operationId: app.accounting.forecast.sales_lines parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Account" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/forecast/expenditures": get: tags: [Forecast] summary: "Get all sales_lines grouped by account" description: "" operationId: app.accounting.forecast.purchases_lines parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Account" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/forecast/payments": get: tags: [Forecast] summary: "Get all sales_lines grouped by account" description: "" operationId: app.accounting.forecast.payments parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Account" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/forecast/average/payment": get: tags: [Forecast] summary: "Get supplier and customer average payment period" description: "" operationId: app.accounting.forecast.average_payment parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/forecast/transactions": get: tags: [Forecast] summary: "Get all transactions grouped by account" description: "" operationId: app.accounting.forecast.transactions parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Account" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/forecast/pourcentages/budgets": get: tags: [Forecast] summary: "Calculate pourcentages budgets for all categories" description: "" operationId: app.accounting.forecast.calculate_pourcentages_budgets parameters: - $ref: "#/components/parameters/appId" - name: id description: "Category ID" in: query required: false schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Account" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/forecast/invoices/unpaid": get: tags: [Forecast] summary: "Calculate pourcentages budgets for all categories" description: "" operationId: app.accounting.forecast.invoices_unpaid parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Account" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/forecast/purchases/unpaid": get: tags: [Forecast] summary: "Calculate pourcentages budgets for all categories" description: "" operationId: app.accounting.forecast.purchases_unpaid parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/Account" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] # Categories "/apps/{appId}/accountcategories/": # CRUD PCG get: tags: [AccountCategories] summary: "List categories" description: "" operationId: app.accounting.categories.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/AccountCategory" "404": description: Not found security: - is_authenticated: [] post: tags: [AccountCategories] summary: "Create a category" description: "" operationId: app.accounting.categories.create parameters: - $ref: "#/components/parameters/appId" - name: name in: query schema: type: string - name: description in: query schema: type: string - name: type in: query schema: type: string responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/AccountCategory" "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/accountcategories/{id}": # CRUD PCG get: tags: [AccountCategories] summary: "Get a category" description: "" operationId: app.accounting.categories.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID" required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/AccountCategory" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [AccountCategories] summary: Update a category description: "" operationId: app.accounting.categories.update parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID" required: true schema: type: integer - name: name in: query schema: type: string - name: description in: query schema: type: string - name: type in: query schema: type: string responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/AccountCategory" "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] delete: tags: [AccountCategories, remove, category] summary: Remove a category description: "" operationId: app.accounting.categories.moveAccountsAndDelete parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of the category to remove" required: true schema: type: integer - name: replacement_id in: query description: "ID of the category to attach accounts attached to the removed category" required: false schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] # Export "/apps/{appId}/exports": # list export entities + create for a period get: tags: [Exports] summary: "List ExportEntity" description: "" operationId: app.accounting.export.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/ExportEntity" "404": description: Not found security: - is_authenticated: [] post: tags: [Exports] summary: "Create a ExportEntity" description: "" operationId: app.accounting.export.create parameters: - $ref: "#/components/parameters/appId" - name: until in: query required: true schema: type: string format: date-time responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ExportEntity" "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/exports/months": # list export entities + create for a period get: tags: [Exports] summary: "List ExportEntity" description: "" operationId: app.accounting.export.list_by_months parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/ExportEntity" "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/exports/acd_compta": get: tags: [Exports, ACD] summary: "Get the ACD UUID for authentification" description: "If response UUID is empty, you must register your identifiants." operationId: app.accounting.export.AcdComptaGetUuid parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success content: application/json: schema: type: object properties: uuid: type: string validity: type: string login: type: string base: type: string cnx: type: string password: type: string uuid_validity: type: string "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Exports, ACD] summary: "Register ACD identifiants" description: "Sinao will try to connect ACD authentification with your ids. If succed, Sinao will store your ids." operationId: app.accounting.export.AcdComptaSetUuid parameters: - $ref: "#/components/parameters/appId" - name: login in: query description: "the login provided by ACD Compta" required: true schema: type: string - name: password in: query required: true description: "the password provided by ACD Compta" schema: type: string - name: base in: query required: true description: "Your ACD file number (3XXXX)" schema: type: string #pattern: "/^3[A-Z]{3,}$/i" - name: cnx in: query required: true description: "your CNX by ACD Compta" schema: type: string - name: accounting_office_uri in: query required: true description: "your accounting office API domain name" schema: type: string pattern: "/^[A-Z0-9\\-]{2,}\\.[A-Z0-9\\-]{2,}\\.[A-Z]{2,}$/i" responses: "200": description: Success content: application/json: schema: type: object properties: uuid: type: string "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/exports/acd_compta/filenumber": post: tags: [ Exports, ACD ] summary: "Set ACD file number" description: "Update ACD file number for your application" operationId: app.accounting.export.AcdComptaSetFilenumber parameters: - $ref: "#/components/parameters/appId" - name: base in: query required: true description: "Your ACD file number (3XXXX)" schema: type: string #pattern: "/^3[A-Z]{3,}$/i" responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_authenticated: [ ] "/apps/{appId}/exports/agiris": get: tags: [Exports, Agiris] summary: "Get your Agiris file code" description: "If response file_code is empty, you must register your file_code. Sinao will prefix your export files with it" operationId: app.accounting.export.AgirisGetFileCode parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success content: application/json: schema: type: object properties: file_code: type: string "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Exports, Agiris] summary: "Register Agiris file code" description: "Agiris specification : the exported file be prefixed with your file code. Sinao will store and prefix your export files with it." operationId: app.accounting.export.AgirisSetFileCode parameters: - $ref: "#/components/parameters/appId" - name: file_code in: query description: "your file code provided by Agiris" required: true schema: type: string responses: "200": description: Success content: application/json: schema: type: object properties: file_code: type: string "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/exports/download": # export FEC / Quadra by exports id list get: tags: [Exports] summary: "Download the export entity as zip" description: "" operationId: app.accounting.export.download parameters: - $ref: "#/components/parameters/appId" - name: format description: "The export format can be a FEC (universal - similar to the French legal file 'Fichier des Ecritures Comptables') or specific for accounting software" in: query schema: type: string enum: [universal, quadra, fiducial, acd, agiris, pennylane, cegid, xls] - name: export_entities_ids in: query schema: type: array items: type: integer # or - name: start_at in: query description: "Automatically find export entities from a date range" schema: type: string format: date-time - name: end_at in: query description: "Automatically find export entities from a date range" schema: type: string format: date-time # or - name: since in: query description: "Automatically find export entities since a date" schema: type: string format: date-time # or - name: since_last in: query description: "Automatically find the export entities since the last export downloaded" schema: type: boolean responses: "200": description: Success content: application/zip: schema: type: string format: binary "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/exports/download/{export_id}": # export FEC / Quadra by exports id list get: tags: [Exports] summary: "Download the export entity as zip" description: "" operationId: app.accounting.export.downloadInfos parameters: - $ref: "#/components/parameters/appId" - name: export_id required: true description: "Export file id" in: path schema: type: integer responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ExportFile" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/exports/{id}": get: tags: [Exports] summary: "Get a ExportEntity" description: "" operationId: app.accounting.export.get parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of ExportEntity" required: true schema: type: integer - name: with_trashed in: query description: "Include trashed rows" schema: type: boolean responses: "200": description: Success content: application/json: schema: $ref: "#/components/schemas/ExportEntity" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] delete: tags: [Exports] summary: Remove a ExportEntity description: "" operationId: app.accounting.export.delete parameters: - $ref: "#/components/parameters/appId" - name: id in: path description: "ID of ExportEntity" required: true schema: type: integer responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] # Entries "/apps/{appId}/accounting_entries/": get: tags: [Entries] summary: "List accounting entries" description: "" operationId: app.accounting.entries.list parameters: - $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/offset" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/search" - $ref: "#/components/parameters/filters" - $ref: "#/components/parameters/order" responses: "200": description: Success content: application/json: schema: type: array items: $ref: "#/components/schemas/Account" "404": description: Not found security: - is_authenticated: [] # # Statistics # "/apps/{appId}/statistics/vat": get: tags: [Statistics] summary: "Obtain statistics about vat" description: "" operationId: app.statistics.vat.get parameters: - $ref: "#/components/parameters/appId" - name: detailed in: query required: false schema: type: boolean default: false - name: start_at in: query required: false schema: type: string format: date-time default: now - name: period in: query schema: type: string enum: [monthly, quarterly, half-yearly, yearly] ## or - name: end_at in: query schema: type: string format: date-time responses: "200": description: Success content: application/json: schema: type: object "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/statistics/timetable/sales": get: tags: [Statistics] summary: "Obtain statistics about sales" description: "" operationId: app.statistics.timetable.sales parameters: - $ref: "#/components/parameters/appId" - name: detailed in: query required: false schema: type: boolean default: false - name: groups in: query required: false schema: type: array description: "Array of intervals in days count" default: "[ [-730, -30], [-30, -1], [-1, 7], [7, 15], [15, 30], [30, 730] ]" items: type: array description: "Interval like [x, y] where x, y are a number of days between today. Example, to have all invoices overdue by more than 30 days but less than 60 : [-60, -30]" items: type: integer responses: "200": description: Success content: application/json: schema: type: array items: type: object properties: interval: type: array items: type: string format: date-time count: type: integer balance: type: integer data: type: array items: $ref: "#/components/schemas/Invoice" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/statistics/timetable/purchases": get: tags: [Statistics] summary: "Obtain statistics about timetable purchases" description: "" operationId: app.statistics.timetable.purchases parameters: - $ref: "#/components/parameters/appId" - name: detailed in: query required: false schema: type: boolean default: false - name: groups in: query required: false schema: type: array description: "Array of intervals in days count" default: "[ [-730, -30], [-30, -1], [-1, 7], [7, 15], [15, 30], [30, 730] ]" items: type: array description: "Interval like [x, y] where x, y are a number of days between today. Example, to have all invoices overdue by more than 30 days but less than 60 : [-60, -30]" items: type: integer responses: "200": description: Success content: application/json: schema: type: array items: type: object properties: interval: type: array items: type: string format: date-time count: type: integer balance: type: integer data: type: array items: $ref: "#/components/schemas/Purchase" "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/statistics/charts/{type}": get: tags: [Statistics] summary: "Obtain statistics about everything" description: "" operationId: app.statistics.charts.get parameters: - $ref: "#/components/parameters/appId" - name: type in: path required: true schema: type: string - name: count in: query schema: type: integer - name: period in: query schema: type: string enum: [hourly, daily, weekly, monthly, quarterly, yearly] - name: start_at in: query schema: type: string format: date-time # Optional - name: object in: query schema: type: string enum: [ invoice, quote, purchase, transaction, payment, relationship, ] - name: object_property in: query schema: type: string - name: calcul in: query schema: type: string enum: [sum, avg, count] - name: methods description: "Array of [object_property, calcul]" in: query schema: type: array items: type: array description: "[object_property, calcul]" items: type: string - name: object_date_property in: query schema: type: string - name: group_by in: query schema: type: array items: type: string - name: group_by_object_name in: query schema: type: string - name: exclude_keys in: query schema: type: array items: type: integer - name: search in: query schema: type: string - name: filters in: query schema: type: object - name: show_details description: "Recovers the details of the calculations" in: query schema: type: boolean responses: "200": description: Success content: application/json: schema: type: array items: type: object "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/declare/vat": get: tags: [Vat, declaration] summary: "Obtain the url of Teledec declaration page redirection" description: "Provide the redirection URL to Teledec with pre-filled data for declaring VAT" operationId: app.statistics.vat.declare parameters: - $ref: "#/components/parameters/appId" - name: start_at in: query required: true schema: type: string format: date-time default: now - name: period in: query required: true schema: type: string enum: [monthly, quarterly, half-yearly, yearly] responses: "200": description: Success content: application/json: schema: type: object "400": description: Bad request "404": description: Not found security: - is_authenticated: [] post: tags: [Vat, declaration, settings] summary: "register Vat declaration settings" description: "Store in app settings Teledec required fields" operationId: app.statistics.vat.store_settings parameters: - $ref: "#/components/parameters/appId" - name: key in: query schema: type: string - name: settings in: query schema: type: object additionalProperties: type: string example: services.teledec.iban: "Iban of the banl account withdrawn" services.teledec.bic: "Iban of the banl account withdrawn" services.teledec.email: "Teledec login account email" services.teledec.password: "Teledec login account password" services.teledec.limit_day: "Declaration deadline day (integer)" responses: "200": description: Success content: application/json: schema: type: object "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/tags": get: tags: [Statistics] summary: "Get all existants tags" description: "" operationId: app.statistics.tags.get parameters: - $ref: "#/components/parameters/appId" - name: object in: query schema: type: string enum: [invoice, quote, purchase, product, transaction, relationship] responses: "200": description: Success content: application/json: schema: type: array items: type: object "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/supplier/accepted": post: tags: [Supplier] summary: Accept a supplier description: "" operationId: app.supplierPurchase.accepted parameters: - $ref: "#/components/parameters/appId" - name: token in: query description: "app id of Supplier" required: true schema: type: string - name: email in: query description: "email of the client" required: true schema: type: string responses: "200": description: Success content: application/json: schema: type: string "400": description: Bad request "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/supplier/accepted/invoice": post: tags: [Supplier] summary: Accepted to add only this invoice description: "" operationId: app.supplierPurchase.accepted_invoice parameters: - $ref: "#/components/parameters/appId" - name: token in: query description: "app id of Supplier" required: true schema: type: string responses: "200": description: Success content: application/json: schema: type: string "400": description: Bad request "404": description: Not found security: - is_authenticated: [] # Signature "/apps/{appId}/signature": post: tags: [Signature] summary: "Create a signature" description: "Create a new signature" operationId: app.documents.sales.signature.create parameters: - $ref: "#/components/parameters/appId" - name: documentId in: query required: true schema: type: integer - name: email in: query required: true schema: type: string - name: firstname in: query required: true schema: type: string - name: lastname required: true in: query schema: type: string - name: phone required: true in: query schema: type: string responses: "200": description: Success "404": description: Not found security: - is_logged: [] # # Services # "/ping": get: tags: [hidden] summary: Ping server description: "" operationId: auth.ping parameters: [] responses: "200": description: "Success" "405": description: "Server error" "/apps/{appId}/services/stripe/webhook": get: tags: [hidden] summary: Ping Stripe webhook endpoint operationId: app.services.stripe.webhook.ping parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "400": description: Bad request "404": description: Not found post: tags: [hidden] summary: Webhook for Stripe operationId: app.services.stripe.webhook.handle parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "400": description: Bad request "404": description: Not found "/services/collector": post: tags: [hidden] summary: Push to purchase collector operationId: admin.purchaseCollector.push parameters: - name: app_identifiant in: query required: true schema: type: string - name: collector_key in: query required: true schema: type: string - name: invoice required: true description: Invoice or receipt file (pdf or image) in: query schema: type: string format: binary responses: "200": description: Success "/services/vies/{siren}": get: tags: [hidden] summary: Get VIES database informations from SIREN operationId: services.vies.get parameters: - name: siren in: path required: true schema: type: string responses: "200": description: Success "/apps/{appId}/services/yousign/webhook": post: tags: [hidden] summary: Webhook for Yousign operationId: app.services.yousign.webhook.handle parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "400": description: Bad request "404": description: Not found # Sponsorship "/apps/{appId}/sponsorship/invite": post: tags: [Emails] summary: "Send an email" operationId: app.sponsorship.send_invitation parameters: - $ref: "#/components/parameters/appId" - name: from in: query required: true schema: type: string format: email - name: recipient in: query required: true schema: type: string format: email - name: referrer_name in: query required: true schema: type: string responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/sponsorship/activate": post: tags: [Sponsorship] summary: "Activate the invitation for sponsorship" operationId: app.sponsorship.activate parameters: - $ref: "#/components/parameters/appId" - name: referrer_app_id in: query required: true schema: type: string - name: recipient in: query required: true schema: type: string format: email responses: "200": description: Success content: application/json: schema: type: object "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/sponsorship/list/referrals": get: tags: [Sponsorship] summary: "Get all referrals for a referrer" operationId: app.sponsorship.referrals parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success content: application/json: schema: type: object "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/sponsorship/referrer": get: tags: [Sponsorship] summary: "Get the referrer information for my app" operationId: app.sponsorship.referrer parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success content: application/json: schema: type: object "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/sponsorship/referrer/url": get: tags: [Sponsorship] summary: "Get the referrer url for my app" operationId: app.sponsorship.referrer_url parameters: - $ref: "#/components/parameters/appId" - name: referrer_name in: query required: true schema: type: string responses: "200": description: Success content: application/json: schema: type: string "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/sponsorship/accept/referrer": post: tags: [Sponsorship] summary: "Verify if the referrer code is valid" operationId: app.sponsorship.accept_referrer parameters: - $ref: "#/components/parameters/appId" - name: referrer_code in: query required: true schema: type: string responses: "200": description: Success content: application/json: schema: type: object "404": description: Not found security: - is_authenticated: [] "/apps/{appId}/sponsorship/credit": get: tags: [Sponsorship] summary: "Get the credit for my app" operationId: app.sponsorship.credit parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success content: application/json: schema: type: object "404": description: Not found security: - is_authenticated: [] # Stripe import "/apps/{appId}/stripe/import/launch": post: tags: [Stripe] summary: "Launch the import of Stripe data" operationId: app.stripeImport.import_launch parameters: - $ref: "#/components/parameters/appId" - name: public_key in: query required: true schema: type: string - name: secret_key in: query required: true schema: type: string - name: private_webhook in: query required: true schema: type: string - name: start_at in: query required: true schema: type: string responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/stripe/import/status": get: tags: [Stripe] summary: "Get the import status of Stripe data" operationId: app.stripeImport.import_status parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/stripe/import/state": get: tags: [Stripe] summary: "Get the import state of Stripe data" operationId: app.stripeImport.import_state parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] # Open AI "/apps/{appId}/openai/billing/estimate": get: tags: [OpenAI] summary: "Get the import state of Stripe data" operationId: app.openai.billings.estimate parameters: - $ref: "#/components/parameters/appId" - name: description in: query required: true schema: type: string responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/openai/billing/reformulate": get: tags: [OpenAI] summary: "Get the reformulate for a designation" operationId: app.openai.billings.reformulate parameters: - $ref: "#/components/parameters/appId" - name: description in: query required: true schema: type: string responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/openai/billing/corrector": get: tags: [OpenAI] summary: "Get the smart corrector for a designation" operationId: app.openai.billings.smartCorrector parameters: - $ref: "#/components/parameters/appId" - name: description in: query required: true schema: type: string responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/paypal/connect/{clientId}": post: tags: [Paypal] summary: "Connect to Paypal" operationId: app.paypal.connect parameters: - $ref: "#/components/parameters/appId" - name: clientId in: query required: true schema: type: string responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/paypal/connect/state": get: tags: [Paypal] summary: "Get if app is connect to Paypal" operationId: app.paypal.state parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] "/apps/{appId}/paypal/connect/delete": get: tags: [Paypal] summary: "Delete synchronisation paypal" operationId: app.paypal.delete_synchronisation parameters: - $ref: "#/components/parameters/appId" responses: "200": description: Success "400": description: Bad request "404": description: Not found security: - is_logged: [] - is_authenticated: [] # # MODELS # components: parameters: appId: name: appId in: path description: The identifier of the Sinao application you are using. Each application corresponds to a company and an accounting. A user can have several Sinao applications. To retrieve the identifiers of its applications, you must call the endpoint `/apps`. required: true schema: type: integer offset: name: offset description: The number of items to skip before starting to collect the result set. required: false in: query schema: type: integer minimum: 0 limit: name: limit description: The numbers of items to return. required: false in: query schema: type: integer minimum: 1 maximum: 10000 default: 10 search: name: search description: A string to search for in objects. required: false in: query schema: type: string filters: name: filters description: List of filters to apply to the query. required: false in: query schema: type: array items: type: object properties: name: type: string value: type: string comparator: type: string enum: [ "=", "<", ">", "<=", ">=", "!=", "LIKE", "IN", "REGEX", "NOT LIKE" ] order: name: order description: List in order of priority of the variables by which to order the result. required: false in: query schema: type: array items: type: object properties: name: type: string description: Column name direction: type: string enum: [asc, desc, closest] value: type: integer description: Value for closest amount relationship: name: relationship description: "Updates the contact's relationship information" in: query schema: type: object nullable: true items: type: object properties: is_customer: type: boolean is_supplier: type: boolean is_prospect: type: boolean importance_level: type: integer nullable: true rating: type: integer nullable: true balance_initial_amount: type: integer nullable: true reference: type: string nullable: true is_notifying: type: boolean note: type: string nullable: true customer_id: description: "Customer accounting number" type: string nullable: true supplier_id: description: "Supplier accounting number" type: string nullable: true metadata: type: array nullable: true headquarters: name: establishments description: "Updates main establishment information (first establishment)" in: query schema: type: object properties: name: type: string phones: description: Replace all phones type: array items: type: string emails: description: Replace all emails type: array items: type: string phone: description: Add one phone type: string email: description: Add one email type: string nic: description: "Establishment number (french NIC)" type: string pattern: "/^[0-9]{5}$/i" place: type: object properties: latitude: type: integer longitude: type: integer street_number: type: string route: type: string route2: type: string locality: type: string sublocality: type: string administrative_area_level3: type: string administrative_area_level2: type: string administrative_area_level1: type: string country: type: string countryiso2: type: string postal_code: type: string formatted_address: description: "Address formatted for intelligent analysis by google maps" type: string establishments: name: establishments description: "Update of a contact card containing the billing address of the individual and his contact information" in: query schema: type: array items: type: object properties: name: type: string phones: description: Replace all phones type: array items: type: string emails: description: Replace all emails type: array items: type: string phone: description: Add one phone type: string email: description: Add one email type: string nic: description: "Establishment number (french NIC)" type: string pattern: "/^[0-9]{5}$/i" place: type: object properties: latitude: type: integer longitude: type: integer street_number: type: string route: type: string route2: type: string locality: type: string sublocality: type: string administrative_area_level3: type: string administrative_area_level2: type: string administrative_area_level1: type: string country: type: string countryiso2: type: string postal_code: type: string formatted_address: description: "Address formatted for intelligent analysis by google maps" type: string securitySchemes: api_key: type: http scheme: bearer always_allowed: type: http scheme: basic is_admin: type: http scheme: basic schemas: # # Functional # ApiResponse: type: object properties: code: type: integer type: type: string message: type: string JsonWebToken: type: object properties: access_token: type: string token_type: type: string expires_in: type: integer # # Global contracts - abstract class # PersonIdentity: # Traits used by User and ContactPerson type: object properties: id: type: integer readOnly: true civility: description: "Civility is the lastname prefix" type: string nullable: true lastname: type: string firstname: type: string establishments: type: array items: $ref: "#/components/schemas/EstablishmentIdentity" image: type: string format: uri metadata: type: array nullable: true OrganizationIdentity: # Traits used by SinaoOrganization, PublicOrganization and ContactOrganization type: object properties: id: type: integer name: description: "Company name visible on the app" type: string billing_name: description: "Company name for billing" type: string establishments: description: "List of contact establishments. Some establishments come from the public database (INSEE), they cannot be edited and have no ID" type: array items: $ref: "#/components/schemas/EstablishmentIdentity" logo: type: string format: uri legal_form: type: string country_iso2: type: string format: "ISO 3166-1 alpha-2" founding_date: type: string format: date founding_location: type: string dissolution_date: type: string format: date vat_system: type: string closeaccounting_period: type: string national_id: description: "Unique National Id, format by country. **In France : [0-9]{9} with last number as security key.**" type: string tax_id: description: "International Tax Id" type: string vat_id: description: "European VAT Id. **In France : FR [0-9]{2} [0-9]{9}**" type: string code_naf: description: "French NAF Code" type: string pattern: "/^[0-9]{4}[a-z]$/i" number_of_employees: type: string slogan: description: "Free variable" type: string rcs: description: "French. Registre du Commerce et des Sociétés" type: string greffe: description: "French. Tribunal de commerce" type: string capital: description: "Capital in cents" type: integer EstablishmentIdentity: # Traits used by PersonIdentity and OrganizationIdentity. type: object description: "A card for an establishment contact informations" properties: id: type: integer description: "The identifier of the establishment can be absent if the data comes from the INSEE database. In this case, it is not editable" nullable: true name: description: "Establishment name" type: string nic: description: "Establishment number (french NIC)" type: string pattern: "/^[0-9]{5}$/i" nullable: true place: type: object properties: id: type: integer latitude: type: integer longitude: type: integer street_number: type: string route: type: string route2: type: string locality: type: string sublocality: type: string administrative_area_level3: type: string administrative_area_level2: type: string administrative_area_level1: type: string country: type: string countryiso2: type: string postal_code: type: string formatted_address: description: "When obtaining data, the formatted address is automatically composed from the other properties of the object. When updating data, the formatted address can be used to automatically hydrate the other properties from Google Maps" type: string emails: type: array items: type: string format: email phones: type: array items: type: string format: phone EstablishmentContact: # Establishment contact. type: object description: "Establishment Contact Object" properties: id: type: integer description: "The identifier of the contact" nullable: false name: description: "Contact Civility, Name and Firstname" type: string job: description: "Can be job or department of the contact" type: string email: type: string phone: type: string Lang: type: object properties: key: type: string name: type: string # # Summary : Account # shared data - account management, apps administration # App: type: object properties: id: type: integer readOnly: true organization: $ref: "#/components/schemas/SinaoOrganization" admin: $ref: "#/components/schemas/User" url: description: "URI to this app. Can be overwrited by hostname_alias param" type: string format: uri readOnly: true hostname_alias: description: "Specific hostname for this app. To use default URI, null this param" type: string nullable: true format: hostname last_access_at: type: string format: date-time readOnly: true last_user: $ref: "#/components/schemas/User" organization_size: type: string config: type: array subscription: $ref: "#/components/schemas/Subscription" policies: type: array items: $ref: "#/components/schemas/UserPolicy" User: allOf: - $ref: "#/components/schemas/PersonIdentity" - type: object properties: id: type: integer readOnly: true email: description: "Email used as login" type: string format: email readOnly: true password: type: string format: password writeOnly: true minLength: 8 password_is_undefined: type: boolean readOnly: true metadata: type: array nullable: true last_access_at: type: string format: date-time readOnly: true created_at: type: string format: date-time readOnly: true updated_at: type: string format: date-time readOnly: true SinaoOrganization: allOf: - $ref: "#/components/schemas/OrganizationIdentity" - type: object properties: app: $ref: "#/components/schemas/App" Subscription: type: object properties: id: type: integer readOnly: true status: type: string readOnly: true access_level: type: string enum: [full, start, pro, restricted] readOnly: true period_starting_date: type: string format: date-time readOnly: true period_ending_date: type: string format: date-time readOnly: true period_remaining_days: type: integer readOnly: true plan_name: type: string readOnly: true plan_color: type: string readOnly: true payment_card: type: string readOnly: true payment_failed_count: type: integer readOnly: true stripe_customer_id: type: string readOnly: true stripe_subscription_id: type: string readOnly: true stripe_plan_id: type: string readOnly: true AccessInvitation: type: object properties: id: type: integer app: $ref: "#/components/schemas/App" recipient_user: $ref: "#/components/schemas/User" sender_user: $ref: "#/components/schemas/User" profile: $ref: "#/components/schemas/PolicyProfile" used_at: type: string format: date-time validity: type: string format: date-time PolicyProfile: type: object properties: name: type: string description: type: string rights: description: "Routes list" type: array items: type: string restricted: type: boolean homepage: type: string format: uri visible: type: integer UserPolicy: type: object properties: app: $ref: "#/components/schemas/App" policy_profile: $ref: "#/components/schemas/PolicyProfile" user: $ref: "#/components/schemas/User" # # Summary : CloudAccounting # private data - contacts, billing, purchases, bank and accounting # Attachment: type: object properties: id: type: integer name: type: string attachable_type: type: string attachable_id: type: string file_url: type: string # # Contacts # ContactPerson: allOf: - $ref: "#/components/schemas/PersonIdentity" ContactOrganization: allOf: - $ref: "#/components/schemas/OrganizationIdentity" Relationship: type: object properties: id: type: integer is_customer: type: boolean is_supplier: type: boolean is_prospect: type: boolean importance_level: type: integer nullable: true rating: type: integer nullable: true is_notifying: type: boolean note: type: string nullable: true accounting_infos: type: object properties: balance_initial_amount: type: integer reference: type: string nullable: true customer_id: type: string readOnly: true supplier_id: type: string readOnly: true metadata: type: array nullable: true # # Documents # # Sales SalesDocumentContract: type: object properties: id: type: integer number: type: string readOnly: true written_at: type: string format: date-time customer: oneOf: - $ref: "#/components/schemas/ContactPerson" - $ref: "#/components/schemas/ContactOrganization" contact_infos: type: object properties: id: type: integer type: type: string enum: [organization, person] name: description: "Customer name obtained from customer object or set manually" type: string address: description: "Customer addresss (street number and address) obtained from customer object or set manually" type: string address2: description: "Customer address subline obtained from customer object or set manually" type: string location: description: "Customer address location (city, postal code and country) obtained from customer object or set manually" type: string details: type: string third_account: type: object properties: id: type: integer type: type: string enum: [organization, person] name: description: "Third account name obtained from customer object or set manually" type: string address: description: "Third account addresss (street number and address) obtained from customer object or set manually" type: string location: description: "Third account address location (city, postal code and country) obtained from customer object or set manually" type: string title: type: string content: type: array items: $ref: "#/components/schemas/SalesLine" columns: description: "Columns titles. Remove or NULL a property to hide a column" type: object properties: designation: type: string quantity: type: string quantity_name: type: string info_total_quantity: type: string amount: type: string subtotal: type: string due: type: string vat_percent: type: string discount: type: string balance: $ref: "#/components/schemas/Balance" reference: description: "Free variable not display in document" type: string discount: type: object properties: name: type: string amount: type: integer percent: type: integer value: description: "Value calculated by amount and percent" type: integer currency: type: string legal_notice: description: "Legal mentions" type: string note: description: "Private note" type: string nullable: true bank_detail: $ref: "#/components/schemas/BankDetails" vat_exemption: type: object properties: exempted: type: boolean reason: type: string article: type: string downpayment_request: type: object description: "Amount of deposit required on the quote. On an invoice, this deposit represents a cash advance to be deducted from the payment but not from the amount of the invoice" properties: amount: type: integer percent: type: integer totals: type: object properties: due: type: integer subtotal: type: object properties: total: type: integer by_vat: type: array items: type: object by_account: type: array items: type: object taxes: type: object properties: total: type: integer vat: type: object properties: total: type: integer by_vat: type: array items: type: object by_account: type: array items: type: object author: $ref: "#/components/schemas/User" attachments: type: array items: type: string format: uri tags: type: array items: format: string imported_at: type: string format: date-time nullable: true validated_at: type: string format: date-time nullable: true email_sent_at: type: string format: date-time nullable: true metadata: type: array nullable: true Invoice: allOf: - $ref: "#/components/schemas/SalesDocumentContract" - type: object properties: downpayments: type: array items: $ref: "#/components/schemas/Invoice" avoid_of: $ref: "#/components/schemas/Invoice" invoice_of: $ref: "#/components/schemas/Quote" related_recurring_invoice: $ref: "#/components/schemas/RecurringInvoice" delivered_at: type: string format: date-time nullable: true sepa_direct_debit_exported_at: type: string format: date-time nullable: true payment_period: description: "Days count before considere this invoice as late" type: integer payment_deadline_at: type: string format: date-time description: "Payment deadline" expected_payment_deadline_at: type: string format: date-time description: "Payment deadline" payment_methods: description: "Accepted methods of payment for this invoice. Methods comma separated" type: string paid_at: type: string format: date-time status: type: string enum: [draft, final, paid] Quote: allOf: - $ref: "#/components/schemas/SalesDocumentContract" - type: object properties: commercialvalidity_deadline: type: string format: date-time nullable: true status: type: string enum: [ draft, waiting, goodforagreement, refused, transformed, deleted, ] Reconciliation: allOf: - type: object properties: type: type: string enum: [ transaction ] id: type: integer description: "transaction id" replace_all: type: boolean movements: type: array items: type: object properties: type: type: string enum: [ account ] id: type: integer description: "account id" amount: type: integer description: "amount of the transaction" RecurringInvoice: allOf: - $ref: "#/components/schemas/SalesDocumentContract" - type: object properties: id: type: integer content: type: array items: $ref: "#/components/schemas/SalesLine" orders_plan: type: array items: type: object properties: model: type: integer end_at: type: string format: date-time nullable: true next_invoice_at: type: string format: date-time nullable: true end_at: type: string format: date-time nullable: true frequency_count: type: integer frequency_duration: type: string discount: type: integer discount_mode: type: string discount_start_at: type: string format: date-time nullable: true discount_end_at: type: string format: date-time nullable: true saving_status: type: string recipient_emails: type: array items: type: string format: email nullable: true need_copy_bcc: type: boolean nullable: false enum: [0, 1] SalesLine: type: object properties: id: type: integer document: oneOf: - $ref: "#/components/schemas/Invoice" - $ref: "#/components/schemas/Quote" product: $ref: "#/components/schemas/Product" stock: $ref: "#/components/schemas/ProductStock" detail: type: string description: "Description of the product or service" action: type: string enum: [sell, rent] quantity: type: number format: double description: "Quantity of product or service" amount_accurately: description: "Price without taxes in cents + 3 decimales, example : 9899000 = 98,99€ || 1 = 0,00001€" type: integer amount_with_taxes: description: "Used when there is a difference of 1 cent when starting from the amount with taxes" type: boolean amount: description: "Price without taxes in cents" type: integer vat_percent: description: "VAT rate in cents" type: integer account: type: object discount: type: object properties: amount: description: "Use discount value for fix discount" type: integer percent: description: "Use discount percent for variable discount" type: integer unity: description: "Unity, hours, days, meters, liters.." type: string total_quantity: description: "Information about total quantity to sell, only for display" type: string style: type: object properties: section_id: description: "Section is an Order with a position like SectionId" type: integer type: type: string enum: [section, description, product] position: type: integer totals: type: object properties: subtotal: type: integer taxes: type: integer due: type: integer metadata: type: array nullable: true SalesDocumentModel: properties: id: type: integer name: type: string title: type: string json: type: array items: $ref: "#/components/schemas/SalesLine" BankDetails: type: object properties: id: type: integer name: type: string iban: type: string bic: type: string # Purchases Purchase: properties: id: type: integer status: type: string enum: [new, completed, paid] title: type: string description: "Name visible on the accounting entries of the purchase" supplier_name: type: string amount: type: integer description: "Amount without taxes in cents" amount_tax: type: integer description: "Amount of taxes in cents" amount_reverse_tax: type: integer description: "Reverse charge amount - Intra-community VAT (amount_tax must be 0)" amount_net_foreign_currency: type: integer description: "Amount without taxes in cents" readOnly: true foreign_currency: type: string description: "Amount of taxes in cents" readOnly: true vat_detail: type: object description: "VAT breakdown" comment: type: string description: "free field" picture: type: string description: "Purchase picture" tags: type: array items: type: string vat_repayment: type: string enum: [payment, billing] description: "In France, depending on the type of purchase (product or service), VAT is not payable at the same time. VAT on products is due on the date of the invoice, while VAT on services is due on the date of payment thereof" md5: type: string description: "Md5 hash of the initial file sent" billed_at: type: string format: date-time description: "Date of invoice" completed_at: type: string format: date-time description: "Date on which the account, supplier, amount and billed_at fields were completed" accounted_at: type: string format: date-time description: "Date on which the accounting entries were generated" paid_at: type: string format: date-time description: "Date on which the invoice was fully paid" payment_deadline_at: type: string format: date-time description: "Payment deadline" expected_payment_deadline_at: type: string format: date-time description: "Payment deadline" payment_account_number: type: string description: "Payment Account number" payment_routing_number: type: string description: "Payment Routing number" payment_swift: type: string description: "Payment SWIFT" payment_iban: type: string description: "Payment IBAN" is_late: type: boolean description: "The payment deadline has passed and full payment has not been received" will_be_late_at: type: string format: date-time description: "Date the payment will be late. Is `false` if payment has been made" account: type: object $ref: "#/components/schemas/Account" supplier: type: object $ref: "#/components/schemas/ContactOrganization" balance: type: object $ref: "#/components/schemas/Balance" PurchaseLine: properties: id: type: integer product: type: object $ref: "#/components/schemas/Product" account: type: object $ref: "#/components/schemas/Account" title: type: string amount: type: integer created_at: type: string format: date-time readOnly: true updated_at: type: string format: date-time readOnly: true # # Catalog # Product: type: object properties: id: type: integer readOnly: true name: type: string amount_accurately: description: "Price without taxes in milli-cents" type: integer vat_percent: description: "VAT rate in cents" type: integer currency: type: string image: oneOf: - type: string format: binary - type: string format: uri lifetime: description: "Product life time in seconds" type: integer description: type: string unity: description: "Unity, hours, days, meters, liters.." type: string intangible: description: "Is a service or a product ?" type: boolean quantity_name: description: "Name of the quantity: days, liters, m2, m3..." type: string reference: type: string accounting_number: type: string tags: type: array items: type: string category: $ref: "#/components/schemas/ProductCategory" metadata: type: array nullable: true ProductStock: properties: id: type: integer readOnly: true quantity_in: type: integer readOnly: true quantity_out: type: integer readOnly: true bar_code: type: integer location: type: integer entered_at: type: integer expired_at: type: integer cost_amount: type: integer initial_quantity: type: integer readOnly: true use_duration: type: integer purchase: $ref: "#/components/schemas/Purchase" product: $ref: "#/components/schemas/Product" product_stocks_movements: type: array items: $ref: "#/components/schemas/ProductStocksMovement" sales_lines: type: array items: $ref: "#/components/schemas/SalesLine" ProductCategory: type: object properties: id: type: integer readOnly: true name: type: string image: oneOf: - type: string format: binary - type: string format: uri parent: $ref: "#/components/schemas/ProductCategory" products: $ref: "#/components/schemas/Product" ProductStocksMovement: type: object properties: id: type: integer readOnly: true type: type: string enum: [buy, sell, back, temporaryexit, destruct] readOnly: true description: type: string use_duration: type: integer description: "Usage duration in seconds" readOnly: true future_return_date: type: string format: date-time quantity: type: integer readOnly: true moved_at: type: string format: date-time invoice: $ref: "#/components/schemas/Invoice" product_stock: $ref: "#/components/schemas/ProductStock" # # Payments # Balance: properties: due: description: "Initial balance total due" type: integer paid: type: integer remaining: type: integer meaning: type: string enum: - completed - remaining - overpaid completed: type: boolean Payment: properties: id: type: integer source: type: string enum: [bank, cashdesk, creditnote] transaction: $ref: "#/components/schemas/Transaction" amount: type: integer date: type: string format: date-time document: oneOf: - $ref: "#/components/schemas/Invoice" - $ref: "#/components/schemas/Purchase" document_type: # Discriminator outside the object to make optional its loading type: string enum: [sales, purchase] SEPAMandate: properties: id: type: integer customer: oneOf: - $ref: "#/components/schemas/ContactPerson" - $ref: "#/components/schemas/ContactOrganization" author: $ref: "#/components/schemas/User" mandate_id: type: integer signed_at: type: string format: date-time electronic_signature: type: string customer_name: type: string iban: type: string bic: type: string is_first: type: integer logs_sepa_direct_debits: type: string last_debit_at: type: string format: date-time last_debit_amount: type: integer last_debit_id: type: integer old_mandate_id: type: integer created_at: type: string format: date-time readOnly: true updated_at: type: string format: date-time readOnly: true URSSAFMandate: properties: id: type: integer iban: type: string bic: type: string created_at: type: string format: date-time readOnly: true updated_at: type: string format: date-time readOnly: true # # Cashflow # CashflowSource: properties: id: type: integer parent_cashflow_source: $ref: "#/components/schemas/CashflowSource" name: type: string identifiant: type: string account_type: type: string disabled: type: boolean balance_amount: type: integer type: type: string status: type: string created_at: type: string format: date-time readOnly: true updated_at: type: string format: date-time readOnly: true Transaction: properties: id: type: integer nullable: true contact_organization_id: type: integer nullable: true contact_person_id: type: integer nullable: true author_user_id: type: integer cashflow_source_id: type: integer amount: type: integer credit: type: integer nullable: true # based on amount : if amont > 0, set egal to amount otherwise set to null debit: type: integer nullable: true # based on amount : if amont < 0, set egal to amount otherwise set to null method: type: integer nullable: true received_at: type: string format: date-time label: type: integer details: type: integer nullable: true lettered_at: type: string format: date-time nullable: true metadata: type: array nullable: true tags: type: string nullable: true created_at: type: string format: date-time readOnly: true updated_at: type: string format: date-time readOnly: true deleted_at: type: string format: date-time readOnly: true Rule: properties: id: type: integer conditions: type: array description: "[ [property, comparator, value], ... ]" items: type: array description: "[property, comparator, value]" items: type: string on_event: type: string parameter: type: string value: type: string priority: type: integer # # Accounting # Account: properties: id: type: integer journalcode: type: string technical_name: type: string editable: type: boolean name: type: string description: type: string keywords: type: string description: "keywords comma separated" accounting_number: type: string need_invoice: type: boolean need_charge: type: boolean need_employee: type: boolean is_associate: type: boolean is_cashflow: type: boolean is_sales: type: boolean is_purchase: type: boolean is_various: type: boolean AccountCategory: properties: id: type: integer name: type: string description: type: string type: type: string ExportEntity: properties: id: type: integer period_start: type: string format: date-time period_end: type: string format: date-time entries_count: type: integer total_debit: type: integer total_credit: type: integer status: type: string created_at: type: string format: date-time readOnly: true updated_at: type: string format: date-time readOnly: true ExportFile: properties: id: type: integer period_start: type: string format: date-time period_end: type: string format: date-time file_url: type: string file_size: type: integer format: type: string entries_count: type: integer status: type: string downloaded_at: type: string format: date-time readOnly: true created_at: type: string format: date-time readOnly: true updated_at: type: string format: date-time readOnly: true