Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Lista fakturor

Listar en eller flera fakturor för autentiserad användare.

...

List invoices

Lists one or more invoices for the authenticated/specified user.

Request

HTTP GET till to /invoices

...

Parameters

namnName

obligatoriskRequired

exempelvärdeValue

förklaring

Värdemängd/DatatypDescription

Data type

Default

id

nejNo

/invoices/32

Invoice ID till en faktura

ID

 

number

nejNo

number=1254

Fakturanummer utan prefix om sådant finnes

SträngInvoice number without prefix

String

 

companyid

nejNo (jaYes*)

companyid=1

Hämtar användarens fakturor kopplade till angivet bolagRetrieves invoices belonging to the user for the specified company.

IDInloggad användares anläggnings bolag

The owning company of the business unit for the logged on/specified user

state

nejNo

state=1

Hämtar användarens fakturor med angivet Retrieves invoices for specified user and status

HeltalInteger

Se status nedan

*Obligatioriskt om ett nummer anges

...

See status below

productidsNoproductids=1,2,3All invoices containing any of the specified productsID-list 

* Requried if ID is specified

Example:

Code Block
APIURL/invoices.xml?apikey=338934897438&state=6

...

Response

TagFormat

Data type

ExempelExample

FörklaringDescription

invoices

 

<invoices>

root-taggen som omsluter alla fakturortag that encloses all invoices

invoice

 

<invoice>

FakturaInvoice

id

ID

<id>1044</id>

Unikt idUnique ID

number

SträngString

<number>796</number>

FakturanummerInvoice number

prefix

SträngString

<prefix>F</prefix>

Fakturanummer Invoice number prefix

orderedby

SträngString

Acme AB, Karl Anka

Faktura mottagaren.

totalamount

Heltal

99900

Fakturans totalbelopp i ören.

rest

Heltal

50000

Kvar att betala i ören.

invoicedate

Datum

2012INC., Homer Simpson

Invoice recipient

orderidID<orderid>44</orderid>Order id
orderedbycustomerid

ID

<orderedbycustomerid>23</orderedbycustomerid>

personID for the customer

totalamount

Integer

99900

The totalt amount of the invoice in cents/ören

rest

Integer

50000

The remaining amount yet to be paid in cents/ören

invoicedate

Date

2015-01-01

Fakturadatum.Invoice date

duedate

DatumDate

20122015-01-31

Förfallodatum.Due date

payeddate

DatumDate

20122015-01-28

Betaldag.Date of final payment

state

 

 

Status, se nedan.see below

number

HeltalInteger

<number>2</number>

Status, se nedan.see below

value

SträngString

<value>Hos BGC<<value>Pending</value>

Utläst Reported status, se nedan.see below

reminderamount

HeltalInteger

<reminderamount>2500</reminderamount>

Påminnelseavgift i Reminder fee in cents/ören

company

 

<company><id>1</id><name>Scrooge Incid><name>Acme INC.</name></company>

Bolaget som fakturan hör tillThe invoicing company

Code Block
<invoices>
  <invoice>
    <id>1044</id>
    <number>796</number>
    <prefix>F</prefix>
	<orderid>44</orderid>
   <orderedby>Karl <orderedby>Homer Anka<Simpson</orderedby>
	<orderedbycustomerid>23</orderedbycustomerid>
    <totalamount>17000</totalamount>
    <rest>17000</rest>
    <invoicedate>2012<invoicedate>2015-01-11</invoicedate>
    <duedate>2012<duedate>2015-01-21</duedate>
    <payeddate/>
    <state>
      <number>2</number>
      <value>Hos BGC<<value>Pending</value>
    </state>
    <reminderamount>2500</reminderamount>
    <company>
      <id>1</id>
      <name>Scrooge<name>Acme IncINC.</name>
    </company>
  </invoice>
  <invoice>
     ...
  </invoice>
</invoices>

Status

...

Create invoice

Create an invoice for the authenticated/specified user. There are three alternatives:

  1. Create an invoice and set status "Not sent"
  2. Create an invoice and send it by e-mail
  3. Create an invoice and send ut by "Central print". See Invoice distribution for more information

Request

HTTP POST to /invoices

Parameters

Name

Required

Value

Description

Data type

Default

orderid

Yes

66

ID för en beställning

ID

 

distributionmethodNoemailName of the distribution method. Valid values are "email" and "centralprint21grams"String 
templateidNo (* Yes)55ID of the template to use if a distribution method is specifiedID

 

duedate

No

2015-01-31

Due date

DateConfigurable in BRP with the setting invoiceDaysWeb

* Required if "distributionmethod" is specified.

 

Important information about invoice distribution 

  • Read the Invoice distribution documentation to understand what features BRP has support for and how to get up and running with invoice distribution.
  • If "distributionmethod" is not specified the invoice will automatically be set to status 1, "Not sent". See invoice status info below.
  • If "distributionmethod" is specified BRP will attempt to distribute the invoice using the specified method. If successful the invoice will receive status 9, "Waiting to be sent". If unsuccessful the invoices will retain it's original status, 1, "Not sent".
  • The "distributionmethod=email" requires that the customer (or other recipient) has a valid e-mail address and an ID for a specific template, "templateid". The ID can be found in BRP by selection Report templates from the Settings menu.
  • The "distributionmethod=centralprint21grams" requires that the customer (or other recipient) has a valid post address.
  • The invoice will be sent and managed by the scheduled activity "Invoice distribution". Once sent the status will be modified to "Sent", this is also logged on the History tab for each specific invoice. If BRP is unable to send the invoice the status will be reset to 1, "Not sent", and any error messages will also be found on the History tab for each invoice.

Example:

Code Block
APIURL/invoices.xml?apikey=338934897438&orderid=66

Response

The same as "List invoices".

Status

See Invoice status for more detailed information in regards to each specific state.
The "Number" is constant. The "Value" can however vary due to locale and future development. The meaning will however not change over time. "Number=1" will always refer to an invoice this is not sent, irregardless of the contextual lable. Always use "Number" and keep your own list for the values.

Number

Value

1Ej

skickadNot sent

2

Hos BGCPending

3

KlarCompleted

4

PåminnelseReminder

5Påminnelseservice

Reminder bureau

6Inkasso

Bill collection

7

SkickadSent

8

ExporteradExported

9Väntar på att skickasWaiting to be sent