---
title: "Create new document"
description: "Create a PayPlus document of a chosen type, with customer details, line items and payments, or preview it or save it as a draft. The response returns links to the document."
source: https://docs.payplus.co.il/en/payplus/latest/post-books-docs-new-doctype
language: en
product: payplus
version: v1
updated: 2025-05-28
---

# Create new document

**POST** `/books/docs/new/{docType}`

- Production: `https://restapi.payplus.co.il/api/v1.0/`
- Staging: `https://restapidev.payplus.co.il/api/v1.0/`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `docType` | path | string | yes | Type of document to create |
| `api-key` | header | string | yes | API Key |
| `secret-key` | header | string | yes | Secret Key |

**Request body** (application/json)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `tags` | array |  | Array of arbitrary strings used to catalogue/ tag documents |
| `draft` | boolean |  | Create a draft document. No actual document will be generated if set to true |
| `items` | array |  |  |
| `items[].name` | string |  | Item/product name |
| `items[].price` | integer |  |  |
| `items[].barcode` | string |  |  |
| `items[].quantity` | integer |  |  |
| `items[].currency_code` | string |  | EX: ILS |
| `items[].discount_type` | string |  | 'percentage' OR 'amount' |
| `items[].vat_type_code` | string |  | If omitted, document level value will be used instead. |
| `items[].discount_value` | integer |  | See previous entry for more details |
| `items[].conversion_rate` | integer |  | Required if currency code is specified and is different from the base currency. |
| `items[].is_summary_item` | boolean |  | Show item as a summary line |
| `preview` | boolean |  | Get a preview of the document. No document will be generated if set to true |
| `vatType` | string |  | If omitted, configuration values will be used instead |
| `customer` | object |  |  |
| `customer.city` | string |  |  |
| `customer.name` | string |  | Name, to be displayed as the document recipient. Required unless existing valid customer uuid provided |
| `customer.email` | string | yes | Shall be displayed on the document. Additionally, if provided, an email message containing the original document will be dispatched to this address. |
| `customer.phone` | string |  | If specified, this number will appear on the document. Also the phone number to send an SMS message if applicable |
| `customer.paying_vat` | boolean |  |  |
| `customer.vat_number` | string |  | Recipient vat number/ID to be displayed on the document |
| `customer.country_ISO` | string |  | EX: IL |
| `customer.postal_code` | string |  |  |
| `customer.street_name` | string |  |  |
| `customer.balance_name` | string |  | Will be used as the balance name for journal exports |
| `customer.customer_uid` | string |  | Reference code of a previously created customer. If specified, document customer information shall be taken from the customer record |
| `customer.street_number` | string |  |  |
| `customer.create_customer` | boolean |  | If true, will attempt to create a new customer from the provided information. If customer with similar details already exists, it will be used instead and all missing details will be added from th |
| `doc_date` | string |  | string Document issue date. Format: YYYY-MM-DD. Defaults to current da |
| `language` | string |  |  |
| `payments` | array |  |  |
| `payments[].rate` | integer |  |  |
| `payments[].amount` | number |  | Total payment amount |
| `payments[].payments` | string |  | Payment type: credit-card. Number of payments |
| `payments[].card_type` | string |  | payment type: credit-card |
| `payments[].bank_number` | string |  | payment type: payment-check,bank-transfer |
| `payments[].description` | string |  | Payment description |
| `payments[].four_digits` | string |  | Payment type: credit-card/ payment-app. Last four digits of the credit card number |
| `payments[].payment_app` | string |  | payment type: payment-app |
| `payments[].check_number` | string |  | payment type: payment-check |
| `payments[].payment_date` | string |  | Date in the format YYYY-MM-DD. Defaults to whatever was set for doc_date |
| `payments[].payment_type` | string |  | Type of the payment being submitted |
| `payments[].branch_number` | string |  |  |
| `payments[].currency_code` | string |  | See currencies for more information |
| `payments[].first_payment` | string |  | Payment type: credit-card. First payment amount |
| `payments[].payer_account` | string |  |  |
| `payments[].account_number` | string |  | payment type: payment-check,bank-transfer |
| `payments[].transaction_type` | string |  | payment type: credit-card |
| `payments[].other_payment_type` | string |  | payment type: other |
| `payments[].transaction_number` | string |  | payment type: paypal |
| `payments[].subsequent_payments` | string |  | Payment type: credit-card. The amount of the subsequent payments |
| `close_doc` | string |  | UUID of a previously created document. If supplied, the new document will also close the document indicated by the UUID |
| `more_info` | string |  | nullable Optional identifier. Will appear at the bottom of the document |
| `brand_uuid` | string |  | If multiple brands exist, specify brand uuid to create document associated with a specific brand. If none provided, the default brand |
| `cancel_doc` | string |  | UUID of a previously created document. If supplied, the new document will also cancel the document indicated by the UUID |
| `totalAmount` | integer |  | Total sum of the document. |
| `callback_url` | string |  | If valid url is specified, payplus will send a notification to the specified URL upon successful document creation |
| `currency_code` | string |  |  |
| `prevent_email` | boolean |  | If true, will not send |
| `vat_percentage` | integer |  | Vat percentage to use for calculations. If omitted, configuration values will be used instead |
| `conversion_rate` | number |  | If document currency specified is not ILS, this value will be used as the conversion rate for all the prices into the base currency. |
| `transaction_uuid` | string |  | UUID of a PayPlus transaction |
| `send_document_sms` | boolean |  | send_document_sms |
| `unique_identifier` | string |  | Arbitrary, unique string. If supplied, the system will refuse further creation attempts if it finds a duplicate, ensuring that this value will always be unique per document. |
| `autocalculate_rate` | boolean |  | If the conversion rate parameter is omitted, determine conversion rate automatically |
| `hide_base_currency` | boolean |  | Whether or not to hide the base currency (usually ILS) in a foreign currency document. |
| `send_document_email` | boolean |  | Send email upon document creation. Will override the whatever's defined in your account |

