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

# Import Malaysia E-Invoice

POST https://api.staple.io/v2/einvoice/malaysia/queue/4521
Content-Type: application/json

# Import Malaysia E-Invoice (JSON) into a Queue

Import a Malaysia e-invoice document into a Staple **Queue** in **JSON** format. Staple will create a document (`docId`) and submit it to LHDN MyInvois asynchronously.

This endpoint supports **all MyInvois document types**, including **self-billed** types.

* * *

## Endpoint

**POST** `/v2/einvoice/malaysia/queue/{queueId}`

* * *

## Request Headers

| Attribute | Type | Option | Description |
| --- | --- | --- | --- |
| x-api-key | String | Required | A unique string |
| Authorization | String | Required | Bearer token |

**Content-Type:** `application/json`  
**Accept:** `application/json`

* * *

## Path Parameter

| Attribute | Type | Option | Description |
| --- | --- | --- | --- |
| queueId | String | Required | Target queue ID |

* * *

## Supported Document Types (`docType`)

`docType` determines the business scenario. Allowed values:

| docType | Description |
| --- | --- |
| `invoice` | Commercial document issued by Supplier to Buyer. |
| `credit_note` | Issued by Supplier to reduce the value of a previously issued e-Invoice (no money returned to Buyer). |
| `debit_note` | Issued by Supplier to indicate additional charges on a previously issued e-Invoice. |
| `refund_note` | Issued by Supplier to confirm refund of Buyer’s payment (money returned to Buyer). |
| `self_billed_invoice` | Issued by Buyer (instead of Supplier) in allowed self-billing scenarios. |
| `self_billed_credit_note` | Issued by Buyer to reduce value of a previously issued self-billed e-Invoice. |
| `self_billed_debit_note` | Issued by Buyer to indicate additional charges on a previously issued self-billed e-Invoice. |
| `self_billed_refund_note` | Issued by Buyer to confirm refund payment (money returned from Supplier to Buyer). |

* * *

## Request Payload (JSON)

A single endpoint supports all `docType` values above.

### Top-level Fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| docType | String | ✅ | One of the supported document types listed above. |
| docNumber | String | ✅ | Document number (Invoice No / Credit Note No / etc.). Used for tracking and de-duplication. |
| issueDate | String (YYYY-MM-DD) | ✅ | Issue date. |
| issueTime | String (HH:mm:ssZ) | ✅ | Issue time. Example: `09:44:25Z`. |
| currency | String | ✅ | ISO 4217 currency code (e.g. `MYR`). |
| fxRate | Number | Optional | Foreign exchange rate. Use `1.0` for MYR documents when no conversion is needed. |
| supplier | Object | ✅ | Supplier / issuer party. |
| buyer | Object | ✅ | Buyer party. |
| lines | Array | ✅ | Line items (min 1). |
| totals | Object | ✅ | Totals (must reconcile with lines). |
| reference | Object | Optional | Required for adjustment documents (see **Reference Rules**). |
| reason | String | Optional | Recommended for adjustment documents (credit/debit/refund) and audit trail. |

* * *

## Sample Payload (Invoice)

> Paste this into Postman Body.

```json
{
  "docType": "invoice",
  "docNumber": "INV-2026-0001",
  "issueDate": "2026-03-23",
  "issueTime": "09:44:25Z",
  "currency": "MYR",
  "fxRate": 1.0,
  "supplier": {
    "name": "Seller Sdn Bhd",
    "tin": "IG59605712010",
    "registrationType": "PASSPORT",
    "registrationNo": "RA2052854",
    "msicCode": "85494",
    "address": {
      "line1": "1 Jalan Example",
      "city": "Kuala Lumpur",
      "stateCode": "14",
      "postcode": "50000",
      "country": "MYS"
    },
    "contact": {
      "telephone": "+60123456789"
    }
  },
  "buyer": {
    "name": "Buyer Sdn Bhd",
    "tin": "C59584904000",
    "registrationType": "BRN",
    "registrationNo": "202401040495",
    "address": {
      "line1": "2 Jalan Example",
      "city": "Kuala Lumpur",
      "stateCode": "14",
      "postcode": "50000",
      "country": "MYS"
    },
    "contact": {
      "telephone": "+60165537256"
    }
  },
  "lines": [
    {
      "lineNo": 1,
      "description": "Consulting service",
      "quantity": 1,
      "unitPrice": 100,
      "amount": 100,
      "amountExclTax": 100,
      "classifications": [
        {
          "code": "003"
        }
      ]
    },
    {
      "lineNo": 2,
      "description": "Non-taxable item",
      "quantity": 1,
      "uom": "EA",
      "unitPrice": 50,
      "amount": 50,
      "amountExclTax": 50,
      "classifications": [
        {
          "code": "003"
        }
      ],
      "taxes": [
        {
          "type": "NOT_APPLICABLE",
          "rate": 0,
          "amount": 0
        }
      ]
    }
  ],
  "totals": {
    "totalExclTax": 150,
    "totalInclTax": 168,
    "taxTotal": 18,
    "payableAmount": 168
  }
}

```

* * *

## Reference Rules (VERY IMPORTANT)

Some document types must reference an earlier document.

### Supplier-issued adjustments (reference original `invoice`)

When `docType` is one of:

-   `credit_note`
    
-   `debit_note`
    
-   `refund_note`
    

`reference.originalInvoiceCodeNumber` is **required** and must point to the original **invoice** `docNumber` / code number used by your integration.

### Buyer-issued (self-billed) adjustments (reference original `self_billed_invoice`)

When `docType` is one of:

-   `self_billed_credit_note`
    
-   `self_billed_debit_note`
    
-   `self_billed_refund_note`
    

`reference.originalInvoiceCodeNumber` is **required** and must point to the original **self\_billed\_invoice** `docNumber` / code number used by your integration.

### Reference Object

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| reference.originalInvoiceCodeNumber | String | ✅ (when applicable) | The original invoice/self-billed invoice code number being adjusted. |

Example:

```json
"reference": {
  "originalInvoiceCodeNumber": "INV-2026-0001"
}

```

* * *

## Party Objects (`supplier`, `buyer`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| name | String | ✅ | Legal/trade name. |
| tin | String | ✅ | Supplier TIN is required. Buyer TIN may be required depending on scenario. |
| registrationType | String | ✅ | Registration identifier type, e.g. `BRN`, `PASSPORT`. |
| registrationNo | String | ✅ | Registration number / identity number. |
| msicCode | String | Conditional | Business classification code. Commonly provided on supplier. |
| address | Object | ✅ | Address object. |
| contact | Object | ✅ | Contact object. |

**Address Object (recommended fields):** `line1`, `city`, `stateCode`, `postcode`, `country`  
**Contact Object (recommended fields):** `telephone`

> Self-billed documents: Buyer is the issuer in business terms, but this API keeps `supplier` and `buyer` fields consistent. Staple validates and maps parties according to `docType`.

* * *

## Line Items (`lines[]`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| lineNo | Integer | ✅ | Line sequence number (starting from 1). |
| description | String | ✅ | Item/service description. |
| quantity | Number | ✅ | Quantity. |
| uom | String | Optional | Unit of measure (e.g. `EA`). |
| unitPrice | Number | ✅ | Unit price (non-negative). |
| amount | Number | Optional | Gross line amount before or alongside tax calculation, depending on integration flow. |
| amountExclTax | Number | ✅ | Line amount excluding tax. Recommended to use negative amounts for `credit_note` and `refund_note`. |
| classifications | Array | ✅ | Example: `[{"code": "003"}]` |
| taxes | Array | ✅ | Line-level taxes array (see **Tax** section). |

* * *

## Totals (`totals`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| totalExclTax | Number | ✅ | Sum of `lines[].amountExclTax`. |
| totalInclTax | Number | ✅ | Final total including tax. |
| taxTotal | Number | ✅ | Total tax amount across all lines. |
| payableAmount | Number | ✅ | Final payable amount. Usually matches `totalInclTax`. |

* * *

## Tax

Tax is represented at **line-level** under `lines[].taxes`.

### Tax Object (`taxes[]`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| type | String | ✅ | Tax category (see allowed values). |
| rate | Number | ✅ | Tax rate in percentage (e.g. `8.0`). |
| amount | Number | ✅ | Tax amount for the line. May be negative for credit/refund documents. |

