Skip to content

Create Sales Offer


Endpoints v1

https://app.passelimerit.fi/api/v1/sendoffer

Query Payload

json
{
  "Customer": {
    "Name": "Hindre",
    "PartyCode": "50055",
    "SalesInvLang": "ET",
    "NotTDCustomer": false,
    "CountryCode": "EE"
  },
  "DocDate": "20200602",
  "ExpireDate": "20200602",
  "DeliveryDate": "20200606",
  "DocType": 2,
  "DocStatus": 3,
  "ReserveItems": false,
  "CurrencyCode": "EUR",
  "OfferNo": "MPO-2001",
  "OfferRow": [
    {
      "Item": {
        "EANCode": "094393450511",
        "Description": "Udupeen Kaup",
        "Type": 3
      },
      "Quantity": 1.0,
      "Price": 100.0,
      "TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21"
    }
  ],
  "Payment": {
    "PaymentMethod": "testaus",
    "PaidAmount": 100.0,
    "PaymDate": "20200602"
  },
  "TaxAmount": [
    {
      "TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21",
      "Amount": 20.0
    }
  ],
  "TotalAmount": 100.0, 
  "Hcomment": "säilivusaja tekst",
  "Fcomment": "Kauba kohaletoimetamise tekst",
  "ContactInfo": "Helista teisipäeval telefonile 123456789" 
}
Click to see the parameters
FieldTypeCommentRequired
CustomerCustomerObject
DocDateDate
ExpireDateDateif DocType 2 or 3, ExpireDate=DueDate
DeliveryDateDate
DocTypeInt1=quote, 2=sales order, 3=prepayment invoice
DocStatusInt1=created, 2=sent, 3=approved, 4=rejected, 5=comment received, 6=invoice created, 7=canceled
OfferNoStr 35Required
RefNoStr 36Please validate this number yourself.
CurrencyCodeStr 4
DepartmentCodeStr 20If used then must be found in the company database.
ProjectCodeStr 20If used then must be found in the company database.
OfferRowArray of OfferRow objects
TaxAmountArray of VAT objectsRequired
RoundingAmountDecimal 18.2Use it for getting PDF invoice to round number. Does not affect TotalAmount.
TotalAmountDecimal 18.2Amount without VAT
PaymentPayment object
ContactInfoStr 4K
HcommentStr 4KIf not specified, API will get it from client record, if it is written there.
FcommentStr 4KIf not specified, API will get it from client record, if it is written there.
ProcCodesArray of StringsPoland only. Values: SW, EE, TP, TT_WNT, TT_D, MR_T, MR_UZ, I_42, I_63, B_SPV, B_SPV_DOSTAWA, BMRW_PROWIZJA, MPP
PolDocTypeIntPoland only.
1 - RO,
2 - WEW,
3 - FP,
4 - OJPK
ContactInfoStr

Customer Object

3 use cases:

  1. new customer – you will create new client record when this name was not found
  2. existing customer by name – if this name exists in our system, Merit will take info from client record instead of reading it from the payload.
  3. customer by ID – every time you add new customer, the CustomerId is returned, you can use this ID instead of name, the object = { CustomerId: <guid-of-the-customer }.
json
{
  "Customer": {
    "Name": "Hindre",
    "NotTDCustomer": false,
    "PartyCode": "50055",
    "SalesInvLang": "ET",
    "CountryCode": "EE"
  },
}
Click to see the CustomerObject parameters
ParameterTypeCommentRequired
IdGuidIf filled and customer is found in the database then following fields are not important. If not found, the customer is added using the following fields.
NameStr 150Required when customer is addedRequired?
RegNoStr 30
NotTDCustomerBoolRequired when customer is added. EE True for physical persons and foreign companies. PL True for physical persons. Allowed "true" or "false" (lowercase).Required?
VatRegNoStr 30
CurrencyCodeStr 30
PaymentDeadLineIntIf missing then taken from default settings.
OverDueChargeDecimal 5.2If missing then taken from default settings.
AddressStr 100
CityStr 30
CountryStr 100
PostalCodeStr 15
CountryCodeStr 2Required when addingRequired?
PhoneNoStr 50
PhoneNo2Str 50
HomePageStr 80
EmailStr 80
SalesInvLangStr 8Invoice language for this specific customer.(ET,EN,RU,FI,PL,SV)
GLNCodeStr 14
PartyCodeStr 20
RefNoBaseStr 36
EInvPaymIdStr 20
EInvOperatorInt1 - Not exist,
2 - E-invoices to the bank through Omniva,
3 - Bank ( full extent E-invoice),
4 - Bank (limited extent E-invoice)
BankAccountStr 50

