POST v1/{organizationId}/vouchers/purchase/{guid}/book

Book a purchase voucher

Request Information

URI Parameters

NameDescriptionTypeAdditional information
guid

guid of the voucher to book

globally unique identifier

Required

organizationId

string

None.

Body Parameters

Model containing timestamp and optional vouchernumber to use for booking

BookModel
NameDescriptionTypeAdditional information
Number

Optional. If specified, the voucher will be created with this number. If the number is already taken the booking of the voucher will fail.

integer

None.

Timestamp

Timestamp to validate against. This is a safety measure to ensure that an API partner is only making changes to the latest version of the entity. The timestamp is generated on Dinero's server every time the entity is updated, and is returned as a part of CreatedResponse and UpdatedResponse. It's also available on the entity itself. If you get a timestamp outdated exception (error code 58), you will need to get the latest version of the enity and use its timestamp.

string

None.

Sample:
{
  "Number": null,
  "Timestamp": "00000000020A5EA8"
}

Response Information

Resource Description

PurchaseVoucherReadModelV2
NameDescriptionType
Guid

Guid of the voucher

globally unique identifier
Timestamp

Timestamp used for verifying version when updating or changing the voucher

string
Status

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

string
FileGuid

Guid of the file associated with the voucher, optional value

string
VoucherNumber

Number of the voucher

integer
VoucherDate

Date of the purchase

string
PaymentDate

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

string
RegionKey

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

string
PurchaseType

Type of purchase, can be cash or credit

string
Lines

The list of lines associated with the purchase

Collection of PurchaseVoucherLineReadModel
DepositAccountNumber

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

integer
ContactGuid

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

globally unique identifier
ExternalReference

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
Sample:
{
  "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"
}