### Allowed Values for `taxes[].type`

| Type | Meaning |
| --- | --- |
| `SALES_TAX` | Sales Tax |
| `SERVICE_TAX` | Service Tax |
| `TOURISM_TAX` | Tourism Tax |
| `HIGH_VALUE_GOODS_TAX` | High-Value Goods Tax |
| `LOW_VALUE_GOODS_TAX` | Sales Tax on Low Value Goods |
| `NOT_APPLICABLE` | No tax applies |
| `EXEMPT` | Tax exempt |

> Do not use ambiguous values like `SST`. Choose `SALES_TAX` or `SERVICE_TAX` explicitly.

* * *

## Amount Conventions (Recommended)

To keep adjustments unambiguous:

-   `credit_note`: use **negative** amounts for `lines[].amountExclTax`, `lines[].taxes[].amount`, and totals.
    
-   `refund_note`: use **negative** amounts when reducing original invoice value and confirming money returned to Buyer.
    
-   `debit_note`: use **positive** amounts (additional charges).
    

Staple will validate totals consistency.

* * *

## Response (Success)

> The response confirms the document was queued in Staple. Use `docId` and `trackingUrl` to check ongoing status.

### Example

```json
{
  "requestId": "c86fdc72-51d7-4572-9e67-d11101bc3e29",
  "queueId": 4520,
  "docId": 242069,
  "docType": "invoice",
  "docNumber": "INV-2026-0001",
  "message": "Document queued for processing. Use docId to track submission status.",
  "trackingUrl": "/v2/einvoice/malaysia/status/242069",
  "myInvois": {
    "submissionId": "9EJDZFB2WJ967NZ5AXSXNMMK10",
    "uuid": "7ZPFV97R3VPY3HWGAXSXNMMK10"
  }
}

```

### Response Field Notes

-   `requestId`: Request trace ID.
    
-   `queueId`: Queue used for import.
    
-   `docId`: Staple document ID created in the queue.
    
-   `docType`: Imported document type.
    
-   `docNumber`: Imported document number.
    
-   `message`: Human-readable processing message.
    
-   `trackingUrl`: Internal status endpoint for this document.
    
-   `myInvois.submissionId`: MyInvois submission batch ID.
    
-   `myInvois.uuid`: MyInvois document UUID.
    

> `myInvois` is present only when Staple already has MyInvois submission details available at response time.  
> If processing later fails, or MyInvois details are not ready yet, the response may still return `docId` **without** `myInvois`.  
> In that case, check the actual processing result via:  
> **GET** `/v2/einvoice/malaysia/status/{docId}`

* * *

## Error / Status Handling

This endpoint is **asynchronous**.  
A successful import request can still return a normal queued response first, while the actual Malaysia e-invoice processing succeeds or fails later.

### Important behavior

-   Do **not** assume failures will come back as HTTP errors from the import endpoint.
    
-   If processing fails after the document is queued, the response may simply **not include** `myInvois`.
    
-   When `myInvois` is missing, use `docId` to call the status endpoint and inspect the real outcome.
    

### Example follow-up check

**GET** `/v2/einvoice/malaysia/status/242069`

Use this endpoint to check whether the document was submitted, validated, rejected, or failed during later processing.

### Practical rule

-   Import response has `docId` + `myInvois` → MyInvois submission details are already available.
    
-   Import response has `docId` but **no** `myInvois` → do **not** treat it as HTTP failure; call `/v2/einvoice/malaysia/status/{docId}`.

Reference: https://docs.staple.ai/api-reference/v2/e-invoice/import-malaysia-e-invoice

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: v2
  version: 1.0.0
