# Invoice from proforma invoice creation

Creating invoice from existing proforma invoice.

Endpoint: POST /api/proforma-invoices/{code}/invoice
Version: 1.0.0
Security: shoptetAccessToken, shoptetPrivateApiToken

## Path parameters:

  - `code` (string, required)
    Code of proforma invoice
    Example: "2018000053"

## Query parameters:

  - `suppressExistenceCheck` (boolean)
    suppress checking of existing invoices per order (allows multiple
invoices per order)
    Example: true

## Header parameters:

  - `Content-Type` (string, required)

## Request fields (application/json):

  - `data` (object, required)

  - `data.invoiceCode` (string)
    Invoice code. Optional, generated by eshop settings if not set.

  - `data.varSymbol` (number)
    Variable symbol. Optional, generated by eshop settings if not set.

  - `data.dueDate` (string)
    Due date. Optional, generated by eshop settings if not set.

  - `data.taxDate` (string)
    Date of taxation. Default is today.

  - `data.constSymbol` (string)
    Const symbol. Only numbers are allowed (max length 4).

  - `data.specSymbol` (number)
    Spec symbol.

  - `data.billingMethodId` (integer,null)
    Id of [billing method](#section/code-lists/Invoice-Billing-Methods). Defaults to order's.

## Response 201 fields (application/json):

  - `data` (object, required)

  - `data.invoice` (object, required)

  - `data.invoice.code` (string, required)
    variant code (product)

  - `data.invoice.isValid` (boolean, required)
    is the invoice valid?

  - `data.invoice.proformaInvoiceCodes` (array, required)
    List of linked proforma invoices

  - `data.invoice.orderCode` (string,null, required)
    purchase order number. Caution! This does not have to be just a number, it can also contain letters, a dash, etc.

  - `data.invoice.creationTime` (string,null, required)
    date of issue, in ISO 8601 format

  - `data.invoice.changeTime` (string,null, required)
    date of change, in ISO 8601 format

  - `data.invoice.dueDate` (string,null, required)
    due date in ISO 8601 format

  - `data.invoice.taxDate` (string,null, required)
    taxation date in ISO 8601 format

  - `data.invoice.varSymbol` (number, required)
    variable symbol

  - `data.invoice.constSymbol` (string,null, required)
    constant symbol

  - `data.invoice.specSymbol` (number,null, required)
    specific symbol

  - `data.invoice.weight` (string,null, required)
    weight in kg, unpacked. 3 decimal places.

  - `data.invoice.completePackageWeight` (string,null, required)
    total weight of package in kg. 3 decimal places.

  - `data.invoice.billingMethod` (any, required)
    information about the method of payment

  - `data.invoice.billingAddress` (object, required)
    invoicing address

  - `data.invoice.billingAddress.company` (string,null, required)
    name of purchaser''s company (or null)

  - `data.invoice.billingAddress.fullName` (string,null, required)
    name of purchaser (or null)

  - `data.invoice.billingAddress.street` (string,null, required)
    street of purchaser (or null)

  - `data.invoice.billingAddress.houseNumber` (string,null, required)
    street number (or null)

  - `data.invoice.billingAddress.city` (string,null, required)
    city/town (village) (or null)

  - `data.invoice.billingAddress.district` (string,null, required)
    county (or null)

  - `data.invoice.billingAddress.additional` (string,null, required)
    additional address information (or null)

  - `data.invoice.billingAddress.zip` (string,null, required)
    ZIP or postal code (or null)

  - `data.invoice.billingAddress.countryCode` (string,null, required)
    tree-character ISO country code (ISO 4217)

  - `data.invoice.billingAddress.regionName` (string,null, required)
    region name (or null)

  - `data.invoice.billingAddress.regionShortcut` (string,null, required)
    region abbreviation (or null)

  - `data.invoice.billingAddress.companyId` (string,null, required)
    Company registration number. (can be null)

  - `data.invoice.billingAddress.vatId` (string,null, required)
    VAT identification number. (can be null)

  - `data.invoice.billingAddress.vatIdValidationStatus` (any)
    Info, whether VAT ID has been verified, enum [unverified, verified, waiting]
    Enum: "unverified", "verified", "waiting", null

  - `data.invoice.billingAddress.taxId` (string,null, required)
    TAX identification number. For Czech address, taxId is same as vatId. (can be null)

  - `data.invoice.deliveryAddress` (object,null, required)

  - `data.invoice.deliveryAddress.company` (string,null, required)
    name of purchaser''s company (or null)

  - `data.invoice.deliveryAddress.fullName` (string,null, required)
    name of purchaser (or null)

  - `data.invoice.deliveryAddress.street` (string,null, required)
    street of purchaser (or null)

  - `data.invoice.deliveryAddress.houseNumber` (string,null, required)
    street number (or null)

  - `data.invoice.deliveryAddress.city` (string,null, required)
    city/town (village) (or null)

  - `data.invoice.deliveryAddress.district` (string,null, required)
    county (or null)

  - `data.invoice.deliveryAddress.additional` (string,null, required)
    additional address information (or null)

  - `data.invoice.deliveryAddress.zip` (string,null, required)
    ZIP or postal code (or null)

  - `data.invoice.deliveryAddress.countryCode` (string,null, required)
    tree-character ISO country code (ISO 4217)

  - `data.invoice.deliveryAddress.regionName` (string,null, required)
    region name (or null)

  - `data.invoice.deliveryAddress.regionShortcut` (string,null, required)
    region abbreviation (or null)

  - `data.invoice.addressesEqual` (boolean, required)
    are the billing and delivery addresses the same?

  - `data.invoice.price` (object, required)

  - `data.invoice.price.vat` (string,null, required)
    VAT value, two decimal places

  - `data.invoice.price.toPay` (string,null, required)
    total price to pay

  - `data.invoice.price.currencyCode` (string, required)
    Currency code. List of available currencies within the e-shop can be found in endpoint GET /api/eshop.

  - `data.invoice.price.withoutVat` (string,null, required)
    price excluding tax

  - `data.invoice.price.withVat` (string,null, required)
    price including tax

  - `data.invoice.price.exchangeRate` (string, required)
    currency rate of the receipt for the default currency of the shop. This value is saved together with the price and reflects the historical value valid in the instant of the order creation. If the shop changes the default currency, the value still refers to the original currency!

  - `data.invoice.price.invoicingExchangeRate` (string)
    currency rate of the receipt for the default currency of the shop. This value is saved together with the price and reflects the historical value valid in the instant of the order creation. If the shop changes the default currency, the value still refers to the original currency!

  - `data.invoice.price.partialPaymentAmount` (string,null)
    can be value expressed in percents or as exact money value expression (with up to two decimal places) - depends on partialPaymentType value

  - `data.invoice.price.partialPaymentType` (string)
    'percents' = partial payment as percentage from total price | 'absolute' = exact expression of partial payment in money

  - `data.invoice.customer` (object, required)

  - `data.invoice.customer.guid` (any, required)
    customer identifier (can be null)

  - `data.invoice.customer.phone` (string,null, required)
    customer phone (can be null)

  - `data.invoice.customer.email` (string,null, required)
    customer e-mail (can be null)

  - `data.invoice.customer.remark` (string,null, required)
    remark for the customer (can be null)

  - `data.invoice.eshop` (object, required)

  - `data.invoice.eshop.bankAccount` (string,null, required)
    e-shop bank account (can be null)

  - `data.invoice.eshop.iban` (string,null, required)
    e-shop IBAN (can be null)

  - `data.invoice.eshop.bic` (string,null, required)
    bank code - SWIFT (can be null)

  - `data.invoice.eshop.vatPayer` (boolean, required)
    VAT payer (can be null)

  - `data.invoice.items` (array, required)
    content of the invoice

  - `data.invoice.items.productGuid` (any, required)
    global unique permanent product identifier.

  - `data.invoice.items.itemId` (integer, required)
    item identifier for manipulation with this item

  - `data.invoice.items.code` (string,null, required)
    variant code (product)

  - `data.invoice.items.itemType` (string, required)
    item type

  - `data.invoice.items.name` (string,null, required)
    product name

  - `data.invoice.items.variantName` (string,null, required)
    variant name

  - `data.invoice.items.brand` (string,null, required)
    brand (or manufacturer, possibly)

  - `data.invoice.items.amount` (string,null, required)
    quantity

  - `data.invoice.items.amountUnit` (string,null, required)
    unit of quantity

  - `data.invoice.items.remark` (string,null, required)
    remark

  - `data.invoice.items.priceRatio` (string, required)
    discount - 0.7800 = discount 22%; 1.0000 = no discount

  - `data.invoice.items.weight` (any, required)

  - `data.invoice.items.additionalField` (string,null, required)
    additional info

  - `data.invoice.items.itemPrice` (object, required)
    item price

  - `data.invoice.items.itemPrice.withVat` (string,null, required)
    price including tax

  - `data.invoice.items.itemPrice.withoutVat` (string,null, required)
    price excluding tax

  - `data.invoice.items.itemPrice.vat` (string,null, required)
    VAT value, two decimal places

  - `data.invoice.items.itemPrice.vatRate` (string, required)
    VAT rate

  - `data.invoice.items.unitPrice` (object, required)
    unit price

  - `data.invoice.items.unitPrice.withVat` (string,null, required)
    price including tax

  - `data.invoice.items.unitPrice.withoutVat` (string,null, required)
    price excluding tax

  - `data.invoice.items.unitPrice.vat` (string,null, required)
    VAT value, two decimal places

  - `data.invoice.items.unitPrice.vatRate` (string, required)
    VAT rate

  - `data.invoice.items.purchasePrice` (any, required)
    purchase price of the part, can be null.

  - `data.invoice.items.displayPrices` (array)
    in some cases, one item is displayed as multiple lines in the administration or a printout. This array contains one or more rows representing the printout version of the item.

  - `data.invoice.items.displayPrices.withVat` (string,null, required)
    price including tax

  - `data.invoice.items.displayPrices.withoutVat` (string,null, required)
    price excluding tax

  - `data.invoice.items.displayPrices.vat` (string,null, required)
    VAT value, two decimal places

  - `data.invoice.items.displayPrices.vatRate` (string, required)
    VAT rate

  - `data.invoice.items.recyclingFee` (object,null)
    recycling fee including category and price (or possibly null)

  - `data.invoice.items.recyclingFee.category` (string, required)
    Recycling fee category name.

  - `data.invoice.items.recyclingFee.fee` (string,null, required)
    Recycling fee.

  - `data.invoice.items.recyclingFee.unit` (any)
    Recycling fee unit.
    Enum: "pcs", "kg"

  - `data.invoice.items.surchargeParameters` (array)
    items surcharge parameters, filled in item creation. Cannot be edited.

  - `data.invoice.items.surchargeParameters.parameterName` (object)
    surcharge parameter name's information

  - `data.invoice.items.surchargeParameters.parameterName.code` (string,null)
    parameters name code, can be null if already deleted

  - `data.invoice.items.surchargeParameters.parameterName.name` (string)
    parameters name

  - `data.invoice.items.surchargeParameters.parameterName.subscription` (boolean,null)
    indicates whether this surcharge parameter is a subscription (recurring payment)

  - `data.invoice.items.surchargeParameters.parameterValue` (object)
    surcharge parameter value's information

  - `data.invoice.items.surchargeParameters.parameterValue.valueIndex` (string,null)
    parameters value code, can be null if already deleted

  - `data.invoice.items.surchargeParameters.parameterValue.description` (string)
    parameters value name

  - `data.invoice.items.surchargeParameters.parameterValue.price` (string,null)
    parameters value additional price

  - `data.invoice.items.specificSurchargeParameters` (array)
    List of specific surcharge parameters for item detail.

  - `data.invoice.items.specificSurchargeParameters.relationId` (string, required)
    id which identifies relation between item and surcharge. Can be used to delete surcharge parameter related to item.

  - `data.invoice.items.specificSurchargeParameters.name` (string, required)
    full name of surcharge parameter.

  - `data.invoice.items.specificSurchargeParameters.price` (string,null, required)
    price of surcharge parameter

  - `data.invoice.items.consumptionTax` (object,null, required)
    consumption tax of invoice item

  - `data.invoice.items.consumptionTax.currency` (string, required)
    Currency code. List of available currencies within the e-shop can be found in endpoint GET /api/eshop.

  - `data.invoice.items.consumptionTax.price` (string,null, required)
    consumption tax value

  - `data.invoice.items.itemPriceVatBreakdown` (array,null)
    Detailed VAT list displaying tax amounts for each VAT rate used in the invoice. Applied for non product items.

  - `data.invoice.items.itemPriceVatBreakdown.withVat` (string,null, required)
    price including tax

  - `data.invoice.items.itemPriceVatBreakdown.withoutVat` (string,null, required)
    price excluding tax

  - `data.invoice.items.itemPriceVatBreakdown.vat` (string,null, required)
    VAT value, two decimal places

  - `data.invoice.items.itemPriceVatBreakdown.vatRate` (string, required)
    VAT rate

  - `data.invoice.items.buyPrice` (any, required)
    buy price of the part, can be null.

  - `data.invoice.documentRemark` (string,null, required)
    remark for the document

  - `data.invoice.vatPayer` (boolean, required)
    is the e-shop a VAT payer?

  - `data.invoice.vatMode` (string,null)
    VAT mode, can be null, possible values: Normal, One Stop Shop, Mini One Stop Shop, Reverse charge, Outside the EU

  - `data.invoice.proofPayments` (array)
    List of linked proof payments

  - `data.invoice.proofPayments.code` (string, required)
    proof payments identifier. Caution! This does not have to be just a number, it can also contain letters, a dash, etc.

  - `data.invoice.proofPayments.vatBreakdown` (object,null, required)
    breakdown of VAT (can be null)

  - `data.invoice.proofPayments.vatBreakdown.items` (array, required)
    breakdown of VAT items

  - `data.invoice.proofPayments.vatBreakdown.items.vatRate` (string, required)
    VAT rate

  - `data.invoice.proofPayments.vatBreakdown.items.priceWithVat` (string,null, required)
    price with VAT

  - `data.invoice.proofPayments.vatBreakdown.items.priceWithoutVat` (string,null, required)
    price without VAT

  - `data.invoice.proofPayments.vatBreakdown.items.vat` (string,null, required)
    VAT value

  - `data.invoice.proofPayments.vatBreakdown.summary` (object, required)
    summary of VAT breakdown

  - `data.invoice.proofPayments.vatBreakdown.summary.withVat` (string,null, required)
    Total price with VAT

  - `data.invoice.proofPayments.vatBreakdown.summary.withoutVat` (string,null, required)
    Total price without VAT

  - `data.invoice.proofPayments.vatBreakdown.summary.vat` (string,null, required)
    Total VAT value

  - `errors` (array,null, required)

  - `errors.errorCode` (string, required)
    Short text error identification

  - `errors.message` (string, required)
    Descriptive error message

  - `errors.instance` (string, required)
    Identification of the entity referenced