OfferRowObject

Every offer has its rows. Row has its quantity and price, it also has its general ledger record and that's why it has its own tax calculation.

json
{
  "OfferRow": [
    {
      "Item": {
        // ...
      },
      "Quantity": 1.0,
      "Price": 100.0,
      "TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21"
    }
  ],
}
Click to see the OfferRowObject parameters
FieldTypeCommentRequired
ItemItemObjectSometimes the volume of transactions in the sales software is very high and there is no need to duplicate all the data in accounting. In those cases, you could consider using the same item code for the items with the same VAT rate.

Items with different VAT rates must have a different item codes.

Also, for the VAT declarations to work, goods and services may not be summed up and must have different item codes.
QuantityDecimal 18.3
PriceDecimal 18.7
DiscountPctDecimal 18.2
DiscountAmountDecimal 18.2Amount * Price * (DiscountPCt / 100). This is not rounded. Will be substracted from row amount before row roundings.
TaxIdGuid
LocationCodeStr 20Used for stock items and multiple stocks. If used then must be found in the company database.
DepartmentCodeStr 20If used then must be found in the company database.
ItemCostAmountDecimal 18.2Required for credit invoices when crediting stock items.Required?
GLAccountCodeStr 10If used, must be found in the company database.
ProjectCodeStr 20If used, must be found in the company database.
CostCenterCodeStr 20If used, must be found in the company database.

ItemObject

json
{
  // ...
  "OfferRow": [
    {
      "Item": {
        "EANCode": "094393450511",
        "Description": "Udupeen Kaup",
        "Type": 3
      },
      // ...
    }
  ],
  // ...
}
Click to see the ItemObject parameters
FieldTypeCommentRequired
CodeStr 20Required
DescriptionStr 100Required
TypeInt1 - stock item,
2 - service,
3 - item.
Required
UOMNameStr 64
DefLocationCodeStr 20
EANCodeStr 20

PaymentObject

You can mark the invoice already paid. This is useful when you create invoice only when internet bank payment is successful, or you have received cash.

json
{
  // ...
  "Payment": {
    "PaymentMethod": "testaus",
    "PaidAmount": 100.0,
    "PaymDate": "20200602"
  },
  // ...
}
Click to see the PaymentObject parameters
FieldTypeCommentRequired
PaymentMethodStr 150Name of the payment method. Must be found in the company database.
PaidAmountDecimal 18.2Amount with VAT (not more) or less if partial payment
PaymDateDateYYYYmmddHHii

TaxObject

Every invoice has section of taxes. Those taxes have to be calculated grouped and summed by TaxId. Every row has its own tax calculation, you have to group and sum them up.

This is because you can have different tax rates for different articles.

API always counts it as well to assure you have correct calculation.

json
{
  // ...
  "TaxAmount": [
    {
      "TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21",
      "Amount": 20.0
    }
  ],
  // ...
}
Click to see the TaxObject parameters
FieldTypeCommentRequired
TaxIdGuidUse gettaxes endpoint to detect the guid neededRequired
AmountDecimal 18.2

Endpoints v2

https://app.passelimerit.fi/api/v2/sendoffer

Query Payload

