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=FISCAL

Request

Request:
HTTP MethodGET
URLStagehttps://api.stage.ananastest.com/order/api/v1/merchant-integration/invoices
Productionhttps://api.ananas.rs/order/api/v1/merchant-integration/invoices
HTTP Headers
Header nameHeader value
AuthorizationBearer {access_token}
URL Parameters
Parameter nameParameter description
typeFISCAL, NON_FISCAl (filters invoices by type)
dateFromReferes to invoicedDateDate must be sent with time zone
dateToReferes to invoicedDateDate must be sent with time zone

Response

Response is a collection of invoices.

Invoice

Fields nameTypeDescription
invoiceHeaderInvoiceHeaderInvoice header information that includes information about type of invoice, customer, merchant, fiscal data and basic order details
productSpecificationProductSpecificationDetails about products, shipping and grand total prices
taxRateSpecificationTaxRateSpecificationDetails about taxes

InvoiceHeader

Fields nameTypeDescription
invoicetypeInvoicetypeRepresents invoice type. Invoice can be of type FISCAL or NON_FISCAL
merchantDetailsMerchantDetailsDetails about merchant
customerDetailsCustomerDetailsDetails about customer
fiscalDetailsFiscalDetailsFiscal data provided by tax administration
orderDetailsOrderDetailsDetails about order

MerchantDetails

Fields nameTypeDescription
nameStringMerchant's name
businessSpaceCodeStringUnique code for business space
taxIdentificationNumberStringUnique merchant tax identification number(PIB)
identificationNumberStringUnique merchant identification number (MB)
taxAdministrationIdStringUnique tax administration id (ESIR)
cashierStringCashier that issued the invoice
contactDetailsContactDetailsMerchant's contact details
addressAddressMerchant’s headquarters address

ContactDetails

Fields nameTypeDescription
phoneStingMerchant's phone
emailStringMerchant's email

Address

Fields nameTypeDescription
streetStingStreet name and number
cityStringCity

CustomerDetails

Fields nameTypeDescription
firstNameStingCustomer's fist name
lastNameStringCustomer's last name
addressCustomerAddressCustomer's billing address

CustomerAddress

Fields nameTypeDescription
streetStingStreet name and number
cityStringCity
postcodestringPostal code

FiscalDetails

Fields nameTypeDescription
invoiceCounterStingInvoice counter generated by tax administration
verificationUrlStringVerification url for fiscal transaction generated by tax administration
fiscalInvoiceDateLocalDateTimeTax administration invoiced date in UTC
invoiceNumberStringUnique tax administration invoice number

OrderDetails

Fields nameTypeDescription
invoiceIdStingUnique Ananas invoice id
invoicedDateLocalDateTimeAnanas invoiced date in UTC
orderIdStringUser friendly unique order id
suborderIdStringUser friendly unique suborder id
fbabooleanFullfilment by Ananas
paymentMethodsList[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
warehouseAddressWarehouseAddressAddress of the warehouse from where the order was picked up
orderDateLocalDateTimeDdate of creating order

WarehouseAddress

Fields nameTypeDescription
WarehouseIdLongMerchant’s warehouse identity
streetStringStreet name and number
cityStringCity

ProductSpecification

Fields nameTypeDescription
itemsList(Item)List of all suborder items with details
GrandTotalDetailsGrandTotalDetailsGrand total prices

Item

Fields nameTypeDescription
productDetailsProductDetailsDetails about product
quantityintPacked quantity for an item
itemPricePricePrice for single item
grandTotalPricePriceItem prices multiplied by quantity

ProductDetails

Fields nameTypeDescription
productDetailsProductDetailsDetails about product
nameStringProduct name
apIdStringAnanas platform id
skuStringSKU value
eanStringEuropean Article Number
aCodeStringAnanas code

Price

Fields nameTypeDescription
unitPriceBigDecimalUnit price
unitPriceWithoutVatBigDecimalUnit price without added vat
basePriceBigDecimalSellable price with discount
basePriceWithoutVatBigDecimalSellable price with discount and without vat
discountVatBigDecimalDiscount percentage
discountAmountBigDecimalDiscount
vatBigDecimalVat percentage
vatAmountBigDecimalVat amount

GrandTotalDetails

Fields nameTypeDescription
basePriceBigDecimalSellable price Sum of items base prices and shipping
basePriceWithoutVatBigDecimalSellable price without vat
vatAmountBigDecimalVat percentage
chargedPriceBigDecimalPrice charged to customer

TaxRateSpecification

Fields nameTypeDescription
taxRateSpecificationList(TaxRateDetails)List of tax rate details
grandTotalBigDecimalTotal tax amountSum of tax rate base prices

TaxRateDetails

Fields nameTypeDescription
labelStringTax rate label
nameStringTax rate name
basePriceWithoutVatBigDecimalSellable price with without vat
vatBigDecimalVat percentage
vatAmountBigDecimalVat amount

Example of response:

Click to copy
Success!
[
  {
    "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,
    }
  },
];
Copyright © Ananas 2023. All right reserved.