> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.staple.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.staple.ai/_mcp/server.

# Storage PDF Document

POST https://api.staple.io/v2/supernova/models/document/create-storage
Content-Type: multipart/form-data

Storage PDF documents based on input JSON data and file. The endpoint supports pre-configured formats and only specific data can go into each PDF document.

Reference: https://docs.staple.ai/api-reference/v2/document-creation/storage-pdf-document

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: v2
  version: 1.0.0
paths:
  /v2/supernova/models/document/create-storage:
    post:
      operationId: storagePdfDocument
      summary: Storage PDF Document
      description: >-
        Storage PDF documents based on input JSON data and file. The endpoint
        supports pre-configured formats and only specific data can go into each
        PDF document.
      tags:
        - documentCreation
      parameters:
        - name: x-api-key
          in: header
          description: API key issued by Staple.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Document
                  Creation_storagePdfDocument_Response_200
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: File to upload
                qid:
                  type: string
                data:
                  type: string
              required:
                - file
                - qid
                - data
servers:
  - url: https://api.staple.io
    description: https://api.staple.io
components:
  schemas:
    Document Creation_storagePdfDocument_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Document Creation_storagePdfDocument_Response_200
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key issued by Staple.
    bearerAuth:
      type: http
      scheme: bearer
      description: JWT obtained from the login endpoint.

```

## Examples

### Storage PDF Document



**Request**

```json
{}
```

**Response**

```json
{
  "createDocumentStorage": {
    "message": "Document creation request has been accepted.",
    "requestId": "5a359a65-f380-4822-8936-81e86005c669"
  }
}
```

**SDK Code**

```python Storage PDF Document
import requests

url = "https://api.staple.io/v2/supernova/models/document/create-storage"

payload = "-----011000010111000001101001--\r\n"
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "multipart/form-data; boundary=---011000010111000001101001"
}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript Storage PDF Document
const url = 'https://api.staple.io/v2/supernova/models/document/create-storage';
const form = new FormData();

