Developer Documentation

Build powerful integrations with our comprehensive API. Connect your POS, ERP, or third-party system to automate invoice submission, manage credentials, and streamline financial compliance.

Introduction

  1. Validating integration tokens
  2. Receiving invoice header + items
  3. Preventing duplicate submissions
  4. Auto-calculating invoice totals
  5. Storing invoice & items into the MySyncTax database

For more information, visit mysynctax.com.

Authentication

All integration requests must contain two parameters inside the JSON body:

  • mysynctax_key
  • mysynctax_secret

These identify the integration and must match the credentials assigned to your company.

Requests without both fields will be rejected with 401 Unauthorized.

JSON Structure

Header-Level Fields

  • invoice_no – The external invoice number.
  • issue_date – Date of invoice (YYYY-MM-DD HH:MM:SS).
  • sale_id_integrate – ID of the transaction in your system.
  • total_amount – Total invoice amount BEFORE item breakdown (amount_before).
  • payment_note_term – CASH / TRANSFER / CHEQUE / etc.

Item-Level Fields

  • item_id – ID of each item in the invoice.
  • sorting_id – Item sorting or line order.
  • invoiced_quantity – Quantity purchased.
  • unit_price – Unit price.
  • price_discount – Discount per unit.
  • total – Total price for this item (quantity × price).
  • item_description – Item name or description.

Normal Invoice with Receipt QR

This API generates a normal invoice together with a receipt QR code. If the customer does not scan the QR code, the transaction will be automatically treated as a consolidated invoice in accordance with LHDN MyInvois rules.

{
  "mysynctax_key": "oHwIxxxx",
  "mysynctax_secret": "fYxPMxxxxx",
  "invoice_no": "INV-9002050",
  "sale_id_integrate": 9002050,
  "payment_note_term": "CASH",
  "items": [
    {
      "item_id": 12,
      "sorting_id": 1,
      "invoiced_quantity": 2,
      "unit_price": 60.00,
      "item_description": "Premium Nasi Ayam Set",
      "price_discount": 20,
      "tax_amount": 10.00
    },
    {
      "item_id": 13,
      "sorting_id": 2,
      "invoiced_quantity": 1,
      "unit_price": 90.00,
      "item_description": "Iced Coffee Latte",
      "price_discount": 10,
      "tax_amount": 8.00
    }
  ]
}

Send Data

Submit data using the following endpoint:

POST https://mysynctax.com/v5/api/myinvois

Key Notes

  • Duplicate JSON payloads (same hashed content) are rejected with 409.
  • All amounts must be numerical.
  • Date formats must use YYYY-MM-DD HH:MM:SS.

Response Examples

Success

{
  "status": "ok",
  "mysynctax_uuid": "generated-unique-id",
  "qr_url": "https://mysynctax.com/v5/redirect/9QqIe39"
}

Duplicate

{
  "status": "duplicate_ignored",
  "mysynctax_uuid": "existing-unique-id"
}

Unauthorized

{
  "status": "unauthorized",
  "message": "Invalid mysynctax_key or mysynctax_secret"
}

Error Codes

HTTP CodeDescription
400Invalid or malformed JSON
401API key or secret missing/invalid
409Duplicate invoice submission
500Server processing error

Delete Invoice

This API allows external ERP, POS, and accounting systems to delete an invoice from MySyncTax using its unique ID. The API validates the integration credentials and checks the invoice submission status before processing the deletion request.

Endpoint

POST https://mysynctax.com/v5/api/myinvois/delete/{mysynctax_uniqueId}

Request Parameters

ParameterTypeDescription
mysynctax_uniqueIdStringUnique identifier of the invoice to delete. Pass this value in the URL.
mysynctax_keyStringIntegration API key assigned to your company.
mysynctax_secretStringIntegration API secret assigned to your company.

Request Example

Send the integration credentials inside the JSON request body.

{
  "mysynctax_key": "ZH1zXXXXXXXXXXX",
  "mysynctax_secret": "F0sWXXXXXXXXXXX"
}

Response Example

This example indicates that the deletion request was rejected because the invoice has already been submitted to LHDN.

{
  "success": false,
  "message": "Invoice cannot be deleted because it has already been submitted.",
  "unique_id": "50dc9929XXXXXXXXXXXXXXXXXXXXXXXXXX",
  "invoice_no": "MZXXX-XXXXXXXX",
  "submission_status": "Submitted"
}

Response Parameters

