@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Sinao API
@base https://api.sinao.app/v1
@version 1.1.0
@auth Bearer bearer | Bearer basic | Bearer basic | Bearer basic
@endpoints 383
@hint download_for_search
@toc login(2), sendpassword(1), changepassword(1), logout(1), refresh(1), me(2), register(1), apps(352), invoice(3), ping(1), services(2), partners(16)

@group login
@endpoint POST /login
@desc Login
@required {email: str(email) # Email for login, password: str # Password for login in clear text}
@optional {code: str # 2FA code}
@returns(200) Successful Operation
@errors {401: Invalid password, 404: Email address not found, 422: No password defined}

@endgroup

@group sendpassword
@endpoint POST /sendpassword
@desc Password recover by email
@required {email: str(email) # Email for login}
@optional {hostname_alias: str # Hostname alias for the email}
@returns(200) Successful Operation
@errors {422: Email does not exists}

@endgroup

@group changepassword
@endpoint POST /changepassword
@desc Change password
@required {forgotten_password_token: str, password: str # Password for account}
@returns(200) Successful Operation
@errors {422: Unprocessable Entity}

@endgroup

@group logout
@endpoint POST /logout
@desc Logout
@returns(200) Success

@endgroup

@group login
@endpoint POST /login/send/2fa
@desc Send 2FA code
@required {email: str(email) # Email for login, password: str # Password for login in clear text}
@returns(200) Success

@endgroup

@group refresh
@endpoint GET /refresh
@desc Refresh a token
@returns(200) {access_token: str, token_type: str, expires_in: int} # Success

@endgroup

@group me
@endpoint GET /me
@desc Get current user
@returns(200) Success

@endpoint POST /me
@desc Update current user
@optional {civility: str, firstname: str, lastname: str, password: str, email: str(email), image: str(binary), metadata: [str]}
@returns(200) Success

@endgroup

@group register
@endpoint POST /register
@desc Create an User
@required {email: str(email) # Email is the user's login, it must not have been registered, password: str, cgu: bool # The user must have validated the T&Cs}
@optional {firstname: str, lastname: str, metadata: [str]}
@returns(200) Successful Operation
@errors {422: Unprocessable Entity}

@endgroup

@group apps
@endpoint POST /apps
@desc Create an app
@required {organization_name: str # Organization name. Minimum 3 characters with 1 alpha}
@optional {organization_size: str(solo/small/medium) # Organization size}
@returns(200) {id: int, organization: any, admin: any, url: str(uri), hostname_alias: str(hostname)?, last_access_at: str(date-time), last_user: any, organization_size: str, config: [any], subscription: map{id: int, status: str, access_level: str, period_starting_date: str(date-time), period_ending_date: str(date-time), period_remaining_days: int, plan_name: str, plan_color: str, payment_card: str, payment_failed_count: int, stripe_customer_id: str, stripe_subscription_id: str, stripe_plan_id: str}, policies: [map]} # Success
@errors {422: The organization name format is invalid : minimum 3 characters with 1 alpha}

@endpoint GET /apps
@desc List apps
@optional {limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) search results
@errors {400: bad input parameter}

@endpoint GET /apps/{appId}
@desc Get an app
@required {appId: int # 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`.}
@returns(200) {id: int, organization: any, admin: any, url: str(uri), hostname_alias: str(hostname)?, last_access_at: str(date-time), last_user: any, organization_size: str, config: [any], subscription: map{id: int, status: str, access_level: str, period_starting_date: str(date-time), period_ending_date: str(date-time), period_remaining_days: int, plan_name: str, plan_color: str, payment_card: str, payment_failed_count: int, stripe_customer_id: str, stripe_subscription_id: str, stripe_plan_id: str}, policies: [map]} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/ping
@desc Ping app web hostname
@required {appId: int # 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`.}
@returns(200) Success
@errors {404: Not found, 405: Server error}

@endpoint POST /apps/{appId}/reset
@desc Reset all data
@required {appId: int # 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`.}
@returns(200) Success
@errors {404: Not found, 405: Server error}

@endpoint GET /apps/{appId}/apikeys
@desc Get all api keys
@required {appId: int # 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`.}
@optional {limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: App not found}

@endpoint POST /apps/{appId}/apikeys
@desc Create new API key
@required {appId: int # 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`., name: str # Key name}
@optional {api_partner_id: int # Partner ID for official connexion}
@returns(200) {code: int, type: str, message: str} # Success
@errors {404: App or key not found}

@endpoint DELETE /apps/{appId}/apikeys/{id}
@desc Remove an api key
@required {appId: int # 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`., id: int # Api key id}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/apipartners
@desc Get all api partners
@required {appId: int # 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`.}
@optional {limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: App not found}

@endpoint GET /apps/{appId}/settings
@desc Get app config
@required {appId: int # 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`.}
@optional {key: str}
@returns(200) Success
@errors {404: App or key not found}

@endpoint POST /apps/{appId}/settings
@desc Update app config
@required {appId: int # 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`.}
@optional {settings: map, key: str, value: str # Value can be a primitive or a file}
@returns(200) {code: int, type: str, message: str} # Success
@errors {404: App or key not found}

@endpoint GET /apps/{appId}/jobs/{job}
@desc Get app job
@required {appId: int # 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`.}
@optional {job: str}
@returns(200) Success
@errors {404: App or key not found}

@endpoint GET /apps/{appId}/templates
@desc Get templates
@required {appId: int # 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`.}
@returns(200) Success

@endpoint POST /apps/{appId}/templates
@desc Create a template
@required {appId: int # 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`.}
@returns(200) Success

@endpoint GET /apps/{appId}/document-langs
@desc Get document (invoice or quote) available printable langs
@required {appId: int # 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`.}
@optional {key: str}
@returns(200) Success
@errors {404: App or key not found}

@endpoint POST /apps/{appId}/templates/batch
@desc Create multiple templates
@required {appId: int # 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`., data: [any] # List of templates. With ID for update, without for insert}
@returns(200) Success

@endpoint GET /apps/{appId}/templates/default
@desc Get default template
@required {appId: int # 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`.}
@returns(200) Success

@endpoint GET /apps/{appId}/templates/{id}
@desc Get a template
@required {appId: int # 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`., id: int}
@returns(200) Success

@endpoint POST /apps/{appId}/templates/{id}
@desc Update a template
@required {appId: int # 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`.}
@returns(200) Success

@endpoint GET /apps/{appId}/subscription/plan/extra
@desc Get current plan
@required {appId: int # 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`., plan_nickname: str # users, invoices, purchases, ocrentries}
@returns(200) {plans: [str], extras: [str]} # Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/subscription/customer
@desc Stripe Customer object
@required {appId: int # 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`.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/subscription/customer
@desc Stripe Customer object
@required {appId: int # 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`.}
@optional {name: str # Name of the customer, email: str # Email of the customer, phone: str # Phone number of the customer, address[line1]: str # Address line 1 of the customer, address[line2]: str # Address line 2 of the customer, address[city]: str # City of the customer's address, address[state]: str # State of the customer's address, address[postal_code]: str # Postal code of the customer's address, address[country]: str # Country of the customer's address}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/subscription/plan
@desc Get current plan
@required {appId: int # 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`.}
@returns(200) {plans: [str], extras: [str]} # Success
@errors {404: Not found}

@endpoint DELETE /apps/{appId}/subscription/plan
@desc End current plan
@required {appId: int # 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`.}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/subscription/plans
@desc Get plans
@required {appId: int # 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`.}
@returns(200) {plans: [str], extras: [str]} # Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/subscription/invoices
@desc See all invoices
@required {appId: int # 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`.}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/subscription/payment_methods
@desc See all payment methods
@required {appId: int # 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`.}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/subscription/extra/count
@desc Count extra usage
@required {appId: int # 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`.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/subscription/extra/{stripe_plan}
@desc Enable plan
@required {appId: int # 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`., stripe_plan: str # Stripe plan id to update invoice}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/subscription/plans/{stripe_plan}
@desc Simulate a plan
@required {appId: int # 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`., stripe_plan: str # Stripe plan id to simulate invoice}
@optional {stripe_coupon: str # Stripe coupon id to simulate invoice}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/subscription/plans/{stripe_plan}
@desc Change plan
@required {appId: int # 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`., stripe_plan: str # Stripe plan id to update invoice}
@optional {stripe_source: str # Stripe source to pay, stripe_coupon: str # Stripe coupon id to apply}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/subscription/plans/{stripe_plan}/checkout
@desc Get payment link to Stripe Checkout
@required {appId: int # 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`., stripe_plan: str # Stripe plan id to simulate invoice}
@optional {stripe_coupon: str # Stripe coupon id to simulate invoice}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/subscription/checkout_session
@desc Get Stripe Checkout Session id
@required {appId: int # 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`.}
@optional {session_id: str # Stripe Checkout Session id}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/subscription/checkout_add_source
@desc Get payment link to Stripe Checkout
@required {appId: int # 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`.}
@optional {redirect: str(app/account)=app # Chose the redirect URL}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/subscription/source
@desc Add creditcard or sepadebit
@required {appId: int # 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`., stripe_source: str # Stripe source to pay}
@returns(200) Success
@errors {404: Not found}

@endpoint DELETE /apps/{appId}/subscription/source
@desc Remove creditcard or sepadebit
@required {appId: int # 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`., stripe_source: str # Stripe source to pay}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/subscription/source/default
@desc Change default source
@required {appId: int # 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`., stripe_source: str # Stripe source to set as default source}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/subscription/pay_all
@desc Pay all due invoices
@required {appId: int # 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`.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/subscription/cancel
@desc Cancel the subscription now
@required {appId: int # 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`.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/subscription/extend_trial
@desc Extend trial period
@required {appId: int # 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`.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/subscription/coupon
@desc Add coupon
@required {appId: int # 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`., code: str}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/subscription/coupon
@desc See coupon
@required {appId: int # 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`., code: str}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/subscription/anchordate
@desc Update anchor date
@required {appId: int # 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`.}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/access/profiles
@desc Get profiles
@required {appId: int # 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`.}
@returns(200) Success

@endpoint POST /apps/{appId}/access/invite
@desc Invite an user
@required {appId: int # 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`., email: str # Email for invitation. Will be used to account creation or account matching with an existing user, policy_profile_id: int # Profile for policies set}
@optional {firstname: str # First name of user before account creation / account link, lastname: str # Last name of user before account creation / account link, civility: str # Last name of user before account creation / account link, password: str # Password for new user, additionalsAppId: [any] # If user is invited to more than one application, add here other apps id}
@returns(200) {id: int, app: map{id: int, organization: any, admin: any, url: str(uri), hostname_alias: str(hostname)?, last_access_at: str(date-time), last_user: any, organization_size: str, config: [any], subscription: map{id: int, status: str, access_level: str, period_starting_date: str(date-time), period_ending_date: str(date-time), period_remaining_days: int, plan_name: str, plan_color: str, payment_card: str, payment_failed_count: int, stripe_customer_id: str, stripe_subscription_id: str, stripe_plan_id: str}, policies: [map]}, recipient_user: any, sender_user: any, profile: map{name: str, description: str, rights: [str], restricted: bool, homepage: str(uri), visible: int}, used_at: str(date-time), validity: str(date-time)} # Success
@errors {403: This user already exists, you can not set a password, 404: App was not found}

@endpoint GET /apps/{appId}/access/invite
@desc List invitations
@required {appId: int # 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`.}
@optional {limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: App was not found}

@endpoint DELETE /apps/{appId}/access/invite/{id}
@desc Delete an invitation
@required {appId: int # 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`., id: int}
@returns(200) {code: int, type: str, message: str} # successful operation
@errors {404: Invitation was not found}

@endpoint GET /apps/{appId}/pennylane/refresh-token
@desc endpoint for Pennylane fesh bearer token
@required {appId: int # 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`.}
@returns(200) successful operation
@errors {404: App or key not found}

@endpoint POST /apps/access/invite/{accessToken}/register
@desc Create an User by invitation
@required {accessToken: str, password: str # Password for account, cgu: bool # User has valided CGU ?}
@optional {firstname: str # First name of user before account creation / account link, lastname: str # Last name of user before account creation / account link}
@returns(200) Success
@errors {400: Bad parameters, 401: Token expired, 404: Token not found}

@endpoint GET /apps/access/invite/{accessToken}
@desc Get invitation informations
@required {accessToken: str}
@returns(200) {id: int, app: map{id: int, organization: any, admin: any, url: str(uri), hostname_alias: str(hostname)?, last_access_at: str(date-time), last_user: any, organization_size: str, config: [any], subscription: map{id: int, status: str, access_level: str, period_starting_date: str(date-time), period_ending_date: str(date-time), period_remaining_days: int, plan_name: str, plan_color: str, payment_card: str, payment_failed_count: int, stripe_customer_id: str, stripe_subscription_id: str, stripe_plan_id: str}, policies: [map]}, recipient_user: any, sender_user: any, profile: map{name: str, description: str, rights: [str], restricted: bool, homepage: str(uri), visible: int}, used_at: str(date-time), validity: str(date-time)} # Success
@errors {404: Invitation was not found}

@endpoint DELETE /apps/access/invite/{accessToken}
@desc Delete an invitation from token
@required {accessToken: str}
@returns(200) {code: int, type: str, message: str} # successful operation
@errors {401: Token expired, 404: Token was not found}

@endpoint POST /apps/access/accounting/policies/accounting/batch
@desc Create/update policies for a user
@required {userId: int}
@optional {appId: [int]}
@returns(200) Success
@errors {400: Bad parameters}

@endpoint GET /apps/{appId}/access
@desc Get policies for an app
@required {appId: int # 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`.}
@optional {limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: App was not found}

@endpoint GET /apps/{appId}/access/{userId}
@desc Get police for an user
@required {appId: int # 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`., userId: str}
@returns(200) {name: str, description: str, rights: [str], restricted: bool, homepage: str(uri), visible: int} # Success
@errors {404: App was not found}

@endpoint POST /apps/{appId}/access/{userId}
@desc Update police for an user
@required {appId: int # 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`., userId: str, policy_profile_id: int}
@returns(200) {name: str, description: str, rights: [str], restricted: bool, homepage: str(uri), visible: int} # Success
@errors {404: App was not found}

@endpoint DELETE /apps/{appId}/access/{userId}
@desc Delete police for an user
@required {appId: int # 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`., userId: str}
@returns(200) {code: int, type: str, message: str} # Success
@errors {404: App was not found}

@endpoint GET /apps/{appId}/organization
@desc Get organization profile for current app
@required {appId: int # 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`.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/organization
@desc Update organization profile for current app
@required {appId: int # 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`.}
@optional {name: str # Company name visible on the app, billing_name: str # Company name for billing, logo: any, legal_form: str, country_iso2: str(ISO 3166-1 alpha-2), founding_date: str(date), founding_location: str, dissolution_date: str(date), closeaccounting_period: str, national_id: str # Unique National Id, format by country. **In France : [0-9]{9} with last number as security key.**, trade_directory_registration: str # France Directory Registration : Unique national ID SIRET [0-9]{9} + 'RM' + CMA identification number [0-9a-z]{2,}, vat_id: str # European VAT Id. **In France : FR [0-9]{2} [0-9]{9}**, code_naf: str # French NAF Code, number_of_employees: str, industry: str, slogan: str, rcs: str # French. Registre du Commerce et des Sociétés, greffe: str # French. Tribunal de commerce, sap_number_registration: str # NOVA agreement/registration number, sap_activities: str # Organisation activities displayed in annual taxes customer attestation, sap_date_registration: str # NOVA agreement/registration date, capital: int, establishments: [map] # Update of a contact card containing the billing address of the individual and his contact information, establishments: map # Updates main establishment information (first establishment)}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/organizations
@desc List organizations
@required {appId: int # 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`.}
@optional {limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/organizations
@desc Create an organization
@required {appId: int # 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`., name: str # Company name visible on the app}
@optional {billing_name: str # Company name for billing, logo: any, legal_form: str, country_iso2: str(ISO 3166-1 alpha-2), founding_date: str(date), founding_location: str, dissolution_date: str(date), vat_system: str, closeaccounting_period: str, national_id: str # Unique National Id, format by country. **In France : [0-9]{9} with last number as security key.**, vat_id: str # European VAT Id. **In France : FR [0-9]{2} [0-9]{9}**, code_naf: str # French NAF Code, number_of_employees: str, slogan: str, rcs: str # French. Registre du Commerce et des Sociétés, greffe: str # French. Tribunal de commerce, capital: int, metadata: [str], relationship: map # Updates the contact's relationship information, establishments: [map] # Update of a contact card containing the billing address of the individual and his contact information, establishments: map # Updates main establishment information (first establishment)}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/organizations/batch
@desc Create multiple organizations
@required {appId: int # 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`., data: [any] # List of invoices. With ID for update, without for insert}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/organizations/batch
@desc Remove multiple organizations
@required {appId: int # 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`., ids: [int] # List of organizations ID}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/organizations/chorus-search
@desc Search organizations in Chorus Pro
@required {appId: int # 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`., national_id: str # Public entity french national Id [0-9]{9} with last number as security key.}
@optional {token: str # The first request has no token, but to avoid requesting a new bearer token for each request, we can send the token returned by the first request in the second request.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/organizations/{id}
@desc Get an organization
@required {appId: int # 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`., id: int # ID of organization}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/organizations/{id}
@desc Update an organization
@required {appId: int # 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`., id: int # ID of organization}
@optional {name: str # Company name visible on the app, billing_name: str # Company name for billing, logo: any, legal_form: str, country_iso2: str(ISO 3166-1 alpha-2), founding_date: str(date), founding_location: str, dissolution_date: str(date), vat_system: str, closeaccounting_period: str, national_id: str # Unique National Id, format by country. **In France : [0-9]{9} with last number as security key.**, vat_id: str # European VAT Id. **In France : FR [0-9]{2} [0-9]{9}**, code_naf: str # French NAF Code, number_of_employees: str, slogan: str, rcs: str # French. Registre du Commerce et des Sociétés, greffe: str # French. Tribunal de commerce, capital: int, metadata: [str], relationship: map # Updates the contact's relationship information, establishments: [map] # Update of a contact card containing the billing address of the individual and his contact information, establishments: map # Updates main establishment information (first establishment)}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/organizations/{id}
@desc Remove an organization
@required {appId: int # 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`., id: int # ID of organization}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/organizations/{id}/restore
@desc Restore an organization
@required {appId: int # 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`., id: int # ID of organization}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/organizations/{id}/sepa/mandate
@desc Get sepa_mandate of a organizations
@required {appId: int # 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`., id: int # ID of a organization}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/organizations/delete/all
@desc Remove all organizations
@returns(200) {code: int, type: str, message: str} # Success

@endpoint GET /apps/{appId}/persons
@desc List persons
@required {appId: int # 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`.}
@optional {limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/persons
@desc Create a person
@required {appId: int # 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`., lastname: str}
@optional {civility: str # Civility is the lastname prefix, firstname: str, picture: any, metadata: [str], relationship: map # Updates the contact's relationship information, establishments: [map] # Update of a contact card containing the billing address of the individual and his contact information, establishments: map # Updates main establishment information (first establishment)}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/persons/batch
@desc Create multiple persons
@required {appId: int # 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`., data: [any] # List of persons. With ID for update, without for insert}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/persons/batch
@desc Delete many persons
@required {appId: int # 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`., ids: [int] # List of persons ID}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/persons/{id}
@desc Get a person
@required {appId: int # 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`., id: int # ID of a person}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/persons/{id}
@desc Update a person
@required {appId: int # 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`., id: int # ID of a person}
@optional {civility: str # Civility is the lastname prefix, lastname: str, firstname: str, picture: any, metadata: [str], relationship: map # Updates the contact's relationship information, establishments: [map] # Update of a contact card containing the billing address of the individual and his contact information, establishments: map # Updates main establishment information (first establishment)}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/persons/{id}
@desc Remove a person
@required {appId: int # 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`., id: int # ID of person}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/persons/{id}/restore
@desc Restore a person
@required {appId: int # 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`., id: int # ID of a person}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/persons/{id}/sepa/mandate
@desc Get sepa_mandate of a person
@required {appId: int # 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`., id: int # ID of a person}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/persons/delete/all
@desc Remove all persons
@returns(200) {code: int, type: str, message: str} # Success

@endpoint GET /apps/{appId}/establishments/{id}
@desc Get an establishment
@required {appId: int # 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`., id: int # ID of an establishment}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) {id: int?, name: str, nic: str?, place: map{id: int, latitude: int, longitude: int, street_number: str, route: str, route2: str, locality: str, sublocality: str, administrative_area_level3: str, administrative_area_level2: str, administrative_area_level1: str, country: str, countryiso2: str, postal_code: str, formatted_address: str}, emails: [str(email)], phones: [str(phone)]} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/establishments/{id}
@desc Update an establishment
@required {appId: int # 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`., id: int # ID of an establishment}
@optional {name: str, phones: [str], emails: [str], nic: str # Establishment number (french NIC), place: map}
@returns(200) {id: int?, name: str, nic: str?, place: map{id: int, latitude: int, longitude: int, street_number: str, route: str, route2: str, locality: str, sublocality: str, administrative_area_level3: str, administrative_area_level2: str, administrative_area_level1: str, country: str, countryiso2: str, postal_code: str, formatted_address: str}, emails: [str(email)], phones: [str(phone)]} # Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/establishments/{id}
@desc Remove an establishment
@required {appId: int # 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`., id: int # ID of establishment}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/establishments/{establishment_id}/contact/{contact_id}
@desc Update an establishment contact
@required {appId: int # 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`., establishment_id: int # ID of the establishment, contact_id: int # ID of the contact}
@optional {name: str # Civility, name and firstname of the contact, job: str # Job / function / department of the contact, phone: str, email: str}
@returns(200) {id: int, name: str, job: str, email: str, phone: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/establishments/{establishment_id}/contact/{contact_id}
@desc Remove an establishment contact
@required {appId: int # 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`., id: int # ID of establishment, establishment_id: int # ID of the establishment, contact_id: int # ID of the contact}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/relationships
@desc List relationships
@required {appId: int # 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`.}
@optional {limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/relationships/{id}/attach
@desc Attach a file
@required {appId: int # 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`., id: int}
@optional {file: str(binary) # File to attach}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/relationships/{id}/attach
@desc Detach a file
@required {appId: int # 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`., id: int}
@optional {file_id: int # File to detach}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/relationships/{id}
@desc Get a relationship
@required {appId: int # 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`., id: int # ID of Relationship}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) {id: int, is_customer: bool, is_supplier: bool, is_prospect: bool, importance_level: int?, rating: int?, is_notifying: bool, note: str?, accounting_infos: map{balance_initial_amount: int, reference: str?, customer_id: str, supplier_id: str}, metadata: [any]?} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/relationships/{id}
@desc Update a relationship
@required {appId: int # 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`., id: int # ID of Relationship}
@optional {is_customer: bool, is_supplier: bool, is_prospect: bool, importance_level: int, rating: int, balance_initial_amount: int, is_notifying: bool, note: str, reference: str # Accounting number if it's specific. No special chars accepted., tags: str, discount: str, details: str, metadata: [str]}
@returns(200) {id: int, is_customer: bool, is_supplier: bool, is_prospect: bool, importance_level: int?, rating: int?, is_notifying: bool, note: str?, accounting_infos: map{balance_initial_amount: int, reference: str?, customer_id: str, supplier_id: str}, metadata: [any]?} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/relationships/{id}/tag
@desc Add a tag on a relationship
@required {appId: int # 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`., id: int # Relationship id}
@optional {tag: str # Tag to add}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/relationships/{id}/tag
@desc Delete a tag on a relationship
@required {appId: int # 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`., id: int # Relationship id}
@optional {tag: str # Tag to delete}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/contacts/merge
@desc Merge many contacts
@required {appId: int # 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`., contacts: [any]}
@optional {target_contact: map}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/invoices
@desc List invoices
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/invoices
@desc Create an invoice
@required {appId: int # 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`.}
@optional {contact_infos: map, third_account: map, title: str, content: [map], columns: map # List columns to display, reference: str # Free variable not display in document, discount: map, currency: str, legal_notice: str # Legal mentions, bank_details_id: int, vat_exemption: map, tags: [any], metadata: [str], downpayments: [int], downpayment_cash: int, avoid_of: int, delivered_at: str(date-time), payment_period: int=30 # Days count before considere this invoice as late, expected_payment_deadline_at: str(date), payment_methods: str=virement bancaire, chèque # Accepted methods of payment for this invoice. Methods comma separated, number_from_other_software: str # Invoices imported from another software are not counted in the numbering and are not locked, is_auto_finalize: bool # Automatically finalize the invoice when written_at is set, is_auto_send_email: bool # Automatically send email when invoice is unpaid}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/invoices/batch
@desc Create or update many invoices
@required {appId: int # 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`., data: [any] # List of invoices. With ID for update, without for insert}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/invoices/batch
@desc Delete many invoices
@required {appId: int # 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`., ids: [int] # List of invoices ID}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/invoices/nextnumber
@desc Get the next invoice number for preview
@required {appId: int # 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`.}
@optional {written_at: str(date-time) # Write date}
@returns(200) Success
@errors {400: Bad request}

@endpoint GET /apps/{appId}/invoices/download
@desc Download a list of invoices in pdf into a .zip file
@required {appId: int # 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`., ids: [int] # Array of invoices id}
@optional {template: str(delivery/command) # Template name to generate document}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/invoices/statistics
@desc Obtain statistics about invoices
@required {appId: int # 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`.}
@optional {search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/invoices/fresh
@desc Regenerate pdf and recalcul amounts of invoice
@required {appId: int # 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`., ids: [int] # Array of invoices id}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/invoices/chorus-pro
@desc Send selected invoices to Chorus-Pro
@required {appId: int # 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`., ids: [int] # Array of invoices id}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/invoices/{id}
@desc Get an invoice
@required {appId: int # 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`., id: int # ID of invoice}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/invoices/{id}
@desc Update an invoice
@required {appId: int # 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`., id: int # ID of invoice}
@optional {contact_infos: map, third_account: map, title: str, content: [map], columns: map # List columns to display, reference: str # Free variable not display in document, discount: map, currency: str, legal_notice: str # Legal mentions, bank_details_id: int, vat_exemption: map, tags: [any], metadata: [str], downpayments: [int], downpayment_cash: int, avoid_of: int, delivered_at: str(date-time), payment_period: int=30 # Days count before considere this invoice as late, expected_payment_deadline_at: str(date), payment_methods: str=virement bancaire, chèque # Accepted methods of payment for this invoice. Methods comma separated, author_user_id: int # Author id of the invoice, details: str, is_auto_finalize: bool # Automatically finalize the invoice when written_at is set, is_auto_send_email: bool # Automatically send email when invoice is unpaid}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/invoices/{id}
@desc Remove an invoice
@required {appId: int # 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`., id: int # ID of invoice}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/invoices/{id}/duplicate
@desc Duplicate an invoice
@required {appId: int # 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`., id: int # Invoice id to duplicate}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/invoices/{id}/avoid
@desc Create a creditnote on an invoice
@required {appId: int # 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`., id: int # Invoice id to create a credit note}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/invoices/{id}/finalize
@desc Finalize an invoice
@required {appId: int # 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`., id: int # Invoice id to finalize}
@optional {force_date: bool # Automatically updates the date if earlier than the last invoice}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/invoices/{id}/updatestatus
@desc Update the status of an invoice
@required {appId: int # 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`., id: int # Invoice id}
@optional {status: str(draft/final/paid) # Status to update}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/invoices/{id}/attach
@desc Attach a file at an invoice
@required {appId: int # 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`., id: int}
@optional {file: str(binary) # File to attach}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/invoices/{id}/attach
@desc Detach a file at an invoice
@required {appId: int # 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`., id: int # Invoice id}
@optional {file_id: int # File to detach}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/invoices/{id}/tag
@desc Add a tag on an invoice
@required {appId: int # 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`., id: int # Invoice id}
@optional {tag: str # Tag to add}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/invoices/{id}/tag
@desc Delete a tag on an invoice
@required {appId: int # 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`., id: int # Invoice id}
@optional {tag: str # Tag to delete}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/invoices/{id}/pdf
@desc Download the invoice as pdf
@required {appId: int # 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`., id: int # Invoice id to download}
@optional {template: str(delivery/command) # Template name to generate document}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/invoices/{id}/preview.jpg
@desc Download invoice as jpeg
@required {appId: int # 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`., id: int # Invoice id to download}
@optional {template: str # Template name to generate document, base64: bool # Get the image in base64}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/invoice/{id}/link
@desc Generate an invoice link
@required {appId: int # 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`., id: int # Invoice id to link}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/invoices/batch/breakdown
@desc Update the breakdown of an invoice
@required {appId: int # 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`.}
@optional {invoices: [any] # Key of array is the invoice id, value is the breakdown array}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endgroup

@group invoice
@endpoint GET /invoice/token-validation/
@desc Validate an invoice token
@required {token: str # Token to validate}
@optional {format: str(jpg/pdf) # Format of the invoice}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /invoice/download/fec/{token}
@desc Download .fec invoice
@required {token: str # Token to validate}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /invoice/download/pdf/{token}
@desc Download pdf invoice
@required {token: str # Token to validate}
@returns(200) Success
@errors {404: Not found}

@endgroup

@group apps
@endpoint DELETE /apps/{appId}/invoices/delete/all
@desc Remove all purchases
@returns(200) {code: int, type: str, message: str} # Success

@endpoint GET /apps/{appId}/quotes
@desc List quotes
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/quotes
@desc Create a quote
@required {appId: int # 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`.}
@optional {contact_infos: map, third_account: map, title: str, content: [map], columns: map # List columns to display, reference: str # Free variable not display in document, discount: map, currency: str, legal_notice: str # Legal mentions, bank_details_id: int, vat_exemption: map, tags: [any], metadata: [str], downpayment_request: map, commercialvalidity_deadline: str(date-time), number_from_other_software: str # Invoices imported from another software are not counted in the numbering and are not locked}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/quotes/batch
@desc Create or update many quotes
@required {appId: int # 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`., data: [any] # List of quotes. With ID for update, without for insert}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/quotes/batch
@desc Delete many quotes
@required {appId: int # 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`., ids: [int] # List of quotes ID}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/quotes/invoice
@desc Create or update many quotes
@required {appId: int # 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`., ids: [int] # Array of quotes id}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/quotes/nextnumber
@desc Get the next quote number for preview
@required {appId: int # 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`.}
@optional {written_at: str(date-time) # Write date}
@returns(200) Success
@errors {400: Bad request}

@endpoint GET /apps/{appId}/quotes/download
@desc Download a list of quotes in pdf into a .zip file
@required {appId: int # 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`., ids: [int] # Array of quotes id}
@optional {template: str(delivery/command) # Template name to generate document}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/quotes/statistics
@desc Obtain statistics about quotes
@required {appId: int # 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`.}
@optional {search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/quotes/fresh
@desc Regenerate pdf and recalcul amounts of quote
@required {appId: int # 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`., ids: [int] # Array of quotes id}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/quotes/{id}
@desc Get a quote
@required {appId: int # 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`., id: int # ID of quote}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/quotes/{id}
@desc Update a quote
@required {appId: int # 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`., id: int # ID of quote}
@optional {contact_infos: map, third_account: map, title: str, content: [map], columns: map # List columns to display, reference: str # Free variable not display in document, discount: map, currency: str, legal_notice: str # Legal mentions, bank_details_id: int, vat_exemption: map, tags: [any], metadata: [str], downpayment_request: map, commercialvalidity_deadline: str(date-time), author_user_id: int # Author id of the invoice}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/quotes/{id}
@desc Remove a quote
@required {appId: int # 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`., id: int # ID of quote}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/quotes/{id}/finalize
@desc Finalize a quote
@required {appId: int # 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`., id: int # Quote id to finalize}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/quotes/{id}/duplicate
@desc Duplicate a quote
@required {appId: int # 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`., id: int # Quote id to duplicate}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/quotes/{id}/invoice
@desc Transform the quote in invoice
@required {appId: int # 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`., id: int # Quote id to transform}
@optional {columns: map # List columns to display}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/quotes/{id}/situation_invoice
@desc Transform the quote into a situation invoice
@required {appId: int # 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`., id: int # Quote id to transform, progress: int # Percentage of progress in cents (100 = 1%)}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/quotes/{id}/downpayment
@desc Transform the quote in a downpayment invoice
@required {appId: int # 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`., id: int, percent: int # Percentage of downpayment in cents (100 = 1%)}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/quotes/{id}/updatestatus
@desc Update the status of a quote
@required {appId: int # 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`., id: int # Invoice id to finalize}
@optional {status: str(waiting/goodforagreement/refused/transformed/deleted) # Status to update}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/quotes/{id}/attach
@desc Attach a file at a quote
@required {appId: int # 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`., id: int # Quote id}
@optional {file: str(binary) # File to attach}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/quotes/{id}/attach
@desc Detach a file at a quote
@required {appId: int # 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`., id: int # Quote id}
@optional {file_id: int # File to detach}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/quotes/{id}/tag
@desc Add a tag on an quote
@required {appId: int # 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`., id: int # Quote id}
@optional {tag: str # Tag to add}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/quotes/{id}/tag
@desc Delete a tag on a quote
@required {appId: int # 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`., id: int # Quote id}
@optional {tag: str # Tag to delete}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/quotes/{id}/pdf
@desc Download the quote as pdf
@required {appId: int # 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`., id: int # Quote id to download}
@optional {template: str(delivery/command) # Template name to generate document}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/quotes/{id}/preview.jpg
@desc Download quote as jpeg
@required {appId: int # 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`., id: int # Quote id to download}
@optional {template: str(delivery/command) # Template name to generate document}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/quotes/{id}/yousign/preview.jpg
@desc Download quote as jpeg
@required {appId: int # 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`., id: int # Quote id to download}
@optional {template: str(delivery/command) # Template name to generate document}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/quotes/delete/all
@desc Remove all quotes
@returns(200) {code: int, type: str, message: str} # Success

@endpoint POST /apps/{appId}/quotes/batch/breakdown
@desc Update the breakdown of an quote
@required {appId: int # 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`.}
@optional {quotes: [any] # Key of array is the quote id, value is the breakdown array}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/salesdocumentmodels
@desc List sales documents models
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/salesdocumentmodels
@desc Create a sales document model
@required {appId: int # 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`.}
@optional {name: str, title: str, content: [map], columns: map # List columns to display}
@returns(200) {id: int, name: str, title: str, json: [map]} # Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/salesdocumentmodels/{id}
@desc Get a sales document model
@required {appId: int # 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`., id: int # ID of SalesDocumentModel}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) {id: int, name: str, title: str, json: [map]} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/salesdocumentmodels/{id}
@desc Update a sales document model
@required {appId: int # 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`., id: int # ID of SalesDocumentModel}
@optional {name: str, title: str, content: [map], columns: map # List columns to display}
@returns(200) {id: int, name: str, title: str, json: [map]} # Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/salesdocumentmodels/{id}
@desc Remove a sales document model
@required {appId: int # 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`., id: int # ID of SalesDocumentModel}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/recurringinvoices
@desc List RecurringInvoice
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/recurringinvoices
@desc Create a RecurringInvoice
@required {appId: int # 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`., frequency_count: int, frequency_duration: str(day/week/month/trimester/semester/year)}
@optional {contact_infos: map, title: str, content: [map], columns: map # List columns to display, currency: str, legal_notice: str # Legal mentions, bank_details_id: int, vat_exemption: map, tags: [any], metadata: [str], payment_period: int=30 # Days count before considere this invoice as late, next_invoice_at: str(date-time), end_at: str(date-time), discount: int, discount_mode: str, discount_start_at: str(date-time), discount_end_at: str(date-time), details: str, orders_plan: [map], recipient_emails: [str(email)], need_copy_bcc: bool(0/1)}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/recurringinvoices/batch
@desc Create or update many RecurringInvoice
@required {appId: int # 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`., data: [any] # List of RecurringInvoice. With ID for update, without for insert}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/recurringinvoices/batch
@desc Delete many RecurringInvoice
@required {appId: int # 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`., ids: [int] # List of RecurringInvoice ID}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/recurringinvoices/periods
@desc Get json of periods_formats for a date.
@required {appId: int # 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`.}
@optional {date: str(date-time) # Date of the invoice}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/recurringinvoices/{id}
@desc Get a RecurringInvoice
@required {appId: int # 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`., id: int(RecurringInvoice) # ID of RecurringInvoice}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/recurringinvoices/{id}
@desc Update a RecurringInvoice
@required {appId: int # 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`., id: int # ID of RecurringInvoice}
@optional {contact_infos: map, title: str, content: [map], columns: map # List columns to display, currency: str, legal_notice: str # Legal mentions, bank_details_id: int, vat_exemption: map, tags: [any], metadata: [str], payment_period: int=30 # Days count before considere this invoice as late, next_invoice_at: str(date-time), end_at: str(date-time), frequency_count: int, frequency_duration: str(day/week/month/trimester/semester/year), discount: int, discount_mode: str, discount_start_at: str(date-time), discount_end_at: str(date-time), details: str, orders_plan: [map], recipient_emails: [str(email)], need_copy_bcc: bool(0/1)}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/recurringinvoices/{id}
@desc Remove a RecurringInvoice
@required {appId: int # 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`., id: int # ID of RecurringInvoice}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/recurringinvoices/{id}/plan
@desc Preview next invoices generations
@required {appId: int # 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`., id: int # Recurring invoice id, until: str(date-time) # Until date to generate plan}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/bankdetails
@desc List BankDetails
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/bankdetails
@desc Create a BankDetails
@required {appId: int # 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`.}
@optional {name: str, iban: str, bic: str}
@returns(200) {id: int, name: str, iban: str, bic: str} # Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/bankdetails/{id}
@desc Get a BankDetails
@required {appId: int # 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`., id: int # ID of BankDetails}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) {id: int, name: str, iban: str, bic: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/bankdetails/{id}
@desc Update a BankDetails
@required {appId: int # 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`., id: int # ID of BankDetails}
@optional {name: str, iban: str, bic: str}
@returns(200) {id: int, name: str, iban: str, bic: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/bankdetails/{id}
@desc Remove a BankDetails
@required {appId: int # 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`., id: int # ID of BankDetails}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/email/document
@desc Send an email
@required {appId: int # 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`., recipients: [str(email)], documents: [map]}
@optional {from: str(email), recipients_cc: [str(email)], recipients_bcc: [str(email)], title: str, body: str, need_copy_bcc: bool=false, attach_invoice: bool=false}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/email/batch
@desc Send emails
@required {appId: int # 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`.}
@optional {from: str(email), messages: [map], need_copy_bcc: bool=false, attach_invoice: bool=false, request_signature: bool=false}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/email/document/{id}
@desc Get all emails assign to a document
@required {appId: int # 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`., id: int # ID of document, type: str(invoice/quote/attachment) # Type of document}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/purchases
@desc List purchases
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result., expand: [str]}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/purchases
@desc Create a purchase
@required {appId: int # 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`.}
@optional {invoice: str(binary) # Invoice or receipt file (pdf or image), account_id: int, supplier_organization_id: int, title: str, supplier_name: str, amount: int, amount_tax: int, amount_reverse_tax: int, currency: str, vat_detail: map, billed_at: str(date), comment: int, tags: [any], vat_repayment: str(payment/billing), payment_deadline_at: str(date), expected_payment_deadline_at: str(date), payment_account_number: str, payment_routing_number: str, payment_swift: str, payment_iban: str, amortization_period: int, author_user_id: int, completed_at: str(date), employee_id: int # Account Employee id of the purchase, employee_name: str # Employee id of the purchase, mileage_allowance_id: int # mileage allowance id of the purchase, is_expense_report: bool=false}
@returns(200) {id: int, status: str, title: str, supplier_name: str, amount: int, amount_tax: int, amount_reverse_tax: int, amount_net_foreign_currency: int, foreign_currency: str, vat_detail: map, comment: str, picture: str, tags: [str], vat_repayment: str, md5: str, billed_at: str(date-time), completed_at: str(date-time), accounted_at: str(date-time), paid_at: str(date-time), payment_deadline_at: str(date-time), expected_payment_deadline_at: str(date-time), payment_account_number: str, payment_routing_number: str, payment_swift: str, payment_iban: str, is_late: bool, will_be_late_at: str(date-time), account: any, supplier: any, balance: any} # Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/purchases/statistics
@desc Obtain statistics about purchases
@required {appId: int # 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`.}
@optional {search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/purchases/batch
@desc Create or update many purchases
@required {appId: int # 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`., data: [any] # List of purchases. With ID for update, without for insert}
@returns(200) {id: int, status: str, title: str, supplier_name: str, amount: int, amount_tax: int, amount_reverse_tax: int, amount_net_foreign_currency: int, foreign_currency: str, vat_detail: map, comment: str, picture: str, tags: [str], vat_repayment: str, md5: str, billed_at: str(date-time), completed_at: str(date-time), accounted_at: str(date-time), paid_at: str(date-time), payment_deadline_at: str(date-time), expected_payment_deadline_at: str(date-time), payment_account_number: str, payment_routing_number: str, payment_swift: str, payment_iban: str, is_late: bool, will_be_late_at: str(date-time), account: any, supplier: any, balance: any} # Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/purchases/batch
@desc Delete many purchases
@required {appId: int # 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`., ids: [int] # List of purchases ID}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/purchases/download
@desc Download a list of purchases in pdf into a .zip file
@required {appId: int # 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`., ids: [int] # Array of purchases id}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/purchases/{id}
@desc Get a purchase
@required {appId: int # 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`., id: int # ID of purchase}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) {id: int, status: str, title: str, supplier_name: str, amount: int, amount_tax: int, amount_reverse_tax: int, amount_net_foreign_currency: int, foreign_currency: str, vat_detail: map, comment: str, picture: str, tags: [str], vat_repayment: str, md5: str, billed_at: str(date-time), completed_at: str(date-time), accounted_at: str(date-time), paid_at: str(date-time), payment_deadline_at: str(date-time), expected_payment_deadline_at: str(date-time), payment_account_number: str, payment_routing_number: str, payment_swift: str, payment_iban: str, is_late: bool, will_be_late_at: str(date-time), account: any, supplier: any, balance: any} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/purchases/{id}
@desc Update a purchase
@required {appId: int # 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`., id: int # ID of purchase}
@optional {account_id: int # Auto-calculated by sales_lines total, supplier_organization_id: int, title: str, supplier_name: str, amount: int # Auto-calculated by sales_lines total, amount_tax: int, amount_reverse_tax: int, currency: str, vat_detail: map, billed_at: str(date), comment: str, tags: [any], vat_repayment: str(payment/billing), payment_deadline_at: str(date), expected_payment_deadline_at: str(date), payment_account_number: str, payment_routing_number: str, payment_swift: str, payment_iban: str, amortization_period: int, purchase_lines: [any], author_user_id: int # Author id of the invoice, employee_user_id: int # Employee id of the purchase, employee_name: str # Employee id of the purchase, mileage_allowance_id: int # mileage allowance id of the purchase, is_expense_report: bool=false}
@returns(200) {id: int, status: str, title: str, supplier_name: str, amount: int, amount_tax: int, amount_reverse_tax: int, amount_net_foreign_currency: int, foreign_currency: str, vat_detail: map, comment: str, picture: str, tags: [str], vat_repayment: str, md5: str, billed_at: str(date-time), completed_at: str(date-time), accounted_at: str(date-time), paid_at: str(date-time), payment_deadline_at: str(date-time), expected_payment_deadline_at: str(date-time), payment_account_number: str, payment_routing_number: str, payment_swift: str, payment_iban: str, is_late: bool, will_be_late_at: str(date-time), account: any, supplier: any, balance: any} # Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/purchases/{id}
@desc Remove a purchase
@required {appId: int # 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`., id: int # ID of purchase}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/purchases/{id}/updatestatus
@desc Update the status of an invoice
@required {appId: int # 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`., id: int # ID of purchase}
@optional {status: str(completed/paid) # Status to update}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/purchases/{id}/attach
@desc Attach a file at a purchase
@required {appId: int # 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`., id: int # Purchase id}
@optional {file: str(binary) # File to attach}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/purchases/{id}/attach
@desc Detach a file at a purchase
@required {appId: int # 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`., id: int # Purchase id}
@optional {file_id: int # File to detach}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/purchases/{id}/tag
@desc Add a tag on a purchase
@required {appId: int # 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`., id: int # Purchase id}
@optional {tag: str # Tag to add}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/purchases/{id}/tag
@desc Delete a tag on a purchase
@required {appId: int # 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`., id: int # Purchase id}
@optional {tag: str # Tag to delete}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/purchases/{id}/original
@desc Download the purchase as pdf
@required {appId: int # 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`., id: int # Purchase id to download}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/purchases/{id}/preview.jpg
@desc Download purchase as jpeg
@required {appId: int # 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`., id: int # Purchase id to download}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/purchases/{id}/thumbnail.jpg
@desc Show purchase thumbnail as jpeg
@required {appId: int # 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`., id: int # Purchase id to download}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/purchases/delete/all
@desc Remove all purchases
@returns(200) {code: int, type: str, message: str} # Success

@endpoint POST /apps/{appId}/purchases/mileage_allowances/create
@desc Create a mileage allowance
@required {appId: int # 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`.}
@optional {start_address: str # Start address of the trip, arrived_address: str # Arrived address of the trip, kilometers_count: int # Kilometers count of the trip, fiscal_power: int(3/4/5/6/7/1/50) # Fiscal power of the car}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/purchases/mileage_allowances/{id}/duplicate
@desc Duplicate an mileage allowance
@required {appId: int # 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`., id: int # Mileage Allowances id}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/purchases/mileage_allowances/resume
@desc Resume of all mileage allowances for the current year + employee
@required {appId: int # 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`.}
@optional {employee_id: int # Account employee id of the purchase, year: int # Year of the purchase}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/purchases/mileage_allowances/{id}
@desc Update a mileage allowance
@required {appId: int # 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`., id: int # Mileage Allowances id}
@optional {start_address: str # Start address of the trip, arrived_address: str # Arrived address of the trip, kilometers_count: int # Kilometers count of the trip, fiscal_power: int(3/4/5/6/7/1/50) # Fiscal power of the car}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/purchases/create/demo
@desc Create a fake purchase for test purpose
@required {appId: int # 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`.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/accounts/employees
@desc Get accounting for all employees
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/accounts/employees
@desc Create accounting for an employee
@required {appId: int # 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`., fiscal_power: int(3/4/5/6/7/1/50) # Fiscal power of the car}
@optional {user_id: int # Employee id, user_name: str # Employee lastname and firstname, account_id: str, vehicle_type: str(car/motorcycle/electric_car) # Vehicle type of employee}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/accounts/employees/{id}
@desc Get account for an employee
@required {appId: int # 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`., id: int # Employee account id}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/accounts/employees/{id}
@desc Update account for an employee
@required {appId: int # 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`., id: int # Employee account id}
@optional {user_name: str # Employee lastname and firstname, fiscal_power: int(3/4/5/6/7/1/50) # Fiscal power of the car, vehicle_type: str(car/motorcycle/electric_car) # Vehicle type of employee}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/accounts/employees/{id}
@desc Delete account for an employee
@required {appId: int # 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`., id: int # Employee account id}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/attachments
@desc List attachments
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/attachments
@desc Attach a file on an object
@required {appId: int # 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`., type: str(none/purchase/invoice/quote/transaction/relationship) # Object to attach file}
@optional {attachable_id: int # Object id, file: str(binary) # File to attach}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint PUT /apps/{appId}/attachments
@desc Recreate S.A.P attestations
@required {appId: int # 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`.}
@optional {year: int # year number to generate}
@returns(200) Success
@errors {400: Bad request, 404: Not found, 422: Error}

@endpoint GET /apps/{appId}/attachments/download
@desc Download a list of attachments in pdf into a .zip file
@required {appId: int # 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`., ids: str # Array of attachments id, type: str # Type of attachment}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/attachments/sap-download
@desc Download a list of SAP attestations in pdf into a .zip file
@required {appId: int # 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`., ids: str # Array of attachments id, type: str # Type of attachment}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/attachments/{id}
@desc Get attachment by id
@required {appId: int # 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`., id: int # Attachment id}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/attachments/{id}
@desc Detach a file from id
@required {appId: int # 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`., id: int # Attachment id}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/attachments/{id}/pdf
@desc Download the attachment as pdf
@required {appId: int # 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`., id: int # Attachment id to download, random: int # random number to force fresh pdf}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/products
@desc List products
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/products
@desc Create a product
@required {appId: int # 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`., name: str}
@optional {amount: int # Price without taxes in cents, amount_accurately: int # Price without taxes in cents / 1000, vat_percent: int # Taxe rate in cents, image: any, lifetime: int # Product life time in seconds, description: str # Product description, type: str(product/service) # Is a service or a product ?, quantity_name: str # Name of the quantity: days, liters, m2, m3..., reference: str, account_id: str, tags: [any], category_id: int, metadata: [str]}
@returns(200) {id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map, products: map}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map, metadata: [any]?}}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map{id: int, name: str, image: any, parent: map, products: map}, metadata: [any]?}}, metadata: [any]?} # Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/products/batch
@desc Create multiple products
@required {appId: int # 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`., data: [map] # List of products. With ID for update, without for insert}
@returns(200) {id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map, products: map}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map, metadata: [any]?}}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map{id: int, name: str, image: any, parent: map, products: map}, metadata: [any]?}}, metadata: [any]?} # Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/products/batch
@desc Delete many products
@required {appId: int # 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`., ids: [int] # List of products ID}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/products/{id}/attach
@desc Attach a file
@required {appId: int # 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`., id: int}
@optional {file: str(binary) # File to attach}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/products/{id}/attach
@desc Detach a file
@required {appId: int # 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`., id: int}
@optional {file_id: int # File to detach}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/products/{id}
@desc Get a product
@required {appId: int # 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`., id: int # ID of product}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) {id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map, products: map}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map, metadata: [any]?}}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map{id: int, name: str, image: any, parent: map, products: map}, metadata: [any]?}}, metadata: [any]?} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/products/{id}
@desc Update a product
@required {appId: int # 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`., id: int # ID of product}
@optional {name: str, amount: int # Price without taxes in cents, amount_accurately: int # Price without taxes in cents / 1000, vat_percent: int # Taxe rate in cents, image: any, lifetime: int # Product life time in seconds, description: str # Product description, type: str(product/service) # Is a service or a product ?, quantity_name: str # Name of the quantity: days, liters, m2, m3..., reference: str, account_id: str, tags: [any], category_id: int, metadata: [str]}
@returns(200) {id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map, products: map}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map, metadata: [any]?}}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map{id: int, name: str, image: any, parent: map, products: map}, metadata: [any]?}}, metadata: [any]?} # Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/products/{id}
@desc Remove a product
@required {appId: int # 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`., id: int # ID of product}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/products/{id}/tag
@desc Add a tag on a product
@required {appId: int # 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`., id: int # Product id}
@optional {tag: str # Tag to add}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/products/{id}/tag
@desc Delete a tag on a product
@required {appId: int # 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`., id: int # Product id}
@optional {tag: str # Tag to delete}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/products/delete/all
@desc Remove all products
@returns(200) {code: int, type: str, message: str} # Success

@endpoint GET /apps/{appId}/productstocks
@desc List stocks
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/productstocks
@desc Create a stocks
@required {appId: int # 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`., product_id: int # Parent object}
@optional {purchase_id: int # Purchase that generated the stock if exists, quantity: int # The initial quantity will no longer be modifiable. To change the quantity manually, use the `destruct` endpoint, bar_code: str, location: str, entered_at: str(date-time), expired_at: str(date-time), cost_amount: int, use_duration: int # Use duration in seconds}
@returns(200) {id: int, quantity_in: int, quantity_out: int, bar_code: int, location: int, entered_at: int, expired_at: int, cost_amount: int, initial_quantity: int, use_duration: int, purchase: any, product: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map, products: map}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map, metadata: [any]?}}, metadata: [any]?}, product_stocks_movements: [map], sales_lines: [map]} # Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/productstocks/{id}
@desc Get a stocks
@required {appId: int # 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`., id: int # ID of stocks}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) {id: int, quantity_in: int, quantity_out: int, bar_code: int, location: int, entered_at: int, expired_at: int, cost_amount: int, initial_quantity: int, use_duration: int, purchase: any, product: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map, products: map}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map, metadata: [any]?}}, metadata: [any]?}, product_stocks_movements: [map], sales_lines: [map]} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/productstocks/{id}
@desc Update a stocks
@required {appId: int # 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`., id: int # ID of stocks}
@optional {purchase_id: int # Purchase that generated the stock if exists, bar_code: str, location: str, entered_at: str(date-time), expired_at: str(date-time), cost_amount: int, use_duration: int # Use duration in seconds}
@returns(200) {id: int, quantity_in: int, quantity_out: int, bar_code: int, location: int, entered_at: int, expired_at: int, cost_amount: int, initial_quantity: int, use_duration: int, purchase: any, product: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map, products: map}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map, metadata: [any]?}}, metadata: [any]?}, product_stocks_movements: [map], sales_lines: [map]} # Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/productstocks/{id}
@desc Remove a stocks
@required {appId: int # 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`., id: int # ID of stocks}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/productstocks/{id}/destruct
@desc Destruct a quantity of stock (forgotten, destructed, expirated stock...)
@required {appId: int # 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`., id: int # ID of stocks}
@optional {quantity: int # Quantity to destruct, comment: str}
@returns(200) {id: int, quantity_in: int, quantity_out: int, bar_code: int, location: int, entered_at: int, expired_at: int, cost_amount: int, initial_quantity: int, use_duration: int, purchase: any, product: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map, products: map}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map, metadata: [any]?}}, metadata: [any]?}, product_stocks_movements: [map], sales_lines: [map]} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/productstocks/{id}/rental/exit
@desc Consider part of the stock as rented
@required {appId: int # 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`., id: int # ID of stocks}
@optional {quantity: int # Quantity to rent, future_return_date: str(date-time), comment: str}
@returns(200) {id: int, quantity_in: int, quantity_out: int, bar_code: int, location: int, entered_at: int, expired_at: int, cost_amount: int, initial_quantity: int, use_duration: int, purchase: any, product: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map, products: map}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map, metadata: [any]?}}, metadata: [any]?}, product_stocks_movements: [map], sales_lines: [map]} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/productstocks/{id}/rental/back
@desc Consider part of the stock as back
@required {appId: int # 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`., id: int # ID of stocks, quantity: int # Quantity to return in stocks}
@optional {current_return_date: str(date-time)=now, use_duration: int=0 # Usage duration in seconds, comment: str}
@returns(200) {id: int, quantity_in: int, quantity_out: int, bar_code: int, location: int, entered_at: int, expired_at: int, cost_amount: int, initial_quantity: int, use_duration: int, purchase: any, product: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map, products: map}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map, metadata: [any]?}}, metadata: [any]?}, product_stocks_movements: [map], sales_lines: [map]} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/productcategory
@desc List product categories
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/productcategory
@desc Create a product category
@required {appId: int # 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`., name: str}
@optional {image: any, parent_category_id: int}
@returns(200) {id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map, products: map}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map, metadata: [any]?}}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map{id: int, name: str, image: any, parent: map, products: map}, metadata: [any]?}}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map, products: map}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map, metadata: [any]?}}, metadata: [any]?}} # Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/productcategory/{id}
@desc Get a product category
@required {appId: int # 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`., id: int # ID of product category}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) {id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map, products: map}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map, metadata: [any]?}}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map{id: int, name: str, image: any, parent: map, products: map}, metadata: [any]?}}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map, products: map}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map, metadata: [any]?}}, metadata: [any]?}} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/productcategory/{id}
@desc Update a product category
@required {appId: int # 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`., id: int # ID of product category, name: str}
@optional {image: any, parent_category_id: int}
@returns(200) {id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map, products: map}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map, metadata: [any]?}}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map{id: int, name: str, image: any, parent: map, products: map}, metadata: [any]?}}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map{id: int, name: str, image: any, parent: map{id: int, name: str, image: any, parent: map, products: map}, products: map{id: int, name: str, amount_accurately: int, vat_percent: int, currency: str, image: any, lifetime: int, description: str, unity: str, intangible: bool, quantity_name: str, reference: str, accounting_number: str, tags: [str], category: map, metadata: [any]?}}, metadata: [any]?}} # Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/productcategory/{id}
@desc Remove a product category
@required {appId: int # 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`., id: int # ID of product category}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/reconcile
@desc Reconcile a transaction or a document
@required {appId: int # 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`., type: str(transaction/sales/purchase) # Object to pay with these payments and categorizations, id: int # Transaction, sales invoice or purchase invoice id to reconcile, movements: map}
@optional {replace_all: bool=false # Remove all previous reconciliations, paid_at: str(date-time) # Payment date for cashdesk or waiting entries, rule: map # Create an auto-reconciliation rule}
@returns(200) {id: int, source: str, transaction: any, amount: int, date: str(date-time), document: any, document_type: str} # Success
@errors {404: Not found}

@endpoint DELETE /apps/{appId}/reconcile
@desc Remove payments by an object
@required {appId: int # 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`., type: str(transaction/sales/purchase) # Object to unpay with this payment, id: int # Transaction, sales invoice or purchase invoice id to unreconcile}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/reconcile/batch
@desc Reconcile several transactions
@required {appId: int # 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`., data: [any] # array of reconciliation params}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/payments
@desc List payments
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/payments/recipe_book
@desc Get the recipe book
@required {appId: int # 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`.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/payments/{id}
@desc Get a payment
@required {appId: int # 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`., id: int # ID of payment}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) {id: int, source: str, transaction: any, amount: int, date: str(date-time), document: any, document_type: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/payments/{id}
@desc Remove a payment
@required {appId: int # 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`., id: int # ID of quote}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/sepamandates/directdebit
@desc Preview sepa direct debit file
@required {appId: int # 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`., invoices_ids: [int]}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/sepamandates/directdebit
@desc Download sepa direct debit file
@required {appId: int # 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`., invoices_ids: [int]}
@optional {amounts: [int] # Optional array with amounts (keys must to correspond to invoices_ids), creditor_name: str, creditor_iban: str, creditor_bic: str, creditor_ics: str, date: str(date-time)}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/sepamandates/credittransfer
@desc Preview sepa credit transfer file
@required {appId: int # 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`., ids: [int]}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/sepamandates/credittransfer
@desc Preview sepa credit transfer file
@required {appId: int # 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`., ids: [int]}
@optional {amounts: [int] # Optional array with amounts (keys must to correspond to ids), debtor_name: str, debtor_iban: str, debtor_bic: str, btchBookg: int}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/sepamandates/
@desc List SEPAMandate
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/sepamandates/
@desc Create a SEPAMandate
@required {appId: int # 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`., mandate_id: str, signed_at: str(date-time), iban: str, bic: str}
@optional {customer_organization_id: int, customer_person_id: int, old_mandate_id: int, electronic_signature: str, customer_name: str, is_first: bool}
@returns(200) {id: int, customer: any, author: any, mandate_id: int, signed_at: str(date-time), electronic_signature: str, customer_name: str, iban: str, bic: str, is_first: int, logs_sepa_direct_debits: str, last_debit_at: str(date-time), last_debit_amount: int, last_debit_id: int, old_mandate_id: int, created_at: str(date-time), updated_at: str(date-time)} # Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/sepamandates/{id}
@desc Get a SEPAMandate
@required {appId: int # 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`., id: int # ID of SEPAMandate}
@returns(200) {id: int, customer: any, author: any, mandate_id: int, signed_at: str(date-time), electronic_signature: str, customer_name: str, iban: str, bic: str, is_first: int, logs_sepa_direct_debits: str, last_debit_at: str(date-time), last_debit_amount: int, last_debit_id: int, old_mandate_id: int, created_at: str(date-time), updated_at: str(date-time)} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/sepamandates/{id}
@desc Update a SEPAMandate
@required {appId: int # 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`., id: int # ID of SEPAMandate}
@optional {customer_organization_id: int, customer_person_id: int, old_mandate_id: int, mandate_id: str, signed_at: str(date-time), electronic_signature: str, customer_name: str, iban: str, bic: str, is_first: bool}
@returns(200) {id: int, customer: any, author: any, mandate_id: int, signed_at: str(date-time), electronic_signature: str, customer_name: str, iban: str, bic: str, is_first: int, logs_sepa_direct_debits: str, last_debit_at: str(date-time), last_debit_amount: int, last_debit_id: int, old_mandate_id: int, created_at: str(date-time), updated_at: str(date-time)} # Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/sepamandates/{id}
@desc Remove a SEPAMandate
@required {appId: int # 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`., id: int # ID of SEPAMandate}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/urssaf/preview
@desc Preview URSSAF request payment
@required {appId: int # 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`., type: str(invoice/quote/contact), ids: [int]}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/urssaf/auth
@desc Login URSSAF
@required {appId: int # 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`., client_id: str, client_secret: str}
@returns(200) Successfully logged, credentials has been saved
@errors {400: Bad request, 401: Invalid credentials, 404: App was not found, 422: All fields are required}

@endpoint POST /apps/{appId}/urssaf/register_customer
@desc Register a person to URSSAF and create him a mandate
@required {appId: int # 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`.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/urssaf/customer
@desc Get person informations
@required {appId: int # 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`.}
@optional {contact_person_id: int}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/urssaf/payment
@desc Get status of a payment
@required {appId: int # 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`., invoices_ids: [int]}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/urssaf/payment
@desc Send URSSAF request payment
@required {appId: int # 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`.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/banks/
@desc List banks connected to bankin
@required {appId: int # 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`.}
@returns(200) Success
@errors {404: Not found}

@endpoint DELETE /apps/{appId}/banks/
@desc Remove a Bankin synchronization
@required {appId: int # 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`., item_id: int}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/banks/connect
@desc Get the link to the funnel to connect a bank with Sinao
@required {appId: int # 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`.}
@returns(200) {url: str(uri)} # Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/banks/synchronize
@desc Triggers synchronization at Bankin then synchronizes transactions with Sinao
@required {appId: int # 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`.}
@optional {id: int # Optional item id to refresh. If set, triggers a refresh at Bankin before synchronizing transactions, is_incremential: bool # 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}
@returns(200) {id: int, parent_cashflow_source: any, name: str, identifiant: str, account_type: str, disabled: bool, balance_amount: int, type: str, status: str, created_at: str(date-time), updated_at: str(date-time)} # Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/banks/{id}/funnel/sync
@desc Get the link to the funnel to start manually a synchronization (SCA)
@required {appId: int # 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`., id: int}
@returns(200) {url: str(uri)} # Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/banks/{id}/funnel/edit
@desc Get the link to the funnel to edit password
@required {appId: int # 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`., id: int}
@returns(200) {url: str(uri)} # Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/banks/{id}/funnel/validate
@desc Get the link to the funnel to validate a pro item (SCA)
@required {appId: int # 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`., id: int}
@returns(200) {url: str(uri)} # Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/banks/{id}/select_accounts
@desc Select accounts to synchronize
@required {appId: int # 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`., id: int}
@optional {bank_account_ids: [int] # List of enables accounts}
@returns(200) {id: int, parent_cashflow_source: any, name: str, identifiant: str, account_type: str, disabled: bool, balance_amount: int, type: str, status: str, created_at: str(date-time), updated_at: str(date-time)} # Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/cashflowsources/
@desc List CashflowSource
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/cashflowsources/
@desc Create a CashflowSource
@required {appId: int # 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`.}
@optional {name: str, identifiant: str, type: str(bank/cashdesk/waiting), balance_amount: int, account_type: str(checking/card/savings/special/securities/loan/life_insurance/unknown/pending/share_savings_plan), parent_cashflow_source_id: int, disabled: bool, currency_iso: str}
@returns(200) {id: int, parent_cashflow_source: any, name: str, identifiant: str, account_type: str, disabled: bool, balance_amount: int, type: str, status: str, created_at: str(date-time), updated_at: str(date-time)} # Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/cashflowsources/{id}
@desc Get a CashflowSource
@required {appId: int # 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`., id: int # ID of CashflowSource}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) {id: int, parent_cashflow_source: any, name: str, identifiant: str, account_type: str, disabled: bool, balance_amount: int, type: str, status: str, created_at: str(date-time), updated_at: str(date-time)} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/cashflowsources/{id}
@desc Update a CashflowSource
@required {appId: int # 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`., id: int # ID of CashflowSource}
@optional {name: str, identifiant: str, type: str(bank/cashdesk/waiting), balance_amount: int, account_type: str(checking/card/savings/special/securities/loan/life_insurance/unknown/pending/share_savings_plan), parent_cashflow_source_id: int, disabled: bool}
@returns(200) {id: int, parent_cashflow_source: any, name: str, identifiant: str, account_type: str, disabled: bool, balance_amount: int, type: str, status: str, created_at: str(date-time), updated_at: str(date-time)} # Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/cashflowsources/{id}
@desc Remove a CashflowSource
@required {appId: int # 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`., id: int # ID of CashflowSource}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/logs/autoreconcile/
@desc List autoreconciliation logs
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/logs/autoreconcile/
@desc Start force autoreconciliation
@required {appId: int # 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`.}
@returns(200) Success
@errors {404: Not found}

@endpoint DELETE /apps/{appId}/logs/autoreconcile/
@desc Clear autoreconciliation logs
@required {appId: int # 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`.}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/transactions/
@desc List Transaction
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/transactions/
@desc Create a Transaction
@required {appId: int # 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`., cashflow_source_id: int, received_at: str(date-time)}
@optional {contact_organization_id: int, contact_person_id: int, account_id: int, contact_name: str, amount: int, original_amount: int, foreign_currency: str, method: str(check/transfer/cash/creditcard/automatic_debit/creditnote), label: str, details: str, tags: str, metadata: [str]}
@returns(200) {id: int?, contact_organization_id: int?, contact_person_id: int?, author_user_id: int, cashflow_source_id: int, amount: int, credit: int?, debit: int?, method: int?, received_at: str(date-time), label: int, details: int?, lettered_at: str(date-time)?, metadata: [any]?, tags: str?, created_at: str(date-time), updated_at: str(date-time), deleted_at: str(date-time)} # Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/transactions/batch
@desc Create multiple transactions
@required {appId: int # 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`., data: [any] # List of transactions. With ID for update, without for insert}
@returns(200) {id: int?, contact_organization_id: int?, contact_person_id: int?, author_user_id: int, cashflow_source_id: int, amount: int, credit: int?, debit: int?, method: int?, received_at: str(date-time), label: int, details: int?, lettered_at: str(date-time)?, metadata: [any]?, tags: str?, created_at: str(date-time), updated_at: str(date-time), deleted_at: str(date-time)} # Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/transactions/batch
@desc Delete many transactions
@required {appId: int # 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`., ids: [int] # List of transactions ID}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/transactions/{id}/attach
@desc Attach a file
@required {appId: int # 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`., id: int}
@optional {file: str(binary) # File to attach}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/transactions/{id}/attach
@desc Detach a file
@required {appId: int # 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`., id: int}
@optional {file_id: int # File to detach}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/transactions/{id}
@desc Get a Transaction
@required {appId: int # 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`., id: int # ID of Transaction}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) {id: int?, contact_organization_id: int?, contact_person_id: int?, author_user_id: int, cashflow_source_id: int, amount: int, credit: int?, debit: int?, method: int?, received_at: str(date-time), label: int, details: int?, lettered_at: str(date-time)?, metadata: [any]?, tags: str?, created_at: str(date-time), updated_at: str(date-time), deleted_at: str(date-time)} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/transactions/{id}
@desc Update a Transaction
@required {appId: int # 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`., id: int # ID of Transaction}
@optional {contact_organization_id: int, contact_person_id: int, account_id: int, cashflow_source_id: int, contact_name: str, amount: int, method: str(check/transfer/cash/creditcard/automatic_debit/creditnote), received_at: str(date-time), label: str, details: str, tags: str, metadata: [str]}
@returns(200) {id: int?, contact_organization_id: int?, contact_person_id: int?, author_user_id: int, cashflow_source_id: int, amount: int, credit: int?, debit: int?, method: int?, received_at: str(date-time), label: int, details: int?, lettered_at: str(date-time)?, metadata: [any]?, tags: str?, created_at: str(date-time), updated_at: str(date-time), deleted_at: str(date-time)} # Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/transactions/{id}
@desc Remove a Transaction
@required {appId: int # 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`., id: int # ID of Transaction}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/transactions/{id}/tag
@desc Add a tag on a transaction
@required {appId: int # 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`., id: int # Transaction id}
@optional {tag: str # Tag to add}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/transactions/{id}/tag
@desc Delete a tag on a transaction
@required {appId: int # 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`., id: int # Transaction id}
@optional {tag: str # Tag to delete}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/rules/
@desc List rules
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/rules/
@desc Create a rule
@required {appId: int # 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`.}
@optional {conditions: [[str]], on_event: str # Event like model.event, event in [saved, created, updated, deleted], parameter: str, value: str, priority: int}
@returns(200) {id: int, conditions: [[str]], on_event: str, parameter: str, value: str, priority: int} # Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/rules/execute_on
@desc Execute all rules
@required {appId: int # 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`.}
@optional {model: str}
@returns(200) {id: int, conditions: [[str]], on_event: str, parameter: str, value: str, priority: int} # Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/rules/{id}
@desc Get a rule
@required {appId: int # 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`., id: int}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) {id: int, conditions: [[str]], on_event: str, parameter: str, value: str, priority: int} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/rules/{id}
@desc Update a rule
@required {appId: int # 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`., id: int}
@optional {conditions: [[str]], on_event: str, parameter: str, value: str, priority: int}
@returns(200) {id: int, conditions: [[str]], on_event: str, parameter: str, value: str, priority: int} # Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/rules/{id}
@desc Remove a rule
@required {appId: int # 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`., id: int}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/accounts/
@desc List Account
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/accounts/
@desc Create a Account
@required {appId: int # 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`.}
@optional {journalcode: str, name: str, description: str, keywords: str, accounting_number: str, is_cashflow: bool, is_sales: bool, is_purchase: bool, is_various: bool, is_associate: bool, initiale_balance: num # Integer for example for initiale balance amount of 10.50, 10.50 x 100 = 1050}
@returns(200) {id: int, journalcode: str, technical_name: str, editable: bool, name: str, description: str, keywords: str, accounting_number: str, need_invoice: bool, need_charge: bool, need_employee: bool, is_associate: bool, is_cashflow: bool, is_sales: bool, is_purchase: bool, is_various: bool} # Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/accounts/batch
@desc Create many accounts
@required {appId: int # 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`., data: [any] # List of accounts. Without ID for insert}
@returns(200) {id: int, journalcode: str, technical_name: str, editable: bool, name: str, description: str, keywords: str, accounting_number: str, need_invoice: bool, need_charge: bool, need_employee: bool, is_associate: bool, is_cashflow: bool, is_sales: bool, is_purchase: bool, is_various: bool} # Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/accounts/batch
@desc Remove multiple accounting accounts
@required {appId: int # 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`., ids: [int] # List of accounting accounts ID to remove}
@returns(200) {code: int, type: str, message: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/accounts/{id}
@desc Get a Account
@required {appId: int # 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`., id: int # ID of Account}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) {id: int, journalcode: str, technical_name: str, editable: bool, name: str, description: str, keywords: str, accounting_number: str, need_invoice: bool, need_charge: bool, need_employee: bool, is_associate: bool, is_cashflow: bool, is_sales: bool, is_purchase: bool, is_various: bool} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/accounts/{id}
@desc Update a Account
@required {appId: int # 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`., id: int # ID of Account}
@optional {journalcode: str, name: str, description: str, keywords: str, accounting_number: str, is_cashflow: bool, is_sales: bool, is_purchase: bool, is_various: bool, initiale_balance: num # Integer for example for initiale balance amount of 10.50, 10.50 x 100 = 1050}
@returns(200) {id: int, journalcode: str, technical_name: str, editable: bool, name: str, description: str, keywords: str, accounting_number: str, need_invoice: bool, need_charge: bool, need_employee: bool, is_associate: bool, is_cashflow: bool, is_sales: bool, is_purchase: bool, is_various: bool} # Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/accounts/{id}
@desc Remove a Account
@required {appId: int # 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`., id: int # ID of Account}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/accounts/{delete_account_id}/replace
@desc Delete an account and replace relatives by replacement account id
@required {appId: int # 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`., delete_account_id: int # ID of Account to delete, replacement_account_id: int # ID of Account to delete}
@returns(200) {id: int, journalcode: str, technical_name: str, editable: bool, name: str, description: str, keywords: str, accounting_number: str, need_invoice: bool, need_charge: bool, need_employee: bool, is_associate: bool, is_cashflow: bool, is_sales: bool, is_purchase: bool, is_various: bool} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/forecast/elements
@desc Get all forecast elements
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) {id: int, journalcode: str, technical_name: str, editable: bool, name: str, description: str, keywords: str, accounting_number: str, need_invoice: bool, need_charge: bool, need_employee: bool, is_associate: bool, is_cashflow: bool, is_sales: bool, is_purchase: bool, is_various: bool} # Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/forecast/elements
@desc Create a forecast element
@required {appId: int # 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`.}
@optional {name: str, amount: int, category_id: int, deducted_budget: int, date: str(date-time)}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/forecast/elements
@desc Remove a forecast element
@required {appId: int # 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`.}
@optional {name: str, category_id: int}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/forecast/elements/{id}
@desc Create a forecast element
@required {appId: int # 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`.}
@optional {name: str, amount: int, category_id: int, deducted_budget: int, date: str(date-time)}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/forecast/elements/{id}
@desc Remove a forecast element
@required {appId: int # 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`., id: int # ID}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/forecast/turnover
@desc Get all sales_lines grouped by account
@required {appId: int # 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`.}
@returns(200) {id: int, journalcode: str, technical_name: str, editable: bool, name: str, description: str, keywords: str, accounting_number: str, need_invoice: bool, need_charge: bool, need_employee: bool, is_associate: bool, is_cashflow: bool, is_sales: bool, is_purchase: bool, is_various: bool} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/forecast/expenditures
@desc Get all sales_lines grouped by account
@required {appId: int # 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`.}
@returns(200) {id: int, journalcode: str, technical_name: str, editable: bool, name: str, description: str, keywords: str, accounting_number: str, need_invoice: bool, need_charge: bool, need_employee: bool, is_associate: bool, is_cashflow: bool, is_sales: bool, is_purchase: bool, is_various: bool} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/forecast/payments
@desc Get all sales_lines grouped by account
@required {appId: int # 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`.}
@returns(200) {id: int, journalcode: str, technical_name: str, editable: bool, name: str, description: str, keywords: str, accounting_number: str, need_invoice: bool, need_charge: bool, need_employee: bool, is_associate: bool, is_cashflow: bool, is_sales: bool, is_purchase: bool, is_various: bool} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/forecast/average/payment
@desc Get supplier and customer average payment period
@required {appId: int # 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`.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/forecast/transactions
@desc Get all transactions grouped by account
@required {appId: int # 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`.}
@returns(200) {id: int, journalcode: str, technical_name: str, editable: bool, name: str, description: str, keywords: str, accounting_number: str, need_invoice: bool, need_charge: bool, need_employee: bool, is_associate: bool, is_cashflow: bool, is_sales: bool, is_purchase: bool, is_various: bool} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/forecast/pourcentages/budgets
@desc Calculate pourcentages budgets for all categories
@required {appId: int # 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`.}
@optional {id: int # Category ID}
@returns(200) {id: int, journalcode: str, technical_name: str, editable: bool, name: str, description: str, keywords: str, accounting_number: str, need_invoice: bool, need_charge: bool, need_employee: bool, is_associate: bool, is_cashflow: bool, is_sales: bool, is_purchase: bool, is_various: bool} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/forecast/invoices/unpaid
@desc Calculate pourcentages budgets for all categories
@required {appId: int # 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`.}
@returns(200) {id: int, journalcode: str, technical_name: str, editable: bool, name: str, description: str, keywords: str, accounting_number: str, need_invoice: bool, need_charge: bool, need_employee: bool, is_associate: bool, is_cashflow: bool, is_sales: bool, is_purchase: bool, is_various: bool} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/forecast/purchases/unpaid
@desc Calculate pourcentages budgets for all categories
@required {appId: int # 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`.}
@returns(200) {id: int, journalcode: str, technical_name: str, editable: bool, name: str, description: str, keywords: str, accounting_number: str, need_invoice: bool, need_charge: bool, need_employee: bool, is_associate: bool, is_cashflow: bool, is_sales: bool, is_purchase: bool, is_various: bool} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/accountcategories/
@desc List categories
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/accountcategories/
@desc Create a category
@required {appId: int # 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`.}
@optional {name: str, description: str, type: str}
@returns(200) {id: int, name: str, description: str, type: str} # Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/accountcategories/{id}
@desc Get a category
@required {appId: int # 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`., id: int # ID}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) {id: int, name: str, description: str, type: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/accountcategories/{id}
@desc Update a category
@required {appId: int # 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`., id: int # ID}
@optional {name: str, description: str, type: str}
@returns(200) {id: int, name: str, description: str, type: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/accountcategories/{id}
@desc Remove a category
@required {appId: int # 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`., id: int # ID of the category to remove}
@optional {replacement_id: int # ID of the category to attach accounts attached to the removed category}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/exports
@desc List ExportEntity
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/exports
@desc Create a ExportEntity
@required {appId: int # 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`., until: str(date-time)}
@returns(200) {id: int, period_start: str(date-time), period_end: str(date-time), entries_count: int, total_debit: int, total_credit: int, status: str, created_at: str(date-time), updated_at: str(date-time)} # Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/exports/months
@desc List ExportEntity
@required {appId: int # 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`.}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/exports/acd_compta
@desc Get the ACD UUID for authentification
@required {appId: int # 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`.}
@returns(200) {uuid: str, validity: str, login: str, base: str, cnx: str, password: str, uuid_validity: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/exports/acd_compta
@desc Register ACD identifiants
@required {appId: int # 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`., login: str # the login provided by ACD Compta, password: str # the password provided by ACD Compta, base: str # Your ACD file number (3XXXX), cnx: str # your CNX by ACD Compta, accounting_office_uri: str # your accounting office API domain name}
@returns(200) {uuid: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/exports/acd_compta/filenumber
@desc Set ACD file number
@required {appId: int # 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`., base: str # Your ACD file number (3XXXX)}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/exports/agiris
@desc Get your Agiris file code
@required {appId: int # 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`.}
@returns(200) {file_code: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/exports/agiris
@desc Register Agiris file code
@required {appId: int # 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`., file_code: str # your file code provided by Agiris}
@returns(200) {file_code: str} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/exports/download
@desc Download the export entity as zip
@required {appId: int # 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`.}
@optional {format: str(universal/quadra/fiducial/acd/agiris/pennylane/cegid/xls) # The export format can be a FEC (universal - similar to the French legal file 'Fichier des Ecritures Comptables') or specific for accounting software, export_entities_ids: [int], start_at: str(date-time) # Automatically find export entities from a date range, end_at: str(date-time) # Automatically find export entities from a date range, since: str(date-time) # Automatically find export entities since a date, since_last: bool # Automatically find the export entities since the last export downloaded}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/exports/download/{export_id}
@desc Download the export entity as zip
@required {appId: int # 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`., export_id: int # Export file id}
@returns(200) {id: int, period_start: str(date-time), period_end: str(date-time), file_url: str, file_size: int, format: str, entries_count: int, status: str, downloaded_at: str(date-time), created_at: str(date-time), updated_at: str(date-time)} # Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/exports/{id}
@desc Get a ExportEntity
@required {appId: int # 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`., id: int # ID of ExportEntity}
@optional {with_trashed: bool # Include trashed rows}
@returns(200) {id: int, period_start: str(date-time), period_end: str(date-time), entries_count: int, total_debit: int, total_credit: int, status: str, created_at: str(date-time), updated_at: str(date-time)} # Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /apps/{appId}/exports/{id}
@desc Remove a ExportEntity
@required {appId: int # 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`., id: int # ID of ExportEntity}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/accounting_entries/
@desc List accounting entries
@required {appId: int # 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`.}
@optional {offset: int # The number of items to skip before starting to collect the result set., limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/statistics/vat
@desc Obtain statistics about vat
@required {appId: int # 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`.}
@optional {detailed: bool=false, start_at: str(date-time)=now, period: str(monthly/quarterly/half-yearly/yearly), end_at: str(date-time)}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/statistics/timetable/sales
@desc Obtain statistics about sales
@required {appId: int # 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`.}
@optional {detailed: bool=false, groups: [[int]]=[ [-730, -30], [-30, -1], [-1, 7], [7, 15], [15, 30], [30, 730] ]}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/statistics/timetable/purchases
@desc Obtain statistics about timetable purchases
@required {appId: int # 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`.}
@optional {detailed: bool=false, groups: [[int]]=[ [-730, -30], [-30, -1], [-1, 7], [7, 15], [15, 30], [30, 730] ]}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/statistics/charts/{type}
@desc Obtain statistics about everything
@required {appId: int # 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`., type: str}
@optional {count: int, period: str(hourly/daily/weekly/monthly/quarterly/yearly), start_at: str(date-time), object: str(invoice/quote/purchase/transaction/payment/relationship), object_property: str, calcul: str(sum/avg/count), methods: [[str]] # Array of [object_property, calcul], object_date_property: str, group_by: [str], group_by_object_name: str, exclude_keys: [int], search: str, filters: map, show_details: bool # Recovers the details of the calculations}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/declare/vat
@desc Obtain the url of Teledec declaration page redirection
@required {appId: int # 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`., start_at: str(date-time)=now, period: str(monthly/quarterly/half-yearly/yearly)}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/declare/vat
@desc register Vat declaration settings
@required {appId: int # 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`.}
@optional {key: str, settings: map}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/tags
@desc Get all existants tags
@required {appId: int # 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`.}
@optional {object: str(invoice/quote/purchase/product/transaction/relationship)}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/supplier/accepted
@desc Accept a supplier
@required {appId: int # 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`., token: str # app id of Supplier, email: str # email of the client}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/supplier/accepted/invoice
@desc Accepted to add only this invoice
@required {appId: int # 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`., token: str # app id of Supplier}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/signature
@desc Create a signature
@required {appId: int # 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`., documentId: int, email: str, firstname: str, lastname: str, phone: str}
@returns(200) Success
@errors {404: Not found}

@endgroup

@group ping
@endpoint GET /ping
@desc Ping server
@returns(200) Success
@errors {405: Server error}

@endgroup

@group apps
@endpoint GET /apps/{appId}/services/stripe/webhook
@desc Ping Stripe webhook endpoint
@required {appId: int # 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`.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/services/stripe/webhook
@desc Webhook for Stripe
@required {appId: int # 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`.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endgroup

@group services
@endpoint POST /services/collector
@desc Push to purchase collector
@required {app_identifiant: str, collector_key: str, invoice: str(binary) # Invoice or receipt file (pdf or image)}
@returns(200) Success

@endpoint GET /services/vies/{siren}
@desc Get VIES database informations from SIREN
@required {siren: str}
@returns(200) Success

@endgroup

@group apps
@endpoint POST /apps/{appId}/services/yousign/webhook
@desc Webhook for Yousign
@required {appId: int # 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`.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/sponsorship/invite
@desc Send an email
@required {appId: int # 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`., from: str(email), recipient: str(email), referrer_name: str}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/sponsorship/activate
@desc Activate the invitation for sponsorship
@required {appId: int # 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`., referrer_app_id: str, recipient: str(email)}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/sponsorship/list/referrals
@desc Get all referrals for a referrer
@required {appId: int # 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`.}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/sponsorship/referrer
@desc Get the referrer information for my app
@required {appId: int # 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`.}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/sponsorship/referrer/url
@desc Get the referrer url for my app
@required {appId: int # 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`., referrer_name: str}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/sponsorship/accept/referrer
@desc Verify if the referrer code is valid
@required {appId: int # 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`., referrer_code: str}
@returns(200) Success
@errors {404: Not found}

@endpoint GET /apps/{appId}/sponsorship/credit
@desc Get the credit for my app
@required {appId: int # 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`.}
@returns(200) Success
@errors {404: Not found}

@endpoint POST /apps/{appId}/stripe/import/launch
@desc Launch the import of Stripe data
@required {appId: int # 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`., public_key: str, secret_key: str, private_webhook: str, start_at: str}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/stripe/import/status
@desc Get the import status of Stripe data
@required {appId: int # 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`.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/stripe/import/state
@desc Get the import state of Stripe data
@required {appId: int # 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`.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/openai/billing/estimate
@desc Get the import state of Stripe data
@required {appId: int # 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`., description: str}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/openai/billing/reformulate
@desc Get the reformulate for a designation
@required {appId: int # 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`., description: str}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/openai/billing/corrector
@desc Get the smart corrector for a designation
@required {appId: int # 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`., description: str}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /apps/{appId}/openai/accounting/suggest
@desc Suggest an accounting account from a free-text description using AI
@required {appId: int # 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`., description: str # Free-text description of the accounting need (e.g. 'loyer', 'retraite complémentaire')}
@returns(200) Success
@errors {400: Bad request, 500: AI service error}

@endpoint POST /apps/{appId}/paypal/connect/{clientId}
@desc Connect to Paypal
@required {appId: int # 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`., clientId: str}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/paypal/connect/state
@desc Get if app is connect to Paypal
@required {appId: int # 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`.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/paypal/connect/delete
@desc Delete synchronisation paypal
@required {appId: int # 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`.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /apps/{appId}/webhooks/events
@desc Get all events
@required {appId: int # 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`.}
@optional {limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result., type: str}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endgroup

@group partners
@endpoint POST /partners/{partnerId}/clients/login
@desc Login a client
@required {partnerId: int, email: str, hostname_alias: str, client_secret: str}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /partners/{partnerId}
@desc Get partner information
@required {partnerId: int}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /partners/{partnerId}/cases
@desc Get all cases for a partner
@required {partnerId: int}
@optional {limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /partners/{partnerId}/apps/{app_id}/apikey
@desc Get or create a apikey for a app inside partner case
@required {partnerId: int, app_id: int}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /partners/{partnerId}/plans
@desc Get all plans for a partner
@required {partnerId: int}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /partners/{partnerId}/subscriptions/{app_id}/update
@desc Update a subscription
@required {partnerId: int, app_id: int, plan_nickname: str}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /partners/{partnerId}/subscriptions/{app_id}/cancel
@desc Cancel a subscription
@required {partnerId: int, app_id: int}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /partners/{partnerId}/delete/cases
@desc Delete apps inside a partner scope
@required {partnerId: int, ids: [int]}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /partners/{partnerId}/dissociate/cases
@desc Dissociate apps from a partner
@required {partnerId: int, ids: [int]}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /partners/{partnerId}/add/collaborator
@desc Add a collaborator to an app
@required {partnerId: int, email: str, firstname: str, lastname: str, policy_profile_id: int}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint GET /partners/{partnerId}/collaborators
@desc Get all collaborators for a partner
@required {partnerId: int}
@optional {limit: int=10 # The numbers of items to return., search: str # A string to search for in objects., filters: [map] # List of filters to apply to the query., order: [map] # List in order of priority of the variables by which to order the result.}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint DELETE /partners/{partnerId}/collaborators/{id}
@desc Delete a collaborator for a partner
@required {partnerId: int, id: int}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /partners/{partnerId}/assign/collaborators/{id}
@desc Affecter un collaborateur à un partenaire
@required {partnerId: int, id: int, appId: int}
@optional {userId: int}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /partners/{partnerId}/collaborators/{id}/update
@desc Update a collaborator profile for a partner
@required {partnerId: int, id: int, policy_profile_id: int}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /partners/{partnerId}/user/accept/invite
@desc User accept an invite 'Support Technique' on this app
@required {partnerId: int, appId: int, email: str, token: str}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endpoint POST /partners/{partnerId}/add/policy
@desc Add a user policy to an app (make by partner)
@required {partnerId: int, app_id: int, user_id: int, policy_profile_id: int}
@returns(200) Success
@errors {400: Bad request, 404: Not found}

@endgroup

@end
