Create purchase voucher

Creates a new purchase voucher draft

Query parameters

NameDescription
organizationId string

Request model

Data to create the voucher from
NameDescription
Lines PurchaseVoucherLineCreateModel[] Show model
NameDescription
AccountNumber integer

Account to book this line on

Description string

Description of what has been purchased

Amount decimal number

The amount of money paid

VatCode string

The vatcode to use for the line, will be set to the default vattype for the account if null is given

The lines containing what has been bought, at what price, and on what account

VoucherDate string

Date of the voucher

DepositAccountNumber integer

Accountnumber of the deposit to book on, only used on cash purchases

RegionKey string

Region the purchase was made from, can be: EU, DK or World. Only used for cash purchases

FileGuid string

Id of the file associated with the purchase

ContactGuid globally unique identifier

Guid of the contact the purchase was made from, only used for credit purchases

PaymentDate string

Date of payment, do not set on cash purchases, payment deadline for credit purchases

PurchaseType string

Type of purchase, can be: cash or credit

Required

ExternalReference string

Your external id This can be used for ID'ing in external apps/services e.g. a web shop. The maximum length is 128 characters

String length: inclusive between 0 and 128

Returns

NameDescription
Guid globally unique identifier

Guid of the voucher

Timestamp string

Timestamp used for verifying version when updating or changing the voucher

Status string

The status of a cash purchase voucher, can be: Draft, Paid, or Editing. The status of a credit purchase voucher can be: Draft, Paid, Editing, Booked, Overdue, or Overpaid

FileGuid string

Guid of the file associated with the voucher, optional value

VoucherNumber integer

Number of the voucher

VoucherDate string

Date of the purchase

PaymentDate string

Date of the payment of the voucher, is the same as voucherdate if the purchase is cash

RegionKey string

The region the purchase is made from, only used on cash purchases, can be: DK, EU, or World

PurchaseType string

Type of purchase, can be cash or credit

Lines PurchaseVoucherLineReadModel[] Show model
NameDescription
Description string

Description of the line

VatCode string

Vat code for the selected account number.

AccountNumber integer

The account number the line books on

AmountExclVatValue decimal number

Amount on the line excluding VAT

AmountInclVatValue decimal number

Amount on the line including VAT

VatAmountValue decimal number

Amount in VAT on the line

The list of lines associated with the purchase

DepositAccountNumber integer

Account number of the deposit to book on, only used for cash purchases

ContactGuid globally unique identifier

Guid of the contact associated with the purchase, can only have a value on credit purchases

ExternalReference string

Your external id This can be used for ID'ing in external apps/services e.g. a web shop. The maximum length is 128 characters

v1.1/{organizationId}/vouchers/purchase

Requests Formats

{
  "Lines": [
    {
      "AccountNumber": 2000,
      "Description": "Purchase of whatever",
      "Amount": 200.0,
      "VatCode": "I25"
    },
    {
      "AccountNumber": 2000,
      "Description": "Purchase of whatever",
      "Amount": 200.0,
      "VatCode": "I25"
    }
  ],
  "VoucherDate": "2019-09-16",
  "DepositAccountNumber": 55000,
  "RegionKey": "DK",
  "FileGuid": "web0crmck5v0ndcx3313g6zn61tc7wgc",
  "ContactGuid": "00000000-0000-0000-0000-000000000000",
  "PaymentDate": "2019-09-16",
  "PurchaseType": "cash",
  "ExternalReference": "Fx. WebShopID:42"
}

Response Formats

{
  "Guid": "00000000-0000-0000-0000-000000000000",
  "Timestamp": "00000000020A5EA8",
  "Status": "Paid",
  "FileGuid": "pa2halkrpgo3oho45hj0dlkfrro4ilf",
  "VoucherNumber": null,
  "VoucherDate": "2019-09-02",
  "PaymentDate": "2019-09-02",
  "RegionKey": "DK",
  "PurchaseType": "cash",
  "Lines": [
    {
      "Description": "Purchase of something",
      "VatCode": "I25",
      "AccountNumber": 2000,
      "AmountExclVatValue": 80.0,
      "AmountInclVatValue": 100.0,
      "VatAmountValue": 20.0
    },
    {
      "Description": "Purchase of something",
      "VatCode": "I25",
      "AccountNumber": 2000,
      "AmountExclVatValue": 80.0,
      "AmountInclVatValue": 100.0,
      "VatAmountValue": 20.0
    }
  ],
  "DepositAccountNumber": 55000,
  "ContactGuid": null,
  "ExternalReference": "Fx. WebShopID:42"
}