ParameterTypeDescription
successBooleanIndicates whether the deletion request was successful.
messageStringProvides the result or reason for rejection.
mysynctax_uniqueIdStringUnique identifier of the requested invoice.
invoice_noStringInvoice number associated with the request.
submission_statusStringCurrent LHDN submission status of the invoice.

Important Notes

  • HTTP method must be POST.
  • The invoice unique ID must be included in the endpoint URL.
  • Both mysynctax_key and mysynctax_secret are required in the JSON body.
  • The API checks the invoice submission status before allowing deletion.
  • An invoice that has already been submitted to LHDN cannot be deleted through this API, as shown in the response example.

ERP - Invoice (With Customer)

POST https://mysynctax.com/v5/api/myinvois/invoice

This API is intended for ERP / Accounting systems that manage customer master data and require direct submission to LHDN.

Request Example

{
  "mysynctax_key": "XXX",
  "mysynctax_secret": "XXXX",
  "isAutoToLHDN": 1,
  "invoice_no": "INV-322",
  "sale_id_integrate": 3312,
  "payment_note_term": "CASH",
  "customer": {
    "tin_no": "IG25461820000",
    "registration_name": "ABC Trading Sdn Bhd",
    "identification_no": "930105045119",
    "identification_type": "NRIC",
    "sst_registration": "SST123456",
    "phone": "0123456789",
    "email": "finance@abctrading.com",
    "address_line_1": "No 10, Jalan Teknologi",
    "address_line_2": "Taman Teknologi",
    "address_line_3": "Seksyen 7",
    "city_name": "Shah Alam",
    "postal_zone": "40000",
    "state_code": "10",
    "country_code": "MYS"
  },
  "items": [
    {
      "item_id": 101,
      "sorting_id": 1,
      "item_description": "USB Keyboard",
      "invoiced_quantity": 2,
      "unit_price": 30.00,
      "price_discount": 5,
      "tax_amount": 3.60
    },
    {
      "item_id": 102,
      "sorting_id": 2,
      "item_description": "USB Mouse",
      "invoiced_quantity": 1,
      "unit_price": 40.00,
      "price_discount": 5,
      "tax_amount": 2.40
    }
  ]
}

Response Example

{
  "status": "ok",
  "invoice_id": 410,
  "mysynctax_uuid": "a461cd55016ece31242098e2bxxxxxx3",
  "customer_status": "updated",
  "qr_lhdn": "https://mysynctax.com/v5/qr_link/a461cd55016ece31242098e2bxxxxxx3",
  "customer_id": 90,
  "result": {
    "headers": {},
    "original": {
      "submissionUid": "X7T2BQBCW6A55280PYxxxxxx",
      "acceptedDocuments": [
        {
          "uuid": "1DB9HRPJ1F1VJZ34PYsssss",
          "invoiceCodeNumber": "INV-567-3455"
        }
      ],
      "rejectedDocuments": []
    },
    "exception": null
  }
}

Credit Note / Debit Note / Refund

POST https://mysynctax.com/v5/api/myinvois/note

Used to submit adjustments for invoices that have already been submitted to LHDN.

Request Example

{
  "mysynctax_key": "XXX",
  "mysynctax_secret": "XXXXX",
  "note_type": "refund",
  "mysynctax_uuid": "bfc2c97e589ceb9fe9cb4b603bb740d011cb3d53",
  "sale_id_integrate": 5643,
  "items": [
    {
      "item_id": 102,
      "qty": 1,
      "price": 50.00,
      "discount": 0.00,
      "tax": 3.00,
      "description": "Item rosak / dipulangkan"
    }
  ]
}

Response Example

{
  "status": "success",
  "note_type": "refund",
  "invoice_id": 409,
  "mysynctax_uuid": "f8259315-45bf-41ba-bd6d-ae9abb93ac32",
  "qr_lhdn": "https://mysynctax.com/v5/qr_link/9QJTTE3H66GCHRHB4A3PVJDK10",
  "message": "Refund Note submitted successfully",
  "result": {
    "headers": {},
    "original": {
      "submissionUid": "5PBX6XF31R26SH0J3A3PVJDK10",
      "acceptedDocuments": [
        {
          "uuid": "9QJTTE3H66GCHRHB4A3PVJDK10",
          "invoiceCodeNumber": "REFUND-NOTE-20251229001155"
        }
      ],
      "rejectedDocuments": []
    },
    "exception": null
  }
}

Self-Billed Invoice

Self-Billed Invoice is used when the supplier does not issue an e-Invoice and the buyer generates the invoice on behalf of the supplier, as required by LHDN MyInvois.

