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 | nej No | /invoices/32 | Invoice ID till en faktura | ID |
| |
number | nej No | number=1254 | Fakturanummer utan prefix om sådant finnes | Sträng Invoice 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. | ID Inloggad användares anläggnings bolag | The owning company of the business unit for the logged on/specified user | |
state | nej No | state=1 | Hämtar användarens fakturor med angivet Retrieves invoices for specified user and status | Heltal Integer | Se status nedan |
*Obligatioriskt om ett nummer anges
...
See status below | |||||
productids | No | productids=1,2,3 | All invoices containing any of the specified products | ID-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 fakturor tag that encloses all invoices |
invoice |
| <invoice> | Faktura Invoice |
id | ID | <id>1044</id> | Unikt id Unique ID |
number | Sträng String | <number>796</number> | Fakturanummer Invoice number |
prefix | Sträng String | <prefix>F</prefix> | Fakturanummer Invoice number prefix |
orderedby | Sträng String | 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 |
orderid | ID | <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 | Datum Date | 20122015-01-31 | Förfallodatum. Due date |
payeddate | Datum Date | 20122015-01-28 | Betaldag. Date of final payment |
state |
|
| Status, se nedan. see below |
number | Heltal Integer | <number>2</number> | Status, se nedan. see below |
value | Sträng String | <value>Hos BGC<<value>Pending</value> | Utläst Reported status, se nedan. see below |
reminderamount | Heltal Integer | <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 till The 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
Se Fakturastatus för mer information om respektive status.
...
Värde
...
Namn
...
1
...
Ej skickad
...
2
...
Hos BGC
...
3
...
Klar
...
4
...
Påminnelse
...
5
...
Påminnelseservice
...
6
...
Inkasso
...
7
...
Skickad
...
8
...
Create invoice
Create an invoice for the authenticated/specified user. There are three alternatives:
- Create an invoice and set status "Not sent"
- Create an invoice and send it by e-mail
- 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 |
|
distributionmethod | No | Name of the distribution method. Valid values are "email" and "centralprint21grams" | String | ||
templateid | No (* Yes) | 55 | ID of the template to use if a distribution method is specified | ID |
|
duedate | No | 2015-01-31 | Due date | Date | Configurable 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 |
---|---|
1 | Not sent |
2 | Pending |
3 | Completed |
4 | Reminder |
5 | Reminder bureau |
6 | Bill collection |
7 | Sent |
8 | Exported |
9 | Waiting to be sent |