The B2Brouter API allows you to send and receive electronic documents.
This Python package is automatically generated by the Swagger Codegen project:
- API version: 1.0.0
- Package version: 1.0.0
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
Python 2.7 and 3.4+
If the python package is hosted on Github, you can install directly from Github
pip install git+https://github.com/ribaguifi/swagger-b2brouter-python.git
(you may need to run pip
with root permission: sudo pip install git+https://github.com/ribaguifi/swagger-b2brouter-python.git
)
Then import the package:
import swagger_client
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import swagger_client
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = swagger_client.Configuration()
configuration.api_key['X-B2B-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-B2B-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.AccountsApi(swagger_client.ApiClient(configuration))
body = swagger_client.AccountsBody() # AccountsBody | The account object in format JSON to create (optional)
try:
# Create an account
api_response = api_instance.create_account(body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountsApi->create_account: %s\n" % e)
# Configure API key authorization: api_key
configuration = swagger_client.Configuration()
configuration.api_key['X-B2B-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-B2B-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.AccountsApi(swagger_client.ApiClient(configuration))
account = 'account_example' # str | Account identifier (ID)
try:
# Delete/archive an account
api_response = api_instance.delete_account(account)
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountsApi->delete_account: %s\n" % e)
# Configure API key authorization: api_key
configuration = swagger_client.Configuration()
configuration.api_key['X-B2B-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-B2B-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.AccountsApi(swagger_client.ApiClient(configuration))
account = 'account_example' # str | Account identifier (ID)
try:
# Deletes account logo
api_response = api_instance.delete_account_logo(account)
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountsApi->delete_account_logo: %s\n" % e)
# Configure API key authorization: api_key
configuration = swagger_client.Configuration()
configuration.api_key['X-B2B-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-B2B-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.AccountsApi(swagger_client.ApiClient(configuration))
account = 'account_example' # str | Account identifier (ID)
try:
# Retrieve an account
api_response = api_instance.get_account(account)
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountsApi->get_account: %s\n" % e)
# Configure API key authorization: api_key
configuration = swagger_client.Configuration()
configuration.api_key['X-B2B-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-B2B-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.AccountsApi(swagger_client.ApiClient(configuration))
offset = 0 # int | Jump to the first object. (optional) (default to 0)
limit = 25 # int | Number of items in the response (500 maximum) (optional) (default to 25)
try:
# List accounts
api_response = api_instance.get_accounts(offset=offset, limit=limit)
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountsApi->get_accounts: %s\n" % e)
# Configure API key authorization: api_key
configuration = swagger_client.Configuration()
configuration.api_key['X-B2B-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-B2B-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.AccountsApi(swagger_client.ApiClient(configuration))
account = 'account_example' # str | Account identifier (ID)
body = swagger_client.AccountsAccountBody() # AccountsAccountBody | The account object in format JSON to update (optional)
try:
# Update an account
api_response = api_instance.put_account(account, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountsApi->put_account: %s\n" % e)
# Configure API key authorization: api_key
configuration = swagger_client.Configuration()
configuration.api_key['X-B2B-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-B2B-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.AccountsApi(swagger_client.ApiClient(configuration))
account = 'account_example' # str | Account identifier (ID)
try:
# Unarchive an account
api_response = api_instance.unarchive_account(account)
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountsApi->unarchive_account: %s\n" % e)
# Configure API key authorization: api_key
configuration = swagger_client.Configuration()
configuration.api_key['X-B2B-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-B2B-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.AccountsApi(swagger_client.ApiClient(configuration))
account = 'account_example' # str | Account identifier (ID)
body = swagger_client.Object() # Object | The logo attachment to add to the account (optional)
try:
# Upload an account logo
api_response = api_instance.upload_account_logo(account, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountsApi->upload_account_logo: %s\n" % e)
All URIs are relative to https://app-staging.b2brouter.net
Class | Method | HTTP request | Description |
---|---|---|---|
AccountsApi | create_account | POST /accounts | Create an account |
AccountsApi | delete_account | DELETE /accounts/{account} | Delete/archive an account |
AccountsApi | delete_account_logo | DELETE /accounts/{account}/logo | Deletes account logo |
AccountsApi | get_account | GET /accounts/{account} | Retrieve an account |
AccountsApi | get_accounts | GET /accounts | List accounts |
AccountsApi | put_account | PUT /accounts/{account} | Update an account |
AccountsApi | unarchive_account | POST /accounts/{account}/unarchive | Unarchive an account |
AccountsApi | upload_account_logo | POST /accounts/{account}/logo | Upload an account logo |
BankAccountsApi | create_bank_account | POST /accounts/{account}/bank_accounts | Create a bank account |
BankAccountsApi | delete_bank_account | DELETE /accounts/{account}/bank_accounts/{id} | Delete a bank account |
BankAccountsApi | get_bank_account | GET /accounts/{account}/bank_accounts/{id} | Get a bank account |
BankAccountsApi | get_bank_accounts | GET /accounts/{account}/bank_accounts | List bank accounts |
BankAccountsApi | put_bank_account | PUT /accounts/{account}/bank_accounts/{id} | Update a bank account |
CodeListsApi | get_channels | GET /users/channels.{format} | List available channels |
CodeListsApi | get_countries | GET /users/countries.{format} | List countries |
CodeListsApi | get_currencies | GET /users/currencies.{format} | List of currencies |
CodeListsApi | get_document_types | GET /document_types.{format} | List of available document types |
CodeListsApi | get_invoice_states | GET /users/invoice_states.{format} | List of available invoice status |
CodeListsApi | get_languages | GET /users/languages.{format} | List of available languages |
CodeListsApi | get_schemes | GET /users/schemes.{format} | List schemes |
CodeListsApi | get_transport_types | GET /transport_types.{format} | List of available transport types |
CompaniesApi | get_companies | GET /projects.{format} | List companies |
CompaniesApi | get_company | GET /projects/{account}/my_company.{format} | Show company |
ContactsApi | create_contact | POST /projects/{account}/clients.{format} | Create a contact |
ContactsApi | delete_contact | DELETE /clients/{id}.{format} | Delete a contact |
ContactsApi | get_contact | GET /clients/{id}.{format} | Get a contact (client/provider) |
ContactsApi | get_contacts | GET /projects/{account}/clients.{format} | List contacts |
ContactsApi | put_contact | PUT /clients/{id}.{format} | Update a contact |
EventsApi | get_events | GET /projects/{account}/events.{format} | List of events |
InvoicesApi | ack_invoice | POST /invoices/{id}/ack.{format} | Mark an invoice as acknowledged |
InvoicesApi | add_attachment_invoice | POST /invoices/{id}/add_attachment.{format} | Add attachment |
InvoicesApi | add_attachments_invoice | POST /invoices/{id}/add_attachments.{format} | Add attachments |
InvoicesApi | create_invoice | POST /projects/{account}/invoices.{format} | Create an invoice |
InvoicesApi | delete_invoice | DELETE /invoices/{id}.{format} | Delete an invoice |
InvoicesApi | generate_tax_report_from_invoice | POST /invoices/{id}/generate_tax_report.{format} | Generate a tax report from an Invoice |
InvoicesApi | get_invoice | GET /invoices/{id}.{format} | Get an invoice |
InvoicesApi | get_invoice_with_document_type | GET /invoices/{id}/as/{document_type_code} | Get an invoice with a specific document type |
InvoicesApi | get_invoices | GET /projects/{account}/invoices.{format} | List of issued invoices |
InvoicesApi | get_issued_self_invoices | GET /projects/{account}/issued_self_invoices.{format} | List of issued self-invoices |
InvoicesApi | get_issued_simplified_invoices | GET /projects/{account}/issued_simplified_invoices.{format} | List of issued simplified invoices |
InvoicesApi | get_received_invoice | GET /projects/{account}/received.{format} | List of received invoices |
InvoicesApi | import_invoice | POST /projects/{account}/invoices/import.{format} | Import an invoice from a file |
InvoicesApi | mark_as_invoice | POST /invoices/{id}/mark_as.{format} | Switch invoice state |
InvoicesApi | put_invoice | PUT /invoices/{id}.{format} | Update an invoice |
InvoicesApi | send_invoice | POST /invoices/send_invoice/{id}.{format} | Send invoice |
InvoicesApi | validate | GET /invoices/{id}/validate | Validates an invoice to send |
LedgersApi | download_ledger | GET /api/v1/ledgers/{id}/download | [New Tax Report API] Download a Ledger |
LedgersApi | download_response_ledger | GET /api/v1/ledgers/{id}/download_response | [New Tax Report API] Download the response for a Ledger |
LedgersApi | import_ledger | POST /api/v1/accounts/{account}/ledgers/import | [BETA][New Tax Report API] Import a ledger |
LookupApi | lookup_directory_by_country | GET /api/v1/directory/{country}/{id}.json | Show company from Directory (by country code) |
LookupApi | lookup_directory_by_country_and_scheme | GET /api/v1/directory/{country}/{scheme}/{id}.json | Show company from Directory (by country and scheme codes) |
LookupApi | lookup_directory_by_scheme | GET /api/v1/directory/{scheme}/{id}.json | Show company from Directory (by scheme code) |
OrdersApi | get_order | GET /orders/{id}.{format} | Get an order |
OrdersApi | get_orders | GET /projects/{account}/orders.{format} | List of orders |
OrdersApi | mark_as_order | POST /orders/{id}/mark_as.{format} | Switch order state |
TaxReportSettingsApi | create_tax_report_setting | POST /accounts/{account}/tax_report_settings | Create a tax report setting |
TaxReportSettingsApi | delete_tax_report_setting | DELETE /accounts/{account}/tax_report_settings/{code} | Delete a tax report setting |
TaxReportSettingsApi | get_tax_report_setting | GET /accounts/{account}/tax_report_settings/{code} | Retrieve a tax report setting |
TaxReportSettingsApi | get_tax_report_settings | GET /accounts/{account}/tax_report_settings | List tax report settings |
TaxReportSettingsApi | put_tax_report_setting | PUT /accounts/{account}/tax_report_settings/{code} | Update a tax report setting |
TaxReportsApi | annulate_tax_report | POST /tax_reports/{id}/annullate.json | [Deprecated] Annulates a tax report |
TaxReportsApi | download_tax_report | GET /tax_reports/{id}/download.{format} | [Deprecated] Download the tax report |
TaxReportsApi | get_tax_report | GET /tax_reports/{id}.{format} | [Deprecated] Get a tax report |
TaxReportsApi | get_tax_report_with_document_type | GET /tax_reports/{id}/as/{document_type_code} | [Deprecated] Get the TaxReport with the specified document type |
TaxReportsApi | get_tax_reports | GET /projects/{account}/tax_reports.{format} | [Deprecated] List tax reports |
TaxReportsApi | new_annulate_tax_report | DELETE /api/v1/tax_reports/{id} | [New Tax Report API] Annulates a tax report |
TaxReportsApi | new_create_tax_report | POST /api/v1/accounts/{account}/tax_reports | [New Tax Report API] Create a Tax Report |
TaxReportsApi | new_download_tax_report | GET /api/v1/tax_reports/{id}/download | [New Tax Report API] Download a tax report |
TaxReportsApi | new_get_tax_report | GET /api/v1/tax_reports/{id} | [New Tax Report API] Get a tax report |
TaxReportsApi | new_get_tax_reports | GET /api/v1/accounts/{account}/tax_reports | [New Tax Report API] List tax reports |
TaxReportsApi | new_import_tax_report | POST /api/v1/accounts/{account}/tax_reports/import | [New Tax Report API] Import a Tax Report from an XML file |
TaxReportsApi | new_modify_tax_report | PATCH /api/v1/tax_reports/{id} | [New Tax Report API] Correct or Modify a Tax Report |
TaxReportsApi | send_tax_report | POST /tax_reports/send_tax_report/{id}.json | [Deprecated] Send a tax report |
TransportsApi | create_transport | POST /accounts/{account}/transports | Create a transport configuration |
TransportsApi | delete_transport | DELETE /accounts/{account}/transports/{code} | Delete a transport configuration |
TransportsApi | get_transport | GET /accounts/{account}/transports/{code} | Retrieve a transport configuration |
TransportsApi | get_transports | GET /accounts/{account}/transports | List configured transports |
TransportsApi | put_transport | PUT /accounts/{account}/transports/{code} | Update a transport configuration |
ValidationApi | validate_document | POST /documents/validate | Validates an electronic document |
EAccountingApi | get_connected_accounts | GET /accounts/{account}/eaccounting/connected_accounts | List connected accounts |
- Account
- AccountBankAccountsBody
- AccountClientsFormatBody
- AccountClientsFormatBody1
- AccountInvoicesFormatBody
- AccountTaxReportSettingsBody
- AccountTaxReportsBody
- AccountTransportsBody
- AccountsAccountBody
- AccountsBody
- Ack
- AdditionalItemProperty
- AllOfClientDocumentType
- AllOfClientDocumentTypeCode
- AllOfClientTransportType
- AllOfClientTransportTypeCode
- AllOfExternalCompanyApplicationResponse
- AllOfExternalCompanyCreditNote
- AllOfExternalCompanyDespatchAdvice
- AllOfExternalCompanyDespatchAdviceResponse
- AllOfExternalCompanyOrder
- AllOfExternalCompanyOrderResponse
- AllOfInvoiceBankAccount
- AllOfInvoiceCardAccount
- AllOfInvoiceCardAccountAttributes
- AllOfInvoiceClient
- AllOfInvoiceContact
- AllOfInvoiceDocumentTypeCode
- AllOfInvoiceState
- AllOfTransportTypeDefaultDocumentType
- AllOfaccountInvoicesFormatBodyInvoice
- AllOfaccountTaxReportsBodyTaxReport
- AllOfaccountsBodyAccount
- AllOfinlineResponse2002Account
- AllOfinlineResponse200AccountsItems
- AnyOfinlineResponse20011TaxReportSettingsItems
- AnyOfinlineResponse20012TaxReportSetting
- AnyOfinlineResponse20013TaxReportSetting
- AnyOfinlineResponse20042EventsItems
- AnyOfinlineResponse20043EventsItems
- AnyOfinlineResponse20046TransportsItems
- AnyOfinlineResponse20048Transport
- AnyOftaxReportSettingsCodeBodyTaxReportSetting
- AnyOftransportsCodeBodyTransport
- Attachment
- BankAccount
- BankAccountCommon
- BankAccountsIdBody
- CardAccountCommon
- CardAccountUpdate
- Channel
- Client
- ClientEvent
- ClientEventClient
- ClientReduced
- ClientReducedClientOffices
- ClientReducedProject
- ClientRoutingCodes
- ClientWithRequiredAttributes
- ClientsIdFormatBody
- Company
- Country
- Currency
- DirectoryOrgUnits
- DirectoryOrgUnitsRoutingCodes
- DocumentType
- DocumentTypeCode
- DocumentValidation
- DocumentValidationValidationResult
- DocumentValidationValidationResultInfo
- DocumentValidationValidationResultSch
- DocumentValidationValidationResultSchErrors
- DocumentValidationValidationResultSchWarnings
- DocumentValidationValidationResultXsd
- DocumentValidationValidationResultXsdErrors
- Error
- ErrorError
- ErrorItem
- ErrorMessage
- Event
- ExternalCompany
- ExternalCompanyInformationNotes
- ExternalCompanyInvoice
- ExternalCompanyRoutingCodes
- ExternalCompanyTransportProperties
- IdAddAttachmentsFormatBody
- IdMarkAsFormatBody
- IdMarkAsFormatBody1
- InlineResponse200
- InlineResponse2001
- InlineResponse20010
- InlineResponse20011
- InlineResponse20012
- InlineResponse20013
- InlineResponse20014
- InlineResponse20015
- InlineResponse20015TaxReportSetting
- InlineResponse20016
- InlineResponse20017
- InlineResponse20018
- InlineResponse20019
- InlineResponse2002
- InlineResponse20020
- InlineResponse20021
- InlineResponse20022
- InlineResponse20022ValidationResult
- InlineResponse20022ValidationResultModel
- InlineResponse20022ValidationResultModelErrors
- InlineResponse20023
- InlineResponse20024
- InlineResponse20025
- InlineResponse20026
- InlineResponse20027
- InlineResponse20028
- InlineResponse20029
- InlineResponse2003
- InlineResponse20030
- InlineResponse20031
- InlineResponse20032
- InlineResponse20033
- InlineResponse20034
- InlineResponse20035
- InlineResponse20036
- InlineResponse20037
- InlineResponse20038
- InlineResponse20039
- InlineResponse2003Account
- InlineResponse2004
- InlineResponse20040
- InlineResponse20041
- InlineResponse20042
- InlineResponse20043
- InlineResponse20044
- InlineResponse20045
- InlineResponse20046
- InlineResponse20047
- InlineResponse20048
- InlineResponse20049
- InlineResponse20049Transport
- InlineResponse2004Account
- InlineResponse2005
- InlineResponse20050
- InlineResponse20051
- InlineResponse20052
- InlineResponse2005Account
- InlineResponse2006
- InlineResponse2006Account
- InlineResponse2007
- InlineResponse2008
- InlineResponse2009
- InlineResponse2009BankAccount
- InlineResponse201
- InlineResponse2011
- InlineResponse2012
- InlineResponse2013
- InlineResponse2013Ledger
- InlineResponse422
- InlineResponse4221
- Invoice
- InvoiceCompany
- InvoiceContactHash
- InvoiceEvent
- InvoiceEventInvoice
- InvoiceLine
- InvoiceLineReceiptReference
- InvoiceLineUpdate
- InvoiceMarkAsCommit
- InvoiceMarkAsReason
- InvoiceProject
- InvoiceReduced
- InvoiceReducedClient
- InvoiceState
- InvoiceUpdate
- InvoicesIdFormatBody
- Language
- LhdnTaxReportSetting
- Message
- NewTaxReport
- OneOfaccountClientsFormatBody1Client
- OneOfaccountClientsFormatBodyClient
- OneOfaccountTaxReportSettingsBodyTaxReportSetting
- OneOfaccountTransportsBodyTransport
- OneOfclientsIdFormatBodyClient
- OneOfinlineResponse20014TaxReportSetting
- OneOfinlineResponse20047Transport
- Order
- OrderAccountingParty
- OrderAttachments
- OrderClient
- OrderId
- OrderLine
- OrderProject
- OrderState
- PaymentDues
- Project
- Scheme
- SdiTaxReportSetting
- SendAfterImport
- StateInput
- StateOutput
- Tax
- TaxBreakdowns
- TaxReport
- TaxReportGenerated
- TaxReportLine
- TaxReportSettingsCodeBody
- TbaiTaxReportSetting
- TransactionsEdocsync
- TransportB2brouter
- TransportEdi
- TransportEmail
- TransportPeppol
- TransportType
- TransportTypeCode
- TransportUserPassword
- TransportsCodeBody
- UnauthorizedError
- UnauthorizedErrorError
- VerifactuTaxReportSetting
- Type: API key
- API key parameter name: X-B2B-API-Key
- Location: HTTP header