POST https://mysynctax.com/v5/api/myinvois/selfbill/invoice

Request Example

{
  "mysynctax_key": "XXXX",
  "mysynctax_secret": "XXXX",
  "isAutoToLHDN": 1,
  "invoice_no": "INV-567-8612",
  "sale_id_integrate": 8612,
  "payment_note_term": "CASH",
  "supplier": {
    "tin_no": "IG20868489010",
    "registration_name": "IMPORT SDN BHD",
    "identification_no": "202503158017",
    "identification_type": "BRN",
    "sst_registration": "SST123456",
    "phone": "0123456789",
    "email": "finance@abctrading.com",
    "address_line_1": "No 10, Jalan Teknologi",
    "address_line_2": "Taman Teknologi",
    "address_line_3": "Seksyen 7",
    "city_name": "Shah Alam",
    "postal_zone": "40000",
    "state_code": "10",
    "country_code": "MYS"
  },
  "items": [
    {
      "item_id": 101,
      "sorting_id": 1,
      "item_description": "USB Keyboard",
      "invoiced_quantity": 2,
      "unit_price": 30.00,
      "tax_amount": 3.60,
      "price_discount": 5
    },
    {
      "item_id": 102,
      "sorting_id": 2,
      "item_description": "USB Mouse",
      "invoiced_quantity": 1,
      "unit_price": 40.00,
      "tax_amount": 2.40,
      "price_discount": 5
    }
  ]
}

Response Example

{
  "status": "ok",
  "invoice_id": 406,
  "mysynctax_uuid": "173a8b67d01a40b2c2e0dd11efcc6wxxxxx",
  "customer_status": "existing",
  "qr_lhdn": "https://mysynctax.com/v5/qr_link/JGT0YJCDKZ5R23JMX89Fxxxxxx",
  "customer_id": 90,
  "result": {
    "headers": {},
    "original": {
      "submissionUid": "6RTRCJFS0EKWTRGTwxxxxxx",
      "acceptedDocuments": [
        {
          "uuid": "JGT0YJCDKZ5R23JMXxxxxx",
          "invoiceCodeNumber": "INV-567-123"
        }
      ],
      "rejectedDocuments": []
    },
    "exception": null
  }
}

Self-Billed Credit / Debit / Refund

This API is used to submit Credit, Debit, or Refund Notes for Self-Billed Invoices that have already been submitted to LHDN.

POST https://mysynctax.com/v5/api/myinvois/selfbill/note

Request Example

{
  "mysynctax_key": "XXXX",
  "mysynctax_secret": "XXXX",
  "note_type": "refund",
  "mysynctax_uuid": "943e75230addb63b7fde84c4b2b9ce8a532ca07a",
  "sale_id_integrate": 456,
  "items": [
    {
      "item_id": 102,
      "qty": 1,
      "price": 50.00,
      "discount": 0.00,
      "tax": 3.00,
      "description": "Item rosak / dipulangkan"
    }
  ]
}

Response Example

{
  "status": "ok",
  "invoice_id": 404,
  "note_type": "refund",
  "mysynctax_uuid": "57f15d7c-b432-4c69-bd66-cadxxxxxx",
  "qr_lhdn": "https://mysynctax.com/v5/qr_link/xaasxxxxxx",
  "result": {
    "headers": {},
    "original": {
      "submissionUid": "X6BEP9R6MN4xxxxxx",
      "acceptedDocuments": [
        {
          "uuid": "F440ZCK2EXZBxxxxx",
          "invoiceCodeNumber": "REFUND-NOTE-20251229000704"
        }
      ],
      "rejectedDocuments": []
    },
    "exception": null
  }
}

Add New Customer

This API is used to create or update customer master data in MySyncTax. It supports bulk customer submission and is commonly used by ERP or POS systems before invoice or self-billed submission.

POST https://mysynctax.com/v5/api/myinvois/add_customer

Request Example

{
  "mysynctax_key": "XXXX",
  "mysynctax_secret": "XXXXX",
  "customers": [
    {
      "tin_no": "EI00000000010",
      "registration_name": "AHMAD1 BIN ALI",
      "identification_type": "NRIC",
      "identification_no": "900101105555",
      "sst_registration": null,
      "phone": "0134455667",
      "email": "ahmad.ali@gmail.com",
      "city_name": "Kota Bharu",
      "postal_zone": "15000",
      "state_code": "03",
      "country_code": "MYS",
      "address_line_1": "Lot 123, Kampung Pantai",
      "address_line_2": "Mukim Badang",
      "address_line_3": "Kelantan"
    }
  ]
}

