MyPages API
Invoices

List of all invoices on a specific customer

To get a complete list of all invoices that belongs to a certain customer you need to send one of their purchaseIds. The list will not contain details on the invoices but could for example be used for an overview of all invoices and their current payment status.

We also need a customerAuthToken + customerTokenProvider. Regardless of how you want to authenticate the customer (self/Google) you need to send one unique token per customer. This means that one customer always should have the same token, but that token should never be used for any other customer.

GET /Invoices

* Required

PropertyData typeDescription
QUERY:
purchaseId *stringUnique ID to the purchase
HEADER:
customerAuthToken *stringUnique token per customer
customerTokenProvider *string (Enum)Available values: [ Self, Google ]
BODY
empty

Response

[
  {
    "id": "string",
    "invoiceDate": "2021-11-26T13:46:21.396Z",
    "dueDate": "2021-11-26T13:46:21.396Z",
    "currency": "SEK",
    "balance": 0,
    "state": "Unpaid",
    "type": "Invoice",
    "paymentReference": "string",
    "purchaseId": ["string"],
    "postponed": true,
    "myPagesLiveUrl": "string",
    "scheduledPaymentAmount": 0,
    "scheduledPaymentChargeDate": "2021-11-26T13:46:21.396Z"
  }
]

Response parameters

PropertyData typeDescription
idstringInvoice ID
invoiceDate *string (DateTime)Invoice issued date
dueDate *string (DateTime)Invoice due date
currency *string (Enum)CurrencyCodes: [ SEK, EUR, NOK, DKK ]
balance *number (Decimal)Actual purchase balance
state *string (Enum)PaymentStatusTypes: [ Unpaid, Paid, Postponed, Overdue, NotProduced, Transferred, PaymentScheduled, ProcessingPayment ]
type *string (Enum)AccountType: [ Invoice, Loan, LargeAmountLoan, B2BInvoice, DirectInvoice ]
paymentReferencestringThe bank account number associated with the payment
purchaseId[string]Unique ID to the purchase
postponed *BooleanInfo on whether the invoice has been postponed or not
myPagesLiveUrlstringURL to the customers “live invoice”
scheduledPaymentAmountnumber (Decimal)Amount for scheduled payments
scheduledPaymentChargeDatestring (DateTime)Charge day for scheduled payments

Detailed invoice information

This gives you all the information needed to display the invoice on your website.

GET /Invoices/{invoiceId}

* Required

PropertyData typeDescription
PATH:
invoiceId *stringUnique ID to the invoice
HEADER:
customerAuthToken *stringUnique token per customer
customerTokenProvider *string (Enum)Available values: [ Self, Google ]
BODY
empty

Response

{
  "id": "string",
  "invoiceDate": "2021-11-27T14:11:08.816Z",
  "dueDate": "2021-11-27T14:11:08.816Z",
  "currency": "SEK",
  "balance": 0,
  "state": "Unpaid",
  "type": "Invoice",
  "paymentReference": "string",
  "purchaseId": ["string"],
  "postponed": true,
  "myPagesLiveUrl": "string",
  "scheduledPaymentAmount": 0,
  "scheduledPaymentChargeDate": "2021-11-27T14:11:08.816Z",
  "minimumAmountToPay": 0,
  "originalAmount": 0,
  "receiver": "string",
  "bankAccount": "string",
  "transactions": [
    {
      "description": "string",
      "notes": "string",
      "amount": 0,
      "taxAmount": 0,
      "taxCode": "string",
      "transactionType": "string",
      "transactionDate": "2021-11-27T14:11:08.816Z",
      "orderReference": "string"
    }
  ],
  "orderReference": ["string"]
}

Response parameters

PropertyData typeDescription
idstringInvoice ID
invoiceDate *string (DateTime)Invoice issued date
dueDate *string (DateTime)Invoice due date
currency *string (Enum)CurrencyCodes: [ SEK, EUR, NOK, DKK ]
balance *number (Decimal)Actual purchase balance
state *string (Enum)PaymentStatusTypes: [ Unpaid, Paid, Postponed, Overdue, NotProduced, Transferred, PaymentScheduled, ProcessingPayment ]
type *string (Enum)AccountType: [ Invoice, Loan, LargeAmountLoan, B2BInvoice, DirectInvoice ]
paymentReferencestringThe bank account number associated with the payment
purchaseId[string]Unique ID to the purchase
postponed *Boolean
myPagesLiveUrlstringURL to our “live invoice”
scheduledPaymentAmountnumber (Decimal)Amount for scheduled payments
scheduledPaymentChargeDatestring (DateTime)Charge day for scheduled payments
minimumAmountToPay *number (Decimal)Lowest amount customer can pay on the invoice. If customer pay amount lower than total they will be rolled over to account
originalAmount *number (Decimal)Original order amount
receiverstringPayment receiver, in this case Avarda
bankAccountstringAvarda bank account where to pay the invoice
transactions
[ Transaction { description notes amount* taxAmount* taxCode transactionType transactionDate * orderReference }]string
string
number (Decimal)
number (Decimal)
string
string
string(DateTime)
string
Transactions on invoice Merchants description Merchants item notes Item price Tax amount Tax code Date of transaction Merchants order reference on transaction
orderReference[string]Merchant custom ID reference