json
{
  "Customer": {
    "Id": "7da4cd44-9b49-4a35-8d1b-f339a68e7058",
    "Name": "Hindre",
    "RegNo": "123456789",
    "NotTDCustomer": false,
    "VatRegNo": "EE123456789",
    "CurrencyCode": "EUR",
    "PaymentDeadLine": 14,
    "OverDueCharge": 10.00,
    "RefNoBase": "123456789",
    "Address": "Tartu mnt 1",
    "CountryCode": "EE",
    "City": "Tallinn",
    "PostalCode": "10111",
    "PhoneNo": "123456789",
    "PhoneNo2": "123456789",
    "HomePage": "www.hindre.ee",
    "Email": "",
    "SalesInvLang": "ET",
    "GLNCode": "123456789",
    "PartyCode": "123456789",
    "EInvOperator": 1,
    "EInvPaymId": "123456789",
    "BankAccount": "123456789",
    "CustGrCode": "123456789",
    "ShowBalance": false,
    "Dimensions": []
  },
  "DocDate": "20200602",
  "ExpireDate": "20200602",
  "DeliveryDate": "20200606",
  "DocType": 2,
  "DocStatus": 3,
  "ReserveItems": false,
  "CurrencyCode": "EUR",
  "OfferNo": "MPO-2001",
  "OfferRow": [
    {
      "Item": {
        "EANCode": "094393450511",
        "Description": "Udupeen Kaup",
        "Type": 3
      },
      "Quantity": 1.0,
      "Price": 100.0,
      "TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21"
    }
  ],
  "Payment": {
    "PaymentMethod": "testaus",
    "PaidAmount": 100.0,
    "PaymDate": "20200602"
  },
  "TaxAmount": [
    {
      "TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21",
      "Amount": 20.0
    }
  ],
  "TotalAmount": 100.0, 
  "Hcomment": "säilivusaja tekst",
  "Fcomment": "Kauba kohaletoimetamise tekst",
  "ContactInfo": "Helista teisipäeval telefonile 123456789",
  "Payer": {
    "Name": "Hindre",
    "RegNo": "123456789",
    "NotTDCustomer": false,
    "VatRegNo": "EE123456789",
    "CurrencyCode": "EUR",
    "PaymentDeadLine": 14,
    "OverDueCharge": 0.5,
    "RefNoBase": "123456789",
    "Address": "Tartu mnt 1",
    "CountryCode": "EE",
    "County": "Harju",
    "City": "Tallinn",
    "PostalCode": "10111",
    "PhoneNo": "123456789",
    "PhoneNo2": "123456789",
    "HomePage": "www.hindre.ee",
    "Email": "",
    "SalesInvLang": "ET",
    "Contact": "Hindre",
    "GLNCode": "123456789",
    "PartyCode": "123456789",
    "EInvOperator": 1,
    "EInvPaymId": "123456789",
    "BankAccount": "123456789",
    "Dimensions": [],
    "CustGrCode": "123456789",
    "ShowBalance": false
  }
}
Click to see the parameters
FieldTypeCommentRequired
CustomerCustomerObject
DocDateDate
ExpireDateDateif DocType 2 or 3, ExpireDate=DueDate
DeliveryDateDate
OfferNoStr 35Recuired
DocTypeInt1=quote, 2=sales order, 3=prepayment invoice
DocStatusInt1=created, 2=sent, 3=approved, 4=rejected, 5=comment received, 6=invoice created, 7=canceled
ContactInfoStr 4K
RefNoStr 36Please validate this number yourself.
CurrencyCodeStr 4
DepartmentCodeStr 20If used then must be found in the company database.
DimensionsArray of Dimensions objectsIf used then must be found in the company database.
OfferRowArray of OfferRow objects
TotalAmountDecimal 18.2Amount without VAT
RoundingAmountDecimal 18.2Use it for getting PDF invoice to round number. Does not affect TotalAmount.
TaxAmountArray of VAT objectsRequired
PaymentPayment object
HcommentStr 4KIf not specified, API will get it from client record, if it is written there.
FcommentStr 4KIf not specified, API will get it from client record, if it is written there.
ReserveItemsbooltrue , false
PrepaymPctDecimal 18.2
PayerPayerObject

Customer Object

3 use cases:

  1. new customer – you will create new client record when this name was not found
  2. existing customer by name – if this name exists in our system, Merit will take info from client record instead of reading it from the payload.
  3. customer by ID – every time you add new customer, the CustomerId is returned, you can use this ID instead of name, the object = { CustomerId: <guid-of-the-customer }.