```json
{
  "tags": [
    "string"
  ],
  "draft": false,
  "items": [
    {
      "name": "string",
      "price": 0,
      "barcode": "string",
      "quantity": 0,
      "currency_code": "string",
      "discount_type": "percentage",
      "vat_type_code": "vat-type-included",
      "discount_value": 0,
      "conversion_rate": 0,
      "is_summary_item": false
    }
  ],
  "preview": false,
  "vatType": "vat-type-included",
  "customer": {
    "city": "string",
    "name": "string",
    "email": "string",
    "phone": "string",
    "paying_vat": false,
    "vat_number": "string",
    "country_ISO": "string",
    "postal_code": "string",
    "street_name": "string",
    "balance_name": "string",
    "customer_uid": "string",
    "street_number": "string",
    "create_customer": false
  },
  "doc_date": "string",
  "language": "he",
  "payments": [
    {
      "rate": 0,
      "amount": 0,
      "payments": "string",
      "card_type": "mastercard",
      "bank_number": "string",
      "description": "string",
      "four_digits": "string",
      "payment_app": "bit",
      "check_number": "string",
      "payment_date": "string",
      "payment_type": "credit-card",
      "branch_number": "string",
      "currency_code": "string",
      "first_payment": "string",
      "payer_account": "string",
      "account_number": "string",
      "transaction_type": "normal",
      "other_payment_type": "crypto",
      "transaction_number": "string",
      "subsequent_payments": "string"
    }
  ],
  "close_doc": "string",
  "more_info": "string",
  "brand_uuid": "string",
  "cancel_doc": "string",
  "totalAmount": 0,
  "callback_url": "string",
  "currency_code": "string",
  "prevent_email": false,
  "vat_percentage": 0,
  "conversion_rate": 0,
  "transaction_uuid": "string",
  "send_document_sms": false,
  "unique_identifier": "string",
  "autocalculate_rate": false,
  "hide_base_currency": false,
  "send_document_email": false
}
```

**Response 200** — 200

```json
{
  "barcode": "472819632332439",
  "brand": {
    "name": "Company Name",
    "uuid": "67a8cc93-75ac-4832-8386-3eb5b24bf3d0"
  },
  "copyDocAddress": "https://restapi.payplus.co.il/getdoc/s/c/1fa79282-61d1-4898-b7b9-afa67f46d34a.pdf",
  "currency_code": "ILS",
  "customer": {
    "customer_name": "John Doe",
    "email": "johndoe@example.com",
    "phone": "123456789",
    "subject_code": "987654321",
    "uuid": "faa6280f-dba5-4889-9b15-de60e1527bdc",
    "vat_number": "1231231"
  },
  "customer_uuid": "faa6280f-dba5-4889-9b15-de60e1527bdc",
  "docUID": "1fa79282-61d1-4898-b7b9-afa67f46d34a",
  "doc_date": "2022-11-15",
  "doc_type": "inv_tax",
  "more_info": null,
  "number": "SCP/50042",
  "originalDocAddress": "https://restapi.payplus.co.il/getdoc/s/o/1fa79282-61d1-4898-b7b9-afa67f46d34a.pdf",
  "total_items_base_currency": 150,
  "validDocumentGenerated": true
}
```

**Response 400** — 400

```json
{}
```
