> 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.

# Send E-Invoice for Singapore

POST https://api.staple.io/v2/einvoice/ar/{qid}
Content-Type: application/json

Generate and send a Singapore e-invoice from ERP invoice JSON. This is the **single entry point for AR/AP flows 1A, 2A, 2B, 3A and 3B** — you POST the invoice JSON, and Staple maps it to PINT-SG UBL, runs it through the document-creation pipeline, and (depending on the flow) sends it over the Peppol network and/or submits the tax data to IRAS.

Send is **asynchronous**: a `requestId` is returned immediately. Track delivery/tax status by polling `GET /v2/supernova/models/document/{requestId}` (`peppolSendStatus`, `irasTaxSubmissionStatus`).

## Flow selection

The exact flow is resolved from the `destination` query parameter plus `Transaction Type` and `Addon` in the payload:

| `destination` | `Transaction Type` | `Addon`       | Flow   | Sends Peppol | Submits IRAS |
| ------------- | ------------------ | ------------- | ------ | :----------: | :----------: |
| `peppol_iras` | Sales              | sg-standard   | **1A** |       ✅      |       ✅      |
| `iras`        | Sales              | sg-standard   | **2A** |       —      |       ✅      |
| `iras`        | Sales              | sg-aggregated | **2B** |       —      |       ✅      |
| `iras`        | Purchases          | sg-standard   | **3A** |       —      |       ✅      |
| `iras`        | Purchases          | sg-aggregated | **3B** |       —      |       ✅      |

## Document Type

`Document Type` is `Invoice` (default when omitted) or `Credit Note`. A credit note additionally requires a `Note` and exactly one `Document Reference` (Number + Date) pointing at the original invoice. **Credit notes are not supported on the `sg-aggregated` addon** (Flows 2B and 3B).

## Company & party rules

* For **Sales (AR)** the **Seller** must be a registered Staple e-invoice company owned by your organisation; for **Purchases (AP)** it is the **Buyer**.
* **Seller and Buyer cannot be the same Peppol participant.**
* For aggregated flows the counterparty is a reserved literal — `POS`/`STI` (Flow 2B) or `PCP` (Flow 3B).

## Use-case catalogue

Every combination the endpoint accepts, with the sample payload that exercises it:

| Scenario                      | `destination` | Txn       | Addon         | Doc Type    | Flow |
| ----------------------------- | ------------- | --------- | ------------- | ----------- | ---- |
| Peppol standard invoice       | `peppol_iras` | Sales     | sg-standard   | Invoice     | 1A   |
| Peppol multi-tax invoice      | `peppol_iras` | Sales     | sg-standard   | Invoice     | 1A   |
| Peppol credit note            | `peppol_iras` | Sales     | sg-standard   | Credit Note | 1A   |
| IRAS standard invoice         | `iras`        | Sales     | sg-standard   | Invoice     | 2A   |
| IRAS foreign-currency invoice | `iras`        | Sales     | sg-standard   | Invoice     | 2A   |
| IRAS zero-rated sales         | `iras`        | Sales     | sg-standard   | Invoice     | 2A   |
| IRAS sales credit note        | `iras`        | Sales     | sg-standard   | Credit Note | 2A   |
| Aggregated POS (single tax)   | `iras`        | Sales     | sg-aggregated | Invoice     | 2B   |
| Aggregated POS (multi tax)    | `iras`        | Sales     | sg-aggregated | Invoice     | 2B   |
| Aggregated STI (simplified)   | `iras`        | Sales     | sg-aggregated | Invoice     | 2B   |
| Purchase standard invoice     | `iras`        | Purchases | sg-standard   | Invoice     | 3A   |
| Purchase residual input tax   | `iras`        | Purchases | sg-standard   | Invoice     | 3A   |
| Purchase credit note          | `iras`        | Purchases | sg-standard   | Credit Note | 3A   |
| Aggregated PCP (single tax)   | `iras`        | Purchases | sg-aggregated | Invoice     | 3B   |
| Aggregated PCP (multi tax)    | `iras`        | Purchases | sg-aggregated | Invoice     | 3B   |
| Aggregated PCP (residual)     | `iras`        | Purchases | sg-aggregated | Invoice     | 3B   |

## Example naming ↔ flow mapping

The request examples use the `sg-test-pack` naming (`1A-01`, `2B-03`, …). Each prefix maps to the flow convention as follows:

| Example prefix     | Scenario group                  | Flow                                      |
| ------------------ | ------------------------------- | ----------------------------------------- |
| `1A-##-peppol-*`   | AR — Peppol + IRAS send         | **Flow 1A** (`destination=peppol_iras`)   |
| `1A-IRAS-##-*`     | AR — IRAS-only, standard        | **Flow 2A** (AR · `iras` · sg-standard)   |
| `2A-##-sales-*`    | AR — sales, IRAS-only, standard | **Flow 2A** (AR · `iras` · sg-standard)   |
| `2B-##-*`          | AR — aggregated (POS / STI)     | **Flow 2B** (AR · `iras` · sg-aggregated) |
| `3A-##-purchase-*` | AP — purchases, standard        | **Flow 3A** (AP · `iras` · sg-standard)   |
| `3B-##-pcp-*`      | AP — aggregated (PCP)           | **Flow 3B** (AP · `iras` · sg-aggregated) |

Reference: https://docs.staple.ai/api-reference/v2/e-invoice/send-e-invoice-for-singapore

## Authentication

- `x-api-key` header (required) — API key issued by Staple.
- `Authorization` header (bearer token, required) — JWT obtained from the login endpoint.

## Request

### Path parameters

- `qid` (string, required) — Target queue ID the generated document lands in.

### Query parameters

- `country` (enum, required) — Country selector for the mapping. Currently SG only.
  - Allowed values: `SG`
- `destination` (enum, required) — Send target — combined with Transaction Type + Addon to resolve the flow (see description).
  - Allowed values: `peppol_iras`, `iras`

### Body (application/json)

- `any`

## Response

### 200

Request accepted (asynchronous — poll status via GET /v2/supernova/models/document/\{requestId}).

## Examples

### 1A-01-peppol-standard

**Request**

```json
{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-1A-01",
  "Line Items": [
    {
      "Description": "Consulting services",
      "Line Amount": 1500,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 135,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 1500
        }
      ],
      "Unit Amount": 1500,
      "Unit of Measure": "C62"
    }
  ],
  "PO Number": "PO-88213",
  "Payment": {
    "Due Date": "2026-09-15"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 1500,
    "Sum of Line Amounts": 1500,
    "Tax Total": 135,
    "Total": 1635,
    "Total incl Tax": 1635
  },
  "Transaction Type": "Sales",
  "UUID": "fd2c31a5-45f2-41b5-aae3-e063e2efdc1b"
}
```

**Response**

```json
{
  "importERP": {
    "message": "[Peppol] Document creation request has been accepted.",
    "requestId": "3f8a625f-1881-438a-9d44-382fb7a6d5cd",
    "status": "SUCCESS"
  }
}
```

**SDK Code**

```python 1A-01-peppol-standard
import requests

url = "https://api.staple.io/v2/einvoice/ar/:qid"

payload = {
    "Addon": "sg-standard",
    "Buyer": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "088541",
            "Street Name": "120 Tanjong Pagar Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Northstar Commerce Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202623458Y",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202623458Y",
        "Tax ID": "M90262345Y"
    },
    "Currency": "SGD",
    "Document Type": "Invoice",
    "Invoice Date": "2026-08-26",
    "Invoice Number": "TC-1A-01",
    "Line Items": [
        {
            "Description": "Consulting services",
            "Line Amount": 1500,
            "Line ID": "1",
            "Quantity": 1,
            "Tax Breakdown": [
                {
                    "Tax Amount": 135,
                    "Tax Category Code": "SR",
                    "Tax Rate": 9,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 1500
                }
            ],
            "Unit Amount": 1500,
            "Unit of Measure": "C62"
        }
    ],
    "PO Number": "PO-88213",
    "Payment": { "Due Date": "2026-09-15" },
    "Seller": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "068895",
            "Street Name": "71 Robinson Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Meridian Crest Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202612344K",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202612344K",
        "Tax ID": "M90261234K"
    },
    "Totals": {
        "Subtotal": 1500,
        "Sum of Line Amounts": 1500,
        "Tax Total": 135,
        "Total": 1635,
        "Total incl Tax": 1635
    },
    "Transaction Type": "Sales",
    "UUID": "fd2c31a5-45f2-41b5-aae3-e063e2efdc1b"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 1A-01-peppol-standard
const url = 'https://api.staple.io/v2/einvoice/ar/:qid';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"Addon":"sg-standard","Buyer":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"088541","Street Name":"120 Tanjong Pagar Road"},"Email":"atharva@staple.io","Name":"Northstar Commerce Pte. Ltd.","Peppol Endpoint ID":"SGTST202623458Y","Peppol Scheme ID":"0195","Registration Number":"202623458Y","Tax ID":"M90262345Y"},"Currency":"SGD","Document Type":"Invoice","Invoice Date":"2026-08-26","Invoice Number":"TC-1A-01","Line Items":[{"Description":"Consulting services","Line Amount":1500,"Line ID":"1","Quantity":1,"Tax Breakdown":[{"Tax Amount":135,"Tax Category Code":"SR","Tax Rate":9,"Tax Scheme":"GST","Taxable Amount":1500}],"Unit Amount":1500,"Unit of Measure":"C62"}],"PO Number":"PO-88213","Payment":{"Due Date":"2026-09-15"},"Seller":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"068895","Street Name":"71 Robinson Road"},"Email":"atharva@staple.io","Name":"Meridian Crest Pte. Ltd.","Peppol Endpoint ID":"SGTST202612344K","Peppol Scheme ID":"0195","Registration Number":"202612344K","Tax ID":"M90261234K"},"Totals":{"Subtotal":1500,"Sum of Line Amounts":1500,"Tax Total":135,"Total":1635,"Total incl Tax":1635},"Transaction Type":"Sales","UUID":"fd2c31a5-45f2-41b5-aae3-e063e2efdc1b"}'
};

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

```go 1A-01-peppol-standard
package main

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