paths:
  /v2/einvoice/malaysia/queue/4521:
    post:
      operationId: importMalaysiaEInvoice
      summary: Import Malaysia E-Invoice
      description: >-
        # Import Malaysia E-Invoice (JSON) into a Queue


        Import a Malaysia e-invoice document into a Staple **Queue** in **JSON**
        format. Staple will create a document (`docId`) and submit it to LHDN
        MyInvois asynchronously.


        This endpoint supports **all MyInvois document types**, including
        **self-billed** types.


        * * *


        ## Endpoint


        **POST** `/v2/einvoice/malaysia/queue/{queueId}`


        * * *


        ## Request Headers


        | Attribute | Type | Option | Description |

        | --- | --- | --- | --- |

        | x-api-key | String | Required | A unique string |

        | Authorization | String | Required | Bearer token |


        **Content-Type:** `application/json`  

        **Accept:** `application/json`


        * * *


        ## Path Parameter


        | Attribute | Type | Option | Description |

        | --- | --- | --- | --- |

        | queueId | String | Required | Target queue ID |


        * * *


        ## Supported Document Types (`docType`)


        `docType` determines the business scenario. Allowed values:


        | docType | Description |

        | --- | --- |

        | `invoice` | Commercial document issued by Supplier to Buyer. |

        | `credit_note` | Issued by Supplier to reduce the value of a previously
        issued e-Invoice (no money returned to Buyer). |

        | `debit_note` | Issued by Supplier to indicate additional charges on a
        previously issued e-Invoice. |

        | `refund_note` | Issued by Supplier to confirm refund of Buyer’s
        payment (money returned to Buyer). |

        | `self_billed_invoice` | Issued by Buyer (instead of Supplier) in
        allowed self-billing scenarios. |

        | `self_billed_credit_note` | Issued by Buyer to reduce value of a
        previously issued self-billed e-Invoice. |

        | `self_billed_debit_note` | Issued by Buyer to indicate additional
        charges on a previously issued self-billed e-Invoice. |

        | `self_billed_refund_note` | Issued by Buyer to confirm refund payment
        (money returned from Supplier to Buyer). |


        * * *


        ## Request Payload (JSON)


        A single endpoint supports all `docType` values above.


        ### Top-level Fields


        | Field | Type | Required | Description |

        | --- | --- | --- | --- |

        | docType | String | ✅ | One of the supported document types listed
        above. |

        | docNumber | String | ✅ | Document number (Invoice No / Credit Note No
        / etc.). Used for tracking and de-duplication. |

        | issueDate | String (YYYY-MM-DD) | ✅ | Issue date. |

        | issueTime | String (HH:mm:ssZ) | ✅ | Issue time. Example: `09:44:25Z`.
        |

        | currency | String | ✅ | ISO 4217 currency code (e.g. `MYR`). |

        | fxRate | Number | Optional | Foreign exchange rate. Use `1.0` for MYR
        documents when no conversion is needed. |

        | supplier | Object | ✅ | Supplier / issuer party. |

        | buyer | Object | ✅ | Buyer party. |

        | lines | Array | ✅ | Line items (min 1). |

        | totals | Object | ✅ | Totals (must reconcile with lines). |

        | reference | Object | Optional | Required for adjustment documents (see
        **Reference Rules**). |

        | reason | String | Optional | Recommended for adjustment documents
        (credit/debit/refund) and audit trail. |


        * * *


        ## Sample Payload (Invoice)


        > Paste this into Postman Body.


        ```json

        {
          "docType": "invoice",
          "docNumber": "INV-2026-0001",
          "issueDate": "2026-03-23",
          "issueTime": "09:44:25Z",
          "currency": "MYR",
          "fxRate": 1.0,
          "supplier": {
            "name": "Seller Sdn Bhd",
            "tin": "IG59605712010",
            "registrationType": "PASSPORT",
            "registrationNo": "RA2052854",
            "msicCode": "85494",
            "address": {
              "line1": "1 Jalan Example",
              "city": "Kuala Lumpur",
              "stateCode": "14",
              "postcode": "50000",
              "country": "MYS"
            },
            "contact": {
              "telephone": "+60123456789"
            }
          },
          "buyer": {
            "name": "Buyer Sdn Bhd",
            "tin": "C59584904000",
            "registrationType": "BRN",
            "registrationNo": "202401040495",
            "address": {
              "line1": "2 Jalan Example",
              "city": "Kuala Lumpur",
              "stateCode": "14",
              "postcode": "50000",
              "country": "MYS"
            },
            "contact": {
              "telephone": "+60165537256"
            }
          },
          "lines": [
            {
              "lineNo": 1,
              "description": "Consulting service",
              "quantity": 1,
              "unitPrice": 100,
              "amount": 100,
              "amountExclTax": 100,
              "classifications": [
                {
                  "code": "003"
                }
              ]
            },
            {
              "lineNo": 2,
              "description": "Non-taxable item",
              "quantity": 1,
              "uom": "EA",
              "unitPrice": 50,
              "amount": 50,
              "amountExclTax": 50,
              "classifications": [
                {
                  "code": "003"
                }
              ],
              "taxes": [
                {
                  "type": "NOT_APPLICABLE",
                  "rate": 0,
                  "amount": 0
                }
              ]
            }
          ],
          "totals": {
            "totalExclTax": 150,
            "totalInclTax": 168,
            "taxTotal": 18,
            "payableAmount": 168
          }
        }


        ```


        * * *


        ## Reference Rules (VERY IMPORTANT)


        Some document types must reference an earlier document.


        ### Supplier-issued adjustments (reference original `invoice`)


        When `docType` is one of:


        -   `credit_note`
            
        -   `debit_note`
            
        -   `refund_note`
            

        `reference.originalInvoiceCodeNumber` is **required** and must point to
        the original **invoice** `docNumber` / code number used by your
        integration.


        ### Buyer-issued (self-billed) adjustments (reference original
        `self_billed_invoice`)


        When `docType` is one of:


        -   `self_billed_credit_note`
            
        -   `self_billed_debit_note`
            
        -   `self_billed_refund_note`
            

        `reference.originalInvoiceCodeNumber` is **required** and must point to
        the original **self\_billed\_invoice** `docNumber` / code number used by
        your integration.


        ### Reference Object


        | Field | Type | Required | Description |

        | --- | --- | --- | --- |

        | reference.originalInvoiceCodeNumber | String | ✅ (when applicable) |
        The original invoice/self-billed invoice code number being adjusted. |


        Example:


        ```json

        "reference": {
          "originalInvoiceCodeNumber": "INV-2026-0001"
        }


        ```


        * * *


        ## Party Objects (`supplier`, `buyer`)


        | Field | Type | Required | Description |

        | --- | --- | --- | --- |

        | name | String | ✅ | Legal/trade name. |

        | tin | String | ✅ | Supplier TIN is required. Buyer TIN may be required
        depending on scenario. |

        | registrationType | String | ✅ | Registration identifier type, e.g.
        `BRN`, `PASSPORT`. |

        | registrationNo | String | ✅ | Registration number / identity number. |

        | msicCode | String | Conditional | Business classification code.
        Commonly provided on supplier. |

        | address | Object | ✅ | Address object. |

        | contact | Object | ✅ | Contact object. |


        **Address Object (recommended fields):** `line1`, `city`, `stateCode`,
        `postcode`, `country`  

        **Contact Object (recommended fields):** `telephone`


        > Self-billed documents: Buyer is the issuer in business terms, but this
        API keeps `supplier` and `buyer` fields consistent. Staple validates and
        maps parties according to `docType`.


        * * *


        ## Line Items (`lines[]`)


        | Field | Type | Required | Description |

        | --- | --- | --- | --- |

        | lineNo | Integer | ✅ | Line sequence number (starting from 1). |

        | description | String | ✅ | Item/service description. |

        | quantity | Number | ✅ | Quantity. |

        | uom | String | Optional | Unit of measure (e.g. `EA`). |

        | unitPrice | Number | ✅ | Unit price (non-negative). |

        | amount | Number | Optional | Gross line amount before or alongside tax
        calculation, depending on integration flow. |

        | amountExclTax | Number | ✅ | Line amount excluding tax. Recommended to
        use negative amounts for `credit_note` and `refund_note`. |

        | classifications | Array | ✅ | Example: `[{"code": "003"}]` |

        | taxes | Array | ✅ | Line-level taxes array (see **Tax** section). |


        * * *


        ## Totals (`totals`)


        | Field | Type | Required | Description |

        | --- | --- | --- | --- |

        | totalExclTax | Number | ✅ | Sum of `lines[].amountExclTax`. |

        | totalInclTax | Number | ✅ | Final total including tax. |

        | taxTotal | Number | ✅ | Total tax amount across all lines. |

        | payableAmount | Number | ✅ | Final payable amount. Usually matches
        `totalInclTax`. |


        * * *


        ## Tax


        Tax is represented at **line-level** under `lines[].taxes`.


        ### Tax Object (`taxes[]`)


        | Field | Type | Required | Description |

        | --- | --- | --- | --- |

        | type | String | ✅ | Tax category (see allowed values). |

        | rate | Number | ✅ | Tax rate in percentage (e.g. `8.0`). |

        | amount | Number | ✅ | Tax amount for the line. May be negative for
        credit/refund documents. |


        ### Allowed Values for `taxes[].type`


        | Type | Meaning |

        | --- | --- |

        | `SALES_TAX` | Sales Tax |

        | `SERVICE_TAX` | Service Tax |

        | `TOURISM_TAX` | Tourism Tax |

        | `HIGH_VALUE_GOODS_TAX` | High-Value Goods Tax |

        | `LOW_VALUE_GOODS_TAX` | Sales Tax on Low Value Goods |

        | `NOT_APPLICABLE` | No tax applies |

        | `EXEMPT` | Tax exempt |


        > Do not use ambiguous values like `SST`. Choose `SALES_TAX` or
        `SERVICE_TAX` explicitly.


        * * *


        ## Amount Conventions (Recommended)


        To keep adjustments unambiguous:


        -   `credit_note`: use **negative** amounts for `lines[].amountExclTax`,
        `lines[].taxes[].amount`, and totals.
            
        -   `refund_note`: use **negative** amounts when reducing original
        invoice value and confirming money returned to Buyer.
            
        -   `debit_note`: use **positive** amounts (additional charges).
            

        Staple will validate totals consistency.


        * * *


        ## Response (Success)


        > The response confirms the document was queued in Staple. Use `docId`
        and `trackingUrl` to check ongoing status.


        ### Example


        ```json

        {
          "requestId": "c86fdc72-51d7-4572-9e67-d11101bc3e29",
          "queueId": 4520,
          "docId": 242069,
          "docType": "invoice",
          "docNumber": "INV-2026-0001",
          "message": "Document queued for processing. Use docId to track submission status.",
          "trackingUrl": "/v2/einvoice/malaysia/status/242069",
          "myInvois": {
            "submissionId": "9EJDZFB2WJ967NZ5AXSXNMMK10",
            "uuid": "7ZPFV97R3VPY3HWGAXSXNMMK10"
          }
        }


        ```


        ### Response Field Notes


        -   `requestId`: Request trace ID.
            
        -   `queueId`: Queue used for import.
            
        -   `docId`: Staple document ID created in the queue.
            
        -   `docType`: Imported document type.
            
        -   `docNumber`: Imported document number.
            
        -   `message`: Human-readable processing message.
            
        -   `trackingUrl`: Internal status endpoint for this document.
            
        -   `myInvois.submissionId`: MyInvois submission batch ID.
            
        -   `myInvois.uuid`: MyInvois document UUID.
            

        > `myInvois` is present only when Staple already has MyInvois submission
        details available at response time.  

        > If processing later fails, or MyInvois details are not ready yet, the
        response may still return `docId` **without** `myInvois`.  

        > In that case, check the actual processing result via:  

        > **GET** `/v2/einvoice/malaysia/status/{docId}`


        * * *


        ## Error / Status Handling


        This endpoint is **asynchronous**.  

        A successful import request can still return a normal queued response
        first, while the actual Malaysia e-invoice processing succeeds or fails
        later.


        ### Important behavior


        -   Do **not** assume failures will come back as HTTP errors from the
        import endpoint.
            
        -   If processing fails after the document is queued, the response may
        simply **not include** `myInvois`.
            
        -   When `myInvois` is missing, use `docId` to call the status endpoint
        and inspect the real outcome.
            

        ### Example follow-up check


        **GET** `/v2/einvoice/malaysia/status/242069`


        Use this endpoint to check whether the document was submitted,
        validated, rejected, or failed during later processing.


        ### Practical rule


        -   Import response has `docId` + `myInvois` → MyInvois submission
        details are already available.
            
        -   Import response has `docId` but **no** `myInvois` → do **not** treat
        it as HTTP failure; call `/v2/einvoice/malaysia/status/{docId}`.
      tags:
        - eInvoice
      parameters:
        - name: x-api-key
          in: header
          description: API key issued by Staple.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/E-Invoice_importMalaysiaEInvoice_Response_200
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                docType:
                  type: string
                docNumber:
                  type: string
                issueDate:
                  type: string
                issueTime:
                  type: string
                currency:
                  type: string
                fxRate:
                  type: integer
                supplier:
                  $ref: >-
                    #/components/schemas/V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaSupplier
                buyer:
                  $ref: >-
                    #/components/schemas/V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaBuyer
                lines:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaLinesItems
                taxTotals:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaTaxTotalsItems
                totals:
                  $ref: >-
                    #/components/schemas/V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaTotals
