Create Sales Offer

Endpoints

Estonia: https://aktiva.merit.ee/api/v1/sendoffer
Poland: https://program.360ksiegowosc.pl/api/v1/sendoffer

Query Payload

Example payload: example send offer

FieldTypeComment 
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 35Recuired
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
ContactInfoString 4K
HcommentString 4KIf not specified, API will get it from client record, if it is written there.
FcommentString 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. Values: 1-RO, 2-WEW, 3-FP, 4-OJPK

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 }.
ParameterTypeComment
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.
Name Str 150Required when customer is added
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).
VatRegNoStr 30
CurrencyCodeStr 30
PaymentDeadLineIntIf missing then taken from default settings.
OverDueChargeDecimal 5.2If missing then taken from default settings.
AddressStr 100
CityStr 30
CountyStr 100
PostalCodeStr 15
CountryCodeStr 2Required when adding
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.

FieldTypeComment 
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.
GLAccountCodeString 10If used, must be found in the company database.
ProjectCodeString 20If used, must be found in the company database.
CostCenterCodeString 20If used, must be found in the company database.

ItemObject

FieldTypeComment 
CodeStr 20Required
Description Str 150Required
More than 150 characters will be cut off
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.

FieldTypeComment 
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.

FieldTypeComment 
TaxIdGuidRequired. Use gettaxes endpoint to detect the guid needed
AmountDecimal 18.2

Endpoints

Estonia: https://aktiva.merit.ee/api/v2/sendoffer
Poland: https://program.360ksiegowosc.pl/api/v2/sendoffer

Query Payload

FieldTypeComment 
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
ContactInfoString 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
HcommentString 4KIf not specified, API will get it from client record, if it is written there.
FcommentString 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 }.
ParameterTypeComment
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.
Name Str 150Required when customer is added
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).
VatRegNoStr 30
CurrencyCodeStr 30
PaymentDeadLineIntIf missing then taken from default settings.
OverDueChargeDecimal 5.2If missing then taken from default settings.
AddressStr 100
CityStr 30
CountyStr 100
PostalCodeStr 15
CountryCodeStr 2Required when adding
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

Offer Row 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.

FieldTypeComment 
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.
GLAccountCodeString 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.
SalesAccCodeString 10If included GLAccountCode then the SalesAccCode not used
PurchaseAccCodeString 10
InventoryAccCodeString 10
CostAccCodeString 10

ItemObject

FieldTypeComment 
CodeStr 20Required
Description Str 150Required
More than 150 characters will be cut off
TypeInt1 = stock item, 2 = service, 3 = item. Required.
UOMNameStr 64
DefLocationCodeStr 20
EANCodeStr 20

DimensionsObject

FieldTypeComment
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.

FieldTypeComment 
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.

FieldTypeComment 
TaxIdGuidRequired. Use gettaxes endpoint to detect the guid needed
AmountDecimal 18.2

PayerObject

FieldTypeComment
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.
Name Str 150Required when payer is added
RegNoStr 30
NotTDCustomerBoolRequired when payer is added. True for physical persons and foreign companies. Allowed “true” or “false” (lowercase).
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 adding
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

  • CustomerId
  • InvoiceId
  • InvoiceNo
  • RefNo
  • NewCustomer