json
{
  "Customer": {
    "Id": "7da4cd44-9b49-4a35-8d1b-f339a68e7058",
    "Name": "Hindre",
    "RegNo": "123456789",
    "NotTDCustomer": false,
    "VatRegNo": "EE123456789",
    "CurrencyCode": "EUR",
    "PaymentDeadLine": 14,
    "OverDueCharge": 10.00,
    "RefNoBase": "123456789",
    "Address": "Tartu mnt 1",
    "CountryCode": "EE",
    "City": "Tallinn",
    "PostalCode": "10111",
    "PhoneNo": "123456789",
    "PhoneNo2": "123456789",
    "HomePage": "www.hindre.ee",
    "Email": "",
    "SalesInvLang": "ET",
    "GLNCode": "123456789",
    "PartyCode": "123456789",
    "EInvOperator": 1,
    "EInvPaymId": "123456789",
    "BankAccount": "123456789",
    "Dimensions": [],
    "CustGrCode": "123456789",
    "ShowBalance": false
  },
  // ...
}
Click to see the CustomerObject parameters
ParameterTypeCommentRequired
IdGuidIf filled and customer is found in the database then following fields are not important. If not found, the customer is added using the following fields.
NameStr 150Required when customer is addedRequired?
RegNoStr 30
NotTDCustomerBoolRequired when customer is added.

EE True for physical persons and foreign companies.

PL True for physical persons.

Allowed "true" or "false" (lowercase).
Required?
VatRegNoStr 30
CurrencyCodeStr 30
PaymentDeadLineIntIf missing then taken from default settings.
OverDueChargeDecimal 5.2If missing then taken from default settings.
AddressStr 100
CityStr 30
CountryStr 100
PostalCodeStr 15
CountryCodeStr 2Required when addingRequired?
PhoneNoStr 50
PhoneNo2Str 50
HomePageStr 80
EmailStr 80
SalesInvLangStr 8Invoice language for this specific customer.(ET,EN,RU,FI,PL,SV)
GLNCodeStr 14
PartyCodeStr 20
RefNoBaseStr 36
EInvPaymIdStr 20
EInvOperatorInt1 - Not exist,
2 - E-invoices to the bank through Omniva,
3 - Bank ( full extent E-invoice),
4 - Bank (limited extent E-invoice)
BankAccountStr 50
ShowBalanceBool

OfferRow Object

Every offer has its rows. Row has its quantity and price, it also has its general ledger record and that's why it has its own tax calculation.

json
{
  // ...
  "OfferRow": [
    {
      "Item": {
        // ...
      },
      "Quantity": 1.0,
      "Price": 100.0,
      "TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21"
    }
  ],
  // ...

}
Click to see the OfferRowObject parameters
FieldTypeCommentRequired
ItemItemObjectSometimes the volume of transactions in the sales software is very high and there is no need to duplicate all the data in accounting. In those cases, you could consider using the same item code for the items with the same VAT rate.

Items with different VAT rates must have a different item codes.

Also, for the VAT declarations to work, goods and services may not be summed up and must have different item codes.
QuantityDecimal 18.3
PriceDecimal 18.7
DiscountPctDecimal 18.2
DiscountAmountDecimal 18.2Amount * Price * (DiscountPCt / 100). This is not rounded. Will be substracted from row amount before row roundings.
TaxIdGuid
LocationCodeStr 20Used for stock items and multiple stocks. If used then must be found in the company database.
DepartmentCodeStr 20If used then must be found in the company database.
GLAccountCodeStr 10If used, must be found in the company database.
DimensionsArray of Dimensions objectsIf used, must be found in the company database.
ItemCostAmountDecimal 18.2Required for credit invoices when crediting stock items.Required?
SalesAccCodeStr 10If included GLAccountCode then the SalesAccCode not used
PurchaseAccCodeStr 10
InventoryAccCodeStr 10
CostAccCodeStr 10

ItemObject

json
{
  // ...
  "OfferRow": [
    {
      "Item": {
        "EANCode": "094393450511",
        "Description": "Udupeen Kaup",
        "Type": 3
      },
      // ...
    }
  ],
  // ...
}
Click to see the ItemObject parameters
FieldTypeCommentRequired
CodeStr 20Required
DescriptionStr 100Required
TypeInt1 - stock item,
2 - service,
3 - item.
Required
UOMNameStr 64
DefLocationCodeStr 20
EANCodeStr 20

DimensionsObject