Response Example

{
  "status": "ok",
  "message": "Customers processed successfully",
  "results": [
    {
      "tin_no": "EI00000000010",
      "status": "created",
      "id_customer": 93
    }
  ]
}

LHDN State Code Reference

Use the following state_code values when submitting customer or supplier address information to MySyncTax. These codes follow the official LHDN lookup.

State NameState Code
Johor01
Kedah02
Kelantan03
Melaka04
Negeri Sembilan05
Pahang06
Pulau Pinang07
Perak08
Perlis09
Selangor10
Terengganu11
Sabah12
Sarawak13
Wilayah Persekutuan Kuala Lumpur14
Wilayah Persekutuan Labuan15
Wilayah Persekutuan Putrajaya16
Not Applicable17

General TIN Types (LHDN Standard)

These predefined TIN values are used when a valid TIN is not available.

ScenarioTINDescription
Walk-in / B2CEI00000000010Consolidate - POS / ERP
Foreign ExportEI00000000020Invoice to overseas customer
Foreign Import (Self-Billed)EI00000000030Import supplier (self-billed)
GovernmentEI00000000040Government related entity

Mandatory Identification Format

"identification_no": "NA",
"identification_type": "BRN"

General TIN Invoice

POST https://mysynctax.com/v5/api/myinvois/invoice_generaltin

Payload

{
  "mysynctax_key": "cccc",
  "mysynctax_secret": "xxxxx",
  "isAutoToLHDN": 1,
  "invoice_no": "INV-32224",
  "sale_id_integrate": 32224,
  "payment_note_term": "CASH",
  "customer": {
    "tin_no": "EI00000000010",
    "identification_type": "BRN",
    "identification_no": "NA",
    "registration_name": "ABC Trading Sdn Bhd",
    "sst_registration": "SST123456",
    "phone": "0123456789",
    "email": "finance@abctrading.com",
    "address_line_1": "No 10, Jalan Teknologi",
    "address_line_2": "Taman Teknologi",
    "address_line_3": "Seksyen 7",
    "city_name": "Shah Alam",
    "postal_zone": "40000",
    "state_code": "10",
    "country_code": "MYS"
  },
  "items": [
    {
      "item_id": 101,
      "sorting_id": 1,
      "item_description": "USB Keyboard",
      "invoiced_quantity": 2,
      "unit_price": 30.00,
      "price_discount": 3,
      "tax_amount": 3
    },
    {
      "item_id": 102,
      "sorting_id": 2,
      "item_description": "USB Mouse",
      "invoiced_quantity": 1,
      "unit_price": 40.00,
      "price_discount": 5,
      "tax_amount": 2
    }
  ]
}

Response

{
  "headers": {},
  "original": {
    "status": "ok",
    "invoice_id": 809,
    "mysynctax_uuid": "6f91236366130791c506ccede35a0b8f48094d66",
    "customer_status": "updated",
    "customer_id": 93,
    "qr_lhdn": "https://mysynctax.com/v5/qr_link/6f91236366130791c506ccede35a0b8f48094d66",
    "result": {
      "headers": {},
      "original": {
        "submissionUid": "YSS2VJXZW9KYHSV4AP0MMKMK10",
        "acceptedDocuments": [
          {
            "uuid": "XMJ9T0GQ79R7VGBKAP0MMKMK10",
            "invoiceCodeNumber": "INV-32224"
          }
        ],
        "rejectedDocuments": []
      },
      "exception": null
    }
  },
  "exception": null
}

General TIN Credit / Debit / Refund

POST https://mysynctax.com/v5/api/myinvois/invoice_generaltin/note

Payload

{
  "mysynctax_key": "xx",
  "mysynctax_secret": "xx",
  "note_type": "credit",
  "mysynctax_uuid": "xxxxxxxxx",
  "sale_id_integrate": 32223,
  "items": [
    {
      "item_id": 102,
      "qty": 1,
      "price": 50.00,
      "discount": 0.00,
      "tax": 3.00,
      "description": "Item rosak / dipulangkan"
    }
  ]
}

Response

{
  "headers": {},
  "original": {
    "status": "ok",
    "note_type": "credit",
    "invoice_id": 1233,
    "mysynctax_uuid": "xxxx",
    "qr_lhdn": "https://mysynctax.com/v5/qr_link/xxxx",
    "result": {
      "headers": {},
      "original": {
        "submissionUid": "ssss",
        "acceptedDocuments": [
          {
            "uuid": "ccc",
            "invoiceCodeNumber": "CREDIT-NOTE-20260301162121"
          }
        ],
        "rejectedDocuments": []
      },
      "exception": null
    }
  },
  "exception": null
}