servers:
  - url: https://api.staple.io
    description: https://api.staple.io
components:
  schemas:
    V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaSupplierAddress:
      type: object
      properties:
        line1:
          type: string
        line2:
          type: string
        line3:
          type: string
        postcode:
          type: string
        city:
          type: string
        stateCode:
          type: string
        country:
          type: string
      title: >-
        V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaSupplierAddress
    V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaSupplierContact:
      type: object
      properties:
        telephone:
          type: string
        email:
          type: string
      title: >-
        V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaSupplierContact
    V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaSupplier:
      type: object
      properties:
        name:
          type: string
        tin:
          type: string
        registrationType:
          type: string
        registrationNo:
          type: string
        sstRegistrationNo:
          type: string
        tourismTaxRegistrationNo:
          type: string
        msicCode:
          type: string
        businessActivityDescription:
          type: string
        address:
          $ref: >-
            #/components/schemas/V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaSupplierAddress
        contact:
          $ref: >-
            #/components/schemas/V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaSupplierContact
      title: >-
        V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaSupplier
    V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaBuyerAddress:
      type: object
      properties:
        line1:
          type: string
        line2:
          type: string
        line3:
          type: string
        postcode:
          type: string
        city:
          type: string
        stateCode:
          type: string
        country:
          type: string
      title: >-
        V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaBuyerAddress
    V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaBuyerContact:
      type: object
      properties:
        email:
          type: string
        telephone:
          type: string
      title: >-
        V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaBuyerContact
    V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaBuyer:
      type: object
      properties:
        name:
          type: string
        tin:
          type: string
        registrationType:
          type: string
        registrationNo:
          type: string
        sstRegistrationNo:
          type: string
        tourismTaxRegistrationNo:
          type: string
        address:
          $ref: >-
            #/components/schemas/V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaBuyerAddress
        contact:
          $ref: >-
            #/components/schemas/V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaBuyerContact
      title: >-
        V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaBuyer
    V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaLinesItemsClassificationsItems:
      type: object
      properties:
        code:
          type: string
      title: >-
        V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaLinesItemsClassificationsItems
    V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaLinesItemsTaxesItems:
      type: object
      properties:
        type:
          type: string
        rate:
          type: integer
        amount:
          type: number
          format: double
      title: >-
        V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaLinesItemsTaxesItems
    V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaLinesItems:
      type: object
      properties:
        lineNo:
          type: integer
        description:
          type: string
        quantity:
          type: integer
        uom:
          type: string
        unitPrice:
          type: integer
        amount:
          type: integer
        amountExclTax:
          type: integer
        classifications:
          type: array
          items:
            $ref: >-
              #/components/schemas/V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaLinesItemsClassificationsItems
        taxes:
          type: array
          items:
            $ref: >-
              #/components/schemas/V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaLinesItemsTaxesItems
        taxExemptionDetails:
          type: string
        taxExemptedAmount:
          type: integer
        discountRate:
          type: integer
        discountAmount:
          type: integer
        discountReason:
          type: string
        feeChargeRate:
          type: integer
        feeChargeAmount:
          type: integer
        feeChargeReason:
          type: string
        productTariffCode:
          type: string
        countryOfOrigin:
          type: string
      title: >-
        V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaLinesItems
    V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaTaxTotalsItems:
      type: object
      properties:
        code:
          type: string
        amount:
          type: number
          format: double
      title: >-
        V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaTaxTotalsItems
    V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaTotals:
      type: object
      properties:
        totalExclTax:
          type: integer
        totalInclTax:
          type: number
          format: double
        taxTotal:
          type: number
          format: double
        payableAmount:
          type: number
          format: double
        totalNetAmount:
          type: integer
        totalDiscountValue:
          type: integer
        totalFeeChargeAmount:
          type: integer
        roundingAmount:
          type: integer
      title: >-
        V2EinvoiceMalaysiaQueue4521PostRequestBodyContentApplicationJsonSchemaTotals
    E-Invoice_importMalaysiaEInvoice_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: E-Invoice_importMalaysiaEInvoice_Response_200
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key issued by Staple.
    bearerAuth:
      type: http
      scheme: bearer
      description: JWT obtained from the login endpoint.

```

## Examples



**Request**

```json
{
  "docType": "invoice",
  "docNumber": "MYEinv-import-7",
  "issueDate": "2026-05-18",
  "issueTime": "09:44:25Z",
  "currency": "MYR",
  "fxRate": 0,
  "supplier": {
    "name": "Seller Sdn Bhd",
    "tin": "IG59605712010",
    "registrationType": "PASSPORT",
    "registrationNo": "RA2052854",
    "sstRegistrationNo": "",
    "tourismTaxRegistrationNo": "",
    "msicCode": "85494",
    "businessActivityDescription": "Computer training FXRate",
    "address": {
      "line1": "1 Jalan Example ABCDEF",
      "line2": "",
      "line3": "",
      "postcode": "50000",
      "city": "Kuala Lumpur",
      "stateCode": "14",
      "country": "MYS"
    },
    "contact": {
      "telephone": "+60123456789",
      "email": "seller@example.com"
    }
  },
  "buyer": {
    "name": "Buyer Sdn Bhd",
    "tin": "C59584904000",
    "registrationType": "BRN",
    "registrationNo": "202401040495",
    "sstRegistrationNo": "",
    "tourismTaxRegistrationNo": "",
    "address": {
      "line1": "2 Jalan Example",
      "line2": "",
      "line3": "",
      "postcode": "50000",
      "city": "Kuala Lumpur",
      "stateCode": "14",
      "country": "MYS"
    },
    "contact": {
      "email": "buyer@email.com",
      "telephone": "+60165537256"
    }
  },
  "lines": [
    {
      "lineNo": 1,
      "description": "Consulting service",
      "quantity": 10,
      "uom": "EA",
      "unitPrice": 100,
      "amount": 1000,
      "amountExclTax": 918,
      "classifications": [
        {
          "code": "003"
        }
      ],
      "taxes": [
        {
          "type": "SALES_TAX",
          "rate": 8,
          "amount": 73.44
        }
      ],
      "taxExemptionDetails": "",
      "taxExemptedAmount": 0,
      "discountRate": 10,
      "discountAmount": 100,
      "discountReason": "Monthly retainer discount",
      "feeChargeRate": 2,
      "feeChargeAmount": 18,
      "feeChargeReason": "Urgent turnaround surcharge",
      "productTariffCode": "",
      "countryOfOrigin": "MYS"
    },
    {
      "lineNo": 2,
      "description": "Non-taxable item",
      "quantity": 1,
      "uom": "EA",
      "unitPrice": 50,
      "amount": 50,
      "amountExclTax": 50,
      "classifications": [
        {
          "code": "003"
        }
      ],
      "taxes": [
        {
          "type": "NOT_APPLICABLE",
          "rate": 0,
          "amount": 0
        }
      ],
      "taxExemptionDetails": "",
      "taxExemptedAmount": 0,
      "discountRate": 0,
      "discountAmount": 0,
      "discountReason": "",
      "feeChargeRate": 0,
      "feeChargeAmount": 0,
      "feeChargeReason": "",
      "productTariffCode": "",
      "countryOfOrigin": ""
    }
  ],
  "taxTotals": [
    {
      "code": "SALES_TAX",
      "amount": 73.44
    },
    {
      "code": "NOT_APPLICABLE",
      "amount": 0
    }
  ],
  "totals": {
    "totalExclTax": 968,
    "totalInclTax": 1041.44,
    "taxTotal": 73.44,
    "payableAmount": 1041.44,
    "totalNetAmount": 1050,
    "totalDiscountValue": 100,
    "totalFeeChargeAmount": 18,
    "roundingAmount": 0
  }
}
```

**Response**

```json
{}
```

**SDK Code**

```python E-Invoice_importMalaysiaEInvoice_example
import requests

