public class FortnoxClient extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_NEW_SUPPLIER_NAME |
| Constructor and Description |
|---|
FortnoxClient() |
| Modifier and Type | Method and Description |
|---|---|
String |
accountFee(String orgNo,
Date acctDate,
Double totalAmount,
Double vatAmount,
String feeAccount,
String srcAccount,
String vatAccount,
String description,
String voucherSeries,
String costCenter,
String srcCurrency)
Creates a fee voucher
|
String |
accountTransfer(String orgNo,
Date acctDate,
Double totalAmount,
String creditAcct,
String debitAcct,
String description,
String voucherSeries,
String srcCurrency)
Creates an account transfer voucher
|
String |
getClientName(String orgNo)
Convenience class to get the name of the client
|
org.notima.api.fortnox.entities3.CompanySetting |
getCompanySetting(String orgNo)
Read company settings.
|
org.notima.api.fortnox.FortnoxClient3 |
getCurrentFortnoxClient() |
org.notima.businessobjects.adapter.fortnox.FortnoxAdapter |
getFortnoxAdapter(String orgNo)
Keeps a cached business object factory
|
org.notima.api.fortnox.entities3.Invoice |
getFortnoxInvoice(String orgNo,
String invoiceNo)
Returns Fortnox invoice
|
List<org.notima.api.fortnox.entities3.Invoice> |
getFortnoxInvoices(String orgNo,
String filter)
Returns fortnox invoices using given filter.
|
String |
getInvoiceReference(org.notima.api.fortnox.entities3.Invoice i) |
List<org.notima.api.fortnox.entities3.Invoice> |
getInvoicesWithPaymentTerm(String orgNo,
String pt)
Returns invoices with given payment term.
|
List<org.notima.api.fortnox.entities3.Invoice> |
getInvoiceToPay(String orgNo,
String invoiceRef,
String invoiceRefType,
Date reconciliationDate,
String invoiceRefRegEx)
Gets the invoice to pay
|
Map<String,org.notima.api.fortnox.entities3.Order> |
getOrderMap(String orgNo,
String referenceField,
String refRegEx)
Creates a mapping of orders using the given reference field.
|
List<org.notima.generic.businessobjects.Invoice> |
getOverdueInvoices(String orgNo)
Gets overdue invoices
|
String |
getSettingFromSupplier(String orgNo,
String supplierOrgNo,
String settingKey)
Get a single settings on the given supplier
|
Map<String,String> |
getSettingsFromSupplier(String orgNo,
String supplierOrgNo)
Get a map of settings on the given supplier
|
org.notima.api.fortnox.entities3.Supplier |
getSupplierByOrgNo(String orgNo,
Boolean createIfNotFound)
Gets a supplier with given orgNo.
|
FortnoxClient |
getThis()
Helper method for easier bean access from blueprint.
|
String |
invoiceAction(String orgNo,
String invoiceNo,
String action)
Invoices action on given invoice
|
boolean |
isLastAccessToken(String accessToken)
Return true if the given parameter is equal to the last access token used.
|
org.notima.api.fortnox.entities3.Customer |
lookupExistingCustomerUsingCanonical(String orgNo,
org.notima.generic.businessobjects.BusinessPartner bp) |
org.notima.api.fortnox.entities3.InvoicePayment |
payCustomerInvoice(String orgNo,
String modeOfPayment,
org.notima.api.fortnox.entities3.Invoice invoice,
Boolean bookkeepPayment,
org.notima.generic.businessobjects.Payment<?> payment)
Pays a customer invoice
|
org.notima.api.fortnox.entities3.Customer |
persistCustomerFromCanonical(String orgNo,
org.notima.generic.businessobjects.BusinessPartner bp) |
String |
persistInvoice(String orgNo,
org.notima.api.fortnox.entities3.Invoice invoice)
Persists invoice
|
org.notima.generic.businessobjects.Invoice |
persistInvoiceFromCanoncialOrder(String orgNo,
org.notima.generic.businessobjects.Order order,
Boolean useArticles,
Date invoiceDate,
boolean debugAdapter)
Persists invoice from order
|
org.notima.api.fortnox.clients.FortnoxCredentials |
retrieveAccessTokenFromApiCode(String clientId,
String clientSecret,
String apiCode,
String redirectUri)
Retrieves access token if possible
NOTE!!
|
org.notima.api.fortnox.entities3.Supplier |
writeSettingToSupplier(String clientOrgNo,
String accessToken,
String supplierOrgNo,
String settingKey,
String settingValue)
Writes a setting to supplier
|
public static String DEFAULT_NEW_SUPPLIER_NAME
public org.notima.api.fortnox.clients.FortnoxCredentials retrieveAccessTokenFromApiCode(@Header(value="clientId")
String clientId,
@Header(value="clientSecret")
String clientSecret,
@Header(value="apiCode")
String apiCode,
@Header(value="redirectUri")
String redirectUri)
throws Exception
clientSecret - apiCode - Exception - If something goes wrong.public boolean isLastAccessToken(String accessToken)
accessToken - public org.notima.businessobjects.adapter.fortnox.FortnoxAdapter getFortnoxAdapter(String orgNo) throws Exception
orgNo - Exceptionpublic org.notima.api.fortnox.FortnoxClient3 getCurrentFortnoxClient()
public List<org.notima.api.fortnox.entities3.Invoice> getInvoicesWithPaymentTerm(@Header(value="orgNo") String orgNo, @Header(value="paymentTerm") String pt) throws Exception
orgNo - pt - Exceptionpublic org.notima.api.fortnox.entities3.Invoice getFortnoxInvoice(@Header(value="orgNo")
String orgNo,
@Header(value="invoiceNo")
String invoiceNo)
throws Exception
orgNo - invoiceNo - Exceptionpublic org.notima.api.fortnox.entities3.CompanySetting getCompanySetting(@Header(value="orgNo")
String orgNo)
throws Exception
orgNo - OrgNoException - If something goes wrongpublic String getClientName(@Header(value="orgNo") String orgNo) throws Exception
orgNo - The orgNoException - If something goes wrong.public org.notima.api.fortnox.entities3.Supplier getSupplierByOrgNo(@Header(value="orgNo")
String orgNo,
@Header(value="createIfNotFound")
Boolean createIfNotFound)
throws Exception
orgNo - Exceptionpublic List<org.notima.api.fortnox.entities3.Invoice> getFortnoxInvoices(@Header(value="orgNo") String orgNo, @Header(value="filter") String filter) throws Exception
orgNo - filter - Exceptionpublic List<org.notima.generic.businessobjects.Invoice> getOverdueInvoices(@Header(value="orgNo") String orgNo) throws Exception
orgNo - Exceptionpublic String invoiceAction(@Header(value="orgNo") String orgNo, @Header(value="invoiceNo") String invoiceNo, @Header(value="action") String action) throws Exception
orgNo - invoiceNo - action - Exceptionpublic String getInvoiceReference(org.notima.api.fortnox.entities3.Invoice i)
public Map<String,org.notima.api.fortnox.entities3.Order> getOrderMap(String orgNo, String referenceField, String refRegEx) throws Exception
orgNo - referenceField - refRegEx - Exceptionpublic FortnoxClient getThis()
public List<org.notima.api.fortnox.entities3.Invoice> getInvoiceToPay(@Header(value="orgNo") String orgNo, @Header(value="invoiceRef") String invoiceRef, @Header(value="invoiceRefType") String invoiceRefType, @Header(value="reconciliationDate") Date reconciliationDate, @Header(value="refRegEx") String invoiceRefRegEx) throws Exception
orgNo - invoiceRef - The actual invoice reference to look for.invoiceRefType - What type of reference this is, meaning the field in the invoice where this reference is found.
Possible fields are: invoice or DocumentNumber (equal), ExternalInvoiceReference1,
ExternalInvoiceReference2, order (meaning orderNo of order existing in Fortnox),
InvoiceReference, OCR, OrderReference, OurReference,
YourOrderNumber, YourReferenceinvoiceRefRegEx - Exceptionpublic org.notima.api.fortnox.entities3.InvoicePayment payCustomerInvoice(@Header(value="orgNo")
String orgNo,
@Header(value="modeOfPayment")
String modeOfPayment,
@Header(value="invoice")
org.notima.api.fortnox.entities3.Invoice invoice,
@Header(value="bookkeepPayment")
Boolean bookkeepPayment,
org.notima.generic.businessobjects.Payment<?> payment)
throws Exception
orgNo - Org nomodeOfPayment - Payment Method Code (ie what account is this payment made to, betalningsvillkor)invoice - The Fortnox invoice to be paid.bookkeepPayment - If false, the payments are not bookkept (only preliminary).payment - The payment to be appliedExceptionpublic String persistInvoice(@Header(value="orgNo") String orgNo, org.notima.api.fortnox.entities3.Invoice invoice) throws Exception
orgNo - invoice - Exceptionpublic org.notima.generic.businessobjects.Invoice persistInvoiceFromCanoncialOrder(@Header(value="orgNo")
String orgNo,
@Header(value="canonicalOrder")
org.notima.generic.businessobjects.Order order,
@Header(value="useArticles")
Boolean useArticles,
@Header(value="invoiceDate")
Date invoiceDate,
@Header(value="debugAdapter")
boolean debugAdapter)
throws org.notima.api.fortnox.FortnoxInvoiceException,
org.notima.api.fortnox.FortnoxScopeException,
Exception
orgNo - The org no of the Fortnox client.order - Order number.useArticles - If true, articles are used when creating invoice lines.invoiceDate - If non null, this date is used as invoice date.defaultRevenueAccount - If set, this is used as default revenue account for the invoice.Exceptionorg.notima.api.fortnox.FortnoxInvoiceExceptionorg.notima.api.fortnox.FortnoxScopeExceptionpublic org.notima.api.fortnox.entities3.Customer persistCustomerFromCanonical(@Header(value="orgNo")
String orgNo,
@Header(value="businessPartner")
org.notima.generic.businessobjects.BusinessPartner bp)
throws Exception
Exceptionpublic org.notima.api.fortnox.entities3.Customer lookupExistingCustomerUsingCanonical(@Header(value="orgNo")
String orgNo,
@Header(value="businessPartner")
org.notima.generic.businessobjects.BusinessPartner bp)
throws Exception
Exceptionpublic String accountTransfer(@Header(value="orgNo") String orgNo, @Header(value="reconciliationDate") Date acctDate, @Header(value="totalAmount") Double totalAmount, @Header(value="creditAcct") String creditAcct, @Header(value="debitAcct") String debitAcct, @Header(value="transferDescription") String description, @Header(value="voucherSeries") String voucherSeries, @Header(value="srcCurrency") String srcCurrency) throws Exception, org.notima.api.fortnox.FortnoxException, org.notima.api.fortnox.FortnoxScopeException
orgNo - acctDate - totalAmount - creditAcct - debitAcct - description - voucherSeries - srcCurrency - Exceptionorg.notima.api.fortnox.FortnoxException - if something goes wrong.org.notima.api.fortnox.FortnoxScopeException - if something goes wrong.public String accountFee(@Header(value="orgNo") String orgNo, @Header(value="reconciliationDate") Date acctDate, @Header(value="feeTotal") Double totalAmount, @Header(value="feeVat") Double vatAmount, @Header(value="feeAccount") String feeAccount, @Header(value="srcAccount") String srcAccount, @Header(value="vatAccount") String vatAccount, @Header(value="feeDescription") String description, @Header(value="voucherSeries") String voucherSeries, @Header(value="costCenter") String costCenter, @Header(value="srcCurrency") String srcCurrency) throws org.notima.api.fortnox.FortnoxException, org.notima.api.fortnox.FortnoxScopeException, Exception
orgNo - acctDate - totalAmount - vatAmount - feeAccount - srcAccount - vatAccount - description - voucherSeries - srcCurrency - The source currency of the voucher.Exception - if something goes wrong.org.notima.api.fortnox.FortnoxException - if something goes wrong.org.notima.api.fortnox.FortnoxScopeException - if something goes wrong.public String getSettingFromSupplier(@Header(value="orgNo") String orgNo, @Header(value="supplierOrgNo") String supplierOrgNo, @Header(value="settingKey") String settingKey) throws Exception
orgNo - The client org nosupplierOrgNo - The org number of supplier where settings are stored.settingKey - The key of the setting.Exception - If something goes wrong.public Map<String,String> getSettingsFromSupplier(@Header(value="orgNo") String orgNo, @Header(value="supplierOrgNo") String supplierOrgNo) throws Exception
orgNo - The client org nosupplierOrgNo - The org number of supplier where settings are stored.Exception - If something goes wrong.public org.notima.api.fortnox.entities3.Supplier writeSettingToSupplier(@Header(value="clientOrgNo")
String clientOrgNo,
@Header(value="accessToken")
String accessToken,
@Header(value="supplierOrgNo")
String supplierOrgNo,
@Header(value="settingKey")
String settingKey,
@Header(value="settingValue")
String settingValue)
throws Exception
clientOrgNo - The client org nosupplierOrgNo - Supplier's org nosettingKey - Setting keysettingValue - Setting valueException - If something goes wrongCopyright © 2017–2024 Notima System Integration AB. All rights reserved.