Complyance Logo

Unify API v3 — Examples

Example: Single Invoice Submit

curl -X POST 'https://YOUR_GATEWAY/api/v3/unify' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "action":  "submit",
    "purpose": "invoicing",
    "env":     "sandbox",
    "defaults": {
      "country":             "MY",
      "logicalDocumentType": "TAX_INVOICE",
      "source": {
        "name":    "my-billing-system",
        "version": "1.0"
      },
      "destinations": [{ "type": "TAX_AUTHORITY" }]
    },
    "invoices": [
      {
        "externalId": "INV-2026-0001",
        "payload": {
          "invoice_data": {
            "document_number": "INV-2026-0001",
            "invoice_date":    "2026-02-23"
          }
        }
      }
    ],
    "options": {
      "continueOnError":    true,
      "submitToGovernment": true
    }
  }'

Example: Bulk Submit (2 Invoices)

You can submit up to 10 invoices in a single request. Each invoice in the invoices array is processed independently. Set continueOnError: true if you want the remaining invoices to be processed even if one fails.

curl -X POST 'https://YOUR_GATEWAY/api/v3/unify' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "action":  "submit",
    "purpose": "invoicing",
    "env":     "sandbox",
    "defaults": {
      "country":             "MY",
      "logicalDocumentType": "TAX_INVOICE",
      "source": {
        "name":    "my-bulk-system",
        "version": "1.0"
      },
      "destinations": [{ "type": "TAX_AUTHORITY" }]
    },
    "invoices": [
      {
        "externalId": "INV-BULK-001",
        "payload": {
          "invoice_data": {
            "document_number": "INV-BULK-001",
            "invoice_date":    "2026-02-23",
            "currency_code":   "MYR"
          },
          "seller_info": { "country_code": "MY" },
          "buyer_info":  { "buyer_country": "MY" }
        }
      },
      {
        "externalId": "INV-BULK-002",
        "payload": {
          "invoice_data": {
            "document_number": "INV-BULK-002",
            "invoice_date":    "2026-02-24",
            "currency_code":   "MYR"
          },
          "seller_info": { "country_code": "MY" },
          "buyer_info":  { "buyer_country": "MY" }
        }
      }
    ],
    "options": {
      "continueOnError":    true,
      "submitToGovernment": true
    }
  }'

Example: List (Malaysia Document Details)

Once an invoice is submitted, use the documentId and uuid from the submit response to retrieve the full document details.

curl -X POST 'https://YOUR_GATEWAY/api/v3/unify' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "action": "list",
    "env":    "sandbox",
    "filters": {
      "country":    "MY",
      "uuid":       "4Q2H2R3YSSYZTX5TRWZF2M2K10",
      "documentId": "01DXXXXXXXXXXXXXXXXXXXXXXX"
    },
    "page":  1,
    "limit": 20,
    "sort":  "createdAt:desc"
  }'

The document details will be in data.results[0].documentDetails of the response.