Get all invoices
GET REST API request that returns list of all invoices that are linked to merchant. Response example is shown below.
Alongside “Authorization” header, parameter “type” can be passed with string value FISCAL or NON_FISCAL, that will filter out invoices by type. If this parameter is not provided, all invoices will be returned. Non fiscalized merchant will not be able to get invoices with parameter type FISCAL, response will be bad request.
Parameters “dateFrom” and “dateTo” are zoned dates with time and are required and inclusive. They represent time range for invoiced dates. Date from is only viable from 1stof May 2022, and date range can’t be longer than 3 months. Example:
https://api.stage.ananastest.com/order/api/v1/merchant-integration/invoices?dateFrom=2022-05-01T10:20:45.1457765Z&dateTo=2022-06-07T10:20:45.1457765Z&type=FISCALRequest
Request:HTTP Method | GET | |||||||||
URL | Stage | https://api.stage.ananastest.com/order/api/v1/merchant-integration/invoices | ||||||||
Production | https://api.ananas.rs/order/api/v1/merchant-integration/invoices | |||||||||
HTTP Headers |
| |||||||||
URL Parameters |
|
Response
Response is a collection of invoices.
Invoice
Fields name | Type | Description |
invoiceHeader | InvoiceHeader | Invoice header information that includes information about type of invoice, customer, merchant, fiscal data and basic order details |
productSpecification | ProductSpecification | Details about products, shipping and grand total prices |
taxRateSpecification | TaxRateSpecification | Details about taxes |
InvoiceHeader
Fields name | Type | Description |
invoicetype | Invoicetype | Represents invoice type. Invoice can be of type FISCAL or NON_FISCAL |
merchantDetails | MerchantDetails | Details about merchant |
customerDetails | CustomerDetails | Details about customer |
fiscalDetails | FiscalDetails | Fiscal data provided by tax administration |
orderDetails | OrderDetails | Details about order |
MerchantDetails
Fields name | Type | Description |
name | String | Merchant's name |
businessSpaceCode | String | Unique code for business space |
taxIdentificationNumber | String | Unique merchant tax identification number(PIB) |
identificationNumber | String | Unique merchant identification number (MB) |
taxAdministrationId | String | Unique tax administration id (ESIR) |
cashier | String | Cashier that issued the invoice |
contactDetails | ContactDetails | Merchant's contact details |
address | Address | Merchant’s headquarters address |
ContactDetails
Fields name | Type | Description |
phone | Sting | Merchant's phone |
String | Merchant's email |
Address
Fields name | Type | Description |
street | Sting | Street name and number |
city | String | City |
CustomerDetails
Fields name | Type | Description |
firstName | Sting | Customer's fist name |
lastName | String | Customer's last name |
address | CustomerAddress | Customer's billing address |
CustomerAddress
Fields name | Type | Description |
street | Sting | Street name and number |
city | String | City |
postcode | string | Postal code |
FiscalDetails
Fields name | Type | Description |
invoiceCounter | Sting | Invoice counter generated by tax administration |
verificationUrl | String | Verification url for fiscal transaction generated by tax administration |
fiscalInvoiceDate | LocalDateTime | Tax administration invoiced date in UTC |
invoiceNumber | String | Unique tax administration invoice number |
OrderDetails
Fields name | Type | Description |
invoiceId | Sting | Unique Ananas invoice id |
invoicedDate | LocalDateTime | Ananas invoiced date in UTC |
orderId | String | User friendly unique order id |
suborderId | String | User friendly unique suborder id |
fba | boolean | Fullfilment by Ananas |
paymentMethods | List[String] | Order payment methods. Example: [COD, VOUCHER] Translation of payment methods: COD- cash on delivery PBC- pay by card POS – pay on site VOUCHER - voucher |
warehouseAddress | WarehouseAddress | Address of the warehouse from where the order was picked up |
orderDate | LocalDateTime | Ddate of creating order |
WarehouseAddress
Fields name | Type | Description |
WarehouseId | Long | Merchant’s warehouse identity |
street | String | Street name and number |
city | String | City |
ProductSpecification
Fields name | Type | Description |
items | List(Item) | List of all suborder items with details |
GrandTotalDetails | GrandTotalDetails | Grand total prices |
Item
Fields name | Type | Description |
productDetails | ProductDetails | Details about product |
quantity | int | Packed quantity for an item |
itemPrice | Price | Price for single item |
grandTotalPrice | Price | Item prices multiplied by quantity |
ProductDetails
Fields name | Type | Description |
productDetails | ProductDetails | Details about product |
name | String | Product name |
apId | String | Ananas platform id |
sku | String | SKU value |
ean | String | European Article Number |
aCode | String | Ananas code |
Price
Fields name | Type | Description |
unitPrice | BigDecimal | Unit price |
unitPriceWithoutVat | BigDecimal | Unit price without added vat |
basePrice | BigDecimal | Sellable price with discount |
basePriceWithoutVat | BigDecimal | Sellable price with discount and without vat |
discountVat | BigDecimal | Discount percentage |
discountAmount | BigDecimal | Discount |
vat | BigDecimal | Vat percentage |
vatAmount | BigDecimal | Vat amount |
GrandTotalDetails
Fields name | Type | Description |
basePrice | BigDecimal | Sellable price Sum of items base prices and shipping |
basePriceWithoutVat | BigDecimal | Sellable price without vat |
vatAmount | BigDecimal | Vat percentage |
chargedPrice | BigDecimal | Price charged to customer |
TaxRateSpecification
Fields name | Type | Description |
taxRateSpecification | List(TaxRateDetails) | List of tax rate details |
grandTotal | BigDecimal | Total tax amountSum of tax rate base prices |
TaxRateDetails
Fields name | Type | Description |
label | String | Tax rate label |
name | String | Tax rate name |
basePriceWithoutVat | BigDecimal | Sellable price with without vat |
vat | BigDecimal | Vat percentage |
vatAmount | BigDecimal | Vat amount |
Example of response:
[
{
"invoiceHeader": {
"invoiceType": "FISCAL",
"merchantDetails": {
"name": "Maki doo",
"businessSpaceCode": "",
"taxIdentificationNumber": "111606273",
"identificationNumber": "20862467",
"taxAdministrationId": "854/1.0",
"cashier": "",
"contactDetails": {
"phone": "+381669879009",
"email": "merchant@gmail.com",
},
"address": {
"street": "ZAOB.PUT ZVORNIK-LJUBOVIJA 23",
"city": "LJUBOVIJA",
},
},
"customerDetails": {
"firstName": "Pera",
"lastName": "Segedinac",
"address": {
"street": "PERE SEGEDINCA 55",
"city": "BEOGRAD-NOVI BEOGRAD",
"postcode": "11010"
},
},
"fiscalDetails": {
"invoiceCounter": "1757/3189ПП",
"verificationUrl":
"https://sandbox.suf.purs.gov.rs/v/?vl=A1JFUkNaS002RHQxT3YxbzB1DAAA3QYAAECdCBAAAAAAAAABgItDMLkAAAB228TA9h5b1hyhwICcG8JmBts0IPX9Qu5OlntWAktzDqQzNskEfv0ENM8l19irPzzwNaeBYFrkym%2BgBW5rnoMT3T3WSoKAWdhR6%2BPoUeDB4vftjCxC6pnpYOyJfecyUAangAl6mdZcsrF472oguahaoHXc8ENXhX1RMSU7qP2gxAL%2FbRY7Jq8PpPxqbN3AcnoVPoLVH%2B85r2jyyoKItPA7fMjMb3gHf%2BH66cP0pegse0P93aX%2BH3SAASSjXwNYQROiL1frth5XRAn4crwNiwWFHECnSy00oZySi47sFS8Fm2j0ZGZafRP8eB1cIv2elgrXVAkqzd8WKC%2FB9jW7L41uFI05BzUcvqQYQEB5ryr79ppa2bxJOR86D4iBikNQpVl2OF8oo28DuzPlsZbT9xmCK%2F17n%2FR5w3RvPJHo4%2FJJDuG4rdY3YVf%2BQQJHeFRt2KEukQcKhZgvuF7N7Ggd%2Fmyk09ojp%2F7oZt3j3yhTg8UiD1XJcz51jNVj50V%2FlXWYxct%2BOTMs7d3xwt8u2RMo4nS7JUzycPyu5TExeDZTZZ7i2e6xfD2qnNJH3OoNLuaes3To9864xszHq8roHOMZU%2FlUKgyQSBSS%2B9EftlmVzzPjHhAmAM%2BWneSyD3oG2Ft6aZ0LMy6JmjKnmqmKpTqmkxSYGL1WJnQ0KwBuknT30%2BrVeLExl7q3HStApjRCqce5mXzL5tiyxMJiXjY2sOIPEE5GZT6He6L2Vnva1Rs5ziXyjP9Ifkl%2Bj6dkkLtYHQ9S1jMN5qoJgDtNQlVxWVFGZZALSKlKUsi4YyUffC9GyQ4V1jaf3U9zDj6cS%2BpTmCAB5yhCz3cLu5Wsdw7yrZwMZIRR6FKJ3mDZ42%2BqxNAuMoVZ5XwRA5Lb9TnAi83%2F36EMrM2N%2Fhkyt1VfZc7ajoPiSPjVAqeIp2P%2FoPeKPl6bWZSoUrbOVQGDBmnpT%2FFCzQMI74veLOEohrvrn8mthiG68xYGzvao82ZQBOrPYMe7LMxtT44GZGGa8RojmlDmQ%2FY0jtKspRjDfWE7xh8rIvrNtmQl",
"fiscalInvoiceDate": "2022-05-03T18:51:18Z",
"invoiceNumber": "RERCZKM6-Dt1Ov1o0-3171"
},
"orderDetails": {
"invoiceNumber": "4599335419",
"invoicedDate": "2022-05-03T00:00:00Z",
"orderId": "69N73-9E0P9",
"suborderId": "69N73-9E0P9-DS-1",
"fba": false,
"paymentMethods": ["PBC","VOUCHER"],
"warehouseAddress": {
"warehouseId": 586749
"street": "DRINSKA 23",
"city": "LJUBOVIJA"
},
},
},
"productSpecification": {
"items": [
{
"productDetails": {
"name": "TESLA Televizor 40T319SFS SMART",
"apId": "VT8YI1VRS7",
"sku": "AA-123456-AB",
"ean": "8606018852161",
"acode": "test123",
},
"quantity": 1,
"itemPrice": {
"unitPrice": 27900,
"unitPriceWithoutVat": 23250,
"basePrice": 26900,
"basePriceWithoutVat": 22416.67,
"discountVat": 3.59,
"discountAmount": 1000,
"vat": 20,
"vatAmount": 4483.33,
},
"grandTotalPrice": {
"unitPrice": 27900,
"unitPriceWithoutVat": 23250,
"basePrice": 26900,
"basePriceWithoutVat": 22416.67,
"discountVat": 3.59,
"discountAmount": 1000,
"vat": 20,
"vatAmount": 4650,
},
},
],
"totalDetails": {
"basePrice": 26900,
"basePriceWithoutVat": 22416.67,
"vatAmount": 4483.33,
"chargedPrice": 26900,
},
},
"taxRateSpecification": {
"taxRateSpecification": [
{
"label": "Ж",
"name": "О-ПДВ",
"basePriceWithoutVat": 22416.67,
"vat": 20,
"vatAmount": 4483.33,
},
],
"grandTotal": 4483.33,
}
},
];