url = "https://api.staple.io/v2/einvoice/malaysia/queue/4521"

payload = {
    "docType": "invoice",
    "docNumber": "MYEinv-import-7",
    "issueDate": "2026-05-18",
    "issueTime": "09:44:25Z",
    "currency": "MYR",
    "fxRate": 0,
    "supplier": {
        "name": "Seller Sdn Bhd",
        "tin": "IG59605712010",
        "registrationType": "PASSPORT",
        "registrationNo": "RA2052854",
        "sstRegistrationNo": "",
        "tourismTaxRegistrationNo": "",
        "msicCode": "85494",
        "businessActivityDescription": "Computer training FXRate",
        "address": {
            "line1": "1 Jalan Example ABCDEF",
            "line2": "",
            "line3": "",
            "postcode": "50000",
            "city": "Kuala Lumpur",
            "stateCode": "14",
            "country": "MYS"
        },
        "contact": {
            "telephone": "+60123456789",
            "email": "seller@example.com"
        }
    },
    "buyer": {
        "name": "Buyer Sdn Bhd",
        "tin": "C59584904000",
        "registrationType": "BRN",
        "registrationNo": "202401040495",
        "sstRegistrationNo": "",
        "tourismTaxRegistrationNo": "",
        "address": {
            "line1": "2 Jalan Example",
            "line2": "",
            "line3": "",
            "postcode": "50000",
            "city": "Kuala Lumpur",
            "stateCode": "14",
            "country": "MYS"
        },
        "contact": {
            "email": "buyer@email.com",
            "telephone": "+60165537256"
        }
    },
    "lines": [
        {
            "lineNo": 1,
            "description": "Consulting service",
            "quantity": 10,
            "uom": "EA",
            "unitPrice": 100,
            "amount": 1000,
            "amountExclTax": 918,
            "classifications": [{ "code": "003" }],
            "taxes": [
                {
                    "type": "SALES_TAX",
                    "rate": 8,
                    "amount": 73.44
                }
            ],
            "taxExemptionDetails": "",
            "taxExemptedAmount": 0,
            "discountRate": 10,
            "discountAmount": 100,
            "discountReason": "Monthly retainer discount",
            "feeChargeRate": 2,
            "feeChargeAmount": 18,
            "feeChargeReason": "Urgent turnaround surcharge",
            "productTariffCode": "",
            "countryOfOrigin": "MYS"
        },
        {
            "lineNo": 2,
            "description": "Non-taxable item",
            "quantity": 1,
            "uom": "EA",
            "unitPrice": 50,
            "amount": 50,
            "amountExclTax": 50,
            "classifications": [{ "code": "003" }],
            "taxes": [
                {
                    "type": "NOT_APPLICABLE",
                    "rate": 0,
                    "amount": 0
                }
            ],
            "taxExemptionDetails": "",
            "taxExemptedAmount": 0,
            "discountRate": 0,
            "discountAmount": 0,
            "discountReason": "",
            "feeChargeRate": 0,
            "feeChargeAmount": 0,
            "feeChargeReason": "",
            "productTariffCode": "",
            "countryOfOrigin": ""
        }
    ],
    "taxTotals": [
        {
            "code": "SALES_TAX",
            "amount": 73.44
        },
        {
            "code": "NOT_APPLICABLE",
            "amount": 0
        }
    ],
    "totals": {
        "totalExclTax": 968,
        "totalInclTax": 1041.44,
        "taxTotal": 73.44,
        "payableAmount": 1041.44,
        "totalNetAmount": 1050,
        "totalDiscountValue": 100,
        "totalFeeChargeAmount": 18,
        "roundingAmount": 0
    }
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript E-Invoice_importMalaysiaEInvoice_example
const url = 'https://api.staple.io/v2/einvoice/malaysia/queue/4521';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"docType":"invoice","docNumber":"MYEinv-import-7","issueDate":"2026-05-18","issueTime":"09:44:25Z","currency":"MYR","fxRate":0,"supplier":{"name":"Seller Sdn Bhd","tin":"IG59605712010","registrationType":"PASSPORT","registrationNo":"RA2052854","sstRegistrationNo":"","tourismTaxRegistrationNo":"","msicCode":"85494","businessActivityDescription":"Computer training FXRate","address":{"line1":"1 Jalan Example ABCDEF","line2":"","line3":"","postcode":"50000","city":"Kuala Lumpur","stateCode":"14","country":"MYS"},"contact":{"telephone":"+60123456789","email":"seller@example.com"}},"buyer":{"name":"Buyer Sdn Bhd","tin":"C59584904000","registrationType":"BRN","registrationNo":"202401040495","sstRegistrationNo":"","tourismTaxRegistrationNo":"","address":{"line1":"2 Jalan Example","line2":"","line3":"","postcode":"50000","city":"Kuala Lumpur","stateCode":"14","country":"MYS"},"contact":{"email":"buyer@email.com","telephone":"+60165537256"}},"lines":[{"lineNo":1,"description":"Consulting service","quantity":10,"uom":"EA","unitPrice":100,"amount":1000,"amountExclTax":918,"classifications":[{"code":"003"}],"taxes":[{"type":"SALES_TAX","rate":8,"amount":73.44}],"taxExemptionDetails":"","taxExemptedAmount":0,"discountRate":10,"discountAmount":100,"discountReason":"Monthly retainer discount","feeChargeRate":2,"feeChargeAmount":18,"feeChargeReason":"Urgent turnaround surcharge","productTariffCode":"","countryOfOrigin":"MYS"},{"lineNo":2,"description":"Non-taxable item","quantity":1,"uom":"EA","unitPrice":50,"amount":50,"amountExclTax":50,"classifications":[{"code":"003"}],"taxes":[{"type":"NOT_APPLICABLE","rate":0,"amount":0}],"taxExemptionDetails":"","taxExemptedAmount":0,"discountRate":0,"discountAmount":0,"discountReason":"","feeChargeRate":0,"feeChargeAmount":0,"feeChargeReason":"","productTariffCode":"","countryOfOrigin":""}],"taxTotals":[{"code":"SALES_TAX","amount":73.44},{"code":"NOT_APPLICABLE","amount":0}],"totals":{"totalExclTax":968,"totalInclTax":1041.44,"taxTotal":73.44,"payableAmount":1041.44,"totalNetAmount":1050,"totalDiscountValue":100,"totalFeeChargeAmount":18,"roundingAmount":0}}'
};

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