const options = {method: 'POST', headers: {'x-api-key': '<apiKey>'}};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Storage PDF Document
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.staple.io/v2/supernova/models/document/create-storage"

	payload := strings.NewReader("-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Storage PDF Document
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/supernova/models/document/create-storage")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request.body = "-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java Storage PDF Document
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/supernova/models/document/create-storage")
  .header("x-api-key", "<apiKey>")
  .body("-----011000010111000001101001--\r\n")
  .asString();
```

```php Storage PDF Document
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/supernova/models/document/create-storage', [
  'headers' => [
    'Content-Type' => 'multipart/form-data; boundary=---011000010111000001101001',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Storage PDF Document
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/supernova/models/document/create-storage");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "multipart/form-data; boundary=---011000010111000001101001");
request.AddParameter("undefined", "-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Storage PDF Document
import Foundation

let headers = ["x-api-key": "<apiKey>"]
let parameters = []

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/supernova/models/document/create-storage")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Document Creation_storagePdfDocument_example



**Request**

```json
{
  "data": " {\n    \"Total\": [\"420.0\"],\n    \"Currency\": [\"SGD\"],\n    \"Discount\": [],\n    \"PONumber\": [\"\"],\n    \"Subtotal\": [\"420.0\"],\n    \"TaxTotal\": [\"27.48\"],\n    \"Signature\": [\"\"],\n    \"TaxPercent\": [\"\"],\n    \"CompanyName\": [\"Dksh Singapore Pte Ltd\"],\n    \"InvoiceDate\": [\"2022-12-19\"],\n    \"RubberStamp\": [\"\"],\n    \"CustomerName\": [\"\"],\n    \"DocumentType\": [\"Credit Note\"],\n    \"InvoiceNumber\": [\"1590886184\", \"345\"],\n    \"SenderAddress\": [\"47 Jalan Buroh 09-01 Singapore\"],\n    \"BillingAddress\": [\"\"],\n    \"ISOCountryCode\": [\"SG\"],\n    \"ShippingAddress\": [\"STORES ( SINGAPORE ) PTE LTD ROC  201933887N 63 ROBINSON RD # 11-01 AFRO ASIA ( RECEIVING HRS  7AM  3PM 60 PIONEER ROAD LEVEL 2 628509 SINGAPORE Tel  69045238 ADRIAN 068894 SINGAPORE\"],\n    \"VendorGSTNumber\": [\"20-0101487-N\"],\n    \"tables\" : [\n        {\n            \"headers\" : [\"header1\", \"header2\", \"header3\", \"header4\", \"header5\"],\n            \"standardheader\" : [\"Description\", \"UnitAmount\", \"Tax\", \"Other\", null],\n            \"rows\" : [\n                [\"a1\", \"a2\", null ,\"a4\", null],\n                [\"b1\", \"b2\", \"b3\", \"b4\", null],\n                [null, \"c2\", \"c4\", \"c4\", \"c5\"],\n                [\"a1\", \"a2\", null ,\"a4\", null],\n                [\"b1\", \"b2\", \"b3\", \"b4\", null],\n                [null, \"c2\", \"c4\", \"c4\", \"c5\"],\n                [\"a1\", \"a2\", null ,\"a4\", null]\n                ],\n            \"table_name\": \" The first table\",\n            \"table_type\": \"default\"\n            \n        }\n    ]\n}",
  "file": "<file: string>",
  "qid": "1"
}
```

**Response**

```json
{
  "createDocumentStorage": {
    "message": "Document creation request has been accepted.",
    "requestId": "5a359a65-f380-4822-8936-81e86005c669"
  }
}
```

**SDK Code**

```python Document Creation_storagePdfDocument_example
import requests

url = "https://api.staple.io/v2/supernova/models/document/create-storage"

files = { "file": "open('string', 'rb')" }
payload = {
    "data": " {
    \"Total\": [\"420.0\"],
    \"Currency\": [\"SGD\"],
    \"Discount\": [],
    \"PONumber\": [\"\"],
    \"Subtotal\": [\"420.0\"],
    \"TaxTotal\": [\"27.48\"],
    \"Signature\": [\"\"],
    \"TaxPercent\": [\"\"],
    \"CompanyName\": [\"Dksh Singapore Pte Ltd\"],
    \"InvoiceDate\": [\"2022-12-19\"],
    \"RubberStamp\": [\"\"],
    \"CustomerName\": [\"\"],
    \"DocumentType\": [\"Credit Note\"],
    \"InvoiceNumber\": [\"1590886184\", \"345\"],
    \"SenderAddress\": [\"47 Jalan Buroh 09-01 Singapore\"],
    \"BillingAddress\": [\"\"],
    \"ISOCountryCode\": [\"SG\"],
    \"ShippingAddress\": [\"STORES ( SINGAPORE ) PTE LTD ROC  201933887N 63 ROBINSON RD # 11-01 AFRO ASIA ( RECEIVING HRS  7AM  3PM 60 PIONEER ROAD LEVEL 2 628509 SINGAPORE Tel  69045238 ADRIAN 068894 SINGAPORE\"],
    \"VendorGSTNumber\": [\"20-0101487-N\"],
    \"tables\" : [
        {
            \"headers\" : [\"header1\", \"header2\", \"header3\", \"header4\", \"header5\"],
            \"standardheader\" : [\"Description\", \"UnitAmount\", \"Tax\", \"Other\", null],
            \"rows\" : [
                [\"a1\", \"a2\", null ,\"a4\", null],
                [\"b1\", \"b2\", \"b3\", \"b4\", null],
                [null, \"c2\", \"c4\", \"c4\", \"c5\"],
                [\"a1\", \"a2\", null ,\"a4\", null],
                [\"b1\", \"b2\", \"b3\", \"b4\", null],
                [null, \"c2\", \"c4\", \"c4\", \"c5\"],
                [\"a1\", \"a2\", null ,\"a4\", null]
                ],
            \"table_name\": \" The first table\",
            \"table_type\": \"default\"
            
        }
    ]
}",
    "qid": "1"
}
headers = {"x-api-key": "<apiKey>"}

response = requests.post(url, data=payload, files=files, headers=headers)

print(response.json())
```

```javascript Document Creation_storagePdfDocument_example
const url = 'https://api.staple.io/v2/supernova/models/document/create-storage';
const form = new FormData();
form.append('data', ' {
    "Total": ["420.0"],
    "Currency": ["SGD"],
    "Discount": [],
    "PONumber": [""],
    "Subtotal": ["420.0"],
    "TaxTotal": ["27.48"],
    "Signature": [""],
    "TaxPercent": [""],
    "CompanyName": ["Dksh Singapore Pte Ltd"],
    "InvoiceDate": ["2022-12-19"],
    "RubberStamp": [""],
    "CustomerName": [""],
    "DocumentType": ["Credit Note"],
    "InvoiceNumber": ["1590886184", "345"],
    "SenderAddress": ["47 Jalan Buroh 09-01 Singapore"],
    "BillingAddress": [""],
    "ISOCountryCode": ["SG"],
    "ShippingAddress": ["STORES ( SINGAPORE ) PTE LTD ROC  201933887N 63 ROBINSON RD # 11-01 AFRO ASIA ( RECEIVING HRS  7AM  3PM 60 PIONEER ROAD LEVEL 2 628509 SINGAPORE Tel  69045238 ADRIAN 068894 SINGAPORE"],
    "VendorGSTNumber": ["20-0101487-N"],
    "tables" : [
        {
            "headers" : ["header1", "header2", "header3", "header4", "header5"],
            "standardheader" : ["Description", "UnitAmount", "Tax", "Other", null],
            "rows" : [
                ["a1", "a2", null ,"a4", null],
                ["b1", "b2", "b3", "b4", null],
                [null, "c2", "c4", "c4", "c5"],
                ["a1", "a2", null ,"a4", null],
                ["b1", "b2", "b3", "b4", null],
                [null, "c2", "c4", "c4", "c5"],
                ["a1", "a2", null ,"a4", null]
                ],
            "table_name": " The first table",
            "table_type": "default"
            
        }
    ]
}');
form.append('file', 'string');
form.append('qid', '1');

const options = {method: 'POST', headers: {'x-api-key': '<apiKey>'}};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Document Creation_storagePdfDocument_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.staple.io/v2/supernova/models/document/create-storage"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"data\"\r\n\r\n {\n    \"Total\": [\"420.0\"],\n    \"Currency\": [\"SGD\"],\n    \"Discount\": [],\n    \"PONumber\": [\"\"],\n    \"Subtotal\": [\"420.0\"],\n    \"TaxTotal\": [\"27.48\"],\n    \"Signature\": [\"\"],\n    \"TaxPercent\": [\"\"],\n    \"CompanyName\": [\"Dksh Singapore Pte Ltd\"],\n    \"InvoiceDate\": [\"2022-12-19\"],\n    \"RubberStamp\": [\"\"],\n    \"CustomerName\": [\"\"],\n    \"DocumentType\": [\"Credit Note\"],\n    \"InvoiceNumber\": [\"1590886184\", \"345\"],\n    \"SenderAddress\": [\"47 Jalan Buroh 09-01 Singapore\"],\n    \"BillingAddress\": [\"\"],\n    \"ISOCountryCode\": [\"SG\"],\n    \"ShippingAddress\": [\"STORES ( SINGAPORE ) PTE LTD ROC  201933887N 63 ROBINSON RD # 11-01 AFRO ASIA ( RECEIVING HRS  7AM  3PM 60 PIONEER ROAD LEVEL 2 628509 SINGAPORE Tel  69045238 ADRIAN 068894 SINGAPORE\"],\n    \"VendorGSTNumber\": [\"20-0101487-N\"],\n    \"tables\" : [\n        {\n            \"headers\" : [\"header1\", \"header2\", \"header3\", \"header4\", \"header5\"],\n            \"standardheader\" : [\"Description\", \"UnitAmount\", \"Tax\", \"Other\", null],\n            \"rows\" : [\n                [\"a1\", \"a2\", null ,\"a4\", null],\n                [\"b1\", \"b2\", \"b3\", \"b4\", null],\n                [null, \"c2\", \"c4\", \"c4\", \"c5\"],\n                [\"a1\", \"a2\", null ,\"a4\", null],\n                [\"b1\", \"b2\", \"b3\", \"b4\", null],\n                [null, \"c2\", \"c4\", \"c4\", \"c5\"],\n                [\"a1\", \"a2\", null ,\"a4\", null]\n                ],\n            \"table_name\": \" The first table\",\n            \"table_type\": \"default\"\n            \n        }\n    ]\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"qid\"\r\n\r\n1\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Document Creation_storagePdfDocument_example
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/supernova/models/document/create-storage")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"data\"\r\n\r\n {\n    \"Total\": [\"420.0\"],\n    \"Currency\": [\"SGD\"],\n    \"Discount\": [],\n    \"PONumber\": [\"\"],\n    \"Subtotal\": [\"420.0\"],\n    \"TaxTotal\": [\"27.48\"],\n    \"Signature\": [\"\"],\n    \"TaxPercent\": [\"\"],\n    \"CompanyName\": [\"Dksh Singapore Pte Ltd\"],\n    \"InvoiceDate\": [\"2022-12-19\"],\n    \"RubberStamp\": [\"\"],\n    \"CustomerName\": [\"\"],\n    \"DocumentType\": [\"Credit Note\"],\n    \"InvoiceNumber\": [\"1590886184\", \"345\"],\n    \"SenderAddress\": [\"47 Jalan Buroh 09-01 Singapore\"],\n    \"BillingAddress\": [\"\"],\n    \"ISOCountryCode\": [\"SG\"],\n    \"ShippingAddress\": [\"STORES ( SINGAPORE ) PTE LTD ROC  201933887N 63 ROBINSON RD # 11-01 AFRO ASIA ( RECEIVING HRS  7AM  3PM 60 PIONEER ROAD LEVEL 2 628509 SINGAPORE Tel  69045238 ADRIAN 068894 SINGAPORE\"],\n    \"VendorGSTNumber\": [\"20-0101487-N\"],\n    \"tables\" : [\n        {\n            \"headers\" : [\"header1\", \"header2\", \"header3\", \"header4\", \"header5\"],\n            \"standardheader\" : [\"Description\", \"UnitAmount\", \"Tax\", \"Other\", null],\n            \"rows\" : [\n                [\"a1\", \"a2\", null ,\"a4\", null],\n                [\"b1\", \"b2\", \"b3\", \"b4\", null],\n                [null, \"c2\", \"c4\", \"c4\", \"c5\"],\n                [\"a1\", \"a2\", null ,\"a4\", null],\n                [\"b1\", \"b2\", \"b3\", \"b4\", null],\n                [null, \"c2\", \"c4\", \"c4\", \"c5\"],\n                [\"a1\", \"a2\", null ,\"a4\", null]\n                ],\n            \"table_name\": \" The first table\",\n            \"table_type\": \"default\"\n            \n        }\n    ]\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"qid\"\r\n\r\n1\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java Document Creation_storagePdfDocument_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/supernova/models/document/create-storage")
  .header("x-api-key", "<apiKey>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"data\"\r\n\r\n {\n    \"Total\": [\"420.0\"],\n    \"Currency\": [\"SGD\"],\n    \"Discount\": [],\n    \"PONumber\": [\"\"],\n    \"Subtotal\": [\"420.0\"],\n    \"TaxTotal\": [\"27.48\"],\n    \"Signature\": [\"\"],\n    \"TaxPercent\": [\"\"],\n    \"CompanyName\": [\"Dksh Singapore Pte Ltd\"],\n    \"InvoiceDate\": [\"2022-12-19\"],\n    \"RubberStamp\": [\"\"],\n    \"CustomerName\": [\"\"],\n    \"DocumentType\": [\"Credit Note\"],\n    \"InvoiceNumber\": [\"1590886184\", \"345\"],\n    \"SenderAddress\": [\"47 Jalan Buroh 09-01 Singapore\"],\n    \"BillingAddress\": [\"\"],\n    \"ISOCountryCode\": [\"SG\"],\n    \"ShippingAddress\": [\"STORES ( SINGAPORE ) PTE LTD ROC  201933887N 63 ROBINSON RD # 11-01 AFRO ASIA ( RECEIVING HRS  7AM  3PM 60 PIONEER ROAD LEVEL 2 628509 SINGAPORE Tel  69045238 ADRIAN 068894 SINGAPORE\"],\n    \"VendorGSTNumber\": [\"20-0101487-N\"],\n    \"tables\" : [\n        {\n            \"headers\" : [\"header1\", \"header2\", \"header3\", \"header4\", \"header5\"],\n            \"standardheader\" : [\"Description\", \"UnitAmount\", \"Tax\", \"Other\", null],\n            \"rows\" : [\n                [\"a1\", \"a2\", null ,\"a4\", null],\n                [\"b1\", \"b2\", \"b3\", \"b4\", null],\n                [null, \"c2\", \"c4\", \"c4\", \"c5\"],\n                [\"a1\", \"a2\", null ,\"a4\", null],\n                [\"b1\", \"b2\", \"b3\", \"b4\", null],\n                [null, \"c2\", \"c4\", \"c4\", \"c5\"],\n                [\"a1\", \"a2\", null ,\"a4\", null]\n                ],\n            \"table_name\": \" The first table\",\n            \"table_type\": \"default\"\n            \n        }\n    ]\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"qid\"\r\n\r\n1\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php Document Creation_storagePdfDocument_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/supernova/models/document/create-storage', [
  'multipart' => [
    [
        'name' => 'data',
        'contents' => ' {
    "Total": ["420.0"],
    "Currency": ["SGD"],
    "Discount": [],
    "PONumber": [""],
    "Subtotal": ["420.0"],
    "TaxTotal": ["27.48"],
    "Signature": [""],
    "TaxPercent": [""],
    "CompanyName": ["Dksh Singapore Pte Ltd"],
    "InvoiceDate": ["2022-12-19"],
    "RubberStamp": [""],
    "CustomerName": [""],
    "DocumentType": ["Credit Note"],
    "InvoiceNumber": ["1590886184", "345"],
    "SenderAddress": ["47 Jalan Buroh 09-01 Singapore"],
    "BillingAddress": [""],
    "ISOCountryCode": ["SG"],
    "ShippingAddress": ["STORES ( SINGAPORE ) PTE LTD ROC  201933887N 63 ROBINSON RD # 11-01 AFRO ASIA ( RECEIVING HRS  7AM  3PM 60 PIONEER ROAD LEVEL 2 628509 SINGAPORE Tel  69045238 ADRIAN 068894 SINGAPORE"],
    "VendorGSTNumber": ["20-0101487-N"],
    "tables" : [
        {
            "headers" : ["header1", "header2", "header3", "header4", "header5"],
            "standardheader" : ["Description", "UnitAmount", "Tax", "Other", null],
            "rows" : [
                ["a1", "a2", null ,"a4", null],
                ["b1", "b2", "b3", "b4", null],
                [null, "c2", "c4", "c4", "c5"],
                ["a1", "a2", null ,"a4", null],
                ["b1", "b2", "b3", "b4", null],
                [null, "c2", "c4", "c4", "c5"],
                ["a1", "a2", null ,"a4", null]
                ],
            "table_name": " The first table",
            "table_type": "default"
            
        }
    ]
}'
    ],
    [
        'name' => 'file',
        'filename' => 'string',
        'contents' => null
    ],
    [
        'name' => 'qid',
        'contents' => '1'
    ]
  ]
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Document Creation_storagePdfDocument_example
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/supernova/models/document/create-storage");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"data\"\r\n\r\n {\n    \"Total\": [\"420.0\"],\n    \"Currency\": [\"SGD\"],\n    \"Discount\": [],\n    \"PONumber\": [\"\"],\n    \"Subtotal\": [\"420.0\"],\n    \"TaxTotal\": [\"27.48\"],\n    \"Signature\": [\"\"],\n    \"TaxPercent\": [\"\"],\n    \"CompanyName\": [\"Dksh Singapore Pte Ltd\"],\n    \"InvoiceDate\": [\"2022-12-19\"],\n    \"RubberStamp\": [\"\"],\n    \"CustomerName\": [\"\"],\n    \"DocumentType\": [\"Credit Note\"],\n    \"InvoiceNumber\": [\"1590886184\", \"345\"],\n    \"SenderAddress\": [\"47 Jalan Buroh 09-01 Singapore\"],\n    \"BillingAddress\": [\"\"],\n    \"ISOCountryCode\": [\"SG\"],\n    \"ShippingAddress\": [\"STORES ( SINGAPORE ) PTE LTD ROC  201933887N 63 ROBINSON RD # 11-01 AFRO ASIA ( RECEIVING HRS  7AM  3PM 60 PIONEER ROAD LEVEL 2 628509 SINGAPORE Tel  69045238 ADRIAN 068894 SINGAPORE\"],\n    \"VendorGSTNumber\": [\"20-0101487-N\"],\n    \"tables\" : [\n        {\n            \"headers\" : [\"header1\", \"header2\", \"header3\", \"header4\", \"header5\"],\n            \"standardheader\" : [\"Description\", \"UnitAmount\", \"Tax\", \"Other\", null],\n            \"rows\" : [\n                [\"a1\", \"a2\", null ,\"a4\", null],\n                [\"b1\", \"b2\", \"b3\", \"b4\", null],\n                [null, \"c2\", \"c4\", \"c4\", \"c5\"],\n                [\"a1\", \"a2\", null ,\"a4\", null],\n                [\"b1\", \"b2\", \"b3\", \"b4\", null],\n                [null, \"c2\", \"c4\", \"c4\", \"c5\"],\n                [\"a1\", \"a2\", null ,\"a4\", null]\n                ],\n            \"table_name\": \" The first table\",\n            \"table_type\": \"default\"\n            \n        }\n    ]\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"qid\"\r\n\r\n1\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Document Creation_storagePdfDocument_example
import Foundation

let headers = ["x-api-key": "<apiKey>"]
let parameters = [
  [
    "name": "data",
    "value": " {
    \"Total\": [\"420.0\"],
    \"Currency\": [\"SGD\"],
    \"Discount\": [],
    \"PONumber\": [\"\"],
    \"Subtotal\": [\"420.0\"],
    \"TaxTotal\": [\"27.48\"],
    \"Signature\": [\"\"],
    \"TaxPercent\": [\"\"],
    \"CompanyName\": [\"Dksh Singapore Pte Ltd\"],
    \"InvoiceDate\": [\"2022-12-19\"],
    \"RubberStamp\": [\"\"],
    \"CustomerName\": [\"\"],
    \"DocumentType\": [\"Credit Note\"],
    \"InvoiceNumber\": [\"1590886184\", \"345\"],
    \"SenderAddress\": [\"47 Jalan Buroh 09-01 Singapore\"],
    \"BillingAddress\": [\"\"],
    \"ISOCountryCode\": [\"SG\"],
    \"ShippingAddress\": [\"STORES ( SINGAPORE ) PTE LTD ROC  201933887N 63 ROBINSON RD # 11-01 AFRO ASIA ( RECEIVING HRS  7AM  3PM 60 PIONEER ROAD LEVEL 2 628509 SINGAPORE Tel  69045238 ADRIAN 068894 SINGAPORE\"],
    \"VendorGSTNumber\": [\"20-0101487-N\"],
    \"tables\" : [
        {
            \"headers\" : [\"header1\", \"header2\", \"header3\", \"header4\", \"header5\"],
            \"standardheader\" : [\"Description\", \"UnitAmount\", \"Tax\", \"Other\", null],
            \"rows\" : [
                [\"a1\", \"a2\", null ,\"a4\", null],
                [\"b1\", \"b2\", \"b3\", \"b4\", null],
                [null, \"c2\", \"c4\", \"c4\", \"c5\"],
                [\"a1\", \"a2\", null ,\"a4\", null],
                [\"b1\", \"b2\", \"b3\", \"b4\", null],
                [null, \"c2\", \"c4\", \"c4\", \"c5\"],
                [\"a1\", \"a2\", null ,\"a4\", null]
                ],
            \"table_name\": \" The first table\",
            \"table_type\": \"default\"
            
        }
    ]
}"
  ],
  [
    "name": "file",
    "fileName": "string"
  ],
  [
    "name": "qid",
    "value": "1"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/supernova/models/document/create-storage")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```