---
updatedAt: 2025-05-28T09:46:16.000Z
agentTools:
  projectIndex: https://docs.payplus.co.il/llms.txt
---

# Create new document

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "PayPlus - API Documentation - Production",
    "version": "1.0"
  },
  "tags": [
    {
      "name": "Invoice+ - Documents"
    }
  ],
  "servers": [
    {
      "url": "https://restapi.payplus.co.il/api/v1.0/",
      "description": "Production"
    },
    {
      "url": "https://restapidev.payplus.co.il/api/v1.0/",
      "description": "Staging"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/books/docs/new/{docType}": {
      "post": {
        "tags": [
          "Invoice+ - Documents"
        ],
        "summary": "Create new document",
        "description": "",
        "parameters": [
          {
            "name": "docType",
            "in": "path",
            "description": "Type of document to create",
            "schema": {
              "type": "string",
              "enum": [
                "inv_tax_receipt",
                "inv_tax",
                "inv_receipt",
                "inv_proforma",
                "inv_refund",
                "crt_delivery",
                "crt_return",
                "order_purchase",
                "purchase",
                "dc_quote",
                "inv_don_receipt",
                "inv_pay_request"
              ]
            },
            "required": true
          },
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "secret-key",
            "in": "header",
            "description": "Secret Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "doc_date": {
                    "type": "string",
                    "description": "string Document issue date. Format: YYYY-MM-DD. Defaults to current da"
                  },
                  "brand_uuid": {
                    "type": "string",
                    "description": "If multiple brands exist, specify brand uuid to create document associated with a specific brand. If none provided, the default brand"
                  },
                  "preview": {
                    "type": "boolean",
                    "description": "Get a preview of the document. No document will be generated if set to true"
                  },
                  "hide_base_currency": {
                    "type": "boolean",
                    "description": "Whether or not to hide the base currency (usually ILS) in a foreign currency document."
                  },
                  "draft": {
                    "type": "boolean",
                    "description": "Create a draft document. No actual document will be generated if set to true"
                  },
                  "more_info": {
                    "type": "string",
                    "description": "nullable Optional identifier. Will appear at the bottom of the document"
                  },
                  "close_doc": {
                    "type": "string",
                    "description": "UUID of a previously created document. If supplied, the new document will also close the document indicated by the UUID"
                  },
                  "cancel_doc": {
                    "type": "string",
                    "description": "UUID of a previously created document. If supplied, the new document will also cancel the document indicated by the UUID"
                  },
                  "transaction_uuid": {
                    "type": "string",
                    "description": "UUID of a PayPlus transaction"
                  },
                  "send_document_email": {
                    "type": "boolean",
                    "description": "Send email upon document creation. Will override the whatever's defined in your account"
                  },
                  "send_document_sms": {
                    "type": "boolean",
                    "description": "send_document_sms"
                  },
                  "callback_url": {
                    "type": "string",
                    "description": "If valid url is specified, payplus will send a notification to the specified URL upon successful document creation"
                  },
                  "vatType": {
                    "type": "string",
                    "description": "If omitted, configuration values will be used instead",
                    "enum": [
                      "vat-type-included",
                      "vat-type-not-included",
                      "vat-type-exempt"
                    ]
                  },
                  "vat_percentage": {
                    "type": "integer",
                    "description": "Vat percentage to use for calculations. If omitted, configuration values will be used instead",
                    "format": "int"
                  },
                  "language": {
                    "type": "string",
                    "enum": [
                      "he",
                      "en"
                    ]
                  },
                  "currency_code": {
                    "type": "string"
                  },
                  "conversion_rate": {
                    "type": "number",
                    "format": "float",
                    "description": "If document currency specified is not ILS, this value will be used as the conversion rate for all the prices into the base currency."
                  },
                  "autocalculate_rate": {
                    "type": "boolean",
                    "description": "If the conversion rate parameter is omitted, determine conversion rate automatically"
                  },
                  "prevent_email": {
                    "type": "boolean",
                    "description": "If true, will not send"
                  },
                  "unique_identifier": {
                    "type": "string",
                    "description": "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."
                  },
                  "customer": {
                    "type": "object",
                    "required": [
                      "customer_name",
                      "email"
                    ],
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Name, to be displayed as the document recipient. Required unless existing valid customer uuid provided"
                      },
                      "customer_uid": {
                        "type": "string",
                        "description": "Reference code of a previously created customer. If specified, document customer information shall be taken from the customer record"
                      },
                      "email": {
                        "type": "string",
                        "description": "Shall be displayed on the document. Additionally, if provided, an email message containing the original document will be dispatched to this address."
                      },
                      "vat_number": {
                        "type": "string",
                        "description": "Recipient vat number/ID to be displayed on the document"
                      },
                      "phone": {
                        "type": "string",
                        "description": "If specified, this number will appear on the document. Also the phone number to send an SMS message if applicable"
                      },
                      "city": {
                        "type": "string"
                      },
                      "street_name": {
                        "type": "string"
                      },
                      "street_number": {
                        "type": "string"
                      },
                      "postal_code": {
                        "type": "string"
                      },
                      "country_ISO": {
                        "type": "string",
                        "description": "EX: IL"
                      },
                      "paying_vat": {
                        "type": "boolean"
                      },
                      "create_customer": {
                        "type": "boolean",
                        "description": "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"
                      },
                      "balance_name": {
                        "type": "string",
                        "description": "Will be used as the balance name for journal exports"
                      }
                    }
                  },
                  "tags": {
                    "type": "array",
                    "description": "Array of arbitrary strings used to catalogue/ tag documents",
                    "items": {
                      "type": "string"
                    }
                  },
                  "payments": {
                    "type": "array",
                    "items": {
                      "properties": {
                        "payment_type": {
                          "type": "string",
                          "description": "Type of the payment being submitted",
                          "enum": [
                            "credit-card",
                            "cash",
                            "paypal",
                            "bank-transfer",
                            "payment-check",
                            "payment-app",
                            "other",
                            "withholding-tax"
                          ]
                        },
                        "payment_date": {
                          "type": "string",
                          "description": "Date in the format YYYY-MM-DD. Defaults to whatever was set for doc_date"
                        },
                        "amount": {
                          "type": "number",
                          "description": "Total payment amount"
                        },
                        "description": {
                          "type": "string",
                          "description": "Payment description"
                        },
                        "currency_code": {
                          "type": "string",
                          "description": "See currencies for more information"
                        },
                        "rate": {
                          "type": "integer",
                          "format": "int"
                        },
                        "transaction_type": {
                          "description": "payment type: credit-card",
                          "type": "string",
                          "enum": [
                            "normal",
                            "payments"
                          ]
                        },
                        "payments": {
                          "description": "Payment type: credit-card. Number of payments",
                          "type": "string"
                        },
                        "first_payment": {
                          "description": "Payment type: credit-card. First payment amount",
                          "type": "string"
                        },
                        "subsequent_payments": {
                          "description": "Payment type: credit-card. The amount of the subsequent payments",
                          "type": "string"
                        },
                        "four_digits": {
                          "description": "Payment type: credit-card/ payment-app. Last four digits of the credit card number",
                          "type": "string"
                        },
                        "card_type": {
                          "description": "payment type: credit-card",
                          "type": "string",
                          "enum": [
                            "mastercard",
                            "american-express",
                            "discover",
                            "visa",
                            "diners",
                            "other",
                            "jcb",
                            "maestro"
                          ]
                        },
                        "bank_number": {
                          "description": "payment type: payment-check,bank-transfer",
                          "type": "string"
                        },
                        "branch_number": {
                          "type": "string"
                        },
                        "account_number": {
                          "type": "string",
                          "description": "payment type: payment-check,bank-transfer"
                        },
                        "check_number": {
                          "type": "string",
                          "description": "payment type: payment-check"
                        },
                        "payer_account": {
                          "type": "string"
                        },
                        "transaction_number": {
                          "type": "string",
                          "description": "payment type: paypal"
                        },
                        "payment_app": {
                          "type": "string",
                          "description": "payment type: payment-app",
                          "enum": [
                            "bit",
                            "string",
                            "max",
                            "string",
                            "apple-pay",
                            "string",
                            "google-pay",
                            "string",
                            "multipass",
                            "string",
                            "pay-box",
                            "string",
                            "tav-zahav",
                            "string",
                            "praxell",
                            "string",
                            "valuecard",
                            "string",
                            "verifone"
                          ]
                        },
                        "other_payment_type": {
                          "type": "string",
                          "description": "payment type: other",
                          "enum": [
                            "crypto",
                            "giftcard",
                            "credit",
                            "vcheck"
                          ]
                        }
                      },
                      "type": "object"
                    }
                  },
                  "totalAmount": {
                    "type": "integer",
                    "format": "int",
                    "description": "Total sum of the document."
                  },
                  "items": {
                    "type": "array",
                    "items": {
                      "properties": {
                        "name": {
                          "type": "string",
                          "description": "Item/product name"
                        },
                        "barcode": {
                          "type": "string"
                        },
                        "is_summary_item": {
                          "type": "boolean",
                          "description": "Show item as a summary line"
                        },
                        "price": {
                          "type": "integer",
                          "format": "int"
                        },
                        "quantity": {
                          "type": "integer",
                          "format": "int"
                        },
                        "vat_type_code": {
                          "description": "If omitted, document level value will be used instead.",
                          "type": "string",
                          "enum": [
                            "vat-type-included",
                            "vat-type-not-included",
                            "vat-type-exempt"
                          ]
                        },
                        "currency_code": {
                          "type": "string",
                          "description": "EX: ILS"
                        },
                        "conversion_rate": {
                          "type": "integer",
                          "format": "int",
                          "description": "Required if currency code is specified and is different from the base currency."
                        },
                        "discount_type": {
                          "description": "'percentage' OR 'amount'",
                          "type": "string",
                          "enum": [
                            "percentage",
                            "amount"
                          ]
                        },
                        "discount_value": {
                          "type": "integer",
                          "format": "int",
                          "description": "See previous entry for more details"
                        }
                      },
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\"barcode\": \"472819632332439\",\n\"brand\": {\n\"name\": \"Company Name\",\n\"uuid\": \"67a8cc93-75ac-4832-8386-3eb5b24bf3d0\"\n},\n\"copyDocAddress\": \"https://restapi.payplus.co.il/getdoc/s/c/1fa79282-61d1-4898-b7b9-afa67f46d34a.pdf\",\n\"currency_code\": \"ILS\",\n\"customer\": {\n\"customer_name\": \"John Doe\",\n\"email\": \"johndoe@example.com\",\n\"phone\": \"123456789\",\n\"subject_code\": \"987654321\",\n\"uuid\": \"faa6280f-dba5-4889-9b15-de60e1527bdc\",\n\"vat_number\": \"1231231\"\n},\n\"customer_uuid\": \"faa6280f-dba5-4889-9b15-de60e1527bdc\",\n\"docUID\": \"1fa79282-61d1-4898-b7b9-afa67f46d34a\",\n\"doc_date\": \"2022-11-15\",\n\"doc_type\": \"inv_tax\",\n\"more_info\": null,\n\"number\": \"SCP/50042\",\n\"originalDocAddress\": \"https://restapi.payplus.co.il/getdoc/s/o/1fa79282-61d1-4898-b7b9-afa67f46d34a.pdf\",\n\"total_items_base_currency\": 150,\n\"validDocumentGenerated\": true\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "barcode": {
                      "type": "string",
                      "example": "472819632332439"
                    },
                    "brand": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "example": "Company Name"
                        },
                        "uuid": {
                          "type": "string",
                          "example": "67a8cc93-75ac-4832-8386-3eb5b24bf3d0"
                        }
                      }
                    },
                    "copyDocAddress": {
                      "type": "string",
                      "example": "https://restapi.payplus.co.il/getdoc/s/c/1fa79282-61d1-4898-b7b9-afa67f46d34a.pdf"
                    },
                    "currency_code": {
                      "type": "string",
                      "example": "ILS"
                    },
                    "customer": {
                      "type": "object",
                      "properties": {
                        "customer_name": {
                          "type": "string",
                          "example": "John Doe"
                        },
                        "email": {
                          "type": "string",
                          "example": "johndoe@example.com"
                        },
                        "phone": {
                          "type": "string",
                          "example": "123456789"
                        },
                        "subject_code": {
                          "type": "string",
                          "example": "987654321"
                        },
                        "uuid": {
                          "type": "string",
                          "example": "faa6280f-dba5-4889-9b15-de60e1527bdc"
                        },
                        "vat_number": {
                          "type": "string",
                          "example": "1231231"
                        }
                      }
                    },
                    "customer_uuid": {
                      "type": "string",
                      "example": "faa6280f-dba5-4889-9b15-de60e1527bdc"
                    },
                    "docUID": {
                      "type": "string",
                      "example": "1fa79282-61d1-4898-b7b9-afa67f46d34a"
                    },
                    "doc_date": {
                      "type": "string",
                      "example": "2022-11-15"
                    },
                    "doc_type": {
                      "type": "string",
                      "example": "inv_tax"
                    },
                    "more_info": {},
                    "number": {
                      "type": "string",
                      "example": "SCP/50042"
                    },
                    "originalDocAddress": {
                      "type": "string",
                      "example": "https://restapi.payplus.co.il/getdoc/s/o/1fa79282-61d1-4898-b7b9-afa67f46d34a.pdf"
                    },
                    "total_items_base_currency": {
                      "type": "integer",
                      "example": 150,
                      "default": 0
                    },
                    "validDocumentGenerated": {
                      "type": "boolean",
                      "example": true,
                      "default": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```