```go E-Invoice_importMalaysiaEInvoice_example
package main

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

func main() {

	url := "https://api.staple.io/v2/einvoice/malaysia/queue/4521"

	payload := strings.NewReader("{\n  \"docType\": \"invoice\",\n  \"docNumber\": \"MYEinv-import-7\",\n  \"issueDate\": \"2026-05-18\",\n  \"issueTime\": \"09:44:25Z\",\n  \"currency\": \"MYR\",\n  \"fxRate\": 0,\n  \"supplier\": {\n    \"name\": \"Seller Sdn Bhd\",\n    \"tin\": \"IG59605712010\",\n    \"registrationType\": \"PASSPORT\",\n    \"registrationNo\": \"RA2052854\",\n    \"sstRegistrationNo\": \"\",\n    \"tourismTaxRegistrationNo\": \"\",\n    \"msicCode\": \"85494\",\n    \"businessActivityDescription\": \"Computer training FXRate\",\n    \"address\": {\n      \"line1\": \"1 Jalan Example ABCDEF\",\n      \"line2\": \"\",\n      \"line3\": \"\",\n      \"postcode\": \"50000\",\n      \"city\": \"Kuala Lumpur\",\n      \"stateCode\": \"14\",\n      \"country\": \"MYS\"\n    },\n    \"contact\": {\n      \"telephone\": \"+60123456789\",\n      \"email\": \"seller@example.com\"\n    }\n  },\n  \"buyer\": {\n    \"name\": \"Buyer Sdn Bhd\",\n    \"tin\": \"C59584904000\",\n    \"registrationType\": \"BRN\",\n    \"registrationNo\": \"202401040495\",\n    \"sstRegistrationNo\": \"\",\n    \"tourismTaxRegistrationNo\": \"\",\n    \"address\": {\n      \"line1\": \"2 Jalan Example\",\n      \"line2\": \"\",\n      \"line3\": \"\",\n      \"postcode\": \"50000\",\n      \"city\": \"Kuala Lumpur\",\n      \"stateCode\": \"14\",\n      \"country\": \"MYS\"\n    },\n    \"contact\": {\n      \"email\": \"buyer@email.com\",\n      \"telephone\": \"+60165537256\"\n    }\n  },\n  \"lines\": [\n    {\n      \"lineNo\": 1,\n      \"description\": \"Consulting service\",\n      \"quantity\": 10,\n      \"uom\": \"EA\",\n      \"unitPrice\": 100,\n      \"amount\": 1000,\n      \"amountExclTax\": 918,\n      \"classifications\": [\n        {\n          \"code\": \"003\"\n        }\n      ],\n      \"taxes\": [\n        {\n          \"type\": \"SALES_TAX\",\n          \"rate\": 8,\n          \"amount\": 73.44\n        }\n      ],\n      \"taxExemptionDetails\": \"\",\n      \"taxExemptedAmount\": 0,\n      \"discountRate\": 10,\n      \"discountAmount\": 100,\n      \"discountReason\": \"Monthly retainer discount\",\n      \"feeChargeRate\": 2,\n      \"feeChargeAmount\": 18,\n      \"feeChargeReason\": \"Urgent turnaround surcharge\",\n      \"productTariffCode\": \"\",\n      \"countryOfOrigin\": \"MYS\"\n    },\n    {\n      \"lineNo\": 2,\n      \"description\": \"Non-taxable item\",\n      \"quantity\": 1,\n      \"uom\": \"EA\",\n      \"unitPrice\": 50,\n      \"amount\": 50,\n      \"amountExclTax\": 50,\n      \"classifications\": [\n        {\n          \"code\": \"003\"\n        }\n      ],\n      \"taxes\": [\n        {\n          \"type\": \"NOT_APPLICABLE\",\n          \"rate\": 0,\n          \"amount\": 0\n        }\n      ],\n      \"taxExemptionDetails\": \"\",\n      \"taxExemptedAmount\": 0,\n      \"discountRate\": 0,\n      \"discountAmount\": 0,\n      \"discountReason\": \"\",\n      \"feeChargeRate\": 0,\n      \"feeChargeAmount\": 0,\n      \"feeChargeReason\": \"\",\n      \"productTariffCode\": \"\",\n      \"countryOfOrigin\": \"\"\n    }\n  ],\n  \"taxTotals\": [\n    {\n      \"code\": \"SALES_TAX\",\n      \"amount\": 73.44\n    },\n    {\n      \"code\": \"NOT_APPLICABLE\",\n      \"amount\": 0\n    }\n  ],\n  \"totals\": {\n    \"totalExclTax\": 968,\n    \"totalInclTax\": 1041.44,\n    \"taxTotal\": 73.44,\n    \"payableAmount\": 1041.44,\n    \"totalNetAmount\": 1050,\n    \"totalDiscountValue\": 100,\n    \"totalFeeChargeAmount\": 18,\n    \"roundingAmount\": 0\n  }\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 E-Invoice_importMalaysiaEInvoice_example
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/einvoice/malaysia/queue/4521")

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  \"docType\": \"invoice\",\n  \"docNumber\": \"MYEinv-import-7\",\n  \"issueDate\": \"2026-05-18\",\n  \"issueTime\": \"09:44:25Z\",\n  \"currency\": \"MYR\",\n  \"fxRate\": 0,\n  \"supplier\": {\n    \"name\": \"Seller Sdn Bhd\",\n    \"tin\": \"IG59605712010\",\n    \"registrationType\": \"PASSPORT\",\n    \"registrationNo\": \"RA2052854\",\n    \"sstRegistrationNo\": \"\",\n    \"tourismTaxRegistrationNo\": \"\",\n    \"msicCode\": \"85494\",\n    \"businessActivityDescription\": \"Computer training FXRate\",\n    \"address\": {\n      \"line1\": \"1 Jalan Example ABCDEF\",\n      \"line2\": \"\",\n      \"line3\": \"\",\n      \"postcode\": \"50000\",\n      \"city\": \"Kuala Lumpur\",\n      \"stateCode\": \"14\",\n      \"country\": \"MYS\"\n    },\n    \"contact\": {\n      \"telephone\": \"+60123456789\",\n      \"email\": \"seller@example.com\"\n    }\n  },\n  \"buyer\": {\n    \"name\": \"Buyer Sdn Bhd\",\n    \"tin\": \"C59584904000\",\n    \"registrationType\": \"BRN\",\n    \"registrationNo\": \"202401040495\",\n    \"sstRegistrationNo\": \"\",\n    \"tourismTaxRegistrationNo\": \"\",\n    \"address\": {\n      \"line1\": \"2 Jalan Example\",\n      \"line2\": \"\",\n      \"line3\": \"\",\n      \"postcode\": \"50000\",\n      \"city\": \"Kuala Lumpur\",\n      \"stateCode\": \"14\",\n      \"country\": \"MYS\"\n    },\n    \"contact\": {\n      \"email\": \"buyer@email.com\",\n      \"telephone\": \"+60165537256\"\n    }\n  },\n  \"lines\": [\n    {\n      \"lineNo\": 1,\n      \"description\": \"Consulting service\",\n      \"quantity\": 10,\n      \"uom\": \"EA\",\n      \"unitPrice\": 100,\n      \"amount\": 1000,\n      \"amountExclTax\": 918,\n      \"classifications\": [\n        {\n          \"code\": \"003\"\n        }\n      ],\n      \"taxes\": [\n        {\n          \"type\": \"SALES_TAX\",\n          \"rate\": 8,\n          \"amount\": 73.44\n        }\n      ],\n      \"taxExemptionDetails\": \"\",\n      \"taxExemptedAmount\": 0,\n      \"discountRate\": 10,\n      \"discountAmount\": 100,\n      \"discountReason\": \"Monthly retainer discount\",\n      \"feeChargeRate\": 2,\n      \"feeChargeAmount\": 18,\n      \"feeChargeReason\": \"Urgent turnaround surcharge\",\n      \"productTariffCode\": \"\",\n      \"countryOfOrigin\": \"MYS\"\n    },\n    {\n      \"lineNo\": 2,\n      \"description\": \"Non-taxable item\",\n      \"quantity\": 1,\n      \"uom\": \"EA\",\n      \"unitPrice\": 50,\n      \"amount\": 50,\n      \"amountExclTax\": 50,\n      \"classifications\": [\n        {\n          \"code\": \"003\"\n        }\n      ],\n      \"taxes\": [\n        {\n          \"type\": \"NOT_APPLICABLE\",\n          \"rate\": 0,\n          \"amount\": 0\n        }\n      ],\n      \"taxExemptionDetails\": \"\",\n      \"taxExemptedAmount\": 0,\n      \"discountRate\": 0,\n      \"discountAmount\": 0,\n      \"discountReason\": \"\",\n      \"feeChargeRate\": 0,\n      \"feeChargeAmount\": 0,\n      \"feeChargeReason\": \"\",\n      \"productTariffCode\": \"\",\n      \"countryOfOrigin\": \"\"\n    }\n  ],\n  \"taxTotals\": [\n    {\n      \"code\": \"SALES_TAX\",\n      \"amount\": 73.44\n    },\n    {\n      \"code\": \"NOT_APPLICABLE\",\n      \"amount\": 0\n    }\n  ],\n  \"totals\": {\n    \"totalExclTax\": 968,\n    \"totalInclTax\": 1041.44,\n    \"taxTotal\": 73.44,\n    \"payableAmount\": 1041.44,\n    \"totalNetAmount\": 1050,\n    \"totalDiscountValue\": 100,\n    \"totalFeeChargeAmount\": 18,\n    \"roundingAmount\": 0\n  }\n}"

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

```java E-Invoice_importMalaysiaEInvoice_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/einvoice/malaysia/queue/4521")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"docType\": \"invoice\",\n  \"docNumber\": \"MYEinv-import-7\",\n  \"issueDate\": \"2026-05-18\",\n  \"issueTime\": \"09:44:25Z\",\n  \"currency\": \"MYR\",\n  \"fxRate\": 0,\n  \"supplier\": {\n    \"name\": \"Seller Sdn Bhd\",\n    \"tin\": \"IG59605712010\",\n    \"registrationType\": \"PASSPORT\",\n    \"registrationNo\": \"RA2052854\",\n    \"sstRegistrationNo\": \"\",\n    \"tourismTaxRegistrationNo\": \"\",\n    \"msicCode\": \"85494\",\n    \"businessActivityDescription\": \"Computer training FXRate\",\n    \"address\": {\n      \"line1\": \"1 Jalan Example ABCDEF\",\n      \"line2\": \"\",\n      \"line3\": \"\",\n      \"postcode\": \"50000\",\n      \"city\": \"Kuala Lumpur\",\n      \"stateCode\": \"14\",\n      \"country\": \"MYS\"\n    },\n    \"contact\": {\n      \"telephone\": \"+60123456789\",\n      \"email\": \"seller@example.com\"\n    }\n  },\n  \"buyer\": {\n    \"name\": \"Buyer Sdn Bhd\",\n    \"tin\": \"C59584904000\",\n    \"registrationType\": \"BRN\",\n    \"registrationNo\": \"202401040495\",\n    \"sstRegistrationNo\": \"\",\n    \"tourismTaxRegistrationNo\": \"\",\n    \"address\": {\n      \"line1\": \"2 Jalan Example\",\n      \"line2\": \"\",\n      \"line3\": \"\",\n      \"postcode\": \"50000\",\n      \"city\": \"Kuala Lumpur\",\n      \"stateCode\": \"14\",\n      \"country\": \"MYS\"\n    },\n    \"contact\": {\n      \"email\": \"buyer@email.com\",\n      \"telephone\": \"+60165537256\"\n    }\n  },\n  \"lines\": [\n    {\n      \"lineNo\": 1,\n      \"description\": \"Consulting service\",\n      \"quantity\": 10,\n      \"uom\": \"EA\",\n      \"unitPrice\": 100,\n      \"amount\": 1000,\n      \"amountExclTax\": 918,\n      \"classifications\": [\n        {\n          \"code\": \"003\"\n        }\n      ],\n      \"taxes\": [\n        {\n          \"type\": \"SALES_TAX\",\n          \"rate\": 8,\n          \"amount\": 73.44\n        }\n      ],\n      \"taxExemptionDetails\": \"\",\n      \"taxExemptedAmount\": 0,\n      \"discountRate\": 10,\n      \"discountAmount\": 100,\n      \"discountReason\": \"Monthly retainer discount\",\n      \"feeChargeRate\": 2,\n      \"feeChargeAmount\": 18,\n      \"feeChargeReason\": \"Urgent turnaround surcharge\",\n      \"productTariffCode\": \"\",\n      \"countryOfOrigin\": \"MYS\"\n    },\n    {\n      \"lineNo\": 2,\n      \"description\": \"Non-taxable item\",\n      \"quantity\": 1,\n      \"uom\": \"EA\",\n      \"unitPrice\": 50,\n      \"amount\": 50,\n      \"amountExclTax\": 50,\n      \"classifications\": [\n        {\n          \"code\": \"003\"\n        }\n      ],\n      \"taxes\": [\n        {\n          \"type\": \"NOT_APPLICABLE\",\n          \"rate\": 0,\n          \"amount\": 0\n        }\n      ],\n      \"taxExemptionDetails\": \"\",\n      \"taxExemptedAmount\": 0,\n      \"discountRate\": 0,\n      \"discountAmount\": 0,\n      \"discountReason\": \"\",\n      \"feeChargeRate\": 0,\n      \"feeChargeAmount\": 0,\n      \"feeChargeReason\": \"\",\n      \"productTariffCode\": \"\",\n      \"countryOfOrigin\": \"\"\n    }\n  ],\n  \"taxTotals\": [\n    {\n      \"code\": \"SALES_TAX\",\n      \"amount\": 73.44\n    },\n    {\n      \"code\": \"NOT_APPLICABLE\",\n      \"amount\": 0\n    }\n  ],\n  \"totals\": {\n    \"totalExclTax\": 968,\n    \"totalInclTax\": 1041.44,\n    \"taxTotal\": 73.44,\n    \"payableAmount\": 1041.44,\n    \"totalNetAmount\": 1050,\n    \"totalDiscountValue\": 100,\n    \"totalFeeChargeAmount\": 18,\n    \"roundingAmount\": 0\n  }\n}")
  .asString();