func main() {

	url := "https://api.staple.io/v2/einvoice/ar/:qid"

	payload := strings.NewReader("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1A-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Consulting services\",\n      \"Line Amount\": 1500,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 135,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1500\n        }\n      ],\n      \"Unit Amount\": 1500,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"PO Number\": \"PO-88213\",\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1500,\n    \"Sum of Line Amounts\": 1500,\n    \"Tax Total\": 135,\n    \"Total\": 1635,\n    \"Total incl Tax\": 1635\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"fd2c31a5-45f2-41b5-aae3-e063e2efdc1b\"\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby 1A-01-peppol-standard
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/einvoice/ar/:qid")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1A-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Consulting services\",\n      \"Line Amount\": 1500,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 135,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1500\n        }\n      ],\n      \"Unit Amount\": 1500,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"PO Number\": \"PO-88213\",\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1500,\n    \"Sum of Line Amounts\": 1500,\n    \"Tax Total\": 135,\n    \"Total\": 1635,\n    \"Total incl Tax\": 1635\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"fd2c31a5-45f2-41b5-aae3-e063e2efdc1b\"\n}"

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

```java 1A-01-peppol-standard
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/einvoice/ar/:qid")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1A-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Consulting services\",\n      \"Line Amount\": 1500,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 135,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1500\n        }\n      ],\n      \"Unit Amount\": 1500,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"PO Number\": \"PO-88213\",\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1500,\n    \"Sum of Line Amounts\": 1500,\n    \"Tax Total\": 135,\n    \"Total\": 1635,\n    \"Total incl Tax\": 1635\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"fd2c31a5-45f2-41b5-aae3-e063e2efdc1b\"\n}")
  .asString();
```

```php 1A-01-peppol-standard
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/einvoice/ar/:qid', [
  'body' => '{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-1A-01",
  "Line Items": [
    {
      "Description": "Consulting services",
      "Line Amount": 1500,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 135,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 1500
        }
      ],
      "Unit Amount": 1500,
      "Unit of Measure": "C62"
    }
  ],
  "PO Number": "PO-88213",
  "Payment": {
    "Due Date": "2026-09-15"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 1500,
    "Sum of Line Amounts": 1500,
    "Tax Total": 135,
    "Total": 1635,
    "Total incl Tax": 1635
  },
  "Transaction Type": "Sales",
  "UUID": "fd2c31a5-45f2-41b5-aae3-e063e2efdc1b"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp 1A-01-peppol-standard
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/einvoice/ar/:qid");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1A-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Consulting services\",\n      \"Line Amount\": 1500,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 135,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1500\n        }\n      ],\n      \"Unit Amount\": 1500,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"PO Number\": \"PO-88213\",\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1500,\n    \"Sum of Line Amounts\": 1500,\n    \"Tax Total\": 135,\n    \"Total\": 1635,\n    \"Total incl Tax\": 1635\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"fd2c31a5-45f2-41b5-aae3-e063e2efdc1b\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 1A-01-peppol-standard
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "Addon": "sg-standard",
  "Buyer": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  ],
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-1A-01",
  "Line Items": [
    [
      "Description": "Consulting services",
      "Line Amount": 1500,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        [
          "Tax Amount": 135,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 1500
        ]
      ],
      "Unit Amount": 1500,
      "Unit of Measure": "C62"
    ]
  ],
  "PO Number": "PO-88213",
  "Payment": ["Due Date": "2026-09-15"],
  "Seller": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  ],
  "Totals": [
    "Subtotal": 1500,
    "Sum of Line Amounts": 1500,
    "Tax Total": 135,
    "Total": 1635,
    "Total incl Tax": 1635
  ],
  "Transaction Type": "Sales",
  "UUID": "fd2c31a5-45f2-41b5-aae3-e063e2efdc1b"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/einvoice/ar/:qid")! 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()
```

### 1A-02-peppol-multi-tax

**Request**

```json
{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-1A-02",
  "Line Items": [
    {
      "Description": "Consulting services",
      "Line Amount": 2000,
      "Line ID": "1",
      "Quantity": 2,
      "Tax Breakdown": [
        {
          "Tax Amount": 180,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 2000
        }
      ],
      "Unit Amount": 1000,
      "Unit of Measure": "C62"
    },
    {
      "Description": "Export handling",
      "Line Amount": 500,
      "Line ID": "2",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 0,
          "Tax Category Code": "ZR",
          "Tax Rate": 0,
          "Tax Scheme": "GST",
          "Taxable Amount": 500
        }
      ],
      "Unit Amount": 500,
      "Unit of Measure": "C62"
    }
  ],
  "Payment": {
    "Due Date": "2026-09-15"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 2500,
    "Sum of Line Amounts": 2500,
    "Tax Total": 180,
    "Total": 2680,
    "Total incl Tax": 2680
  },
  "Transaction Type": "Sales",
  "UUID": "dc651e25-dde5-4328-8a62-da42e44b5079"
}
```

**Response**

```json
{
  "importERP": {
    "message": "[Peppol] Document creation request has been accepted.",
    "requestId": "3f8a625f-1881-438a-9d44-382fb7a6d5cd",
    "status": "SUCCESS"
  }
}
```

**SDK Code**

```python 1A-02-peppol-multi-tax
import requests

url = "https://api.staple.io/v2/einvoice/ar/:qid"

payload = {
    "Addon": "sg-standard",
    "Buyer": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "088541",
            "Street Name": "120 Tanjong Pagar Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Northstar Commerce Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202623458Y",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202623458Y",
        "Tax ID": "M90262345Y"
    },
    "Currency": "SGD",
    "Document Type": "Invoice",
    "Invoice Date": "2026-08-26",
    "Invoice Number": "TC-1A-02",
    "Line Items": [
        {
            "Description": "Consulting services",
            "Line Amount": 2000,
            "Line ID": "1",
            "Quantity": 2,
            "Tax Breakdown": [
                {
                    "Tax Amount": 180,
                    "Tax Category Code": "SR",
                    "Tax Rate": 9,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 2000
                }
            ],
            "Unit Amount": 1000,
            "Unit of Measure": "C62"
        },
        {
            "Description": "Export handling",
            "Line Amount": 500,
            "Line ID": "2",
            "Quantity": 1,
            "Tax Breakdown": [
                {
                    "Tax Amount": 0,
                    "Tax Category Code": "ZR",
                    "Tax Rate": 0,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 500
                }
            ],
            "Unit Amount": 500,
            "Unit of Measure": "C62"
        }
    ],
    "Payment": { "Due Date": "2026-09-15" },
    "Seller": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "068895",
            "Street Name": "71 Robinson Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Meridian Crest Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202612344K",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202612344K",
        "Tax ID": "M90261234K"
    },
    "Totals": {
        "Subtotal": 2500,
        "Sum of Line Amounts": 2500,
        "Tax Total": 180,
        "Total": 2680,
        "Total incl Tax": 2680
    },
    "Transaction Type": "Sales",
    "UUID": "dc651e25-dde5-4328-8a62-da42e44b5079"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 1A-02-peppol-multi-tax
const url = 'https://api.staple.io/v2/einvoice/ar/:qid';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"Addon":"sg-standard","Buyer":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"088541","Street Name":"120 Tanjong Pagar Road"},"Email":"atharva@staple.io","Name":"Northstar Commerce Pte. Ltd.","Peppol Endpoint ID":"SGTST202623458Y","Peppol Scheme ID":"0195","Registration Number":"202623458Y","Tax ID":"M90262345Y"},"Currency":"SGD","Document Type":"Invoice","Invoice Date":"2026-08-26","Invoice Number":"TC-1A-02","Line Items":[{"Description":"Consulting services","Line Amount":2000,"Line ID":"1","Quantity":2,"Tax Breakdown":[{"Tax Amount":180,"Tax Category Code":"SR","Tax Rate":9,"Tax Scheme":"GST","Taxable Amount":2000}],"Unit Amount":1000,"Unit of Measure":"C62"},{"Description":"Export handling","Line Amount":500,"Line ID":"2","Quantity":1,"Tax Breakdown":[{"Tax Amount":0,"Tax Category Code":"ZR","Tax Rate":0,"Tax Scheme":"GST","Taxable Amount":500}],"Unit Amount":500,"Unit of Measure":"C62"}],"Payment":{"Due Date":"2026-09-15"},"Seller":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"068895","Street Name":"71 Robinson Road"},"Email":"atharva@staple.io","Name":"Meridian Crest Pte. Ltd.","Peppol Endpoint ID":"SGTST202612344K","Peppol Scheme ID":"0195","Registration Number":"202612344K","Tax ID":"M90261234K"},"Totals":{"Subtotal":2500,"Sum of Line Amounts":2500,"Tax Total":180,"Total":2680,"Total incl Tax":2680},"Transaction Type":"Sales","UUID":"dc651e25-dde5-4328-8a62-da42e44b5079"}'
};

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

```go 1A-02-peppol-multi-tax
package main

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

func main() {

	url := "https://api.staple.io/v2/einvoice/ar/:qid"

	payload := strings.NewReader("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1A-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Consulting services\",\n      \"Line Amount\": 2000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 2,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 180,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 2000\n        }\n      ],\n      \"Unit Amount\": 1000,\n      \"Unit of Measure\": \"C62\"\n    },\n    {\n      \"Description\": \"Export handling\",\n      \"Line Amount\": 500,\n      \"Line ID\": \"2\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 0,\n          \"Tax Category Code\": \"ZR\",\n          \"Tax Rate\": 0,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 500\n        }\n      ],\n      \"Unit Amount\": 500,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 2500,\n    \"Sum of Line Amounts\": 2500,\n    \"Tax Total\": 180,\n    \"Total\": 2680,\n    \"Total incl Tax\": 2680\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"dc651e25-dde5-4328-8a62-da42e44b5079\"\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby 1A-02-peppol-multi-tax
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/einvoice/ar/:qid")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1A-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Consulting services\",\n      \"Line Amount\": 2000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 2,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 180,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 2000\n        }\n      ],\n      \"Unit Amount\": 1000,\n      \"Unit of Measure\": \"C62\"\n    },\n    {\n      \"Description\": \"Export handling\",\n      \"Line Amount\": 500,\n      \"Line ID\": \"2\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 0,\n          \"Tax Category Code\": \"ZR\",\n          \"Tax Rate\": 0,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 500\n        }\n      ],\n      \"Unit Amount\": 500,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 2500,\n    \"Sum of Line Amounts\": 2500,\n    \"Tax Total\": 180,\n    \"Total\": 2680,\n    \"Total incl Tax\": 2680\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"dc651e25-dde5-4328-8a62-da42e44b5079\"\n}"

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

```java 1A-02-peppol-multi-tax
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/einvoice/ar/:qid")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1A-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Consulting services\",\n      \"Line Amount\": 2000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 2,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 180,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 2000\n        }\n      ],\n      \"Unit Amount\": 1000,\n      \"Unit of Measure\": \"C62\"\n    },\n    {\n      \"Description\": \"Export handling\",\n      \"Line Amount\": 500,\n      \"Line ID\": \"2\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 0,\n          \"Tax Category Code\": \"ZR\",\n          \"Tax Rate\": 0,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 500\n        }\n      ],\n      \"Unit Amount\": 500,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 2500,\n    \"Sum of Line Amounts\": 2500,\n    \"Tax Total\": 180,\n    \"Total\": 2680,\n    \"Total incl Tax\": 2680\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"dc651e25-dde5-4328-8a62-da42e44b5079\"\n}")
  .asString();
```

```php 1A-02-peppol-multi-tax
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/einvoice/ar/:qid', [
  'body' => '{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-1A-02",
  "Line Items": [
    {
      "Description": "Consulting services",
      "Line Amount": 2000,
      "Line ID": "1",
      "Quantity": 2,
      "Tax Breakdown": [
        {
          "Tax Amount": 180,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 2000
        }
      ],
      "Unit Amount": 1000,
      "Unit of Measure": "C62"
    },
    {
      "Description": "Export handling",
      "Line Amount": 500,
      "Line ID": "2",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 0,
          "Tax Category Code": "ZR",
          "Tax Rate": 0,
          "Tax Scheme": "GST",
          "Taxable Amount": 500
        }
      ],
      "Unit Amount": 500,
      "Unit of Measure": "C62"
    }
  ],
  "Payment": {
    "Due Date": "2026-09-15"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 2500,
    "Sum of Line Amounts": 2500,
    "Tax Total": 180,
    "Total": 2680,
    "Total incl Tax": 2680
  },
  "Transaction Type": "Sales",
  "UUID": "dc651e25-dde5-4328-8a62-da42e44b5079"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp 1A-02-peppol-multi-tax
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/einvoice/ar/:qid");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1A-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Consulting services\",\n      \"Line Amount\": 2000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 2,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 180,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 2000\n        }\n      ],\n      \"Unit Amount\": 1000,\n      \"Unit of Measure\": \"C62\"\n    },\n    {\n      \"Description\": \"Export handling\",\n      \"Line Amount\": 500,\n      \"Line ID\": \"2\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 0,\n          \"Tax Category Code\": \"ZR\",\n          \"Tax Rate\": 0,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 500\n        }\n      ],\n      \"Unit Amount\": 500,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 2500,\n    \"Sum of Line Amounts\": 2500,\n    \"Tax Total\": 180,\n    \"Total\": 2680,\n    \"Total incl Tax\": 2680\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"dc651e25-dde5-4328-8a62-da42e44b5079\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 1A-02-peppol-multi-tax
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "Addon": "sg-standard",
  "Buyer": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  ],
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-1A-02",
  "Line Items": [
    [
      "Description": "Consulting services",
      "Line Amount": 2000,
      "Line ID": "1",
      "Quantity": 2,
      "Tax Breakdown": [
        [
          "Tax Amount": 180,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 2000
        ]
      ],
      "Unit Amount": 1000,
      "Unit of Measure": "C62"
    ],
    [
      "Description": "Export handling",
      "Line Amount": 500,
      "Line ID": "2",
      "Quantity": 1,
      "Tax Breakdown": [
        [
          "Tax Amount": 0,
          "Tax Category Code": "ZR",
          "Tax Rate": 0,
          "Tax Scheme": "GST",
          "Taxable Amount": 500
        ]
      ],
      "Unit Amount": 500,
      "Unit of Measure": "C62"
    ]
  ],
  "Payment": ["Due Date": "2026-09-15"],
  "Seller": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  ],
  "Totals": [
    "Subtotal": 2500,
    "Sum of Line Amounts": 2500,
    "Tax Total": 180,
    "Total": 2680,
    "Total incl Tax": 2680
  ],
  "Transaction Type": "Sales",
  "UUID": "dc651e25-dde5-4328-8a62-da42e44b5079"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/einvoice/ar/:qid")! 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()
```

### 1A-03-peppol-credit-note

**Request**

```json
{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Currency": "SGD",
  "Document Reference": [
    {
      "Date": "2026-08-26",
      "Number": "TC-1A-01",
      "Type": "Invoice"
    }
  ],
  "Document Type": "Credit Note",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-1A-03",
  "Line Items": [
    {
      "Description": "Consulting services — returned",
      "Line Amount": 300,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 27,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 300
        }
      ],
      "Unit Amount": 300,
      "Unit of Measure": "C62"
    }
  ],
  "Note": "Partial cancellation of TC-1A-01",
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 300,
    "Sum of Line Amounts": 300,
    "Tax Total": 27,
    "Total": 327,
    "Total incl Tax": 327
  },
  "Transaction Type": "Sales",
  "UUID": "afbd07a2-5fdd-4f7d-9994-9ab1335be814"
}
```

**Response**

```json
{
  "importERP": {
    "message": "[Peppol] Document creation request has been accepted.",
    "requestId": "3f8a625f-1881-438a-9d44-382fb7a6d5cd",
    "status": "SUCCESS"
  }
}
```

**SDK Code**

```python 1A-03-peppol-credit-note
import requests

url = "https://api.staple.io/v2/einvoice/ar/:qid"

payload = {
    "Addon": "sg-standard",
    "Buyer": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "088541",
            "Street Name": "120 Tanjong Pagar Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Northstar Commerce Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202623458Y",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202623458Y",
        "Tax ID": "M90262345Y"
    },
    "Currency": "SGD",
    "Document Reference": [
        {
            "Date": "2026-08-26",
            "Number": "TC-1A-01",
            "Type": "Invoice"
        }
    ],
    "Document Type": "Credit Note",
    "Invoice Date": "2026-08-26",
    "Invoice Number": "TC-1A-03",
    "Line Items": [
        {
            "Description": "Consulting services — returned",
            "Line Amount": 300,
            "Line ID": "1",
            "Quantity": 1,
            "Tax Breakdown": [
                {
                    "Tax Amount": 27,
                    "Tax Category Code": "SR",
                    "Tax Rate": 9,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 300
                }
            ],
            "Unit Amount": 300,
            "Unit of Measure": "C62"
        }
    ],
    "Note": "Partial cancellation of TC-1A-01",
    "Seller": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "068895",
            "Street Name": "71 Robinson Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Meridian Crest Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202612344K",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202612344K",
        "Tax ID": "M90261234K"
    },
    "Totals": {
        "Subtotal": 300,
        "Sum of Line Amounts": 300,
        "Tax Total": 27,
        "Total": 327,
        "Total incl Tax": 327
    },
    "Transaction Type": "Sales",
    "UUID": "afbd07a2-5fdd-4f7d-9994-9ab1335be814"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 1A-03-peppol-credit-note
const url = 'https://api.staple.io/v2/einvoice/ar/:qid';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"Addon":"sg-standard","Buyer":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"088541","Street Name":"120 Tanjong Pagar Road"},"Email":"atharva@staple.io","Name":"Northstar Commerce Pte. Ltd.","Peppol Endpoint ID":"SGTST202623458Y","Peppol Scheme ID":"0195","Registration Number":"202623458Y","Tax ID":"M90262345Y"},"Currency":"SGD","Document Reference":[{"Date":"2026-08-26","Number":"TC-1A-01","Type":"Invoice"}],"Document Type":"Credit Note","Invoice Date":"2026-08-26","Invoice Number":"TC-1A-03","Line Items":[{"Description":"Consulting services — returned","Line Amount":300,"Line ID":"1","Quantity":1,"Tax Breakdown":[{"Tax Amount":27,"Tax Category Code":"SR","Tax Rate":9,"Tax Scheme":"GST","Taxable Amount":300}],"Unit Amount":300,"Unit of Measure":"C62"}],"Note":"Partial cancellation of TC-1A-01","Seller":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"068895","Street Name":"71 Robinson Road"},"Email":"atharva@staple.io","Name":"Meridian Crest Pte. Ltd.","Peppol Endpoint ID":"SGTST202612344K","Peppol Scheme ID":"0195","Registration Number":"202612344K","Tax ID":"M90261234K"},"Totals":{"Subtotal":300,"Sum of Line Amounts":300,"Tax Total":27,"Total":327,"Total incl Tax":327},"Transaction Type":"Sales","UUID":"afbd07a2-5fdd-4f7d-9994-9ab1335be814"}'
};

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

```go 1A-03-peppol-credit-note
package main

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

func main() {

	url := "https://api.staple.io/v2/einvoice/ar/:qid"

	payload := strings.NewReader("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Reference\": [\n    {\n      \"Date\": \"2026-08-26\",\n      \"Number\": \"TC-1A-01\",\n      \"Type\": \"Invoice\"\n    }\n  ],\n  \"Document Type\": \"Credit Note\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1A-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Consulting services — returned\",\n      \"Line Amount\": 300,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 27,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 300\n        }\n      ],\n      \"Unit Amount\": 300,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Note\": \"Partial cancellation of TC-1A-01\",\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 300,\n    \"Sum of Line Amounts\": 300,\n    \"Tax Total\": 27,\n    \"Total\": 327,\n    \"Total incl Tax\": 327\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"afbd07a2-5fdd-4f7d-9994-9ab1335be814\"\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby 1A-03-peppol-credit-note
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/einvoice/ar/:qid")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Reference\": [\n    {\n      \"Date\": \"2026-08-26\",\n      \"Number\": \"TC-1A-01\",\n      \"Type\": \"Invoice\"\n    }\n  ],\n  \"Document Type\": \"Credit Note\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1A-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Consulting services — returned\",\n      \"Line Amount\": 300,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 27,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 300\n        }\n      ],\n      \"Unit Amount\": 300,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Note\": \"Partial cancellation of TC-1A-01\",\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 300,\n    \"Sum of Line Amounts\": 300,\n    \"Tax Total\": 27,\n    \"Total\": 327,\n    \"Total incl Tax\": 327\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"afbd07a2-5fdd-4f7d-9994-9ab1335be814\"\n}"

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

```java 1A-03-peppol-credit-note
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/einvoice/ar/:qid")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Reference\": [\n    {\n      \"Date\": \"2026-08-26\",\n      \"Number\": \"TC-1A-01\",\n      \"Type\": \"Invoice\"\n    }\n  ],\n  \"Document Type\": \"Credit Note\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1A-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Consulting services — returned\",\n      \"Line Amount\": 300,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 27,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 300\n        }\n      ],\n      \"Unit Amount\": 300,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Note\": \"Partial cancellation of TC-1A-01\",\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 300,\n    \"Sum of Line Amounts\": 300,\n    \"Tax Total\": 27,\n    \"Total\": 327,\n    \"Total incl Tax\": 327\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"afbd07a2-5fdd-4f7d-9994-9ab1335be814\"\n}")
  .asString();
```

```php 1A-03-peppol-credit-note
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/einvoice/ar/:qid', [
  'body' => '{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Currency": "SGD",
  "Document Reference": [
    {
      "Date": "2026-08-26",
      "Number": "TC-1A-01",
      "Type": "Invoice"
    }
  ],
  "Document Type": "Credit Note",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-1A-03",
  "Line Items": [
    {
      "Description": "Consulting services — returned",
      "Line Amount": 300,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 27,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 300
        }
      ],
      "Unit Amount": 300,
      "Unit of Measure": "C62"
    }
  ],
  "Note": "Partial cancellation of TC-1A-01",
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 300,
    "Sum of Line Amounts": 300,
    "Tax Total": 27,
    "Total": 327,
    "Total incl Tax": 327
  },
  "Transaction Type": "Sales",
  "UUID": "afbd07a2-5fdd-4f7d-9994-9ab1335be814"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp 1A-03-peppol-credit-note
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/einvoice/ar/:qid");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Reference\": [\n    {\n      \"Date\": \"2026-08-26\",\n      \"Number\": \"TC-1A-01\",\n      \"Type\": \"Invoice\"\n    }\n  ],\n  \"Document Type\": \"Credit Note\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1A-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Consulting services — returned\",\n      \"Line Amount\": 300,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 27,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 300\n        }\n      ],\n      \"Unit Amount\": 300,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Note\": \"Partial cancellation of TC-1A-01\",\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 300,\n    \"Sum of Line Amounts\": 300,\n    \"Tax Total\": 27,\n    \"Total\": 327,\n    \"Total incl Tax\": 327\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"afbd07a2-5fdd-4f7d-9994-9ab1335be814\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 1A-03-peppol-credit-note
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "Addon": "sg-standard",
  "Buyer": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  ],
  "Currency": "SGD",
  "Document Reference": [
    [
      "Date": "2026-08-26",
      "Number": "TC-1A-01",
      "Type": "Invoice"
    ]
  ],
  "Document Type": "Credit Note",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-1A-03",
  "Line Items": [
    [
      "Description": "Consulting services — returned",
      "Line Amount": 300,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        [
          "Tax Amount": 27,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 300
        ]
      ],
      "Unit Amount": 300,
      "Unit of Measure": "C62"
    ]
  ],
  "Note": "Partial cancellation of TC-1A-01",
  "Seller": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  ],
  "Totals": [
    "Subtotal": 300,
    "Sum of Line Amounts": 300,
    "Tax Total": 27,
    "Total": 327,
    "Total incl Tax": 327
  ],
  "Transaction Type": "Sales",
  "UUID": "afbd07a2-5fdd-4f7d-9994-9ab1335be814"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/einvoice/ar/:qid")! 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()
```

### 1A-IRAS-01-standard

**Request**

```json
{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-1AI-01",
  "Line Items": [
    {
      "Description": "Software licence",
      "Line Amount": 4000,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 360,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 4000
        }
      ],
      "Unit Amount": 4000,
      "Unit of Measure": "C62"
    }
  ],
  "PO Number": "PO-88214",
  "Payment": {
    "Due Date": "2026-09-15"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 4000,
    "Sum of Line Amounts": 4000,
    "Tax Total": 360,
    "Total": 4360,
    "Total incl Tax": 4360
  },
  "Transaction Type": "Sales",
  "UUID": "cc416630-de64-4e5e-9b36-a0f3d57a1054"
}
```

**Response**

```json
{
  "importERP": {
    "message": "[Peppol] Document creation request has been accepted.",
    "requestId": "3f8a625f-1881-438a-9d44-382fb7a6d5cd",
    "status": "SUCCESS"
  }
}
```

**SDK Code**

```python 1A-IRAS-01-standard
import requests

url = "https://api.staple.io/v2/einvoice/ar/:qid"

payload = {
    "Addon": "sg-standard",
    "Buyer": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "088541",
            "Street Name": "120 Tanjong Pagar Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Northstar Commerce Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202623458Y",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202623458Y",
        "Tax ID": "M90262345Y"
    },
    "Currency": "SGD",
    "Document Type": "Invoice",
    "Invoice Date": "2026-08-26",
    "Invoice Number": "TC-1AI-01",
    "Line Items": [
        {
            "Description": "Software licence",
            "Line Amount": 4000,
            "Line ID": "1",
            "Quantity": 1,
            "Tax Breakdown": [
                {
                    "Tax Amount": 360,
                    "Tax Category Code": "SR",
                    "Tax Rate": 9,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 4000
                }
            ],
            "Unit Amount": 4000,
            "Unit of Measure": "C62"
        }
    ],
    "PO Number": "PO-88214",
    "Payment": { "Due Date": "2026-09-15" },
    "Seller": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "068895",
            "Street Name": "71 Robinson Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Meridian Crest Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202612344K",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202612344K",
        "Tax ID": "M90261234K"
    },
    "Totals": {
        "Subtotal": 4000,
        "Sum of Line Amounts": 4000,
        "Tax Total": 360,
        "Total": 4360,
        "Total incl Tax": 4360
    },
    "Transaction Type": "Sales",
    "UUID": "cc416630-de64-4e5e-9b36-a0f3d57a1054"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 1A-IRAS-01-standard
const url = 'https://api.staple.io/v2/einvoice/ar/:qid';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"Addon":"sg-standard","Buyer":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"088541","Street Name":"120 Tanjong Pagar Road"},"Email":"atharva@staple.io","Name":"Northstar Commerce Pte. Ltd.","Peppol Endpoint ID":"SGTST202623458Y","Peppol Scheme ID":"0195","Registration Number":"202623458Y","Tax ID":"M90262345Y"},"Currency":"SGD","Document Type":"Invoice","Invoice Date":"2026-08-26","Invoice Number":"TC-1AI-01","Line Items":[{"Description":"Software licence","Line Amount":4000,"Line ID":"1","Quantity":1,"Tax Breakdown":[{"Tax Amount":360,"Tax Category Code":"SR","Tax Rate":9,"Tax Scheme":"GST","Taxable Amount":4000}],"Unit Amount":4000,"Unit of Measure":"C62"}],"PO Number":"PO-88214","Payment":{"Due Date":"2026-09-15"},"Seller":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"068895","Street Name":"71 Robinson Road"},"Email":"atharva@staple.io","Name":"Meridian Crest Pte. Ltd.","Peppol Endpoint ID":"SGTST202612344K","Peppol Scheme ID":"0195","Registration Number":"202612344K","Tax ID":"M90261234K"},"Totals":{"Subtotal":4000,"Sum of Line Amounts":4000,"Tax Total":360,"Total":4360,"Total incl Tax":4360},"Transaction Type":"Sales","UUID":"cc416630-de64-4e5e-9b36-a0f3d57a1054"}'
};

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

```go 1A-IRAS-01-standard
package main

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

func main() {

	url := "https://api.staple.io/v2/einvoice/ar/:qid"

	payload := strings.NewReader("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1AI-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Software licence\",\n      \"Line Amount\": 4000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 360,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 4000\n        }\n      ],\n      \"Unit Amount\": 4000,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"PO Number\": \"PO-88214\",\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 4000,\n    \"Sum of Line Amounts\": 4000,\n    \"Tax Total\": 360,\n    \"Total\": 4360,\n    \"Total incl Tax\": 4360\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"cc416630-de64-4e5e-9b36-a0f3d57a1054\"\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby 1A-IRAS-01-standard
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/einvoice/ar/:qid")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1AI-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Software licence\",\n      \"Line Amount\": 4000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 360,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 4000\n        }\n      ],\n      \"Unit Amount\": 4000,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"PO Number\": \"PO-88214\",\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 4000,\n    \"Sum of Line Amounts\": 4000,\n    \"Tax Total\": 360,\n    \"Total\": 4360,\n    \"Total incl Tax\": 4360\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"cc416630-de64-4e5e-9b36-a0f3d57a1054\"\n}"

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

```java 1A-IRAS-01-standard
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/einvoice/ar/:qid")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1AI-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Software licence\",\n      \"Line Amount\": 4000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 360,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 4000\n        }\n      ],\n      \"Unit Amount\": 4000,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"PO Number\": \"PO-88214\",\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 4000,\n    \"Sum of Line Amounts\": 4000,\n    \"Tax Total\": 360,\n    \"Total\": 4360,\n    \"Total incl Tax\": 4360\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"cc416630-de64-4e5e-9b36-a0f3d57a1054\"\n}")
  .asString();
```

```php 1A-IRAS-01-standard
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/einvoice/ar/:qid', [
  'body' => '{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-1AI-01",
  "Line Items": [
    {
      "Description": "Software licence",
      "Line Amount": 4000,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 360,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 4000
        }
      ],
      "Unit Amount": 4000,
      "Unit of Measure": "C62"
    }
  ],
  "PO Number": "PO-88214",
  "Payment": {
    "Due Date": "2026-09-15"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 4000,
    "Sum of Line Amounts": 4000,
    "Tax Total": 360,
    "Total": 4360,
    "Total incl Tax": 4360
  },
  "Transaction Type": "Sales",
  "UUID": "cc416630-de64-4e5e-9b36-a0f3d57a1054"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp 1A-IRAS-01-standard
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/einvoice/ar/:qid");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1AI-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Software licence\",\n      \"Line Amount\": 4000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 360,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 4000\n        }\n      ],\n      \"Unit Amount\": 4000,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"PO Number\": \"PO-88214\",\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 4000,\n    \"Sum of Line Amounts\": 4000,\n    \"Tax Total\": 360,\n    \"Total\": 4360,\n    \"Total incl Tax\": 4360\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"cc416630-de64-4e5e-9b36-a0f3d57a1054\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 1A-IRAS-01-standard
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "Addon": "sg-standard",
  "Buyer": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  ],
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-1AI-01",
  "Line Items": [
    [
      "Description": "Software licence",
      "Line Amount": 4000,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        [
          "Tax Amount": 360,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 4000
        ]
      ],
      "Unit Amount": 4000,
      "Unit of Measure": "C62"
    ]
  ],
  "PO Number": "PO-88214",
  "Payment": ["Due Date": "2026-09-15"],
  "Seller": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  ],
  "Totals": [
    "Subtotal": 4000,
    "Sum of Line Amounts": 4000,
    "Tax Total": 360,
    "Total": 4360,
    "Total incl Tax": 4360
  ],
  "Transaction Type": "Sales",
  "UUID": "cc416630-de64-4e5e-9b36-a0f3d57a1054"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/einvoice/ar/:qid")! 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()
```

### 1A-IRAS-02-foreign-currency

**Request**

```json
{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Currency": "USD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-1AI-02",
  "Line Items": [
    {
      "Description": "Advisory retainer",
      "Line Amount": 1000,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 90,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 1000
        }
      ],
      "Unit Amount": 1000,
      "Unit of Measure": "C62"
    }
  ],
  "Payment": {
    "Due Date": "2026-09-15"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 1000,
    "Subtotal in SGD": 1350,
    "Sum of Line Amounts": 1000,
    "Tax Total": 90,
    "Tax Total in SGD": 121.5,
    "Total": 1090,
    "Total incl Tax": 1090,
    "Total incl Tax in SGD": 1471.5
  },
  "Transaction Type": "Sales",
  "UUID": "4374ee14-d584-4cef-811a-d5c8bbaaf8e8"
}
```

**Response**

```json
{
  "importERP": {
    "message": "[Peppol] Document creation request has been accepted.",
    "requestId": "3f8a625f-1881-438a-9d44-382fb7a6d5cd",
    "status": "SUCCESS"
  }
}
```

**SDK Code**

```python 1A-IRAS-02-foreign-currency
import requests

url = "https://api.staple.io/v2/einvoice/ar/:qid"

payload = {
    "Addon": "sg-standard",
    "Buyer": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "088541",
            "Street Name": "120 Tanjong Pagar Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Northstar Commerce Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202623458Y",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202623458Y",
        "Tax ID": "M90262345Y"
    },
    "Currency": "USD",
    "Document Type": "Invoice",
    "Invoice Date": "2026-08-26",
    "Invoice Number": "TC-1AI-02",
    "Line Items": [
        {
            "Description": "Advisory retainer",
            "Line Amount": 1000,
            "Line ID": "1",
            "Quantity": 1,
            "Tax Breakdown": [
                {
                    "Tax Amount": 90,
                    "Tax Category Code": "SR",
                    "Tax Rate": 9,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 1000
                }
            ],
            "Unit Amount": 1000,
            "Unit of Measure": "C62"
        }
    ],
    "Payment": { "Due Date": "2026-09-15" },
    "Seller": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "068895",
            "Street Name": "71 Robinson Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Meridian Crest Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202612344K",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202612344K",
        "Tax ID": "M90261234K"
    },
    "Totals": {
        "Subtotal": 1000,
        "Subtotal in SGD": 1350,
        "Sum of Line Amounts": 1000,
        "Tax Total": 90,
        "Tax Total in SGD": 121.5,
        "Total": 1090,
        "Total incl Tax": 1090,
        "Total incl Tax in SGD": 1471.5
    },
    "Transaction Type": "Sales",
    "UUID": "4374ee14-d584-4cef-811a-d5c8bbaaf8e8"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 1A-IRAS-02-foreign-currency
const url = 'https://api.staple.io/v2/einvoice/ar/:qid';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"Addon":"sg-standard","Buyer":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"088541","Street Name":"120 Tanjong Pagar Road"},"Email":"atharva@staple.io","Name":"Northstar Commerce Pte. Ltd.","Peppol Endpoint ID":"SGTST202623458Y","Peppol Scheme ID":"0195","Registration Number":"202623458Y","Tax ID":"M90262345Y"},"Currency":"USD","Document Type":"Invoice","Invoice Date":"2026-08-26","Invoice Number":"TC-1AI-02","Line Items":[{"Description":"Advisory retainer","Line Amount":1000,"Line ID":"1","Quantity":1,"Tax Breakdown":[{"Tax Amount":90,"Tax Category Code":"SR","Tax Rate":9,"Tax Scheme":"GST","Taxable Amount":1000}],"Unit Amount":1000,"Unit of Measure":"C62"}],"Payment":{"Due Date":"2026-09-15"},"Seller":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"068895","Street Name":"71 Robinson Road"},"Email":"atharva@staple.io","Name":"Meridian Crest Pte. Ltd.","Peppol Endpoint ID":"SGTST202612344K","Peppol Scheme ID":"0195","Registration Number":"202612344K","Tax ID":"M90261234K"},"Totals":{"Subtotal":1000,"Subtotal in SGD":1350,"Sum of Line Amounts":1000,"Tax Total":90,"Tax Total in SGD":121.5,"Total":1090,"Total incl Tax":1090,"Total incl Tax in SGD":1471.5},"Transaction Type":"Sales","UUID":"4374ee14-d584-4cef-811a-d5c8bbaaf8e8"}'
};

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

```go 1A-IRAS-02-foreign-currency
package main

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

func main() {

	url := "https://api.staple.io/v2/einvoice/ar/:qid"

	payload := strings.NewReader("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"USD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1AI-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Advisory retainer\",\n      \"Line Amount\": 1000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 90,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1000\n        }\n      ],\n      \"Unit Amount\": 1000,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1000,\n    \"Subtotal in SGD\": 1350,\n    \"Sum of Line Amounts\": 1000,\n    \"Tax Total\": 90,\n    \"Tax Total in SGD\": 121.5,\n    \"Total\": 1090,\n    \"Total incl Tax\": 1090,\n    \"Total incl Tax in SGD\": 1471.5\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"4374ee14-d584-4cef-811a-d5c8bbaaf8e8\"\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby 1A-IRAS-02-foreign-currency
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/einvoice/ar/:qid")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"USD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1AI-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Advisory retainer\",\n      \"Line Amount\": 1000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 90,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1000\n        }\n      ],\n      \"Unit Amount\": 1000,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1000,\n    \"Subtotal in SGD\": 1350,\n    \"Sum of Line Amounts\": 1000,\n    \"Tax Total\": 90,\n    \"Tax Total in SGD\": 121.5,\n    \"Total\": 1090,\n    \"Total incl Tax\": 1090,\n    \"Total incl Tax in SGD\": 1471.5\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"4374ee14-d584-4cef-811a-d5c8bbaaf8e8\"\n}"

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

```java 1A-IRAS-02-foreign-currency
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/einvoice/ar/:qid")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"USD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1AI-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Advisory retainer\",\n      \"Line Amount\": 1000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 90,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1000\n        }\n      ],\n      \"Unit Amount\": 1000,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1000,\n    \"Subtotal in SGD\": 1350,\n    \"Sum of Line Amounts\": 1000,\n    \"Tax Total\": 90,\n    \"Tax Total in SGD\": 121.5,\n    \"Total\": 1090,\n    \"Total incl Tax\": 1090,\n    \"Total incl Tax in SGD\": 1471.5\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"4374ee14-d584-4cef-811a-d5c8bbaaf8e8\"\n}")
  .asString();
```

```php 1A-IRAS-02-foreign-currency
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/einvoice/ar/:qid', [
  'body' => '{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Currency": "USD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-1AI-02",
  "Line Items": [
    {
      "Description": "Advisory retainer",
      "Line Amount": 1000,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 90,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 1000
        }
      ],
      "Unit Amount": 1000,
      "Unit of Measure": "C62"
    }
  ],
  "Payment": {
    "Due Date": "2026-09-15"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 1000,
    "Subtotal in SGD": 1350,
    "Sum of Line Amounts": 1000,
    "Tax Total": 90,
    "Tax Total in SGD": 121.5,
    "Total": 1090,
    "Total incl Tax": 1090,
    "Total incl Tax in SGD": 1471.5
  },
  "Transaction Type": "Sales",
  "UUID": "4374ee14-d584-4cef-811a-d5c8bbaaf8e8"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp 1A-IRAS-02-foreign-currency
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/einvoice/ar/:qid");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"USD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1AI-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Advisory retainer\",\n      \"Line Amount\": 1000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 90,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1000\n        }\n      ],\n      \"Unit Amount\": 1000,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1000,\n    \"Subtotal in SGD\": 1350,\n    \"Sum of Line Amounts\": 1000,\n    \"Tax Total\": 90,\n    \"Tax Total in SGD\": 121.5,\n    \"Total\": 1090,\n    \"Total incl Tax\": 1090,\n    \"Total incl Tax in SGD\": 1471.5\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"4374ee14-d584-4cef-811a-d5c8bbaaf8e8\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 1A-IRAS-02-foreign-currency
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "Addon": "sg-standard",
  "Buyer": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  ],
  "Currency": "USD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-1AI-02",
  "Line Items": [
    [
      "Description": "Advisory retainer",
      "Line Amount": 1000,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        [
          "Tax Amount": 90,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 1000
        ]
      ],
      "Unit Amount": 1000,
      "Unit of Measure": "C62"
    ]
  ],
  "Payment": ["Due Date": "2026-09-15"],
  "Seller": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  ],
  "Totals": [
    "Subtotal": 1000,
    "Subtotal in SGD": 1350,
    "Sum of Line Amounts": 1000,
    "Tax Total": 90,
    "Tax Total in SGD": 121.5,
    "Total": 1090,
    "Total incl Tax": 1090,
    "Total incl Tax in SGD": 1471.5
  ],
  "Transaction Type": "Sales",
  "UUID": "4374ee14-d584-4cef-811a-d5c8bbaaf8e8"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/einvoice/ar/:qid")! 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()
```

### 1A-IRAS-03-credit-note

**Request**

```json
{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Currency": "SGD",
  "Document Reference": [
    {
      "Date": "2026-08-26",
      "Number": "TC-1AI-01",
      "Type": "Invoice"
    }
  ],
  "Document Type": "Credit Note",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-1AI-03",
  "Line Items": [
    {
      "Description": "Software licence — refund",
      "Line Amount": 1000,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 90,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 1000
        }
      ],
      "Unit Amount": 1000,
      "Unit of Measure": "C62"
    }
  ],
  "Note": "Overbilling on TC-1AI-01",
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 1000,
    "Sum of Line Amounts": 1000,
    "Tax Total": 90,
    "Total": 1090,
    "Total incl Tax": 1090
  },
  "Transaction Type": "Sales",
  "UUID": "e4ba6d86-34c6-4422-8f69-6744daa32c50"
}
```

**Response**

```json
{
  "importERP": {
    "message": "[Peppol] Document creation request has been accepted.",
    "requestId": "3f8a625f-1881-438a-9d44-382fb7a6d5cd",
    "status": "SUCCESS"
  }
}
```

**SDK Code**

```python 1A-IRAS-03-credit-note
import requests

url = "https://api.staple.io/v2/einvoice/ar/:qid"

payload = {
    "Addon": "sg-standard",
    "Buyer": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "088541",
            "Street Name": "120 Tanjong Pagar Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Northstar Commerce Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202623458Y",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202623458Y",
        "Tax ID": "M90262345Y"
    },
    "Currency": "SGD",
    "Document Reference": [
        {
            "Date": "2026-08-26",
            "Number": "TC-1AI-01",
            "Type": "Invoice"
        }
    ],
    "Document Type": "Credit Note",
    "Invoice Date": "2026-08-26",
    "Invoice Number": "TC-1AI-03",
    "Line Items": [
        {
            "Description": "Software licence — refund",
            "Line Amount": 1000,
            "Line ID": "1",
            "Quantity": 1,
            "Tax Breakdown": [
                {
                    "Tax Amount": 90,
                    "Tax Category Code": "SR",
                    "Tax Rate": 9,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 1000
                }
            ],
            "Unit Amount": 1000,
            "Unit of Measure": "C62"
        }
    ],
    "Note": "Overbilling on TC-1AI-01",
    "Seller": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "068895",
            "Street Name": "71 Robinson Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Meridian Crest Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202612344K",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202612344K",
        "Tax ID": "M90261234K"
    },
    "Totals": {
        "Subtotal": 1000,
        "Sum of Line Amounts": 1000,
        "Tax Total": 90,
        "Total": 1090,
        "Total incl Tax": 1090
    },
    "Transaction Type": "Sales",
    "UUID": "e4ba6d86-34c6-4422-8f69-6744daa32c50"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 1A-IRAS-03-credit-note
const url = 'https://api.staple.io/v2/einvoice/ar/:qid';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"Addon":"sg-standard","Buyer":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"088541","Street Name":"120 Tanjong Pagar Road"},"Email":"atharva@staple.io","Name":"Northstar Commerce Pte. Ltd.","Peppol Endpoint ID":"SGTST202623458Y","Peppol Scheme ID":"0195","Registration Number":"202623458Y","Tax ID":"M90262345Y"},"Currency":"SGD","Document Reference":[{"Date":"2026-08-26","Number":"TC-1AI-01","Type":"Invoice"}],"Document Type":"Credit Note","Invoice Date":"2026-08-26","Invoice Number":"TC-1AI-03","Line Items":[{"Description":"Software licence — refund","Line Amount":1000,"Line ID":"1","Quantity":1,"Tax Breakdown":[{"Tax Amount":90,"Tax Category Code":"SR","Tax Rate":9,"Tax Scheme":"GST","Taxable Amount":1000}],"Unit Amount":1000,"Unit of Measure":"C62"}],"Note":"Overbilling on TC-1AI-01","Seller":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"068895","Street Name":"71 Robinson Road"},"Email":"atharva@staple.io","Name":"Meridian Crest Pte. Ltd.","Peppol Endpoint ID":"SGTST202612344K","Peppol Scheme ID":"0195","Registration Number":"202612344K","Tax ID":"M90261234K"},"Totals":{"Subtotal":1000,"Sum of Line Amounts":1000,"Tax Total":90,"Total":1090,"Total incl Tax":1090},"Transaction Type":"Sales","UUID":"e4ba6d86-34c6-4422-8f69-6744daa32c50"}'
};

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

```go 1A-IRAS-03-credit-note
package main

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

func main() {

	url := "https://api.staple.io/v2/einvoice/ar/:qid"

	payload := strings.NewReader("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Reference\": [\n    {\n      \"Date\": \"2026-08-26\",\n      \"Number\": \"TC-1AI-01\",\n      \"Type\": \"Invoice\"\n    }\n  ],\n  \"Document Type\": \"Credit Note\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1AI-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Software licence — refund\",\n      \"Line Amount\": 1000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 90,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1000\n        }\n      ],\n      \"Unit Amount\": 1000,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Note\": \"Overbilling on TC-1AI-01\",\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1000,\n    \"Sum of Line Amounts\": 1000,\n    \"Tax Total\": 90,\n    \"Total\": 1090,\n    \"Total incl Tax\": 1090\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"e4ba6d86-34c6-4422-8f69-6744daa32c50\"\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby 1A-IRAS-03-credit-note
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/einvoice/ar/:qid")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Reference\": [\n    {\n      \"Date\": \"2026-08-26\",\n      \"Number\": \"TC-1AI-01\",\n      \"Type\": \"Invoice\"\n    }\n  ],\n  \"Document Type\": \"Credit Note\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1AI-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Software licence — refund\",\n      \"Line Amount\": 1000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 90,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1000\n        }\n      ],\n      \"Unit Amount\": 1000,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Note\": \"Overbilling on TC-1AI-01\",\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1000,\n    \"Sum of Line Amounts\": 1000,\n    \"Tax Total\": 90,\n    \"Total\": 1090,\n    \"Total incl Tax\": 1090\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"e4ba6d86-34c6-4422-8f69-6744daa32c50\"\n}"

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

```java 1A-IRAS-03-credit-note
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/einvoice/ar/:qid")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Reference\": [\n    {\n      \"Date\": \"2026-08-26\",\n      \"Number\": \"TC-1AI-01\",\n      \"Type\": \"Invoice\"\n    }\n  ],\n  \"Document Type\": \"Credit Note\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1AI-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Software licence — refund\",\n      \"Line Amount\": 1000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 90,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1000\n        }\n      ],\n      \"Unit Amount\": 1000,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Note\": \"Overbilling on TC-1AI-01\",\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1000,\n    \"Sum of Line Amounts\": 1000,\n    \"Tax Total\": 90,\n    \"Total\": 1090,\n    \"Total incl Tax\": 1090\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"e4ba6d86-34c6-4422-8f69-6744daa32c50\"\n}")
  .asString();
```

```php 1A-IRAS-03-credit-note
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/einvoice/ar/:qid', [
  'body' => '{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Currency": "SGD",
  "Document Reference": [
    {
      "Date": "2026-08-26",
      "Number": "TC-1AI-01",
      "Type": "Invoice"
    }
  ],
  "Document Type": "Credit Note",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-1AI-03",
  "Line Items": [
    {
      "Description": "Software licence — refund",
      "Line Amount": 1000,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 90,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 1000
        }
      ],
      "Unit Amount": 1000,
      "Unit of Measure": "C62"
    }
  ],
  "Note": "Overbilling on TC-1AI-01",
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 1000,
    "Sum of Line Amounts": 1000,
    "Tax Total": 90,
    "Total": 1090,
    "Total incl Tax": 1090
  },
  "Transaction Type": "Sales",
  "UUID": "e4ba6d86-34c6-4422-8f69-6744daa32c50"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp 1A-IRAS-03-credit-note
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/einvoice/ar/:qid");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Reference\": [\n    {\n      \"Date\": \"2026-08-26\",\n      \"Number\": \"TC-1AI-01\",\n      \"Type\": \"Invoice\"\n    }\n  ],\n  \"Document Type\": \"Credit Note\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-1AI-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Software licence — refund\",\n      \"Line Amount\": 1000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 90,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1000\n        }\n      ],\n      \"Unit Amount\": 1000,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Note\": \"Overbilling on TC-1AI-01\",\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1000,\n    \"Sum of Line Amounts\": 1000,\n    \"Tax Total\": 90,\n    \"Total\": 1090,\n    \"Total incl Tax\": 1090\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"e4ba6d86-34c6-4422-8f69-6744daa32c50\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 1A-IRAS-03-credit-note
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "Addon": "sg-standard",
  "Buyer": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  ],
  "Currency": "SGD",
  "Document Reference": [
    [
      "Date": "2026-08-26",
      "Number": "TC-1AI-01",
      "Type": "Invoice"
    ]
  ],
  "Document Type": "Credit Note",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-1AI-03",
  "Line Items": [
    [
      "Description": "Software licence — refund",
      "Line Amount": 1000,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        [
          "Tax Amount": 90,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 1000
        ]
      ],
      "Unit Amount": 1000,
      "Unit of Measure": "C62"
    ]
  ],
  "Note": "Overbilling on TC-1AI-01",
  "Seller": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  ],
  "Totals": [
    "Subtotal": 1000,
    "Sum of Line Amounts": 1000,
    "Tax Total": 90,
    "Total": 1090,
    "Total incl Tax": 1090
  ],
  "Transaction Type": "Sales",
  "UUID": "e4ba6d86-34c6-4422-8f69-6744daa32c50"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/einvoice/ar/:qid")! 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()
```

### 2A-01-sales-standard

**Request**

```json
{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-2A-01",
  "Line Items": [
    {
      "Description": "Design services",
      "Line Amount": 2500,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 225,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 2500
        }
      ],
      "Unit Amount": 2500,
      "Unit of Measure": "C62"
    }
  ],
  "Payment": {
    "Due Date": "2026-09-15"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 2500,
    "Sum of Line Amounts": 2500,
    "Tax Total": 225,
    "Total": 2725,
    "Total incl Tax": 2725
  },
  "Transaction Type": "Sales",
  "UUID": "d4246a12-ca5d-42ba-a91b-a000d9554ac8"
}
```

**Response**

```json
{
  "importERP": {
    "message": "[Peppol] Document creation request has been accepted.",
    "requestId": "3f8a625f-1881-438a-9d44-382fb7a6d5cd",
    "status": "SUCCESS"
  }
}
```

**SDK Code**

```python 2A-01-sales-standard
import requests

url = "https://api.staple.io/v2/einvoice/ar/:qid"

payload = {
    "Addon": "sg-standard",
    "Buyer": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "088541",
            "Street Name": "120 Tanjong Pagar Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Northstar Commerce Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202623458Y",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202623458Y",
        "Tax ID": "M90262345Y"
    },
    "Currency": "SGD",
    "Document Type": "Invoice",
    "Invoice Date": "2026-08-26",
    "Invoice Number": "TC-2A-01",
    "Line Items": [
        {
            "Description": "Design services",
            "Line Amount": 2500,
            "Line ID": "1",
            "Quantity": 1,
            "Tax Breakdown": [
                {
                    "Tax Amount": 225,
                    "Tax Category Code": "SR",
                    "Tax Rate": 9,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 2500
                }
            ],
            "Unit Amount": 2500,
            "Unit of Measure": "C62"
        }
    ],
    "Payment": { "Due Date": "2026-09-15" },
    "Seller": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "068895",
            "Street Name": "71 Robinson Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Meridian Crest Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202612344K",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202612344K",
        "Tax ID": "M90261234K"
    },
    "Totals": {
        "Subtotal": 2500,
        "Sum of Line Amounts": 2500,
        "Tax Total": 225,
        "Total": 2725,
        "Total incl Tax": 2725
    },
    "Transaction Type": "Sales",
    "UUID": "d4246a12-ca5d-42ba-a91b-a000d9554ac8"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 2A-01-sales-standard
const url = 'https://api.staple.io/v2/einvoice/ar/:qid';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"Addon":"sg-standard","Buyer":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"088541","Street Name":"120 Tanjong Pagar Road"},"Email":"atharva@staple.io","Name":"Northstar Commerce Pte. Ltd.","Peppol Endpoint ID":"SGTST202623458Y","Peppol Scheme ID":"0195","Registration Number":"202623458Y","Tax ID":"M90262345Y"},"Currency":"SGD","Document Type":"Invoice","Invoice Date":"2026-08-26","Invoice Number":"TC-2A-01","Line Items":[{"Description":"Design services","Line Amount":2500,"Line ID":"1","Quantity":1,"Tax Breakdown":[{"Tax Amount":225,"Tax Category Code":"SR","Tax Rate":9,"Tax Scheme":"GST","Taxable Amount":2500}],"Unit Amount":2500,"Unit of Measure":"C62"}],"Payment":{"Due Date":"2026-09-15"},"Seller":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"068895","Street Name":"71 Robinson Road"},"Email":"atharva@staple.io","Name":"Meridian Crest Pte. Ltd.","Peppol Endpoint ID":"SGTST202612344K","Peppol Scheme ID":"0195","Registration Number":"202612344K","Tax ID":"M90261234K"},"Totals":{"Subtotal":2500,"Sum of Line Amounts":2500,"Tax Total":225,"Total":2725,"Total incl Tax":2725},"Transaction Type":"Sales","UUID":"d4246a12-ca5d-42ba-a91b-a000d9554ac8"}'
};

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

```go 2A-01-sales-standard
package main

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

func main() {

	url := "https://api.staple.io/v2/einvoice/ar/:qid"

	payload := strings.NewReader("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2A-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Design services\",\n      \"Line Amount\": 2500,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 225,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 2500\n        }\n      ],\n      \"Unit Amount\": 2500,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 2500,\n    \"Sum of Line Amounts\": 2500,\n    \"Tax Total\": 225,\n    \"Total\": 2725,\n    \"Total incl Tax\": 2725\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"d4246a12-ca5d-42ba-a91b-a000d9554ac8\"\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby 2A-01-sales-standard
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/einvoice/ar/:qid")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2A-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Design services\",\n      \"Line Amount\": 2500,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 225,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 2500\n        }\n      ],\n      \"Unit Amount\": 2500,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 2500,\n    \"Sum of Line Amounts\": 2500,\n    \"Tax Total\": 225,\n    \"Total\": 2725,\n    \"Total incl Tax\": 2725\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"d4246a12-ca5d-42ba-a91b-a000d9554ac8\"\n}"

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

```java 2A-01-sales-standard
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/einvoice/ar/:qid")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2A-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Design services\",\n      \"Line Amount\": 2500,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 225,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 2500\n        }\n      ],\n      \"Unit Amount\": 2500,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 2500,\n    \"Sum of Line Amounts\": 2500,\n    \"Tax Total\": 225,\n    \"Total\": 2725,\n    \"Total incl Tax\": 2725\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"d4246a12-ca5d-42ba-a91b-a000d9554ac8\"\n}")
  .asString();
```

```php 2A-01-sales-standard
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/einvoice/ar/:qid', [
  'body' => '{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-2A-01",
  "Line Items": [
    {
      "Description": "Design services",
      "Line Amount": 2500,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 225,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 2500
        }
      ],
      "Unit Amount": 2500,
      "Unit of Measure": "C62"
    }
  ],
  "Payment": {
    "Due Date": "2026-09-15"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 2500,
    "Sum of Line Amounts": 2500,
    "Tax Total": 225,
    "Total": 2725,
    "Total incl Tax": 2725
  },
  "Transaction Type": "Sales",
  "UUID": "d4246a12-ca5d-42ba-a91b-a000d9554ac8"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp 2A-01-sales-standard
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/einvoice/ar/:qid");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2A-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Design services\",\n      \"Line Amount\": 2500,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 225,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 2500\n        }\n      ],\n      \"Unit Amount\": 2500,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 2500,\n    \"Sum of Line Amounts\": 2500,\n    \"Tax Total\": 225,\n    \"Total\": 2725,\n    \"Total incl Tax\": 2725\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"d4246a12-ca5d-42ba-a91b-a000d9554ac8\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 2A-01-sales-standard
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "Addon": "sg-standard",
  "Buyer": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  ],
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-2A-01",
  "Line Items": [
    [
      "Description": "Design services",
      "Line Amount": 2500,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        [
          "Tax Amount": 225,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 2500
        ]
      ],
      "Unit Amount": 2500,
      "Unit of Measure": "C62"
    ]
  ],
  "Payment": ["Due Date": "2026-09-15"],
  "Seller": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  ],
  "Totals": [
    "Subtotal": 2500,
    "Sum of Line Amounts": 2500,
    "Tax Total": 225,
    "Total": 2725,
    "Total incl Tax": 2725
  ],
  "Transaction Type": "Sales",
  "UUID": "d4246a12-ca5d-42ba-a91b-a000d9554ac8"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/einvoice/ar/:qid")! 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()
```

### 2A-02-sales-zero-rated

**Request**

```json
{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-2A-02",
  "Line Items": [
    {
      "Description": "Export of goods",
      "Line Amount": 1200,
      "Line ID": "1",
      "Quantity": 10,
      "Tax Breakdown": [
        {
          "Tax Amount": 0,
          "Tax Category Code": "ZR",
          "Tax Rate": 0,
          "Tax Scheme": "GST",
          "Taxable Amount": 1200
        }
      ],
      "Unit Amount": 120,
      "Unit of Measure": "KGM"
    }
  ],
  "Payment": {
    "Due Date": "2026-09-15"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 1200,
    "Sum of Line Amounts": 1200,
    "Tax Total": 0,
    "Total": 1200,
    "Total incl Tax": 1200
  },
  "Transaction Type": "Sales",
  "UUID": "86744f1b-058b-4abe-8aab-48fb93d9b262"
}
```

**Response**

```json
{
  "importERP": {
    "message": "[Peppol] Document creation request has been accepted.",
    "requestId": "3f8a625f-1881-438a-9d44-382fb7a6d5cd",
    "status": "SUCCESS"
  }
}
```

**SDK Code**

```python 2A-02-sales-zero-rated
import requests

url = "https://api.staple.io/v2/einvoice/ar/:qid"

payload = {
    "Addon": "sg-standard",
    "Buyer": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "088541",
            "Street Name": "120 Tanjong Pagar Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Northstar Commerce Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202623458Y",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202623458Y",
        "Tax ID": "M90262345Y"
    },
    "Currency": "SGD",
    "Document Type": "Invoice",
    "Invoice Date": "2026-08-26",
    "Invoice Number": "TC-2A-02",
    "Line Items": [
        {
            "Description": "Export of goods",
            "Line Amount": 1200,
            "Line ID": "1",
            "Quantity": 10,
            "Tax Breakdown": [
                {
                    "Tax Amount": 0,
                    "Tax Category Code": "ZR",
                    "Tax Rate": 0,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 1200
                }
            ],
            "Unit Amount": 120,
            "Unit of Measure": "KGM"
        }
    ],
    "Payment": { "Due Date": "2026-09-15" },
    "Seller": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "068895",
            "Street Name": "71 Robinson Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Meridian Crest Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202612344K",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202612344K",
        "Tax ID": "M90261234K"
    },
    "Totals": {
        "Subtotal": 1200,
        "Sum of Line Amounts": 1200,
        "Tax Total": 0,
        "Total": 1200,
        "Total incl Tax": 1200
    },
    "Transaction Type": "Sales",
    "UUID": "86744f1b-058b-4abe-8aab-48fb93d9b262"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 2A-02-sales-zero-rated
const url = 'https://api.staple.io/v2/einvoice/ar/:qid';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"Addon":"sg-standard","Buyer":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"088541","Street Name":"120 Tanjong Pagar Road"},"Email":"atharva@staple.io","Name":"Northstar Commerce Pte. Ltd.","Peppol Endpoint ID":"SGTST202623458Y","Peppol Scheme ID":"0195","Registration Number":"202623458Y","Tax ID":"M90262345Y"},"Currency":"SGD","Document Type":"Invoice","Invoice Date":"2026-08-26","Invoice Number":"TC-2A-02","Line Items":[{"Description":"Export of goods","Line Amount":1200,"Line ID":"1","Quantity":10,"Tax Breakdown":[{"Tax Amount":0,"Tax Category Code":"ZR","Tax Rate":0,"Tax Scheme":"GST","Taxable Amount":1200}],"Unit Amount":120,"Unit of Measure":"KGM"}],"Payment":{"Due Date":"2026-09-15"},"Seller":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"068895","Street Name":"71 Robinson Road"},"Email":"atharva@staple.io","Name":"Meridian Crest Pte. Ltd.","Peppol Endpoint ID":"SGTST202612344K","Peppol Scheme ID":"0195","Registration Number":"202612344K","Tax ID":"M90261234K"},"Totals":{"Subtotal":1200,"Sum of Line Amounts":1200,"Tax Total":0,"Total":1200,"Total incl Tax":1200},"Transaction Type":"Sales","UUID":"86744f1b-058b-4abe-8aab-48fb93d9b262"}'
};

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

```go 2A-02-sales-zero-rated
package main

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

func main() {

	url := "https://api.staple.io/v2/einvoice/ar/:qid"

	payload := strings.NewReader("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2A-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Export of goods\",\n      \"Line Amount\": 1200,\n      \"Line ID\": \"1\",\n      \"Quantity\": 10,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 0,\n          \"Tax Category Code\": \"ZR\",\n          \"Tax Rate\": 0,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1200\n        }\n      ],\n      \"Unit Amount\": 120,\n      \"Unit of Measure\": \"KGM\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1200,\n    \"Sum of Line Amounts\": 1200,\n    \"Tax Total\": 0,\n    \"Total\": 1200,\n    \"Total incl Tax\": 1200\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"86744f1b-058b-4abe-8aab-48fb93d9b262\"\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby 2A-02-sales-zero-rated
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/einvoice/ar/:qid")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2A-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Export of goods\",\n      \"Line Amount\": 1200,\n      \"Line ID\": \"1\",\n      \"Quantity\": 10,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 0,\n          \"Tax Category Code\": \"ZR\",\n          \"Tax Rate\": 0,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1200\n        }\n      ],\n      \"Unit Amount\": 120,\n      \"Unit of Measure\": \"KGM\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1200,\n    \"Sum of Line Amounts\": 1200,\n    \"Tax Total\": 0,\n    \"Total\": 1200,\n    \"Total incl Tax\": 1200\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"86744f1b-058b-4abe-8aab-48fb93d9b262\"\n}"

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

```java 2A-02-sales-zero-rated
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/einvoice/ar/:qid")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2A-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Export of goods\",\n      \"Line Amount\": 1200,\n      \"Line ID\": \"1\",\n      \"Quantity\": 10,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 0,\n          \"Tax Category Code\": \"ZR\",\n          \"Tax Rate\": 0,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1200\n        }\n      ],\n      \"Unit Amount\": 120,\n      \"Unit of Measure\": \"KGM\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1200,\n    \"Sum of Line Amounts\": 1200,\n    \"Tax Total\": 0,\n    \"Total\": 1200,\n    \"Total incl Tax\": 1200\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"86744f1b-058b-4abe-8aab-48fb93d9b262\"\n}")
  .asString();
```

```php 2A-02-sales-zero-rated
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/einvoice/ar/:qid', [
  'body' => '{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-2A-02",
  "Line Items": [
    {
      "Description": "Export of goods",
      "Line Amount": 1200,
      "Line ID": "1",
      "Quantity": 10,
      "Tax Breakdown": [
        {
          "Tax Amount": 0,
          "Tax Category Code": "ZR",
          "Tax Rate": 0,
          "Tax Scheme": "GST",
          "Taxable Amount": 1200
        }
      ],
      "Unit Amount": 120,
      "Unit of Measure": "KGM"
    }
  ],
  "Payment": {
    "Due Date": "2026-09-15"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 1200,
    "Sum of Line Amounts": 1200,
    "Tax Total": 0,
    "Total": 1200,
    "Total incl Tax": 1200
  },
  "Transaction Type": "Sales",
  "UUID": "86744f1b-058b-4abe-8aab-48fb93d9b262"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp 2A-02-sales-zero-rated
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/einvoice/ar/:qid");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2A-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Export of goods\",\n      \"Line Amount\": 1200,\n      \"Line ID\": \"1\",\n      \"Quantity\": 10,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 0,\n          \"Tax Category Code\": \"ZR\",\n          \"Tax Rate\": 0,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1200\n        }\n      ],\n      \"Unit Amount\": 120,\n      \"Unit of Measure\": \"KGM\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1200,\n    \"Sum of Line Amounts\": 1200,\n    \"Tax Total\": 0,\n    \"Total\": 1200,\n    \"Total incl Tax\": 1200\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"86744f1b-058b-4abe-8aab-48fb93d9b262\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 2A-02-sales-zero-rated
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "Addon": "sg-standard",
  "Buyer": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  ],
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-2A-02",
  "Line Items": [
    [
      "Description": "Export of goods",
      "Line Amount": 1200,
      "Line ID": "1",
      "Quantity": 10,
      "Tax Breakdown": [
        [
          "Tax Amount": 0,
          "Tax Category Code": "ZR",
          "Tax Rate": 0,
          "Tax Scheme": "GST",
          "Taxable Amount": 1200
        ]
      ],
      "Unit Amount": 120,
      "Unit of Measure": "KGM"
    ]
  ],
  "Payment": ["Due Date": "2026-09-15"],
  "Seller": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  ],
  "Totals": [
    "Subtotal": 1200,
    "Sum of Line Amounts": 1200,
    "Tax Total": 0,
    "Total": 1200,
    "Total incl Tax": 1200
  ],
  "Transaction Type": "Sales",
  "UUID": "86744f1b-058b-4abe-8aab-48fb93d9b262"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/einvoice/ar/:qid")! 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()
```

### 2A-03-sales-credit-note

**Request**

```json
{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Currency": "SGD",
  "Document Reference": [
    {
      "Date": "2026-08-26",
      "Number": "TC-2A-01",
      "Type": "Invoice"
    }
  ],
  "Document Type": "Credit Note",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-2A-03",
  "Line Items": [
    {
      "Description": "Design services — rebate",
      "Line Amount": 250,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 22.5,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 250
        }
      ],
      "Unit Amount": 250,
      "Unit of Measure": "C62"
    }
  ],
  "Note": "Volume rebate on TC-2A-01",
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 250,
    "Sum of Line Amounts": 250,
    "Tax Total": 22.5,
    "Total": 272.5,
    "Total incl Tax": 272.5
  },
  "Transaction Type": "Sales",
  "UUID": "f9378088-3d16-41b8-bb80-fc47e30fa102"
}
```

**Response**

```json
{
  "importERP": {
    "message": "[Peppol] Document creation request has been accepted.",
    "requestId": "3f8a625f-1881-438a-9d44-382fb7a6d5cd",
    "status": "SUCCESS"
  }
}
```

**SDK Code**

```python 2A-03-sales-credit-note
import requests

url = "https://api.staple.io/v2/einvoice/ar/:qid"

payload = {
    "Addon": "sg-standard",
    "Buyer": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "088541",
            "Street Name": "120 Tanjong Pagar Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Northstar Commerce Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202623458Y",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202623458Y",
        "Tax ID": "M90262345Y"
    },
    "Currency": "SGD",
    "Document Reference": [
        {
            "Date": "2026-08-26",
            "Number": "TC-2A-01",
            "Type": "Invoice"
        }
    ],
    "Document Type": "Credit Note",
    "Invoice Date": "2026-08-26",
    "Invoice Number": "TC-2A-03",
    "Line Items": [
        {
            "Description": "Design services — rebate",
            "Line Amount": 250,
            "Line ID": "1",
            "Quantity": 1,
            "Tax Breakdown": [
                {
                    "Tax Amount": 22.5,
                    "Tax Category Code": "SR",
                    "Tax Rate": 9,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 250
                }
            ],
            "Unit Amount": 250,
            "Unit of Measure": "C62"
        }
    ],
    "Note": "Volume rebate on TC-2A-01",
    "Seller": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "068895",
            "Street Name": "71 Robinson Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Meridian Crest Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202612344K",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202612344K",
        "Tax ID": "M90261234K"
    },
    "Totals": {
        "Subtotal": 250,
        "Sum of Line Amounts": 250,
        "Tax Total": 22.5,
        "Total": 272.5,
        "Total incl Tax": 272.5
    },
    "Transaction Type": "Sales",
    "UUID": "f9378088-3d16-41b8-bb80-fc47e30fa102"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 2A-03-sales-credit-note
const url = 'https://api.staple.io/v2/einvoice/ar/:qid';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"Addon":"sg-standard","Buyer":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"088541","Street Name":"120 Tanjong Pagar Road"},"Email":"atharva@staple.io","Name":"Northstar Commerce Pte. Ltd.","Peppol Endpoint ID":"SGTST202623458Y","Peppol Scheme ID":"0195","Registration Number":"202623458Y","Tax ID":"M90262345Y"},"Currency":"SGD","Document Reference":[{"Date":"2026-08-26","Number":"TC-2A-01","Type":"Invoice"}],"Document Type":"Credit Note","Invoice Date":"2026-08-26","Invoice Number":"TC-2A-03","Line Items":[{"Description":"Design services — rebate","Line Amount":250,"Line ID":"1","Quantity":1,"Tax Breakdown":[{"Tax Amount":22.5,"Tax Category Code":"SR","Tax Rate":9,"Tax Scheme":"GST","Taxable Amount":250}],"Unit Amount":250,"Unit of Measure":"C62"}],"Note":"Volume rebate on TC-2A-01","Seller":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"068895","Street Name":"71 Robinson Road"},"Email":"atharva@staple.io","Name":"Meridian Crest Pte. Ltd.","Peppol Endpoint ID":"SGTST202612344K","Peppol Scheme ID":"0195","Registration Number":"202612344K","Tax ID":"M90261234K"},"Totals":{"Subtotal":250,"Sum of Line Amounts":250,"Tax Total":22.5,"Total":272.5,"Total incl Tax":272.5},"Transaction Type":"Sales","UUID":"f9378088-3d16-41b8-bb80-fc47e30fa102"}'
};

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

```go 2A-03-sales-credit-note
package main

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

func main() {

	url := "https://api.staple.io/v2/einvoice/ar/:qid"

	payload := strings.NewReader("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Reference\": [\n    {\n      \"Date\": \"2026-08-26\",\n      \"Number\": \"TC-2A-01\",\n      \"Type\": \"Invoice\"\n    }\n  ],\n  \"Document Type\": \"Credit Note\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2A-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Design services — rebate\",\n      \"Line Amount\": 250,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 22.5,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 250\n        }\n      ],\n      \"Unit Amount\": 250,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Note\": \"Volume rebate on TC-2A-01\",\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 250,\n    \"Sum of Line Amounts\": 250,\n    \"Tax Total\": 22.5,\n    \"Total\": 272.5,\n    \"Total incl Tax\": 272.5\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"f9378088-3d16-41b8-bb80-fc47e30fa102\"\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby 2A-03-sales-credit-note
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/einvoice/ar/:qid")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Reference\": [\n    {\n      \"Date\": \"2026-08-26\",\n      \"Number\": \"TC-2A-01\",\n      \"Type\": \"Invoice\"\n    }\n  ],\n  \"Document Type\": \"Credit Note\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2A-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Design services — rebate\",\n      \"Line Amount\": 250,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 22.5,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 250\n        }\n      ],\n      \"Unit Amount\": 250,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Note\": \"Volume rebate on TC-2A-01\",\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 250,\n    \"Sum of Line Amounts\": 250,\n    \"Tax Total\": 22.5,\n    \"Total\": 272.5,\n    \"Total incl Tax\": 272.5\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"f9378088-3d16-41b8-bb80-fc47e30fa102\"\n}"

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

```java 2A-03-sales-credit-note
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/einvoice/ar/:qid")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Reference\": [\n    {\n      \"Date\": \"2026-08-26\",\n      \"Number\": \"TC-2A-01\",\n      \"Type\": \"Invoice\"\n    }\n  ],\n  \"Document Type\": \"Credit Note\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2A-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Design services — rebate\",\n      \"Line Amount\": 250,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 22.5,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 250\n        }\n      ],\n      \"Unit Amount\": 250,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Note\": \"Volume rebate on TC-2A-01\",\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 250,\n    \"Sum of Line Amounts\": 250,\n    \"Tax Total\": 22.5,\n    \"Total\": 272.5,\n    \"Total incl Tax\": 272.5\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"f9378088-3d16-41b8-bb80-fc47e30fa102\"\n}")
  .asString();
```

```php 2A-03-sales-credit-note
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/einvoice/ar/:qid', [
  'body' => '{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Currency": "SGD",
  "Document Reference": [
    {
      "Date": "2026-08-26",
      "Number": "TC-2A-01",
      "Type": "Invoice"
    }
  ],
  "Document Type": "Credit Note",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-2A-03",
  "Line Items": [
    {
      "Description": "Design services — rebate",
      "Line Amount": 250,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 22.5,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 250
        }
      ],
      "Unit Amount": 250,
      "Unit of Measure": "C62"
    }
  ],
  "Note": "Volume rebate on TC-2A-01",
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 250,
    "Sum of Line Amounts": 250,
    "Tax Total": 22.5,
    "Total": 272.5,
    "Total incl Tax": 272.5
  },
  "Transaction Type": "Sales",
  "UUID": "f9378088-3d16-41b8-bb80-fc47e30fa102"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp 2A-03-sales-credit-note
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/einvoice/ar/:qid");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Reference\": [\n    {\n      \"Date\": \"2026-08-26\",\n      \"Number\": \"TC-2A-01\",\n      \"Type\": \"Invoice\"\n    }\n  ],\n  \"Document Type\": \"Credit Note\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2A-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Design services — rebate\",\n      \"Line Amount\": 250,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 22.5,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 250\n        }\n      ],\n      \"Unit Amount\": 250,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Note\": \"Volume rebate on TC-2A-01\",\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 250,\n    \"Sum of Line Amounts\": 250,\n    \"Tax Total\": 22.5,\n    \"Total\": 272.5,\n    \"Total incl Tax\": 272.5\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"f9378088-3d16-41b8-bb80-fc47e30fa102\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 2A-03-sales-credit-note
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "Addon": "sg-standard",
  "Buyer": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  ],
  "Currency": "SGD",
  "Document Reference": [
    [
      "Date": "2026-08-26",
      "Number": "TC-2A-01",
      "Type": "Invoice"
    ]
  ],
  "Document Type": "Credit Note",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-2A-03",
  "Line Items": [
    [
      "Description": "Design services — rebate",
      "Line Amount": 250,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        [
          "Tax Amount": 22.5,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 250
        ]
      ],
      "Unit Amount": 250,
      "Unit of Measure": "C62"
    ]
  ],
  "Note": "Volume rebate on TC-2A-01",
  "Seller": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  ],
  "Totals": [
    "Subtotal": 250,
    "Sum of Line Amounts": 250,
    "Tax Total": 22.5,
    "Total": 272.5,
    "Total incl Tax": 272.5
  ],
  "Transaction Type": "Sales",
  "UUID": "f9378088-3d16-41b8-bb80-fc47e30fa102"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/einvoice/ar/:qid")! 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()
```

### 2B-01-pos-single-tax

**Request**

```json
{
  "Addon": "sg-aggregated",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "NA",
      "Street Name": "NA"
    },
    "Name": "POS",
    "Peppol Endpoint ID": "POS",
    "Peppol Scheme ID": "0195",
    "Registration Number": "POS"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-2B-01",
  "Line Items": [
    {
      "Description": "POS",
      "Line Amount": 8000,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 720,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 8000
        }
      ],
      "Unit Amount": 8000,
      "Unit of Measure": "XLT"
    }
  ],
  "Note": "POS sales 1-26 Aug 2026",
  "Period": {
    "End Date": "2026-08-26",
    "Start Date": "2026-08-01"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 8000,
    "Sum of Line Amounts": 8000,
    "Tax Total": 720,
    "Total": 8720,
    "Total incl Tax": 8720
  },
  "Transaction Type": "Sales",
  "UUID": "e49ebc1f-df82-4aa2-a778-5a2bc5a0500f"
}
```

**Response**

```json
{
  "importERP": {
    "message": "[Peppol] Document creation request has been accepted.",
    "requestId": "3f8a625f-1881-438a-9d44-382fb7a6d5cd",
    "status": "SUCCESS"
  }
}
```

**SDK Code**

```python 2B-01-pos-single-tax
import requests

url = "https://api.staple.io/v2/einvoice/ar/:qid"

payload = {
    "Addon": "sg-aggregated",
    "Buyer": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "NA",
            "Street Name": "NA"
        },
        "Name": "POS",
        "Peppol Endpoint ID": "POS",
        "Peppol Scheme ID": "0195",
        "Registration Number": "POS"
    },
    "Currency": "SGD",
    "Document Type": "Invoice",
    "Invoice Date": "2026-08-26",
    "Invoice Number": "TC-2B-01",
    "Line Items": [
        {
            "Description": "POS",
            "Line Amount": 8000,
            "Line ID": "1",
            "Quantity": 1,
            "Tax Breakdown": [
                {
                    "Tax Amount": 720,
                    "Tax Category Code": "SR",
                    "Tax Rate": 9,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 8000
                }
            ],
            "Unit Amount": 8000,
            "Unit of Measure": "XLT"
        }
    ],
    "Note": "POS sales 1-26 Aug 2026",
    "Period": {
        "End Date": "2026-08-26",
        "Start Date": "2026-08-01"
    },
    "Seller": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "068895",
            "Street Name": "71 Robinson Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Meridian Crest Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202612344K",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202612344K",
        "Tax ID": "M90261234K"
    },
    "Totals": {
        "Subtotal": 8000,
        "Sum of Line Amounts": 8000,
        "Tax Total": 720,
        "Total": 8720,
        "Total incl Tax": 8720
    },
    "Transaction Type": "Sales",
    "UUID": "e49ebc1f-df82-4aa2-a778-5a2bc5a0500f"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 2B-01-pos-single-tax
const url = 'https://api.staple.io/v2/einvoice/ar/:qid';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"Addon":"sg-aggregated","Buyer":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"NA","Street Name":"NA"},"Name":"POS","Peppol Endpoint ID":"POS","Peppol Scheme ID":"0195","Registration Number":"POS"},"Currency":"SGD","Document Type":"Invoice","Invoice Date":"2026-08-26","Invoice Number":"TC-2B-01","Line Items":[{"Description":"POS","Line Amount":8000,"Line ID":"1","Quantity":1,"Tax Breakdown":[{"Tax Amount":720,"Tax Category Code":"SR","Tax Rate":9,"Tax Scheme":"GST","Taxable Amount":8000}],"Unit Amount":8000,"Unit of Measure":"XLT"}],"Note":"POS sales 1-26 Aug 2026","Period":{"End Date":"2026-08-26","Start Date":"2026-08-01"},"Seller":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"068895","Street Name":"71 Robinson Road"},"Email":"atharva@staple.io","Name":"Meridian Crest Pte. Ltd.","Peppol Endpoint ID":"SGTST202612344K","Peppol Scheme ID":"0195","Registration Number":"202612344K","Tax ID":"M90261234K"},"Totals":{"Subtotal":8000,"Sum of Line Amounts":8000,"Tax Total":720,"Total":8720,"Total incl Tax":8720},"Transaction Type":"Sales","UUID":"e49ebc1f-df82-4aa2-a778-5a2bc5a0500f"}'
};

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

```go 2B-01-pos-single-tax
package main

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

func main() {

	url := "https://api.staple.io/v2/einvoice/ar/:qid"

	payload := strings.NewReader("{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"POS\",\n    \"Peppol Endpoint ID\": \"POS\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"POS\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2B-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"POS\",\n      \"Line Amount\": 8000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 720,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 8000\n        }\n      ],\n      \"Unit Amount\": 8000,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"POS sales 1-26 Aug 2026\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 8000,\n    \"Sum of Line Amounts\": 8000,\n    \"Tax Total\": 720,\n    \"Total\": 8720,\n    \"Total incl Tax\": 8720\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"e49ebc1f-df82-4aa2-a778-5a2bc5a0500f\"\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby 2B-01-pos-single-tax
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/einvoice/ar/:qid")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"POS\",\n    \"Peppol Endpoint ID\": \"POS\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"POS\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2B-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"POS\",\n      \"Line Amount\": 8000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 720,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 8000\n        }\n      ],\n      \"Unit Amount\": 8000,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"POS sales 1-26 Aug 2026\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 8000,\n    \"Sum of Line Amounts\": 8000,\n    \"Tax Total\": 720,\n    \"Total\": 8720,\n    \"Total incl Tax\": 8720\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"e49ebc1f-df82-4aa2-a778-5a2bc5a0500f\"\n}"

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

```java 2B-01-pos-single-tax
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/einvoice/ar/:qid")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"POS\",\n    \"Peppol Endpoint ID\": \"POS\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"POS\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2B-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"POS\",\n      \"Line Amount\": 8000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 720,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 8000\n        }\n      ],\n      \"Unit Amount\": 8000,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"POS sales 1-26 Aug 2026\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 8000,\n    \"Sum of Line Amounts\": 8000,\n    \"Tax Total\": 720,\n    \"Total\": 8720,\n    \"Total incl Tax\": 8720\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"e49ebc1f-df82-4aa2-a778-5a2bc5a0500f\"\n}")
  .asString();
```

```php 2B-01-pos-single-tax
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/einvoice/ar/:qid', [
  'body' => '{
  "Addon": "sg-aggregated",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "NA",
      "Street Name": "NA"
    },
    "Name": "POS",
    "Peppol Endpoint ID": "POS",
    "Peppol Scheme ID": "0195",
    "Registration Number": "POS"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-2B-01",
  "Line Items": [
    {
      "Description": "POS",
      "Line Amount": 8000,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 720,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 8000
        }
      ],
      "Unit Amount": 8000,
      "Unit of Measure": "XLT"
    }
  ],
  "Note": "POS sales 1-26 Aug 2026",
  "Period": {
    "End Date": "2026-08-26",
    "Start Date": "2026-08-01"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 8000,
    "Sum of Line Amounts": 8000,
    "Tax Total": 720,
    "Total": 8720,
    "Total incl Tax": 8720
  },
  "Transaction Type": "Sales",
  "UUID": "e49ebc1f-df82-4aa2-a778-5a2bc5a0500f"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp 2B-01-pos-single-tax
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/einvoice/ar/:qid");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"POS\",\n    \"Peppol Endpoint ID\": \"POS\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"POS\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2B-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"POS\",\n      \"Line Amount\": 8000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 720,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 8000\n        }\n      ],\n      \"Unit Amount\": 8000,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"POS sales 1-26 Aug 2026\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 8000,\n    \"Sum of Line Amounts\": 8000,\n    \"Tax Total\": 720,\n    \"Total\": 8720,\n    \"Total incl Tax\": 8720\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"e49ebc1f-df82-4aa2-a778-5a2bc5a0500f\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 2B-01-pos-single-tax
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "Addon": "sg-aggregated",
  "Buyer": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "NA",
      "Street Name": "NA"
    ],
    "Name": "POS",
    "Peppol Endpoint ID": "POS",
    "Peppol Scheme ID": "0195",
    "Registration Number": "POS"
  ],
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-2B-01",
  "Line Items": [
    [
      "Description": "POS",
      "Line Amount": 8000,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        [
          "Tax Amount": 720,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 8000
        ]
      ],
      "Unit Amount": 8000,
      "Unit of Measure": "XLT"
    ]
  ],
  "Note": "POS sales 1-26 Aug 2026",
  "Period": [
    "End Date": "2026-08-26",
    "Start Date": "2026-08-01"
  ],
  "Seller": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  ],
  "Totals": [
    "Subtotal": 8000,
    "Sum of Line Amounts": 8000,
    "Tax Total": 720,
    "Total": 8720,
    "Total incl Tax": 8720
  ],
  "Transaction Type": "Sales",
  "UUID": "e49ebc1f-df82-4aa2-a778-5a2bc5a0500f"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/einvoice/ar/:qid")! 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()
```

### 2B-02-pos-multi-tax

**Request**

```json
{
  "Addon": "sg-aggregated",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "NA",
      "Street Name": "NA"
    },
    "Name": "POS",
    "Peppol Endpoint ID": "POS",
    "Peppol Scheme ID": "0195",
    "Registration Number": "POS"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-2B-02",
  "Line Items": [
    {
      "Description": "POS",
      "Line Amount": 6000,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 540,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 6000
        }
      ],
      "Unit Amount": 6000,
      "Unit of Measure": "XLT"
    },
    {
      "Description": "POS",
      "Line Amount": 900,
      "Line ID": "2",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 0,
          "Tax Category Code": "ZR",
          "Tax Rate": 0,
          "Tax Scheme": "GST",
          "Taxable Amount": 900
        }
      ],
      "Unit Amount": 900,
      "Unit of Measure": "XLT"
    }
  ],
  "Note": "POS sales 1-26 Aug 2026",
  "Period": {
    "End Date": "2026-08-26",
    "Start Date": "2026-08-01"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 6900,
    "Sum of Line Amounts": 6900,
    "Tax Total": 540,
    "Total": 7440,
    "Total incl Tax": 7440
  },
  "Transaction Type": "Sales",
  "UUID": "f1aae16c-4f1a-49b3-a624-ba92fd1f69e1"
}
```

**Response**

```json
{
  "importERP": {
    "message": "[Peppol] Document creation request has been accepted.",
    "requestId": "3f8a625f-1881-438a-9d44-382fb7a6d5cd",
    "status": "SUCCESS"
  }
}
```

**SDK Code**

```python 2B-02-pos-multi-tax
import requests

url = "https://api.staple.io/v2/einvoice/ar/:qid"

payload = {
    "Addon": "sg-aggregated",
    "Buyer": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "NA",
            "Street Name": "NA"
        },
        "Name": "POS",
        "Peppol Endpoint ID": "POS",
        "Peppol Scheme ID": "0195",
        "Registration Number": "POS"
    },
    "Currency": "SGD",
    "Document Type": "Invoice",
    "Invoice Date": "2026-08-26",
    "Invoice Number": "TC-2B-02",
    "Line Items": [
        {
            "Description": "POS",
            "Line Amount": 6000,
            "Line ID": "1",
            "Quantity": 1,
            "Tax Breakdown": [
                {
                    "Tax Amount": 540,
                    "Tax Category Code": "SR",
                    "Tax Rate": 9,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 6000
                }
            ],
            "Unit Amount": 6000,
            "Unit of Measure": "XLT"
        },
        {
            "Description": "POS",
            "Line Amount": 900,
            "Line ID": "2",
            "Quantity": 1,
            "Tax Breakdown": [
                {
                    "Tax Amount": 0,
                    "Tax Category Code": "ZR",
                    "Tax Rate": 0,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 900
                }
            ],
            "Unit Amount": 900,
            "Unit of Measure": "XLT"
        }
    ],
    "Note": "POS sales 1-26 Aug 2026",
    "Period": {
        "End Date": "2026-08-26",
        "Start Date": "2026-08-01"
    },
    "Seller": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "068895",
            "Street Name": "71 Robinson Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Meridian Crest Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202612344K",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202612344K",
        "Tax ID": "M90261234K"
    },
    "Totals": {
        "Subtotal": 6900,
        "Sum of Line Amounts": 6900,
        "Tax Total": 540,
        "Total": 7440,
        "Total incl Tax": 7440
    },
    "Transaction Type": "Sales",
    "UUID": "f1aae16c-4f1a-49b3-a624-ba92fd1f69e1"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 2B-02-pos-multi-tax
const url = 'https://api.staple.io/v2/einvoice/ar/:qid';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"Addon":"sg-aggregated","Buyer":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"NA","Street Name":"NA"},"Name":"POS","Peppol Endpoint ID":"POS","Peppol Scheme ID":"0195","Registration Number":"POS"},"Currency":"SGD","Document Type":"Invoice","Invoice Date":"2026-08-26","Invoice Number":"TC-2B-02","Line Items":[{"Description":"POS","Line Amount":6000,"Line ID":"1","Quantity":1,"Tax Breakdown":[{"Tax Amount":540,"Tax Category Code":"SR","Tax Rate":9,"Tax Scheme":"GST","Taxable Amount":6000}],"Unit Amount":6000,"Unit of Measure":"XLT"},{"Description":"POS","Line Amount":900,"Line ID":"2","Quantity":1,"Tax Breakdown":[{"Tax Amount":0,"Tax Category Code":"ZR","Tax Rate":0,"Tax Scheme":"GST","Taxable Amount":900}],"Unit Amount":900,"Unit of Measure":"XLT"}],"Note":"POS sales 1-26 Aug 2026","Period":{"End Date":"2026-08-26","Start Date":"2026-08-01"},"Seller":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"068895","Street Name":"71 Robinson Road"},"Email":"atharva@staple.io","Name":"Meridian Crest Pte. Ltd.","Peppol Endpoint ID":"SGTST202612344K","Peppol Scheme ID":"0195","Registration Number":"202612344K","Tax ID":"M90261234K"},"Totals":{"Subtotal":6900,"Sum of Line Amounts":6900,"Tax Total":540,"Total":7440,"Total incl Tax":7440},"Transaction Type":"Sales","UUID":"f1aae16c-4f1a-49b3-a624-ba92fd1f69e1"}'
};

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

```go 2B-02-pos-multi-tax
package main

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

func main() {

	url := "https://api.staple.io/v2/einvoice/ar/:qid"

	payload := strings.NewReader("{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"POS\",\n    \"Peppol Endpoint ID\": \"POS\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"POS\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2B-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"POS\",\n      \"Line Amount\": 6000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 540,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 6000\n        }\n      ],\n      \"Unit Amount\": 6000,\n      \"Unit of Measure\": \"XLT\"\n    },\n    {\n      \"Description\": \"POS\",\n      \"Line Amount\": 900,\n      \"Line ID\": \"2\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 0,\n          \"Tax Category Code\": \"ZR\",\n          \"Tax Rate\": 0,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 900\n        }\n      ],\n      \"Unit Amount\": 900,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"POS sales 1-26 Aug 2026\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 6900,\n    \"Sum of Line Amounts\": 6900,\n    \"Tax Total\": 540,\n    \"Total\": 7440,\n    \"Total incl Tax\": 7440\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"f1aae16c-4f1a-49b3-a624-ba92fd1f69e1\"\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby 2B-02-pos-multi-tax
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/einvoice/ar/:qid")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"POS\",\n    \"Peppol Endpoint ID\": \"POS\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"POS\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2B-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"POS\",\n      \"Line Amount\": 6000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 540,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 6000\n        }\n      ],\n      \"Unit Amount\": 6000,\n      \"Unit of Measure\": \"XLT\"\n    },\n    {\n      \"Description\": \"POS\",\n      \"Line Amount\": 900,\n      \"Line ID\": \"2\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 0,\n          \"Tax Category Code\": \"ZR\",\n          \"Tax Rate\": 0,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 900\n        }\n      ],\n      \"Unit Amount\": 900,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"POS sales 1-26 Aug 2026\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 6900,\n    \"Sum of Line Amounts\": 6900,\n    \"Tax Total\": 540,\n    \"Total\": 7440,\n    \"Total incl Tax\": 7440\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"f1aae16c-4f1a-49b3-a624-ba92fd1f69e1\"\n}"

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

```java 2B-02-pos-multi-tax
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/einvoice/ar/:qid")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"POS\",\n    \"Peppol Endpoint ID\": \"POS\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"POS\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2B-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"POS\",\n      \"Line Amount\": 6000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 540,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 6000\n        }\n      ],\n      \"Unit Amount\": 6000,\n      \"Unit of Measure\": \"XLT\"\n    },\n    {\n      \"Description\": \"POS\",\n      \"Line Amount\": 900,\n      \"Line ID\": \"2\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 0,\n          \"Tax Category Code\": \"ZR\",\n          \"Tax Rate\": 0,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 900\n        }\n      ],\n      \"Unit Amount\": 900,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"POS sales 1-26 Aug 2026\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 6900,\n    \"Sum of Line Amounts\": 6900,\n    \"Tax Total\": 540,\n    \"Total\": 7440,\n    \"Total incl Tax\": 7440\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"f1aae16c-4f1a-49b3-a624-ba92fd1f69e1\"\n}")
  .asString();
```

```php 2B-02-pos-multi-tax
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/einvoice/ar/:qid', [
  'body' => '{
  "Addon": "sg-aggregated",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "NA",
      "Street Name": "NA"
    },
    "Name": "POS",
    "Peppol Endpoint ID": "POS",
    "Peppol Scheme ID": "0195",
    "Registration Number": "POS"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-2B-02",
  "Line Items": [
    {
      "Description": "POS",
      "Line Amount": 6000,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 540,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 6000
        }
      ],
      "Unit Amount": 6000,
      "Unit of Measure": "XLT"
    },
    {
      "Description": "POS",
      "Line Amount": 900,
      "Line ID": "2",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 0,
          "Tax Category Code": "ZR",
          "Tax Rate": 0,
          "Tax Scheme": "GST",
          "Taxable Amount": 900
        }
      ],
      "Unit Amount": 900,
      "Unit of Measure": "XLT"
    }
  ],
  "Note": "POS sales 1-26 Aug 2026",
  "Period": {
    "End Date": "2026-08-26",
    "Start Date": "2026-08-01"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 6900,
    "Sum of Line Amounts": 6900,
    "Tax Total": 540,
    "Total": 7440,
    "Total incl Tax": 7440
  },
  "Transaction Type": "Sales",
  "UUID": "f1aae16c-4f1a-49b3-a624-ba92fd1f69e1"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp 2B-02-pos-multi-tax
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/einvoice/ar/:qid");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"POS\",\n    \"Peppol Endpoint ID\": \"POS\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"POS\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2B-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"POS\",\n      \"Line Amount\": 6000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 540,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 6000\n        }\n      ],\n      \"Unit Amount\": 6000,\n      \"Unit of Measure\": \"XLT\"\n    },\n    {\n      \"Description\": \"POS\",\n      \"Line Amount\": 900,\n      \"Line ID\": \"2\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 0,\n          \"Tax Category Code\": \"ZR\",\n          \"Tax Rate\": 0,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 900\n        }\n      ],\n      \"Unit Amount\": 900,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"POS sales 1-26 Aug 2026\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 6900,\n    \"Sum of Line Amounts\": 6900,\n    \"Tax Total\": 540,\n    \"Total\": 7440,\n    \"Total incl Tax\": 7440\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"f1aae16c-4f1a-49b3-a624-ba92fd1f69e1\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 2B-02-pos-multi-tax
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "Addon": "sg-aggregated",
  "Buyer": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "NA",
      "Street Name": "NA"
    ],
    "Name": "POS",
    "Peppol Endpoint ID": "POS",
    "Peppol Scheme ID": "0195",
    "Registration Number": "POS"
  ],
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-2B-02",
  "Line Items": [
    [
      "Description": "POS",
      "Line Amount": 6000,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        [
          "Tax Amount": 540,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 6000
        ]
      ],
      "Unit Amount": 6000,
      "Unit of Measure": "XLT"
    ],
    [
      "Description": "POS",
      "Line Amount": 900,
      "Line ID": "2",
      "Quantity": 1,
      "Tax Breakdown": [
        [
          "Tax Amount": 0,
          "Tax Category Code": "ZR",
          "Tax Rate": 0,
          "Tax Scheme": "GST",
          "Taxable Amount": 900
        ]
      ],
      "Unit Amount": 900,
      "Unit of Measure": "XLT"
    ]
  ],
  "Note": "POS sales 1-26 Aug 2026",
  "Period": [
    "End Date": "2026-08-26",
    "Start Date": "2026-08-01"
  ],
  "Seller": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  ],
  "Totals": [
    "Subtotal": 6900,
    "Sum of Line Amounts": 6900,
    "Tax Total": 540,
    "Total": 7440,
    "Total incl Tax": 7440
  ],
  "Transaction Type": "Sales",
  "UUID": "f1aae16c-4f1a-49b3-a624-ba92fd1f69e1"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/einvoice/ar/:qid")! 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()
```

### 2B-03-sti-simplified

**Request**

```json
{
  "Addon": "sg-aggregated",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "NA",
      "Street Name": "NA"
    },
    "Name": "STI",
    "Peppol Endpoint ID": "STI",
    "Peppol Scheme ID": "0195",
    "Registration Number": "STI"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-2B-03",
  "Line Items": [
    {
      "Description": "STI",
      "Line Amount": 3200,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 288,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 3200
        }
      ],
      "Unit Amount": 3200,
      "Unit of Measure": "XLT"
    }
  ],
  "Note": "Simplified tax invoices 1-26 Aug 2026",
  "Period": {
    "End Date": "2026-08-26",
    "Start Date": "2026-08-01"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 3200,
    "Sum of Line Amounts": 3200,
    "Tax Total": 288,
    "Total": 3488,
    "Total incl Tax": 3488
  },
  "Transaction Type": "Sales",
  "UUID": "1fe4ab28-4bd4-4e83-b605-a1c3e2761a82"
}
```

**Response**

```json
{
  "importERP": {
    "message": "[Peppol] Document creation request has been accepted.",
    "requestId": "3f8a625f-1881-438a-9d44-382fb7a6d5cd",
    "status": "SUCCESS"
  }
}
```

**SDK Code**

```python 2B-03-sti-simplified
import requests

url = "https://api.staple.io/v2/einvoice/ar/:qid"

payload = {
    "Addon": "sg-aggregated",
    "Buyer": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "NA",
            "Street Name": "NA"
        },
        "Name": "STI",
        "Peppol Endpoint ID": "STI",
        "Peppol Scheme ID": "0195",
        "Registration Number": "STI"
    },
    "Currency": "SGD",
    "Document Type": "Invoice",
    "Invoice Date": "2026-08-26",
    "Invoice Number": "TC-2B-03",
    "Line Items": [
        {
            "Description": "STI",
            "Line Amount": 3200,
            "Line ID": "1",
            "Quantity": 1,
            "Tax Breakdown": [
                {
                    "Tax Amount": 288,
                    "Tax Category Code": "SR",
                    "Tax Rate": 9,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 3200
                }
            ],
            "Unit Amount": 3200,
            "Unit of Measure": "XLT"
        }
    ],
    "Note": "Simplified tax invoices 1-26 Aug 2026",
    "Period": {
        "End Date": "2026-08-26",
        "Start Date": "2026-08-01"
    },
    "Seller": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "068895",
            "Street Name": "71 Robinson Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Meridian Crest Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202612344K",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202612344K",
        "Tax ID": "M90261234K"
    },
    "Totals": {
        "Subtotal": 3200,
        "Sum of Line Amounts": 3200,
        "Tax Total": 288,
        "Total": 3488,
        "Total incl Tax": 3488
    },
    "Transaction Type": "Sales",
    "UUID": "1fe4ab28-4bd4-4e83-b605-a1c3e2761a82"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 2B-03-sti-simplified
const url = 'https://api.staple.io/v2/einvoice/ar/:qid';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"Addon":"sg-aggregated","Buyer":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"NA","Street Name":"NA"},"Name":"STI","Peppol Endpoint ID":"STI","Peppol Scheme ID":"0195","Registration Number":"STI"},"Currency":"SGD","Document Type":"Invoice","Invoice Date":"2026-08-26","Invoice Number":"TC-2B-03","Line Items":[{"Description":"STI","Line Amount":3200,"Line ID":"1","Quantity":1,"Tax Breakdown":[{"Tax Amount":288,"Tax Category Code":"SR","Tax Rate":9,"Tax Scheme":"GST","Taxable Amount":3200}],"Unit Amount":3200,"Unit of Measure":"XLT"}],"Note":"Simplified tax invoices 1-26 Aug 2026","Period":{"End Date":"2026-08-26","Start Date":"2026-08-01"},"Seller":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"068895","Street Name":"71 Robinson Road"},"Email":"atharva@staple.io","Name":"Meridian Crest Pte. Ltd.","Peppol Endpoint ID":"SGTST202612344K","Peppol Scheme ID":"0195","Registration Number":"202612344K","Tax ID":"M90261234K"},"Totals":{"Subtotal":3200,"Sum of Line Amounts":3200,"Tax Total":288,"Total":3488,"Total incl Tax":3488},"Transaction Type":"Sales","UUID":"1fe4ab28-4bd4-4e83-b605-a1c3e2761a82"}'
};

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

```go 2B-03-sti-simplified
package main

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

func main() {

	url := "https://api.staple.io/v2/einvoice/ar/:qid"

	payload := strings.NewReader("{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"STI\",\n    \"Peppol Endpoint ID\": \"STI\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"STI\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2B-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"STI\",\n      \"Line Amount\": 3200,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 288,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 3200\n        }\n      ],\n      \"Unit Amount\": 3200,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"Simplified tax invoices 1-26 Aug 2026\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 3200,\n    \"Sum of Line Amounts\": 3200,\n    \"Tax Total\": 288,\n    \"Total\": 3488,\n    \"Total incl Tax\": 3488\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"1fe4ab28-4bd4-4e83-b605-a1c3e2761a82\"\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby 2B-03-sti-simplified
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/einvoice/ar/:qid")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"STI\",\n    \"Peppol Endpoint ID\": \"STI\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"STI\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2B-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"STI\",\n      \"Line Amount\": 3200,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 288,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 3200\n        }\n      ],\n      \"Unit Amount\": 3200,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"Simplified tax invoices 1-26 Aug 2026\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 3200,\n    \"Sum of Line Amounts\": 3200,\n    \"Tax Total\": 288,\n    \"Total\": 3488,\n    \"Total incl Tax\": 3488\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"1fe4ab28-4bd4-4e83-b605-a1c3e2761a82\"\n}"

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

```java 2B-03-sti-simplified
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/einvoice/ar/:qid")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"STI\",\n    \"Peppol Endpoint ID\": \"STI\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"STI\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2B-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"STI\",\n      \"Line Amount\": 3200,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 288,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 3200\n        }\n      ],\n      \"Unit Amount\": 3200,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"Simplified tax invoices 1-26 Aug 2026\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 3200,\n    \"Sum of Line Amounts\": 3200,\n    \"Tax Total\": 288,\n    \"Total\": 3488,\n    \"Total incl Tax\": 3488\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"1fe4ab28-4bd4-4e83-b605-a1c3e2761a82\"\n}")
  .asString();
```

```php 2B-03-sti-simplified
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/einvoice/ar/:qid', [
  'body' => '{
  "Addon": "sg-aggregated",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "NA",
      "Street Name": "NA"
    },
    "Name": "STI",
    "Peppol Endpoint ID": "STI",
    "Peppol Scheme ID": "0195",
    "Registration Number": "STI"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-2B-03",
  "Line Items": [
    {
      "Description": "STI",
      "Line Amount": 3200,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 288,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 3200
        }
      ],
      "Unit Amount": 3200,
      "Unit of Measure": "XLT"
    }
  ],
  "Note": "Simplified tax invoices 1-26 Aug 2026",
  "Period": {
    "End Date": "2026-08-26",
    "Start Date": "2026-08-01"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Totals": {
    "Subtotal": 3200,
    "Sum of Line Amounts": 3200,
    "Tax Total": 288,
    "Total": 3488,
    "Total incl Tax": 3488
  },
  "Transaction Type": "Sales",
  "UUID": "1fe4ab28-4bd4-4e83-b605-a1c3e2761a82"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp 2B-03-sti-simplified
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/einvoice/ar/:qid");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"STI\",\n    \"Peppol Endpoint ID\": \"STI\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"STI\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-2B-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"STI\",\n      \"Line Amount\": 3200,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 288,\n          \"Tax Category Code\": \"SR\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 3200\n        }\n      ],\n      \"Unit Amount\": 3200,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"Simplified tax invoices 1-26 Aug 2026\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 3200,\n    \"Sum of Line Amounts\": 3200,\n    \"Tax Total\": 288,\n    \"Total\": 3488,\n    \"Total incl Tax\": 3488\n  },\n  \"Transaction Type\": \"Sales\",\n  \"UUID\": \"1fe4ab28-4bd4-4e83-b605-a1c3e2761a82\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 2B-03-sti-simplified
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "Addon": "sg-aggregated",
  "Buyer": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "NA",
      "Street Name": "NA"
    ],
    "Name": "STI",
    "Peppol Endpoint ID": "STI",
    "Peppol Scheme ID": "0195",
    "Registration Number": "STI"
  ],
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-2B-03",
  "Line Items": [
    [
      "Description": "STI",
      "Line Amount": 3200,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        [
          "Tax Amount": 288,
          "Tax Category Code": "SR",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 3200
        ]
      ],
      "Unit Amount": 3200,
      "Unit of Measure": "XLT"
    ]
  ],
  "Note": "Simplified tax invoices 1-26 Aug 2026",
  "Period": [
    "End Date": "2026-08-26",
    "Start Date": "2026-08-01"
  ],
  "Seller": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  ],
  "Totals": [
    "Subtotal": 3200,
    "Sum of Line Amounts": 3200,
    "Tax Total": 288,
    "Total": 3488,
    "Total incl Tax": 3488
  ],
  "Transaction Type": "Sales",
  "UUID": "1fe4ab28-4bd4-4e83-b605-a1c3e2761a82"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/einvoice/ar/:qid")! 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()
```

### 3A-01-purchase-standard

**Request**

```json
{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-3A-01",
  "Line Items": [
    {
      "Description": "Office furniture",
      "Line Amount": 2000,
      "Line ID": "1",
      "Quantity": 5,
      "Tax Breakdown": [
        {
          "Tax Amount": 180,
          "Tax Category Code": "TX",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 2000
        }
      ],
      "Unit Amount": 400,
      "Unit of Measure": "H87"
    }
  ],
  "Payment": {
    "Due Date": "2026-09-15"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Totals": {
    "Subtotal": 2000,
    "Sum of Line Amounts": 2000,
    "Tax Total": 180,
    "Total": 2180,
    "Total incl Tax": 2180
  },
  "Transaction Type": "Purchases",
  "UUID": "73726453-2309-4043-bbeb-c69977e548cf"
}
```

**Response**

```json
{
  "importERP": {
    "message": "[Peppol] Document creation request has been accepted.",
    "requestId": "3f8a625f-1881-438a-9d44-382fb7a6d5cd",
    "status": "SUCCESS"
  }
}
```

**SDK Code**

```python 3A-01-purchase-standard
import requests

url = "https://api.staple.io/v2/einvoice/ar/:qid"

payload = {
    "Addon": "sg-standard",
    "Buyer": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "068895",
            "Street Name": "71 Robinson Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Meridian Crest Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202612344K",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202612344K",
        "Tax ID": "M90261234K"
    },
    "Currency": "SGD",
    "Document Type": "Invoice",
    "Invoice Date": "2026-08-26",
    "Invoice Number": "TC-3A-01",
    "Line Items": [
        {
            "Description": "Office furniture",
            "Line Amount": 2000,
            "Line ID": "1",
            "Quantity": 5,
            "Tax Breakdown": [
                {
                    "Tax Amount": 180,
                    "Tax Category Code": "TX",
                    "Tax Rate": 9,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 2000
                }
            ],
            "Unit Amount": 400,
            "Unit of Measure": "H87"
        }
    ],
    "Payment": { "Due Date": "2026-09-15" },
    "Seller": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "088541",
            "Street Name": "120 Tanjong Pagar Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Northstar Commerce Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202623458Y",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202623458Y",
        "Tax ID": "M90262345Y"
    },
    "Totals": {
        "Subtotal": 2000,
        "Sum of Line Amounts": 2000,
        "Tax Total": 180,
        "Total": 2180,
        "Total incl Tax": 2180
    },
    "Transaction Type": "Purchases",
    "UUID": "73726453-2309-4043-bbeb-c69977e548cf"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 3A-01-purchase-standard
const url = 'https://api.staple.io/v2/einvoice/ar/:qid';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"Addon":"sg-standard","Buyer":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"068895","Street Name":"71 Robinson Road"},"Email":"atharva@staple.io","Name":"Meridian Crest Pte. Ltd.","Peppol Endpoint ID":"SGTST202612344K","Peppol Scheme ID":"0195","Registration Number":"202612344K","Tax ID":"M90261234K"},"Currency":"SGD","Document Type":"Invoice","Invoice Date":"2026-08-26","Invoice Number":"TC-3A-01","Line Items":[{"Description":"Office furniture","Line Amount":2000,"Line ID":"1","Quantity":5,"Tax Breakdown":[{"Tax Amount":180,"Tax Category Code":"TX","Tax Rate":9,"Tax Scheme":"GST","Taxable Amount":2000}],"Unit Amount":400,"Unit of Measure":"H87"}],"Payment":{"Due Date":"2026-09-15"},"Seller":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"088541","Street Name":"120 Tanjong Pagar Road"},"Email":"atharva@staple.io","Name":"Northstar Commerce Pte. Ltd.","Peppol Endpoint ID":"SGTST202623458Y","Peppol Scheme ID":"0195","Registration Number":"202623458Y","Tax ID":"M90262345Y"},"Totals":{"Subtotal":2000,"Sum of Line Amounts":2000,"Tax Total":180,"Total":2180,"Total incl Tax":2180},"Transaction Type":"Purchases","UUID":"73726453-2309-4043-bbeb-c69977e548cf"}'
};

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

```go 3A-01-purchase-standard
package main

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

func main() {

	url := "https://api.staple.io/v2/einvoice/ar/:qid"

	payload := strings.NewReader("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3A-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Office furniture\",\n      \"Line Amount\": 2000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 5,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 180,\n          \"Tax Category Code\": \"TX\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 2000\n        }\n      ],\n      \"Unit Amount\": 400,\n      \"Unit of Measure\": \"H87\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 2000,\n    \"Sum of Line Amounts\": 2000,\n    \"Tax Total\": 180,\n    \"Total\": 2180,\n    \"Total incl Tax\": 2180\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"73726453-2309-4043-bbeb-c69977e548cf\"\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby 3A-01-purchase-standard
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/einvoice/ar/:qid")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3A-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Office furniture\",\n      \"Line Amount\": 2000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 5,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 180,\n          \"Tax Category Code\": \"TX\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 2000\n        }\n      ],\n      \"Unit Amount\": 400,\n      \"Unit of Measure\": \"H87\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 2000,\n    \"Sum of Line Amounts\": 2000,\n    \"Tax Total\": 180,\n    \"Total\": 2180,\n    \"Total incl Tax\": 2180\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"73726453-2309-4043-bbeb-c69977e548cf\"\n}"

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

```java 3A-01-purchase-standard
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/einvoice/ar/:qid")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3A-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Office furniture\",\n      \"Line Amount\": 2000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 5,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 180,\n          \"Tax Category Code\": \"TX\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 2000\n        }\n      ],\n      \"Unit Amount\": 400,\n      \"Unit of Measure\": \"H87\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 2000,\n    \"Sum of Line Amounts\": 2000,\n    \"Tax Total\": 180,\n    \"Total\": 2180,\n    \"Total incl Tax\": 2180\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"73726453-2309-4043-bbeb-c69977e548cf\"\n}")
  .asString();
```

```php 3A-01-purchase-standard
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/einvoice/ar/:qid', [
  'body' => '{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-3A-01",
  "Line Items": [
    {
      "Description": "Office furniture",
      "Line Amount": 2000,
      "Line ID": "1",
      "Quantity": 5,
      "Tax Breakdown": [
        {
          "Tax Amount": 180,
          "Tax Category Code": "TX",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 2000
        }
      ],
      "Unit Amount": 400,
      "Unit of Measure": "H87"
    }
  ],
  "Payment": {
    "Due Date": "2026-09-15"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Totals": {
    "Subtotal": 2000,
    "Sum of Line Amounts": 2000,
    "Tax Total": 180,
    "Total": 2180,
    "Total incl Tax": 2180
  },
  "Transaction Type": "Purchases",
  "UUID": "73726453-2309-4043-bbeb-c69977e548cf"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp 3A-01-purchase-standard
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/einvoice/ar/:qid");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3A-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Office furniture\",\n      \"Line Amount\": 2000,\n      \"Line ID\": \"1\",\n      \"Quantity\": 5,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 180,\n          \"Tax Category Code\": \"TX\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 2000\n        }\n      ],\n      \"Unit Amount\": 400,\n      \"Unit of Measure\": \"H87\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 2000,\n    \"Sum of Line Amounts\": 2000,\n    \"Tax Total\": 180,\n    \"Total\": 2180,\n    \"Total incl Tax\": 2180\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"73726453-2309-4043-bbeb-c69977e548cf\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 3A-01-purchase-standard
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "Addon": "sg-standard",
  "Buyer": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  ],
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-3A-01",
  "Line Items": [
    [
      "Description": "Office furniture",
      "Line Amount": 2000,
      "Line ID": "1",
      "Quantity": 5,
      "Tax Breakdown": [
        [
          "Tax Amount": 180,
          "Tax Category Code": "TX",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 2000
        ]
      ],
      "Unit Amount": 400,
      "Unit of Measure": "H87"
    ]
  ],
  "Payment": ["Due Date": "2026-09-15"],
  "Seller": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  ],
  "Totals": [
    "Subtotal": 2000,
    "Sum of Line Amounts": 2000,
    "Tax Total": 180,
    "Total": 2180,
    "Total incl Tax": 2180
  ],
  "Transaction Type": "Purchases",
  "UUID": "73726453-2309-4043-bbeb-c69977e548cf"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/einvoice/ar/:qid")! 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()
```

### 3A-02-purchase-residual

**Request**

```json
{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-3A-02",
  "Line Items": [
    {
      "Description": "Shared services",
      "Line Amount": 1800,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 162,
          "Tax Category Code": "TX-RE",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 1800
        }
      ],
      "Unit Amount": 1800,
      "Unit of Measure": "C62"
    }
  ],
  "Payment": {
    "Due Date": "2026-09-15"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Totals": {
    "Subtotal": 1800,
    "Sum of Line Amounts": 1800,
    "Tax Total": 162,
    "Total": 1962,
    "Total incl Tax": 1962
  },
  "Transaction Type": "Purchases",
  "UUID": "e76361b8-41fe-481e-94ce-824336481259"
}
```

**Response**

```json
{
  "importERP": {
    "message": "[Peppol] Document creation request has been accepted.",
    "requestId": "3f8a625f-1881-438a-9d44-382fb7a6d5cd",
    "status": "SUCCESS"
  }
}
```

**SDK Code**

```python 3A-02-purchase-residual
import requests

url = "https://api.staple.io/v2/einvoice/ar/:qid"

payload = {
    "Addon": "sg-standard",
    "Buyer": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "068895",
            "Street Name": "71 Robinson Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Meridian Crest Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202612344K",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202612344K",
        "Tax ID": "M90261234K"
    },
    "Currency": "SGD",
    "Document Type": "Invoice",
    "Invoice Date": "2026-08-26",
    "Invoice Number": "TC-3A-02",
    "Line Items": [
        {
            "Description": "Shared services",
            "Line Amount": 1800,
            "Line ID": "1",
            "Quantity": 1,
            "Tax Breakdown": [
                {
                    "Tax Amount": 162,
                    "Tax Category Code": "TX-RE",
                    "Tax Rate": 9,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 1800
                }
            ],
            "Unit Amount": 1800,
            "Unit of Measure": "C62"
        }
    ],
    "Payment": { "Due Date": "2026-09-15" },
    "Seller": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "088541",
            "Street Name": "120 Tanjong Pagar Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Northstar Commerce Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202623458Y",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202623458Y",
        "Tax ID": "M90262345Y"
    },
    "Totals": {
        "Subtotal": 1800,
        "Sum of Line Amounts": 1800,
        "Tax Total": 162,
        "Total": 1962,
        "Total incl Tax": 1962
    },
    "Transaction Type": "Purchases",
    "UUID": "e76361b8-41fe-481e-94ce-824336481259"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 3A-02-purchase-residual
const url = 'https://api.staple.io/v2/einvoice/ar/:qid';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"Addon":"sg-standard","Buyer":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"068895","Street Name":"71 Robinson Road"},"Email":"atharva@staple.io","Name":"Meridian Crest Pte. Ltd.","Peppol Endpoint ID":"SGTST202612344K","Peppol Scheme ID":"0195","Registration Number":"202612344K","Tax ID":"M90261234K"},"Currency":"SGD","Document Type":"Invoice","Invoice Date":"2026-08-26","Invoice Number":"TC-3A-02","Line Items":[{"Description":"Shared services","Line Amount":1800,"Line ID":"1","Quantity":1,"Tax Breakdown":[{"Tax Amount":162,"Tax Category Code":"TX-RE","Tax Rate":9,"Tax Scheme":"GST","Taxable Amount":1800}],"Unit Amount":1800,"Unit of Measure":"C62"}],"Payment":{"Due Date":"2026-09-15"},"Seller":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"088541","Street Name":"120 Tanjong Pagar Road"},"Email":"atharva@staple.io","Name":"Northstar Commerce Pte. Ltd.","Peppol Endpoint ID":"SGTST202623458Y","Peppol Scheme ID":"0195","Registration Number":"202623458Y","Tax ID":"M90262345Y"},"Totals":{"Subtotal":1800,"Sum of Line Amounts":1800,"Tax Total":162,"Total":1962,"Total incl Tax":1962},"Transaction Type":"Purchases","UUID":"e76361b8-41fe-481e-94ce-824336481259"}'
};

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

```go 3A-02-purchase-residual
package main

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

func main() {

	url := "https://api.staple.io/v2/einvoice/ar/:qid"

	payload := strings.NewReader("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3A-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Shared services\",\n      \"Line Amount\": 1800,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 162,\n          \"Tax Category Code\": \"TX-RE\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1800\n        }\n      ],\n      \"Unit Amount\": 1800,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1800,\n    \"Sum of Line Amounts\": 1800,\n    \"Tax Total\": 162,\n    \"Total\": 1962,\n    \"Total incl Tax\": 1962\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"e76361b8-41fe-481e-94ce-824336481259\"\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby 3A-02-purchase-residual
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/einvoice/ar/:qid")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3A-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Shared services\",\n      \"Line Amount\": 1800,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 162,\n          \"Tax Category Code\": \"TX-RE\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1800\n        }\n      ],\n      \"Unit Amount\": 1800,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1800,\n    \"Sum of Line Amounts\": 1800,\n    \"Tax Total\": 162,\n    \"Total\": 1962,\n    \"Total incl Tax\": 1962\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"e76361b8-41fe-481e-94ce-824336481259\"\n}"

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

```java 3A-02-purchase-residual
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/einvoice/ar/:qid")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3A-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Shared services\",\n      \"Line Amount\": 1800,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 162,\n          \"Tax Category Code\": \"TX-RE\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1800\n        }\n      ],\n      \"Unit Amount\": 1800,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1800,\n    \"Sum of Line Amounts\": 1800,\n    \"Tax Total\": 162,\n    \"Total\": 1962,\n    \"Total incl Tax\": 1962\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"e76361b8-41fe-481e-94ce-824336481259\"\n}")
  .asString();
```

```php 3A-02-purchase-residual
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/einvoice/ar/:qid', [
  'body' => '{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-3A-02",
  "Line Items": [
    {
      "Description": "Shared services",
      "Line Amount": 1800,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 162,
          "Tax Category Code": "TX-RE",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 1800
        }
      ],
      "Unit Amount": 1800,
      "Unit of Measure": "C62"
    }
  ],
  "Payment": {
    "Due Date": "2026-09-15"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Totals": {
    "Subtotal": 1800,
    "Sum of Line Amounts": 1800,
    "Tax Total": 162,
    "Total": 1962,
    "Total incl Tax": 1962
  },
  "Transaction Type": "Purchases",
  "UUID": "e76361b8-41fe-481e-94ce-824336481259"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp 3A-02-purchase-residual
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/einvoice/ar/:qid");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3A-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Shared services\",\n      \"Line Amount\": 1800,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 162,\n          \"Tax Category Code\": \"TX-RE\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1800\n        }\n      ],\n      \"Unit Amount\": 1800,\n      \"Unit of Measure\": \"C62\"\n    }\n  ],\n  \"Payment\": {\n    \"Due Date\": \"2026-09-15\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1800,\n    \"Sum of Line Amounts\": 1800,\n    \"Tax Total\": 162,\n    \"Total\": 1962,\n    \"Total incl Tax\": 1962\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"e76361b8-41fe-481e-94ce-824336481259\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 3A-02-purchase-residual
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "Addon": "sg-standard",
  "Buyer": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  ],
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-3A-02",
  "Line Items": [
    [
      "Description": "Shared services",
      "Line Amount": 1800,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        [
          "Tax Amount": 162,
          "Tax Category Code": "TX-RE",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 1800
        ]
      ],
      "Unit Amount": 1800,
      "Unit of Measure": "C62"
    ]
  ],
  "Payment": ["Due Date": "2026-09-15"],
  "Seller": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  ],
  "Totals": [
    "Subtotal": 1800,
    "Sum of Line Amounts": 1800,
    "Tax Total": 162,
    "Total": 1962,
    "Total incl Tax": 1962
  ],
  "Transaction Type": "Purchases",
  "UUID": "e76361b8-41fe-481e-94ce-824336481259"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/einvoice/ar/:qid")! 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()
```

### 3A-03-purchase-credit-note

**Request**

```json
{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Currency": "SGD",
  "Document Reference": [
    {
      "Date": "2026-08-26",
      "Number": "TC-3A-01",
      "Type": "Invoice"
    }
  ],
  "Document Type": "Credit Note",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-3A-03",
  "Line Items": [
    {
      "Description": "Office furniture — returned",
      "Line Amount": 400,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 36,
          "Tax Category Code": "TX",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 400
        }
      ],
      "Unit Amount": 400,
      "Unit of Measure": "H87"
    }
  ],
  "Note": "Return against TC-3A-01",
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Totals": {
    "Subtotal": 400,
    "Sum of Line Amounts": 400,
    "Tax Total": 36,
    "Total": 436,
    "Total incl Tax": 436
  },
  "Transaction Type": "Purchases",
  "UUID": "da50effc-9a07-4557-bd06-e0f41dc636a5"
}
```

**Response**

```json
{
  "importERP": {
    "message": "[Peppol] Document creation request has been accepted.",
    "requestId": "3f8a625f-1881-438a-9d44-382fb7a6d5cd",
    "status": "SUCCESS"
  }
}
```

**SDK Code**

```python 3A-03-purchase-credit-note
import requests

url = "https://api.staple.io/v2/einvoice/ar/:qid"

payload = {
    "Addon": "sg-standard",
    "Buyer": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "068895",
            "Street Name": "71 Robinson Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Meridian Crest Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202612344K",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202612344K",
        "Tax ID": "M90261234K"
    },
    "Currency": "SGD",
    "Document Reference": [
        {
            "Date": "2026-08-26",
            "Number": "TC-3A-01",
            "Type": "Invoice"
        }
    ],
    "Document Type": "Credit Note",
    "Invoice Date": "2026-08-26",
    "Invoice Number": "TC-3A-03",
    "Line Items": [
        {
            "Description": "Office furniture — returned",
            "Line Amount": 400,
            "Line ID": "1",
            "Quantity": 1,
            "Tax Breakdown": [
                {
                    "Tax Amount": 36,
                    "Tax Category Code": "TX",
                    "Tax Rate": 9,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 400
                }
            ],
            "Unit Amount": 400,
            "Unit of Measure": "H87"
        }
    ],
    "Note": "Return against TC-3A-01",
    "Seller": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "088541",
            "Street Name": "120 Tanjong Pagar Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Northstar Commerce Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202623458Y",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202623458Y",
        "Tax ID": "M90262345Y"
    },
    "Totals": {
        "Subtotal": 400,
        "Sum of Line Amounts": 400,
        "Tax Total": 36,
        "Total": 436,
        "Total incl Tax": 436
    },
    "Transaction Type": "Purchases",
    "UUID": "da50effc-9a07-4557-bd06-e0f41dc636a5"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 3A-03-purchase-credit-note
const url = 'https://api.staple.io/v2/einvoice/ar/:qid';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"Addon":"sg-standard","Buyer":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"068895","Street Name":"71 Robinson Road"},"Email":"atharva@staple.io","Name":"Meridian Crest Pte. Ltd.","Peppol Endpoint ID":"SGTST202612344K","Peppol Scheme ID":"0195","Registration Number":"202612344K","Tax ID":"M90261234K"},"Currency":"SGD","Document Reference":[{"Date":"2026-08-26","Number":"TC-3A-01","Type":"Invoice"}],"Document Type":"Credit Note","Invoice Date":"2026-08-26","Invoice Number":"TC-3A-03","Line Items":[{"Description":"Office furniture — returned","Line Amount":400,"Line ID":"1","Quantity":1,"Tax Breakdown":[{"Tax Amount":36,"Tax Category Code":"TX","Tax Rate":9,"Tax Scheme":"GST","Taxable Amount":400}],"Unit Amount":400,"Unit of Measure":"H87"}],"Note":"Return against TC-3A-01","Seller":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"088541","Street Name":"120 Tanjong Pagar Road"},"Email":"atharva@staple.io","Name":"Northstar Commerce Pte. Ltd.","Peppol Endpoint ID":"SGTST202623458Y","Peppol Scheme ID":"0195","Registration Number":"202623458Y","Tax ID":"M90262345Y"},"Totals":{"Subtotal":400,"Sum of Line Amounts":400,"Tax Total":36,"Total":436,"Total incl Tax":436},"Transaction Type":"Purchases","UUID":"da50effc-9a07-4557-bd06-e0f41dc636a5"}'
};

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

```go 3A-03-purchase-credit-note
package main

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

func main() {

	url := "https://api.staple.io/v2/einvoice/ar/:qid"

	payload := strings.NewReader("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Reference\": [\n    {\n      \"Date\": \"2026-08-26\",\n      \"Number\": \"TC-3A-01\",\n      \"Type\": \"Invoice\"\n    }\n  ],\n  \"Document Type\": \"Credit Note\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3A-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Office furniture — returned\",\n      \"Line Amount\": 400,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 36,\n          \"Tax Category Code\": \"TX\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 400\n        }\n      ],\n      \"Unit Amount\": 400,\n      \"Unit of Measure\": \"H87\"\n    }\n  ],\n  \"Note\": \"Return against TC-3A-01\",\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 400,\n    \"Sum of Line Amounts\": 400,\n    \"Tax Total\": 36,\n    \"Total\": 436,\n    \"Total incl Tax\": 436\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"da50effc-9a07-4557-bd06-e0f41dc636a5\"\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby 3A-03-purchase-credit-note
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/einvoice/ar/:qid")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Reference\": [\n    {\n      \"Date\": \"2026-08-26\",\n      \"Number\": \"TC-3A-01\",\n      \"Type\": \"Invoice\"\n    }\n  ],\n  \"Document Type\": \"Credit Note\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3A-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Office furniture — returned\",\n      \"Line Amount\": 400,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 36,\n          \"Tax Category Code\": \"TX\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 400\n        }\n      ],\n      \"Unit Amount\": 400,\n      \"Unit of Measure\": \"H87\"\n    }\n  ],\n  \"Note\": \"Return against TC-3A-01\",\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 400,\n    \"Sum of Line Amounts\": 400,\n    \"Tax Total\": 36,\n    \"Total\": 436,\n    \"Total incl Tax\": 436\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"da50effc-9a07-4557-bd06-e0f41dc636a5\"\n}"

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

```java 3A-03-purchase-credit-note
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/einvoice/ar/:qid")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Reference\": [\n    {\n      \"Date\": \"2026-08-26\",\n      \"Number\": \"TC-3A-01\",\n      \"Type\": \"Invoice\"\n    }\n  ],\n  \"Document Type\": \"Credit Note\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3A-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Office furniture — returned\",\n      \"Line Amount\": 400,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 36,\n          \"Tax Category Code\": \"TX\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 400\n        }\n      ],\n      \"Unit Amount\": 400,\n      \"Unit of Measure\": \"H87\"\n    }\n  ],\n  \"Note\": \"Return against TC-3A-01\",\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 400,\n    \"Sum of Line Amounts\": 400,\n    \"Tax Total\": 36,\n    \"Total\": 436,\n    \"Total incl Tax\": 436\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"da50effc-9a07-4557-bd06-e0f41dc636a5\"\n}")
  .asString();
```

```php 3A-03-purchase-credit-note
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/einvoice/ar/:qid', [
  'body' => '{
  "Addon": "sg-standard",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Currency": "SGD",
  "Document Reference": [
    {
      "Date": "2026-08-26",
      "Number": "TC-3A-01",
      "Type": "Invoice"
    }
  ],
  "Document Type": "Credit Note",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-3A-03",
  "Line Items": [
    {
      "Description": "Office furniture — returned",
      "Line Amount": 400,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 36,
          "Tax Category Code": "TX",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 400
        }
      ],
      "Unit Amount": 400,
      "Unit of Measure": "H87"
    }
  ],
  "Note": "Return against TC-3A-01",
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  },
  "Totals": {
    "Subtotal": 400,
    "Sum of Line Amounts": 400,
    "Tax Total": 36,
    "Total": 436,
    "Total incl Tax": 436
  },
  "Transaction Type": "Purchases",
  "UUID": "da50effc-9a07-4557-bd06-e0f41dc636a5"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp 3A-03-purchase-credit-note
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/einvoice/ar/:qid");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"Addon\": \"sg-standard\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Reference\": [\n    {\n      \"Date\": \"2026-08-26\",\n      \"Number\": \"TC-3A-01\",\n      \"Type\": \"Invoice\"\n    }\n  ],\n  \"Document Type\": \"Credit Note\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3A-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"Office furniture — returned\",\n      \"Line Amount\": 400,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 36,\n          \"Tax Category Code\": \"TX\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 400\n        }\n      ],\n      \"Unit Amount\": 400,\n      \"Unit of Measure\": \"H87\"\n    }\n  ],\n  \"Note\": \"Return against TC-3A-01\",\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"088541\",\n      \"Street Name\": \"120 Tanjong Pagar Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Northstar Commerce Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202623458Y\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202623458Y\",\n    \"Tax ID\": \"M90262345Y\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 400,\n    \"Sum of Line Amounts\": 400,\n    \"Tax Total\": 36,\n    \"Total\": 436,\n    \"Total incl Tax\": 436\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"da50effc-9a07-4557-bd06-e0f41dc636a5\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 3A-03-purchase-credit-note
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "Addon": "sg-standard",
  "Buyer": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  ],
  "Currency": "SGD",
  "Document Reference": [
    [
      "Date": "2026-08-26",
      "Number": "TC-3A-01",
      "Type": "Invoice"
    ]
  ],
  "Document Type": "Credit Note",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-3A-03",
  "Line Items": [
    [
      "Description": "Office furniture — returned",
      "Line Amount": 400,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        [
          "Tax Amount": 36,
          "Tax Category Code": "TX",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 400
        ]
      ],
      "Unit Amount": 400,
      "Unit of Measure": "H87"
    ]
  ],
  "Note": "Return against TC-3A-01",
  "Seller": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "088541",
      "Street Name": "120 Tanjong Pagar Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Northstar Commerce Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202623458Y",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202623458Y",
    "Tax ID": "M90262345Y"
  ],
  "Totals": [
    "Subtotal": 400,
    "Sum of Line Amounts": 400,
    "Tax Total": 36,
    "Total": 436,
    "Total incl Tax": 436
  ],
  "Transaction Type": "Purchases",
  "UUID": "da50effc-9a07-4557-bd06-e0f41dc636a5"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/einvoice/ar/:qid")! 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()
```

### 3B-01-pcp-single-tax

**Request**

```json
{
  "Addon": "sg-aggregated",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-3B-01",
  "Line Items": [
    {
      "Description": "PCP",
      "Line Amount": 1200,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 108,
          "Tax Category Code": "TX",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 1200
        }
      ],
      "Unit Amount": 1200,
      "Unit of Measure": "XLT"
    }
  ],
  "Note": "Staff claims Aug 2026",
  "Period": {
    "End Date": "2026-08-26",
    "Start Date": "2026-08-01"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "NA",
      "Street Name": "NA"
    },
    "Name": "PCP",
    "Peppol Endpoint ID": "PCP",
    "Peppol Scheme ID": "0195",
    "Registration Number": "PCP",
    "Tax ID": "PCP"
  },
  "Totals": {
    "Subtotal": 1200,
    "Sum of Line Amounts": 1200,
    "Tax Total": 108,
    "Total": 1308,
    "Total incl Tax": 1308
  },
  "Transaction Type": "Purchases",
  "UUID": "adf8e3d9-7ab9-4f61-9ff0-6ae0c39633dd"
}
```

**Response**

```json
{
  "importERP": {
    "message": "[Peppol] Document creation request has been accepted.",
    "requestId": "3f8a625f-1881-438a-9d44-382fb7a6d5cd",
    "status": "SUCCESS"
  }
}
```

**SDK Code**

```python 3B-01-pcp-single-tax
import requests

url = "https://api.staple.io/v2/einvoice/ar/:qid"

payload = {
    "Addon": "sg-aggregated",
    "Buyer": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "068895",
            "Street Name": "71 Robinson Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Meridian Crest Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202612344K",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202612344K",
        "Tax ID": "M90261234K"
    },
    "Currency": "SGD",
    "Document Type": "Invoice",
    "Invoice Date": "2026-08-26",
    "Invoice Number": "TC-3B-01",
    "Line Items": [
        {
            "Description": "PCP",
            "Line Amount": 1200,
            "Line ID": "1",
            "Quantity": 1,
            "Tax Breakdown": [
                {
                    "Tax Amount": 108,
                    "Tax Category Code": "TX",
                    "Tax Rate": 9,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 1200
                }
            ],
            "Unit Amount": 1200,
            "Unit of Measure": "XLT"
        }
    ],
    "Note": "Staff claims Aug 2026",
    "Period": {
        "End Date": "2026-08-26",
        "Start Date": "2026-08-01"
    },
    "Seller": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "NA",
            "Street Name": "NA"
        },
        "Name": "PCP",
        "Peppol Endpoint ID": "PCP",
        "Peppol Scheme ID": "0195",
        "Registration Number": "PCP",
        "Tax ID": "PCP"
    },
    "Totals": {
        "Subtotal": 1200,
        "Sum of Line Amounts": 1200,
        "Tax Total": 108,
        "Total": 1308,
        "Total incl Tax": 1308
    },
    "Transaction Type": "Purchases",
    "UUID": "adf8e3d9-7ab9-4f61-9ff0-6ae0c39633dd"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 3B-01-pcp-single-tax
const url = 'https://api.staple.io/v2/einvoice/ar/:qid';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"Addon":"sg-aggregated","Buyer":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"068895","Street Name":"71 Robinson Road"},"Email":"atharva@staple.io","Name":"Meridian Crest Pte. Ltd.","Peppol Endpoint ID":"SGTST202612344K","Peppol Scheme ID":"0195","Registration Number":"202612344K","Tax ID":"M90261234K"},"Currency":"SGD","Document Type":"Invoice","Invoice Date":"2026-08-26","Invoice Number":"TC-3B-01","Line Items":[{"Description":"PCP","Line Amount":1200,"Line ID":"1","Quantity":1,"Tax Breakdown":[{"Tax Amount":108,"Tax Category Code":"TX","Tax Rate":9,"Tax Scheme":"GST","Taxable Amount":1200}],"Unit Amount":1200,"Unit of Measure":"XLT"}],"Note":"Staff claims Aug 2026","Period":{"End Date":"2026-08-26","Start Date":"2026-08-01"},"Seller":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"NA","Street Name":"NA"},"Name":"PCP","Peppol Endpoint ID":"PCP","Peppol Scheme ID":"0195","Registration Number":"PCP","Tax ID":"PCP"},"Totals":{"Subtotal":1200,"Sum of Line Amounts":1200,"Tax Total":108,"Total":1308,"Total incl Tax":1308},"Transaction Type":"Purchases","UUID":"adf8e3d9-7ab9-4f61-9ff0-6ae0c39633dd"}'
};

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

```go 3B-01-pcp-single-tax
package main

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

func main() {

	url := "https://api.staple.io/v2/einvoice/ar/:qid"

	payload := strings.NewReader("{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3B-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"PCP\",\n      \"Line Amount\": 1200,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 108,\n          \"Tax Category Code\": \"TX\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1200\n        }\n      ],\n      \"Unit Amount\": 1200,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"Staff claims Aug 2026\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"PCP\",\n    \"Peppol Endpoint ID\": \"PCP\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"PCP\",\n    \"Tax ID\": \"PCP\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1200,\n    \"Sum of Line Amounts\": 1200,\n    \"Tax Total\": 108,\n    \"Total\": 1308,\n    \"Total incl Tax\": 1308\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"adf8e3d9-7ab9-4f61-9ff0-6ae0c39633dd\"\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby 3B-01-pcp-single-tax
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/einvoice/ar/:qid")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3B-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"PCP\",\n      \"Line Amount\": 1200,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 108,\n          \"Tax Category Code\": \"TX\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1200\n        }\n      ],\n      \"Unit Amount\": 1200,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"Staff claims Aug 2026\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"PCP\",\n    \"Peppol Endpoint ID\": \"PCP\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"PCP\",\n    \"Tax ID\": \"PCP\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1200,\n    \"Sum of Line Amounts\": 1200,\n    \"Tax Total\": 108,\n    \"Total\": 1308,\n    \"Total incl Tax\": 1308\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"adf8e3d9-7ab9-4f61-9ff0-6ae0c39633dd\"\n}"

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

```java 3B-01-pcp-single-tax
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/einvoice/ar/:qid")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3B-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"PCP\",\n      \"Line Amount\": 1200,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 108,\n          \"Tax Category Code\": \"TX\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1200\n        }\n      ],\n      \"Unit Amount\": 1200,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"Staff claims Aug 2026\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"PCP\",\n    \"Peppol Endpoint ID\": \"PCP\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"PCP\",\n    \"Tax ID\": \"PCP\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1200,\n    \"Sum of Line Amounts\": 1200,\n    \"Tax Total\": 108,\n    \"Total\": 1308,\n    \"Total incl Tax\": 1308\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"adf8e3d9-7ab9-4f61-9ff0-6ae0c39633dd\"\n}")
  .asString();
```

```php 3B-01-pcp-single-tax
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/einvoice/ar/:qid', [
  'body' => '{
  "Addon": "sg-aggregated",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-3B-01",
  "Line Items": [
    {
      "Description": "PCP",
      "Line Amount": 1200,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 108,
          "Tax Category Code": "TX",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 1200
        }
      ],
      "Unit Amount": 1200,
      "Unit of Measure": "XLT"
    }
  ],
  "Note": "Staff claims Aug 2026",
  "Period": {
    "End Date": "2026-08-26",
    "Start Date": "2026-08-01"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "NA",
      "Street Name": "NA"
    },
    "Name": "PCP",
    "Peppol Endpoint ID": "PCP",
    "Peppol Scheme ID": "0195",
    "Registration Number": "PCP",
    "Tax ID": "PCP"
  },
  "Totals": {
    "Subtotal": 1200,
    "Sum of Line Amounts": 1200,
    "Tax Total": 108,
    "Total": 1308,
    "Total incl Tax": 1308
  },
  "Transaction Type": "Purchases",
  "UUID": "adf8e3d9-7ab9-4f61-9ff0-6ae0c39633dd"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp 3B-01-pcp-single-tax
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/einvoice/ar/:qid");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3B-01\",\n  \"Line Items\": [\n    {\n      \"Description\": \"PCP\",\n      \"Line Amount\": 1200,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 108,\n          \"Tax Category Code\": \"TX\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 1200\n        }\n      ],\n      \"Unit Amount\": 1200,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"Staff claims Aug 2026\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"PCP\",\n    \"Peppol Endpoint ID\": \"PCP\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"PCP\",\n    \"Tax ID\": \"PCP\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1200,\n    \"Sum of Line Amounts\": 1200,\n    \"Tax Total\": 108,\n    \"Total\": 1308,\n    \"Total incl Tax\": 1308\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"adf8e3d9-7ab9-4f61-9ff0-6ae0c39633dd\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 3B-01-pcp-single-tax
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "Addon": "sg-aggregated",
  "Buyer": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  ],
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-3B-01",
  "Line Items": [
    [
      "Description": "PCP",
      "Line Amount": 1200,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        [
          "Tax Amount": 108,
          "Tax Category Code": "TX",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 1200
        ]
      ],
      "Unit Amount": 1200,
      "Unit of Measure": "XLT"
    ]
  ],
  "Note": "Staff claims Aug 2026",
  "Period": [
    "End Date": "2026-08-26",
    "Start Date": "2026-08-01"
  ],
  "Seller": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "NA",
      "Street Name": "NA"
    ],
    "Name": "PCP",
    "Peppol Endpoint ID": "PCP",
    "Peppol Scheme ID": "0195",
    "Registration Number": "PCP",
    "Tax ID": "PCP"
  ],
  "Totals": [
    "Subtotal": 1200,
    "Sum of Line Amounts": 1200,
    "Tax Total": 108,
    "Total": 1308,
    "Total incl Tax": 1308
  ],
  "Transaction Type": "Purchases",
  "UUID": "adf8e3d9-7ab9-4f61-9ff0-6ae0c39633dd"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/einvoice/ar/:qid")! 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()
```

### 3B-02-pcp-multi-tax

**Request**

```json
{
  "Addon": "sg-aggregated",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-3B-02",
  "Line Items": [
    {
      "Description": "PCP",
      "Line Amount": 900,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 81,
          "Tax Category Code": "TX",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 900
        }
      ],
      "Unit Amount": 900,
      "Unit of Measure": "XLT"
    },
    {
      "Description": "PCP",
      "Line Amount": 300,
      "Line ID": "2",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 0,
          "Tax Category Code": "ZP",
          "Tax Rate": 0,
          "Tax Scheme": "GST",
          "Taxable Amount": 300
        }
      ],
      "Unit Amount": 300,
      "Unit of Measure": "XLT"
    }
  ],
  "Note": "Staff claims Aug 2026",
  "Period": {
    "End Date": "2026-08-26",
    "Start Date": "2026-08-01"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "NA",
      "Street Name": "NA"
    },
    "Name": "PCP",
    "Peppol Endpoint ID": "PCP",
    "Peppol Scheme ID": "0195",
    "Registration Number": "PCP",
    "Tax ID": "PCP"
  },
  "Totals": {
    "Subtotal": 1200,
    "Sum of Line Amounts": 1200,
    "Tax Total": 81,
    "Total": 1281,
    "Total incl Tax": 1281
  },
  "Transaction Type": "Purchases",
  "UUID": "fb8bdbd5-3ac3-49ac-84eb-c0915b84ee6f"
}
```

**Response**

```json
{
  "importERP": {
    "message": "[Peppol] Document creation request has been accepted.",
    "requestId": "3f8a625f-1881-438a-9d44-382fb7a6d5cd",
    "status": "SUCCESS"
  }
}
```

**SDK Code**

```python 3B-02-pcp-multi-tax
import requests

url = "https://api.staple.io/v2/einvoice/ar/:qid"

payload = {
    "Addon": "sg-aggregated",
    "Buyer": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "068895",
            "Street Name": "71 Robinson Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Meridian Crest Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202612344K",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202612344K",
        "Tax ID": "M90261234K"
    },
    "Currency": "SGD",
    "Document Type": "Invoice",
    "Invoice Date": "2026-08-26",
    "Invoice Number": "TC-3B-02",
    "Line Items": [
        {
            "Description": "PCP",
            "Line Amount": 900,
            "Line ID": "1",
            "Quantity": 1,
            "Tax Breakdown": [
                {
                    "Tax Amount": 81,
                    "Tax Category Code": "TX",
                    "Tax Rate": 9,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 900
                }
            ],
            "Unit Amount": 900,
            "Unit of Measure": "XLT"
        },
        {
            "Description": "PCP",
            "Line Amount": 300,
            "Line ID": "2",
            "Quantity": 1,
            "Tax Breakdown": [
                {
                    "Tax Amount": 0,
                    "Tax Category Code": "ZP",
                    "Tax Rate": 0,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 300
                }
            ],
            "Unit Amount": 300,
            "Unit of Measure": "XLT"
        }
    ],
    "Note": "Staff claims Aug 2026",
    "Period": {
        "End Date": "2026-08-26",
        "Start Date": "2026-08-01"
    },
    "Seller": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "NA",
            "Street Name": "NA"
        },
        "Name": "PCP",
        "Peppol Endpoint ID": "PCP",
        "Peppol Scheme ID": "0195",
        "Registration Number": "PCP",
        "Tax ID": "PCP"
    },
    "Totals": {
        "Subtotal": 1200,
        "Sum of Line Amounts": 1200,
        "Tax Total": 81,
        "Total": 1281,
        "Total incl Tax": 1281
    },
    "Transaction Type": "Purchases",
    "UUID": "fb8bdbd5-3ac3-49ac-84eb-c0915b84ee6f"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 3B-02-pcp-multi-tax
const url = 'https://api.staple.io/v2/einvoice/ar/:qid';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"Addon":"sg-aggregated","Buyer":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"068895","Street Name":"71 Robinson Road"},"Email":"atharva@staple.io","Name":"Meridian Crest Pte. Ltd.","Peppol Endpoint ID":"SGTST202612344K","Peppol Scheme ID":"0195","Registration Number":"202612344K","Tax ID":"M90261234K"},"Currency":"SGD","Document Type":"Invoice","Invoice Date":"2026-08-26","Invoice Number":"TC-3B-02","Line Items":[{"Description":"PCP","Line Amount":900,"Line ID":"1","Quantity":1,"Tax Breakdown":[{"Tax Amount":81,"Tax Category Code":"TX","Tax Rate":9,"Tax Scheme":"GST","Taxable Amount":900}],"Unit Amount":900,"Unit of Measure":"XLT"},{"Description":"PCP","Line Amount":300,"Line ID":"2","Quantity":1,"Tax Breakdown":[{"Tax Amount":0,"Tax Category Code":"ZP","Tax Rate":0,"Tax Scheme":"GST","Taxable Amount":300}],"Unit Amount":300,"Unit of Measure":"XLT"}],"Note":"Staff claims Aug 2026","Period":{"End Date":"2026-08-26","Start Date":"2026-08-01"},"Seller":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"NA","Street Name":"NA"},"Name":"PCP","Peppol Endpoint ID":"PCP","Peppol Scheme ID":"0195","Registration Number":"PCP","Tax ID":"PCP"},"Totals":{"Subtotal":1200,"Sum of Line Amounts":1200,"Tax Total":81,"Total":1281,"Total incl Tax":1281},"Transaction Type":"Purchases","UUID":"fb8bdbd5-3ac3-49ac-84eb-c0915b84ee6f"}'
};

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

```go 3B-02-pcp-multi-tax
package main

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

func main() {

	url := "https://api.staple.io/v2/einvoice/ar/:qid"

	payload := strings.NewReader("{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3B-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"PCP\",\n      \"Line Amount\": 900,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 81,\n          \"Tax Category Code\": \"TX\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 900\n        }\n      ],\n      \"Unit Amount\": 900,\n      \"Unit of Measure\": \"XLT\"\n    },\n    {\n      \"Description\": \"PCP\",\n      \"Line Amount\": 300,\n      \"Line ID\": \"2\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 0,\n          \"Tax Category Code\": \"ZP\",\n          \"Tax Rate\": 0,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 300\n        }\n      ],\n      \"Unit Amount\": 300,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"Staff claims Aug 2026\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"PCP\",\n    \"Peppol Endpoint ID\": \"PCP\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"PCP\",\n    \"Tax ID\": \"PCP\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1200,\n    \"Sum of Line Amounts\": 1200,\n    \"Tax Total\": 81,\n    \"Total\": 1281,\n    \"Total incl Tax\": 1281\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"fb8bdbd5-3ac3-49ac-84eb-c0915b84ee6f\"\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby 3B-02-pcp-multi-tax
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/einvoice/ar/:qid")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3B-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"PCP\",\n      \"Line Amount\": 900,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 81,\n          \"Tax Category Code\": \"TX\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 900\n        }\n      ],\n      \"Unit Amount\": 900,\n      \"Unit of Measure\": \"XLT\"\n    },\n    {\n      \"Description\": \"PCP\",\n      \"Line Amount\": 300,\n      \"Line ID\": \"2\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 0,\n          \"Tax Category Code\": \"ZP\",\n          \"Tax Rate\": 0,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 300\n        }\n      ],\n      \"Unit Amount\": 300,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"Staff claims Aug 2026\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"PCP\",\n    \"Peppol Endpoint ID\": \"PCP\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"PCP\",\n    \"Tax ID\": \"PCP\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1200,\n    \"Sum of Line Amounts\": 1200,\n    \"Tax Total\": 81,\n    \"Total\": 1281,\n    \"Total incl Tax\": 1281\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"fb8bdbd5-3ac3-49ac-84eb-c0915b84ee6f\"\n}"

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

```java 3B-02-pcp-multi-tax
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/einvoice/ar/:qid")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3B-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"PCP\",\n      \"Line Amount\": 900,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 81,\n          \"Tax Category Code\": \"TX\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 900\n        }\n      ],\n      \"Unit Amount\": 900,\n      \"Unit of Measure\": \"XLT\"\n    },\n    {\n      \"Description\": \"PCP\",\n      \"Line Amount\": 300,\n      \"Line ID\": \"2\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 0,\n          \"Tax Category Code\": \"ZP\",\n          \"Tax Rate\": 0,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 300\n        }\n      ],\n      \"Unit Amount\": 300,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"Staff claims Aug 2026\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"PCP\",\n    \"Peppol Endpoint ID\": \"PCP\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"PCP\",\n    \"Tax ID\": \"PCP\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1200,\n    \"Sum of Line Amounts\": 1200,\n    \"Tax Total\": 81,\n    \"Total\": 1281,\n    \"Total incl Tax\": 1281\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"fb8bdbd5-3ac3-49ac-84eb-c0915b84ee6f\"\n}")
  .asString();
```

```php 3B-02-pcp-multi-tax
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/einvoice/ar/:qid', [
  'body' => '{
  "Addon": "sg-aggregated",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-3B-02",
  "Line Items": [
    {
      "Description": "PCP",
      "Line Amount": 900,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 81,
          "Tax Category Code": "TX",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 900
        }
      ],
      "Unit Amount": 900,
      "Unit of Measure": "XLT"
    },
    {
      "Description": "PCP",
      "Line Amount": 300,
      "Line ID": "2",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 0,
          "Tax Category Code": "ZP",
          "Tax Rate": 0,
          "Tax Scheme": "GST",
          "Taxable Amount": 300
        }
      ],
      "Unit Amount": 300,
      "Unit of Measure": "XLT"
    }
  ],
  "Note": "Staff claims Aug 2026",
  "Period": {
    "End Date": "2026-08-26",
    "Start Date": "2026-08-01"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "NA",
      "Street Name": "NA"
    },
    "Name": "PCP",
    "Peppol Endpoint ID": "PCP",
    "Peppol Scheme ID": "0195",
    "Registration Number": "PCP",
    "Tax ID": "PCP"
  },
  "Totals": {
    "Subtotal": 1200,
    "Sum of Line Amounts": 1200,
    "Tax Total": 81,
    "Total": 1281,
    "Total incl Tax": 1281
  },
  "Transaction Type": "Purchases",
  "UUID": "fb8bdbd5-3ac3-49ac-84eb-c0915b84ee6f"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp 3B-02-pcp-multi-tax
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/einvoice/ar/:qid");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3B-02\",\n  \"Line Items\": [\n    {\n      \"Description\": \"PCP\",\n      \"Line Amount\": 900,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 81,\n          \"Tax Category Code\": \"TX\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 900\n        }\n      ],\n      \"Unit Amount\": 900,\n      \"Unit of Measure\": \"XLT\"\n    },\n    {\n      \"Description\": \"PCP\",\n      \"Line Amount\": 300,\n      \"Line ID\": \"2\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 0,\n          \"Tax Category Code\": \"ZP\",\n          \"Tax Rate\": 0,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 300\n        }\n      ],\n      \"Unit Amount\": 300,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"Staff claims Aug 2026\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"PCP\",\n    \"Peppol Endpoint ID\": \"PCP\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"PCP\",\n    \"Tax ID\": \"PCP\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 1200,\n    \"Sum of Line Amounts\": 1200,\n    \"Tax Total\": 81,\n    \"Total\": 1281,\n    \"Total incl Tax\": 1281\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"fb8bdbd5-3ac3-49ac-84eb-c0915b84ee6f\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 3B-02-pcp-multi-tax
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "Addon": "sg-aggregated",
  "Buyer": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  ],
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-3B-02",
  "Line Items": [
    [
      "Description": "PCP",
      "Line Amount": 900,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        [
          "Tax Amount": 81,
          "Tax Category Code": "TX",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 900
        ]
      ],
      "Unit Amount": 900,
      "Unit of Measure": "XLT"
    ],
    [
      "Description": "PCP",
      "Line Amount": 300,
      "Line ID": "2",
      "Quantity": 1,
      "Tax Breakdown": [
        [
          "Tax Amount": 0,
          "Tax Category Code": "ZP",
          "Tax Rate": 0,
          "Tax Scheme": "GST",
          "Taxable Amount": 300
        ]
      ],
      "Unit Amount": 300,
      "Unit of Measure": "XLT"
    ]
  ],
  "Note": "Staff claims Aug 2026",
  "Period": [
    "End Date": "2026-08-26",
    "Start Date": "2026-08-01"
  ],
  "Seller": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "NA",
      "Street Name": "NA"
    ],
    "Name": "PCP",
    "Peppol Endpoint ID": "PCP",
    "Peppol Scheme ID": "0195",
    "Registration Number": "PCP",
    "Tax ID": "PCP"
  ],
  "Totals": [
    "Subtotal": 1200,
    "Sum of Line Amounts": 1200,
    "Tax Total": 81,
    "Total": 1281,
    "Total incl Tax": 1281
  ],
  "Transaction Type": "Purchases",
  "UUID": "fb8bdbd5-3ac3-49ac-84eb-c0915b84ee6f"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/einvoice/ar/:qid")! 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()
```

### 3B-03-pcp-residual

**Request**

```json
{
  "Addon": "sg-aggregated",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-3B-03",
  "Line Items": [
    {
      "Description": "PCP",
      "Line Amount": 750,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 67.5,
          "Tax Category Code": "TX-RE",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 750
        }
      ],
      "Unit Amount": 750,
      "Unit of Measure": "XLT"
    }
  ],
  "Note": "Staff claims Aug 2026 - residual",
  "Period": {
    "End Date": "2026-08-26",
    "Start Date": "2026-08-01"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "NA",
      "Street Name": "NA"
    },
    "Name": "PCP",
    "Peppol Endpoint ID": "PCP",
    "Peppol Scheme ID": "0195",
    "Registration Number": "PCP",
    "Tax ID": "PCP"
  },
  "Totals": {
    "Subtotal": 750,
    "Sum of Line Amounts": 750,
    "Tax Total": 67.5,
    "Total": 817.5,
    "Total incl Tax": 817.5
  },
  "Transaction Type": "Purchases",
  "UUID": "f52f30f8-9702-4a87-a616-3f0080c18a39"
}
```

**Response**

```json
{
  "importERP": {
    "message": "[Peppol] Document creation request has been accepted.",
    "requestId": "3f8a625f-1881-438a-9d44-382fb7a6d5cd",
    "status": "SUCCESS"
  }
}
```

**SDK Code**

```python 3B-03-pcp-residual
import requests

url = "https://api.staple.io/v2/einvoice/ar/:qid"

payload = {
    "Addon": "sg-aggregated",
    "Buyer": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "068895",
            "Street Name": "71 Robinson Road"
        },
        "Email": "atharva@staple.io",
        "Name": "Meridian Crest Pte. Ltd.",
        "Peppol Endpoint ID": "SGTST202612344K",
        "Peppol Scheme ID": "0195",
        "Registration Number": "202612344K",
        "Tax ID": "M90261234K"
    },
    "Currency": "SGD",
    "Document Type": "Invoice",
    "Invoice Date": "2026-08-26",
    "Invoice Number": "TC-3B-03",
    "Line Items": [
        {
            "Description": "PCP",
            "Line Amount": 750,
            "Line ID": "1",
            "Quantity": 1,
            "Tax Breakdown": [
                {
                    "Tax Amount": 67.5,
                    "Tax Category Code": "TX-RE",
                    "Tax Rate": 9,
                    "Tax Scheme": "GST",
                    "Taxable Amount": 750
                }
            ],
            "Unit Amount": 750,
            "Unit of Measure": "XLT"
        }
    ],
    "Note": "Staff claims Aug 2026 - residual",
    "Period": {
        "End Date": "2026-08-26",
        "Start Date": "2026-08-01"
    },
    "Seller": {
        "Address": {
            "City Name": "Singapore",
            "Country Code": "SG",
            "Postal Zone": "NA",
            "Street Name": "NA"
        },
        "Name": "PCP",
        "Peppol Endpoint ID": "PCP",
        "Peppol Scheme ID": "0195",
        "Registration Number": "PCP",
        "Tax ID": "PCP"
    },
    "Totals": {
        "Subtotal": 750,
        "Sum of Line Amounts": 750,
        "Tax Total": 67.5,
        "Total": 817.5,
        "Total incl Tax": 817.5
    },
    "Transaction Type": "Purchases",
    "UUID": "f52f30f8-9702-4a87-a616-3f0080c18a39"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 3B-03-pcp-residual
const url = 'https://api.staple.io/v2/einvoice/ar/:qid';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"Addon":"sg-aggregated","Buyer":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"068895","Street Name":"71 Robinson Road"},"Email":"atharva@staple.io","Name":"Meridian Crest Pte. Ltd.","Peppol Endpoint ID":"SGTST202612344K","Peppol Scheme ID":"0195","Registration Number":"202612344K","Tax ID":"M90261234K"},"Currency":"SGD","Document Type":"Invoice","Invoice Date":"2026-08-26","Invoice Number":"TC-3B-03","Line Items":[{"Description":"PCP","Line Amount":750,"Line ID":"1","Quantity":1,"Tax Breakdown":[{"Tax Amount":67.5,"Tax Category Code":"TX-RE","Tax Rate":9,"Tax Scheme":"GST","Taxable Amount":750}],"Unit Amount":750,"Unit of Measure":"XLT"}],"Note":"Staff claims Aug 2026 - residual","Period":{"End Date":"2026-08-26","Start Date":"2026-08-01"},"Seller":{"Address":{"City Name":"Singapore","Country Code":"SG","Postal Zone":"NA","Street Name":"NA"},"Name":"PCP","Peppol Endpoint ID":"PCP","Peppol Scheme ID":"0195","Registration Number":"PCP","Tax ID":"PCP"},"Totals":{"Subtotal":750,"Sum of Line Amounts":750,"Tax Total":67.5,"Total":817.5,"Total incl Tax":817.5},"Transaction Type":"Purchases","UUID":"f52f30f8-9702-4a87-a616-3f0080c18a39"}'
};

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

```go 3B-03-pcp-residual
package main

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

func main() {

	url := "https://api.staple.io/v2/einvoice/ar/:qid"

	payload := strings.NewReader("{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3B-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"PCP\",\n      \"Line Amount\": 750,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 67.5,\n          \"Tax Category Code\": \"TX-RE\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 750\n        }\n      ],\n      \"Unit Amount\": 750,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"Staff claims Aug 2026 - residual\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"PCP\",\n    \"Peppol Endpoint ID\": \"PCP\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"PCP\",\n    \"Tax ID\": \"PCP\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 750,\n    \"Sum of Line Amounts\": 750,\n    \"Tax Total\": 67.5,\n    \"Total\": 817.5,\n    \"Total incl Tax\": 817.5\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"f52f30f8-9702-4a87-a616-3f0080c18a39\"\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby 3B-03-pcp-residual
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/einvoice/ar/:qid")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3B-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"PCP\",\n      \"Line Amount\": 750,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 67.5,\n          \"Tax Category Code\": \"TX-RE\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 750\n        }\n      ],\n      \"Unit Amount\": 750,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"Staff claims Aug 2026 - residual\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"PCP\",\n    \"Peppol Endpoint ID\": \"PCP\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"PCP\",\n    \"Tax ID\": \"PCP\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 750,\n    \"Sum of Line Amounts\": 750,\n    \"Tax Total\": 67.5,\n    \"Total\": 817.5,\n    \"Total incl Tax\": 817.5\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"f52f30f8-9702-4a87-a616-3f0080c18a39\"\n}"

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

```java 3B-03-pcp-residual
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/einvoice/ar/:qid")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3B-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"PCP\",\n      \"Line Amount\": 750,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 67.5,\n          \"Tax Category Code\": \"TX-RE\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 750\n        }\n      ],\n      \"Unit Amount\": 750,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"Staff claims Aug 2026 - residual\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"PCP\",\n    \"Peppol Endpoint ID\": \"PCP\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"PCP\",\n    \"Tax ID\": \"PCP\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 750,\n    \"Sum of Line Amounts\": 750,\n    \"Tax Total\": 67.5,\n    \"Total\": 817.5,\n    \"Total incl Tax\": 817.5\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"f52f30f8-9702-4a87-a616-3f0080c18a39\"\n}")
  .asString();
```

```php 3B-03-pcp-residual
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/einvoice/ar/:qid', [
  'body' => '{
  "Addon": "sg-aggregated",
  "Buyer": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    },
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  },
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-3B-03",
  "Line Items": [
    {
      "Description": "PCP",
      "Line Amount": 750,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        {
          "Tax Amount": 67.5,
          "Tax Category Code": "TX-RE",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 750
        }
      ],
      "Unit Amount": 750,
      "Unit of Measure": "XLT"
    }
  ],
  "Note": "Staff claims Aug 2026 - residual",
  "Period": {
    "End Date": "2026-08-26",
    "Start Date": "2026-08-01"
  },
  "Seller": {
    "Address": {
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "NA",
      "Street Name": "NA"
    },
    "Name": "PCP",
    "Peppol Endpoint ID": "PCP",
    "Peppol Scheme ID": "0195",
    "Registration Number": "PCP",
    "Tax ID": "PCP"
  },
  "Totals": {
    "Subtotal": 750,
    "Sum of Line Amounts": 750,
    "Tax Total": 67.5,
    "Total": 817.5,
    "Total incl Tax": 817.5
  },
  "Transaction Type": "Purchases",
  "UUID": "f52f30f8-9702-4a87-a616-3f0080c18a39"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp 3B-03-pcp-residual
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/einvoice/ar/:qid");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"Addon\": \"sg-aggregated\",\n  \"Buyer\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"068895\",\n      \"Street Name\": \"71 Robinson Road\"\n    },\n    \"Email\": \"atharva@staple.io\",\n    \"Name\": \"Meridian Crest Pte. Ltd.\",\n    \"Peppol Endpoint ID\": \"SGTST202612344K\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"202612344K\",\n    \"Tax ID\": \"M90261234K\"\n  },\n  \"Currency\": \"SGD\",\n  \"Document Type\": \"Invoice\",\n  \"Invoice Date\": \"2026-08-26\",\n  \"Invoice Number\": \"TC-3B-03\",\n  \"Line Items\": [\n    {\n      \"Description\": \"PCP\",\n      \"Line Amount\": 750,\n      \"Line ID\": \"1\",\n      \"Quantity\": 1,\n      \"Tax Breakdown\": [\n        {\n          \"Tax Amount\": 67.5,\n          \"Tax Category Code\": \"TX-RE\",\n          \"Tax Rate\": 9,\n          \"Tax Scheme\": \"GST\",\n          \"Taxable Amount\": 750\n        }\n      ],\n      \"Unit Amount\": 750,\n      \"Unit of Measure\": \"XLT\"\n    }\n  ],\n  \"Note\": \"Staff claims Aug 2026 - residual\",\n  \"Period\": {\n    \"End Date\": \"2026-08-26\",\n    \"Start Date\": \"2026-08-01\"\n  },\n  \"Seller\": {\n    \"Address\": {\n      \"City Name\": \"Singapore\",\n      \"Country Code\": \"SG\",\n      \"Postal Zone\": \"NA\",\n      \"Street Name\": \"NA\"\n    },\n    \"Name\": \"PCP\",\n    \"Peppol Endpoint ID\": \"PCP\",\n    \"Peppol Scheme ID\": \"0195\",\n    \"Registration Number\": \"PCP\",\n    \"Tax ID\": \"PCP\"\n  },\n  \"Totals\": {\n    \"Subtotal\": 750,\n    \"Sum of Line Amounts\": 750,\n    \"Tax Total\": 67.5,\n    \"Total\": 817.5,\n    \"Total incl Tax\": 817.5\n  },\n  \"Transaction Type\": \"Purchases\",\n  \"UUID\": \"f52f30f8-9702-4a87-a616-3f0080c18a39\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 3B-03-pcp-residual
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "Addon": "sg-aggregated",
  "Buyer": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "068895",
      "Street Name": "71 Robinson Road"
    ],
    "Email": "atharva@staple.io",
    "Name": "Meridian Crest Pte. Ltd.",
    "Peppol Endpoint ID": "SGTST202612344K",
    "Peppol Scheme ID": "0195",
    "Registration Number": "202612344K",
    "Tax ID": "M90261234K"
  ],
  "Currency": "SGD",
  "Document Type": "Invoice",
  "Invoice Date": "2026-08-26",
  "Invoice Number": "TC-3B-03",
  "Line Items": [
    [
      "Description": "PCP",
      "Line Amount": 750,
      "Line ID": "1",
      "Quantity": 1,
      "Tax Breakdown": [
        [
          "Tax Amount": 67.5,
          "Tax Category Code": "TX-RE",
          "Tax Rate": 9,
          "Tax Scheme": "GST",
          "Taxable Amount": 750
        ]
      ],
      "Unit Amount": 750,
      "Unit of Measure": "XLT"
    ]
  ],
  "Note": "Staff claims Aug 2026 - residual",
  "Period": [
    "End Date": "2026-08-26",
    "Start Date": "2026-08-01"
  ],
  "Seller": [
    "Address": [
      "City Name": "Singapore",
      "Country Code": "SG",
      "Postal Zone": "NA",
      "Street Name": "NA"
    ],
    "Name": "PCP",
    "Peppol Endpoint ID": "PCP",
    "Peppol Scheme ID": "0195",
    "Registration Number": "PCP",
    "Tax ID": "PCP"
  ],
  "Totals": [
    "Subtotal": 750,
    "Sum of Line Amounts": 750,
    "Tax Total": 67.5,
    "Total": 817.5,
    "Total incl Tax": 817.5
  ],
  "Transaction Type": "Purchases",
  "UUID": "f52f30f8-9702-4a87-a616-3f0080c18a39"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/einvoice/ar/:qid")! 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()
```