Send E-Invoice for Singapore

View as Markdown
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) |

Authentication

x-api-keystring
API key issued by Staple.
AuthorizationBearer
JWT obtained from the login endpoint.

Path parameters

qidstringRequired
Target queue ID the generated document lands in.

Query parameters

countryenumRequired
Country selector for the mapping. Currently SG only.
Allowed values:
destinationenumRequired

Send target — combined with Transaction Type + Addon to resolve the flow (see description).

Allowed values:

Request

This endpoint expects any.

Response

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