json
{
  "Customer": {
    // ...
    "Dimensions": [
      {
        "DimId": 1,
        "DimValueId": "00000000-0000-0000-0000-000000000000",
        "DimCode": "1"
      }
    ],
  },
  // ...
}
Click to see the DimensionsObject parameters
FieldTypeCommentRequired
DimIdInt
DimValueIdGuid
DimCodeStr

PaymentObject

You can mark the invoice already paid. This is useful when you create invoice only when internet bank payment is successful, or you have received cash.

json
{
  "Payment": {
    "PaymentMethod": "testaus",
    "PaidAmount": 100.0,
    "PaymDate": "20200602"
  },
  // ...  
}
Click to see the PaymentObject parameters
FieldTypeCommentRequired
PaymentMethodStr 150Name of the payment method. Must be found in the company database.
PaidAmountDecimal 18.2Amount with VAT (not more) or less if partial payment
PaymDateDateYYYYmmddHHii

TaxObject

Every offer has section of taxes. Those taxes have to be calculated grouped and summed by TaxId. Every row has its own tax calculation, you have to group and sum them up.

This is because you can have different tax rates for different articles.

API always counts it as well to assure you have correct calculation.

json
{
  // ...
  "TaxAmount": [
    {
      "TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21",
      "Amount": 20.0
    }
  ],
  // ...
}
Click to see the TaxObject parameters
FieldTypeCommentRequired
TaxIdGuidUse gettaxes endpoint to detect the guid neededRequired
AmountDecimal 18.2

PayerObject

json
{
  // ...
  "Payer": {
    "Name": "Hindre",
    "RegNo": "123456789",
    "NotTDCustomer": false,
    "VatRegNo": "EE123456789",
    "CurrencyCode": "EUR",
    "PaymentDeadLine": 14,
    "OverDueCharge": 0.5,
    "RefNoBase": "123456789",
    "Address": "Tartu mnt 1",
    "CountryCode": "EE",
    "County": "Harju",
    "City": "Tallinn",
    "PostalCode": "10111",
    "PhoneNo": "123456789",
    "PhoneNo2": "123456789",
    "HomePage": "www.hindre.ee",
    "Email": "",
    "SalesInvLang": "ET",
    "Contact": "Hindre",
    "GLNCode": "123456789",
    "PartyCode": "123456789",
    "EInvOperator": 1,
    "EInvPaymId": "123456789",
    "BankAccount": "123456789",
    "Dimensions": [],
    "CustGrCode": "123456789",
    "ShowBalance": false
  }
}
Click to see the PayerObject parameters
FieldTypeCommentRequired
IdGuidIf filled and payer (customer) is found in the database then following fields are not important. If not found, the payer is added using the following fields.
NameStr 150Required when payer is addedRequired?
RegNoStr 30
NotTDCustomerBoolRequired when payer is added. True for physical persons and foreign companies. Allowed "true" or "false" (lowercase).Required?
VatRegNoStr 30
CurrencyCodeStr 30
PaymentDeadLineIntIf missing then taken from default settings.
OverDueChargeDecimal 5.2If missing then taken from default settings.
RefNoBaseStr 36
AddressStr 100
CountryCodeStr 2Required when addingRequired?
CountyStr 100
CityStr 30
PostalCodeStr 15
PhoneNoStr 50
PhoneNo2Str 50
HomePageStr 80
EmailStr 80
SalesInvLangStr 8Invoice language for this specific payer.(ET,EN,RU,FI,PL,SV)
ContactStr 35
GLNCodeStr 10
PartyCodeStr 20
EInvOperatorInt1 - Not exist,
2 - E-invoices to the bank through Omniva,
3 - Bank ( full extent E-invoice),
4 - Bank (limited extent E-invoice)
EInvPaymIdStr 20
BankAccountStr 50
DimensionsArray of DimensionsObjects
CustGrCodeStr 20
ShowBalanceBool

Successful Result

json
{
  "CustomerId": "ac8a114d-e40c-4fa5-a57f-de30a03d550d",
  "InvoiceId": "31fe26d0-7928-47f7-8702-2d066e332b77",
  "InvoiceNo": "MPO-2001",
  "RefNo": null,
  "NewCustomer": null
}