General TIN Self-Billed Invoice

POST https://mysynctax.com/v5/api/myinvois/invoice_generaltin/selfbill

Payload

{
  "mysynctax_key": "oHwIlgfhsBPP30f7",
  "mysynctax_secret": "fYxPMD2A5hPDWNI6",
  "isAutoToLHDN": 1,
  "invoice_no": "INV-323574",
  "sale_id_integrate": 323574,
  "payment_note_term": "CASH",
  "supplier": {
    "tin_no": "EI00000000010",
    "registration_name": "ABC23 Trading Sdn Bhd",
    "sst_registration": "SST123456",
    "identification_type": "BRN",
    "phone": "0123456789",
    "email": "finance@abctrading.com",
    "address_line_1": "No 10, Jalan Teknologi",
    "address_line_2": "Taman Teknologi",
    "address_line_3": "Seksyen 7",
    "city_name": "Shah Alam",
    "postal_zone": "40000",
    "state_code": "10",
    "country_code": "MYS"
  },
  "items": [
    {
      "item_id": 101,
      "sorting_id": 1,
      "item_description": "USB Keyboard",
      "invoiced_quantity": 2,
      "unit_price": 30.00,
      "price_discount": 3,
      "tax_amount": 3
    },
    {
      "item_id": 102,
      "sorting_id": 2,
      "item_description": "USB Mouse",
      "invoiced_quantity": 1,
      "unit_price": 40.00,
      "price_discount": 5,
      "tax_amount": 2
    }
  ]
}

Response

{
  "status": "ok",
  "invoice_id": 1235,
  "mysynctax_uuid": "xxx",
  "customer_status": "created",
  "qr_lhdn": "https://mysynctax.com/v5/qr_link/xxxx",
  "customer_id": 349,
  "result": {
    "headers": {},
    "original": {
      "submissionUid": "xxxc",
      "acceptedDocuments": [
        {
          "uuid": "ccc",
          "invoiceCodeNumber": "INV-323574"
        }
      ],
      "rejectedDocuments": []
    },
    "exception": null
  }
}

General TIN Self-Billed Note

POST https://mysynctax.com/v5/api/myinvois/invoice_generaltin/selfbill/note

Payload

{
  "mysynctax_key": "cccc",
  "mysynctax_secret": "xxxx",
  "note_type": "credit",
  "mysynctax_uuid": "xxxxxxx",
  "sale_id_integrate": 32223,
  "items": [
    {
      "item_id": 102,
      "qty": 1,
      "price": 50.00,
      "discount": 0.00,
      "tax": 3.00,
      "description": "Item rosak / dipulangkan"
    }
  ]
}

Response

{
  "status": "ok",
  "note_type": "credit",
  "invoice_id": 1236,
  "mysynctax_uuid": "xxxxxxx",
  "qr_lhdn": "https://mysynctax.com/v5/qr_link/xxxxxx2",
  "result": {
    "headers": {},
    "original": {
      "submissionUid": "dfdsf",
      "acceptedDocuments": [
        {
          "uuid": "qwewqe",
          "invoiceCodeNumber": "CREDIT-NOTE-20260301162227"
        }
      ],
      "rejectedDocuments": []
    },
    "exception": null
  }
}

Add / Update Supplier

This API is used to create or update supplier master data in MySyncTax. It is commonly required for Self-Billed Invoice and ERP-based invoice submissions.

POST https://mysynctax.com/v5/api/myinvois/add_supplier

Request Example

{
  "mysynctax_key": "XXXX",
  "mysynctax_secret": "XXXX",
  "supplier": [
    {
      "tin_no": "EI00000000010",
      "registration_name": "AHMAD1 BIN ALI",
      "identification_type": "NRIC",
      "identification_no": "900101105555",
      "sst_registration": null,
      "phone": "0134455667",
      "email": "ahmad.ali@gmail.com",
      "city_name": "Kota Bharu",
      "postal_zone": "15000",
      "state_code": "03",
      "country_code": "MYS",
      "address_line_1": "Lot 123, Kampung Pantai",
      "address_line_2": "Mukim Badang",
      "address_line_3": "Kelantan"
    }
  ]
}

Response Example