```

```php E-Invoice_importMalaysiaEInvoice_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/einvoice/malaysia/queue/4521', [
  'body' => '{
  "docType": "invoice",
  "docNumber": "MYEinv-import-7",
  "issueDate": "2026-05-18",
  "issueTime": "09:44:25Z",
  "currency": "MYR",
  "fxRate": 0,
  "supplier": {
    "name": "Seller Sdn Bhd",
    "tin": "IG59605712010",
    "registrationType": "PASSPORT",
    "registrationNo": "RA2052854",
    "sstRegistrationNo": "",
    "tourismTaxRegistrationNo": "",
    "msicCode": "85494",
    "businessActivityDescription": "Computer training FXRate",
    "address": {
      "line1": "1 Jalan Example ABCDEF",
      "line2": "",
      "line3": "",
      "postcode": "50000",
      "city": "Kuala Lumpur",
      "stateCode": "14",
      "country": "MYS"
    },
    "contact": {
      "telephone": "+60123456789",
      "email": "seller@example.com"
    }
  },
  "buyer": {
    "name": "Buyer Sdn Bhd",
    "tin": "C59584904000",
    "registrationType": "BRN",
    "registrationNo": "202401040495",
    "sstRegistrationNo": "",
    "tourismTaxRegistrationNo": "",
    "address": {
      "line1": "2 Jalan Example",
      "line2": "",
      "line3": "",
      "postcode": "50000",
      "city": "Kuala Lumpur",
      "stateCode": "14",
      "country": "MYS"
    },
    "contact": {
      "email": "buyer@email.com",
      "telephone": "+60165537256"
    }
  },
  "lines": [
    {
      "lineNo": 1,
      "description": "Consulting service",
      "quantity": 10,
      "uom": "EA",
      "unitPrice": 100,
      "amount": 1000,
      "amountExclTax": 918,
      "classifications": [
        {
          "code": "003"
        }
      ],
      "taxes": [
        {
          "type": "SALES_TAX",
          "rate": 8,
          "amount": 73.44
        }
      ],
      "taxExemptionDetails": "",
      "taxExemptedAmount": 0,
      "discountRate": 10,
      "discountAmount": 100,
      "discountReason": "Monthly retainer discount",
      "feeChargeRate": 2,
      "feeChargeAmount": 18,
      "feeChargeReason": "Urgent turnaround surcharge",
      "productTariffCode": "",
      "countryOfOrigin": "MYS"
    },
    {
      "lineNo": 2,
      "description": "Non-taxable item",
      "quantity": 1,
      "uom": "EA",
      "unitPrice": 50,
      "amount": 50,
      "amountExclTax": 50,
      "classifications": [
        {
          "code": "003"
        }
      ],
      "taxes": [
        {
          "type": "NOT_APPLICABLE",
          "rate": 0,
          "amount": 0
        }
      ],
      "taxExemptionDetails": "",
      "taxExemptedAmount": 0,
      "discountRate": 0,
      "discountAmount": 0,
      "discountReason": "",
      "feeChargeRate": 0,
      "feeChargeAmount": 0,
      "feeChargeReason": "",
      "productTariffCode": "",
      "countryOfOrigin": ""
    }
  ],
  "taxTotals": [
    {
      "code": "SALES_TAX",
      "amount": 73.44
    },
    {
      "code": "NOT_APPLICABLE",
      "amount": 0
    }
  ],
  "totals": {
    "totalExclTax": 968,
    "totalInclTax": 1041.44,
    "taxTotal": 73.44,
    "payableAmount": 1041.44,
    "totalNetAmount": 1050,
    "totalDiscountValue": 100,
    "totalFeeChargeAmount": 18,
    "roundingAmount": 0
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp E-Invoice_importMalaysiaEInvoice_example
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/einvoice/malaysia/queue/4521");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"docType\": \"invoice\",\n  \"docNumber\": \"MYEinv-import-7\",\n  \"issueDate\": \"2026-05-18\",\n  \"issueTime\": \"09:44:25Z\",\n  \"currency\": \"MYR\",\n  \"fxRate\": 0,\n  \"supplier\": {\n    \"name\": \"Seller Sdn Bhd\",\n    \"tin\": \"IG59605712010\",\n    \"registrationType\": \"PASSPORT\",\n    \"registrationNo\": \"RA2052854\",\n    \"sstRegistrationNo\": \"\",\n    \"tourismTaxRegistrationNo\": \"\",\n    \"msicCode\": \"85494\",\n    \"businessActivityDescription\": \"Computer training FXRate\",\n    \"address\": {\n      \"line1\": \"1 Jalan Example ABCDEF\",\n      \"line2\": \"\",\n      \"line3\": \"\",\n      \"postcode\": \"50000\",\n      \"city\": \"Kuala Lumpur\",\n      \"stateCode\": \"14\",\n      \"country\": \"MYS\"\n    },\n    \"contact\": {\n      \"telephone\": \"+60123456789\",\n      \"email\": \"seller@example.com\"\n    }\n  },\n  \"buyer\": {\n    \"name\": \"Buyer Sdn Bhd\",\n    \"tin\": \"C59584904000\",\n    \"registrationType\": \"BRN\",\n    \"registrationNo\": \"202401040495\",\n    \"sstRegistrationNo\": \"\",\n    \"tourismTaxRegistrationNo\": \"\",\n    \"address\": {\n      \"line1\": \"2 Jalan Example\",\n      \"line2\": \"\",\n      \"line3\": \"\",\n      \"postcode\": \"50000\",\n      \"city\": \"Kuala Lumpur\",\n      \"stateCode\": \"14\",\n      \"country\": \"MYS\"\n    },\n    \"contact\": {\n      \"email\": \"buyer@email.com\",\n      \"telephone\": \"+60165537256\"\n    }\n  },\n  \"lines\": [\n    {\n      \"lineNo\": 1,\n      \"description\": \"Consulting service\",\n      \"quantity\": 10,\n      \"uom\": \"EA\",\n      \"unitPrice\": 100,\n      \"amount\": 1000,\n      \"amountExclTax\": 918,\n      \"classifications\": [\n        {\n          \"code\": \"003\"\n        }\n      ],\n      \"taxes\": [\n        {\n          \"type\": \"SALES_TAX\",\n          \"rate\": 8,\n          \"amount\": 73.44\n        }\n      ],\n      \"taxExemptionDetails\": \"\",\n      \"taxExemptedAmount\": 0,\n      \"discountRate\": 10,\n      \"discountAmount\": 100,\n      \"discountReason\": \"Monthly retainer discount\",\n      \"feeChargeRate\": 2,\n      \"feeChargeAmount\": 18,\n      \"feeChargeReason\": \"Urgent turnaround surcharge\",\n      \"productTariffCode\": \"\",\n      \"countryOfOrigin\": \"MYS\"\n    },\n    {\n      \"lineNo\": 2,\n      \"description\": \"Non-taxable item\",\n      \"quantity\": 1,\n      \"uom\": \"EA\",\n      \"unitPrice\": 50,\n      \"amount\": 50,\n      \"amountExclTax\": 50,\n      \"classifications\": [\n        {\n          \"code\": \"003\"\n        }\n      ],\n      \"taxes\": [\n        {\n          \"type\": \"NOT_APPLICABLE\",\n          \"rate\": 0,\n          \"amount\": 0\n        }\n      ],\n      \"taxExemptionDetails\": \"\",\n      \"taxExemptedAmount\": 0,\n      \"discountRate\": 0,\n      \"discountAmount\": 0,\n      \"discountReason\": \"\",\n      \"feeChargeRate\": 0,\n      \"feeChargeAmount\": 0,\n      \"feeChargeReason\": \"\",\n      \"productTariffCode\": \"\",\n      \"countryOfOrigin\": \"\"\n    }\n  ],\n  \"taxTotals\": [\n    {\n      \"code\": \"SALES_TAX\",\n      \"amount\": 73.44\n    },\n    {\n      \"code\": \"NOT_APPLICABLE\",\n      \"amount\": 0\n    }\n  ],\n  \"totals\": {\n    \"totalExclTax\": 968,\n    \"totalInclTax\": 1041.44,\n    \"taxTotal\": 73.44,\n    \"payableAmount\": 1041.44,\n    \"totalNetAmount\": 1050,\n    \"totalDiscountValue\": 100,\n    \"totalFeeChargeAmount\": 18,\n    \"roundingAmount\": 0\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift E-Invoice_importMalaysiaEInvoice_example
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "docType": "invoice",
  "docNumber": "MYEinv-import-7",
  "issueDate": "2026-05-18",
  "issueTime": "09:44:25Z",
  "currency": "MYR",
  "fxRate": 0,
  "supplier": [
    "name": "Seller Sdn Bhd",
    "tin": "IG59605712010",
    "registrationType": "PASSPORT",
    "registrationNo": "RA2052854",
    "sstRegistrationNo": "",
    "tourismTaxRegistrationNo": "",
    "msicCode": "85494",
    "businessActivityDescription": "Computer training FXRate",
    "address": [
      "line1": "1 Jalan Example ABCDEF",
      "line2": "",
      "line3": "",
      "postcode": "50000",
      "city": "Kuala Lumpur",
      "stateCode": "14",
      "country": "MYS"
    ],
    "contact": [
      "telephone": "+60123456789",
      "email": "seller@example.com"
    ]
  ],
  "buyer": [
    "name": "Buyer Sdn Bhd",
    "tin": "C59584904000",
    "registrationType": "BRN",
    "registrationNo": "202401040495",
    "sstRegistrationNo": "",
    "tourismTaxRegistrationNo": "",
    "address": [
      "line1": "2 Jalan Example",
      "line2": "",
      "line3": "",
      "postcode": "50000",
      "city": "Kuala Lumpur",
      "stateCode": "14",
      "country": "MYS"
    ],
    "contact": [
      "email": "buyer@email.com",
      "telephone": "+60165537256"
    ]
  ],
  "lines": [
    [
      "lineNo": 1,
      "description": "Consulting service",
      "quantity": 10,
      "uom": "EA",
      "unitPrice": 100,
      "amount": 1000,
      "amountExclTax": 918,
      "classifications": [["code": "003"]],
      "taxes": [
        [
          "type": "SALES_TAX",
          "rate": 8,
          "amount": 73.44
        ]
      ],
      "taxExemptionDetails": "",
      "taxExemptedAmount": 0,
      "discountRate": 10,
      "discountAmount": 100,
      "discountReason": "Monthly retainer discount",
      "feeChargeRate": 2,
      "feeChargeAmount": 18,
      "feeChargeReason": "Urgent turnaround surcharge",
      "productTariffCode": "",
      "countryOfOrigin": "MYS"
    ],
    [
      "lineNo": 2,
      "description": "Non-taxable item",
      "quantity": 1,
      "uom": "EA",
      "unitPrice": 50,
      "amount": 50,
      "amountExclTax": 50,
      "classifications": [["code": "003"]],
      "taxes": [
        [
          "type": "NOT_APPLICABLE",
          "rate": 0,
          "amount": 0
        ]
      ],
      "taxExemptionDetails": "",
      "taxExemptedAmount": 0,
      "discountRate": 0,
      "discountAmount": 0,
      "discountReason": "",
      "feeChargeRate": 0,
      "feeChargeAmount": 0,
      "feeChargeReason": "",
      "productTariffCode": "",
      "countryOfOrigin": ""
    ]
  ],
  "taxTotals": [
    [
      "code": "SALES_TAX",
      "amount": 73.44
    ],
    [
      "code": "NOT_APPLICABLE",
      "amount": 0
    ]
  ],
  "totals": [
    "totalExclTax": 968,
    "totalInclTax": 1041.44,
    "taxTotal": 73.44,
    "payableAmount": 1041.44,
    "totalNetAmount": 1050,
    "totalDiscountValue": 100,
    "totalFeeChargeAmount": 18,
    "roundingAmount": 0
  ]
] as [String : Any]

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

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