{
  "status": "ok",
  "message": "Supplier processed successfully",
  "results": [
    {
      "tin_no": "EI00000000010",
      "status": "updated",
      "id_customer": 93
    }
  ]
}

Generate PDF e-Invoice

This endpoint allows you to retrieve or display the official e-Invoice PDF generated by MySyncTax.

Endpoint

GET https://mysynctax.com/v5/invoice/view/{mysynctax_uuid}

Description

  • Returns a rendered PDF invoice
  • Based on mysynctax_uuid from API response
  • Used for download, preview, or printing

Example

https://mysynctax.com/v5/invoice/view/5a59f5ba7a4f65b47b844ae6671c833c0d5c8b16

How to Use

  • Step 1: Submit invoice via API
  • Step 2: Get mysynctax_uuid from response
  • Step 3: Open the PDF using this endpoint

Sample Usage

Open in Browser

window.open("https://mysynctax.com/v5/invoice/view/" + mysynctax_uuid);

Download using PHP

$pdfUrl = "https://mysynctax.com/v5/invoice/view/" . $mysynctax_uuid;
header("Location: " . $pdfUrl);
exit;

Download using JavaScript

fetch("https://mysynctax.com/v5/invoice/view/" + mysynctax_uuid)
  .then(res => res.blob())
  .then(blob => {
    const url = window.URL.createObjectURL(blob);
    const a = document.createElement("a");
    a.href = url;
    a.download = "invoice.pdf";
    a.click();
  });

Notes

  • No authentication required (public access via UUID)
  • Ensure UUID is valid
  • PDF includes QR code and LHDN validation details

Cancel Document API

This endpoint allows you to cleanly cancel an e-Invoice that has already been submitted to LHDN. Note: LHDN strictly enforces a 72-hour window for document cancellations.

Endpoint

POST https://mysynctax.com/v5/api/myinvois/cancel-document/cancel-document/{unique_id}

Payload

{
  "mysynctax_key": "YOUR_API_KEY",
  "mysynctax_secret": "YOUR_API_SECRET",
  "reason": "Wrong item quantity entered"
}

Response (Success)

{
  "success": true,
  "message": "Document cancelled on LHDN via External API and status reset."
}

Response (Error - Outside 72 Hours)

{
  "success": false,
  "message": "Failed: 72-hour cancellation window has expired."
}

Send Invoice Email API

This endpoint triggers the system to send an email notification containing the PDF e-Invoice link directly to the customer's registered email address, with BCC/CC routing to administrators.

Endpoint

POST https://mysynctax.com/v5/api/invoice/send-email

Payload

{
  "mysynctax_uuid": "5a59f5ba7a4f65b47b844ae6671c833c0d5c8b16"
}

Note: You can pass either the LHDN UUID or the internal unique_id as the parameter.

Response (Success)

{
  "success": true,
  "message": "Email sent to customer@email.com ",
  "link": "https://mysynctax.com/v5/invoice/view/5a59f5ba7a4f65b47b844ae6671c833c0d5c8b16"
}

Response (Error)

{
  "success": false,
  "message": "Customer does not have an email address."
}

Language Samples

JavaScript (jQuery)

$.ajax({
  url: "https://mysynctax.com/v5/api/myinvois",
  type: "POST",
  contentType: "application/json",
  data: JSON.stringify(payload),
  success: function(res) {
      console.log(res);
  }
});

PHP (cURL)

$ch = curl_init("https://mysynctax.com/v5/api/myinvois");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;

.NET C#

using (var client = new HttpClient()) {
    var json = JsonConvert.SerializeObject(payload);
    var content = new StringContent(json, Encoding.UTF8, "application/json");
    var response = await client.PostAsync("https://mysynctax.com/v5/api/myinvois", content);
    var result = await response.Content.ReadAsStringAsync();
}

VB.NET

Dim client As New HttpClient()
Dim json = JsonConvert.SerializeObject(payload)
Dim content = New StringContent(json, Encoding.UTF8, "application/json")
Dim response = Await client.PostAsync("https://mysynctax.com/v5/api/myinvois", content)
Dim result = Await response.Content.ReadAsStringAsync()

Python

import requests

r = requests.post("https://mysynctax.com/v5/api/myinvois", json=payload)
print(r.json())

Java

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://mysynctax.com/v5/api/myinvois"))
    .POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
    .header("Content-Type", "application/json")
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

Node.js

const axios = require("axios");

axios.post("https://mysynctax.com/v5/api/myinvois", payload)
     .then(res => console.log(res.data));
Activity