Skip to content

Self-Billed Documents

Self-billed documents are invoices issued by the buyer on behalf of the seller. This is common when businesses pay suppliers who don't issue their own invoices.

Setup

Before using the examples below, set up your HTTP client:

javascript
const API_URL = 'https://invoisx.com/api/v1';
const API_TOKEN = 'your-api-token';

async function api(method, endpoint, data = null) {
  const response = await fetch(`${API_URL}${endpoint}`, {
    method,
    headers: {
      'Authorization': `Bearer ${API_TOKEN}`,
      'Accept': 'application/json',
      'Content-Type': 'application/json',
    },
    body: data ? JSON.stringify(data) : null,
  });
  return response.json();
}
python
import requests

API_URL = 'https://invoisx.com/api/v1'
API_TOKEN = 'your-api-token'

def api(method, endpoint, data=None):
    response = requests.request(
        method,
        f'{API_URL}{endpoint}',
        headers={
            'Authorization': f'Bearer {API_TOKEN}',
            'Accept': 'application/json',
        },
        json=data
    )
    return response.json()
php
use Illuminate\Support\Facades\Http;

$api = Http::withToken('your-api-token')
    ->accept('application/json')
    ->baseUrl('https://invoisx.com/api/v1');
php
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://invoisx.com/api/v1/',
    'headers' => [
        'Authorization' => 'Bearer your-api-token',
        'Accept' => 'application/json',
        'Content-Type' => 'application/json',
    ],
]);
java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newHttpClient();
String API_URL = "https://invoisx.com/api/v1";
String API_TOKEN = "your-api-token";
csharp
using System.Net.Http;
using System.Net.Http.Json;
using System.Text.Json;

var client = new HttpClient {
    BaseAddress = new Uri("https://invoisx.com/api/v1")
};
client.DefaultRequestHeaders.Add("Authorization", "Bearer your-api-token");
client.DefaultRequestHeaders.Add("Accept", "application/json");

Overview

Instead of using buyerId, self-billed documents use onBehalfSellerId - your supplier who you're issuing the invoice for.

Normal DocumentsSelf-Billed Documents
You (seller) issue to buyerYou (buyer) issue on behalf of seller
Uses buyerIdUses onBehalfSellerId
/invoices/self-billed-invoices

Creating On-Behalf Sellers

First, create the on-behalf seller (your supplier):

javascript
const seller = await api('POST', '/on-behalf-sellers', {
  name: 'Supplier Corp Sdn Bhd',
  tin: 'C12345678910',
  id_type: 'BRN',
  id_value: '202401012345',
  address: {
    line1: '456 Jalan Supplier',
    line2: 'Unit 5',
    city: 'Petaling Jaya',
    state: '10',
    postCode: '47800',
    countryCode: 'MYS'
  },
  contact: {
    phone: '+60398765432',
    email: 'sales@supplier.com',
    name: 'Jane Smith'
  }
});

const sellerId = seller.data.id;
console.log(`Seller ID: ${sellerId}`);
console.log(`Is Ready: ${seller.data.is_ready}`);
python
seller = api('POST', '/on-behalf-sellers', {
    'name': 'Supplier Corp Sdn Bhd',
    'tin': 'C12345678910',
    'id_type': 'BRN',
    'id_value': '202401012345',
    'address': {
        'line1': '456 Jalan Supplier',
        'line2': 'Unit 5',
        'city': 'Petaling Jaya',
        'state': '10',
        'postCode': '47800',
        'countryCode': 'MYS'
    },
    'contact': {
        'phone': '+60398765432',
        'email': 'sales@supplier.com',
        'name': 'Jane Smith'
    }
})

seller_id = seller['data']['id']
print(f"Seller ID: {seller_id}")
print(f"Is Ready: {seller['data']['is_ready']}")
php
$seller = $api->post('/on-behalf-sellers', [
    'name' => 'Supplier Corp Sdn Bhd',
    'tin' => 'C12345678910',
    'id_type' => 'BRN',
    'id_value' => '202401012345',
    'address' => [
        'line1' => '456 Jalan Supplier',
        'line2' => 'Unit 5',
        'city' => 'Petaling Jaya',
        'state' => '10',
        'postCode' => '47800',
        'countryCode' => 'MYS'
    ],
    'contact' => [
        'phone' => '+60398765432',
        'email' => 'sales@supplier.com',
        'name' => 'Jane Smith'
    ]
]);

$sellerId = $seller->json('data.id');
echo "Seller ID: $sellerId\n";
echo "Is Ready: " . ($seller->json('data.is_ready') ? 'Yes' : 'No') . "\n";
php
$response = $client->post('on-behalf-sellers', [
    'json' => [
        'name' => 'Supplier Corp Sdn Bhd',
        'tin' => 'C12345678910',
        'id_type' => 'BRN',
        'id_value' => '202401012345',
        'address' => [
            'line1' => '456 Jalan Supplier',
            'line2' => 'Unit 5',
            'city' => 'Petaling Jaya',
            'state' => '10',
            'postCode' => '47800',
            'countryCode' => 'MYS'
        ],
        'contact' => [
            'phone' => '+60398765432',
            'email' => 'sales@supplier.com',
            'name' => 'Jane Smith'
        ]
    ]
]);
$seller = json_decode($response->getBody(), true)['data'];

$sellerId = $seller['id'];
echo "Seller ID: $sellerId\n";
echo "Is Ready: " . ($seller['is_ready'] ? 'Yes' : 'No') . "\n";
java
var sellerJson = """
{
    "name": "Supplier Corp Sdn Bhd",
    "tin": "C12345678910",
    "id_type": "BRN",
    "id_value": "202401012345",
    "address": {
        "line1": "456 Jalan Supplier",
        "line2": "Unit 5",
        "city": "Petaling Jaya",
        "state": "10",
        "postCode": "47800",
        "countryCode": "MYS"
    },
    "contact": {
        "phone": "+60398765432",
        "email": "sales@supplier.com",
        "name": "Jane Smith"
    }
}
""";

var request = HttpRequest.newBuilder()
    .uri(URI.create(API_URL + "/on-behalf-sellers"))
    .header("Authorization", "Bearer " + API_TOKEN)
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(sellerJson))
    .build();

var response = client.send(request, HttpResponse.BodyHandlers.ofString());
// Parse JSON to get seller ID and is_ready
System.out.println("Response: " + response.body());
csharp
var response = await client.PostAsJsonAsync("/on-behalf-sellers", new {
    name = "Supplier Corp Sdn Bhd",
    tin = "C12345678910",
    id_type = "BRN",
    id_value = "202401012345",
    address = new {
        line1 = "456 Jalan Supplier",
        line2 = "Unit 5",
        city = "Petaling Jaya",
        state = "10",
        postCode = "47800",
        countryCode = "MYS"
    },
    contact = new {
        phone = "+60398765432",
        email = "sales@supplier.com",
        name = "Jane Smith"
    }
});

var json = await response.Content.ReadFromJsonAsync<JsonElement>();
var seller = json.GetProperty("data");

var sellerId = seller.GetProperty("id").GetString();
Console.WriteLine($"Seller ID: {sellerId}");
Console.WriteLine($"Is Ready: {seller.GetProperty("is_ready").GetBoolean()}");

Self-Billed Invoice

Create an invoice on behalf of your supplier:

javascript
const selfBilledInvoice = await api('POST', '/self-billed-invoices', {
  onBehalfSellerId: sellerId,  // Not buyerId!
  invoiceSerialNumber: 'SBI-2024-001',
  currencyCode: 'MYR',
  autoCalculate: true,
  invoiceLines: [
    {
      classifications: ['001'],
      productDescription: 'Goods Purchased from Supplier',
      quantity: 100,
      unitCode: 'H87',
      unitPrice: 50.00,
      invoiceLineTaxes: [
        { taxType: '01', taxRate: 8 }
      ]
    }
  ]
});
python
self_billed_invoice = api('POST', '/self-billed-invoices', {
    'onBehalfSellerId': seller_id,  # Not buyerId!
    'invoiceSerialNumber': 'SBI-2024-001',
    'currencyCode': 'MYR',
    'autoCalculate': True,
    'invoiceLines': [
        {
            'classifications': ['001'],
            'productDescription': 'Goods Purchased from Supplier',
            'quantity': 100,
            'unitCode': 'H87',
            'unitPrice': 50.00,
            'invoiceLineTaxes': [
                {'taxType': '01', 'taxRate': 8}
            ]
        }
    ]
})
php
$selfBilledInvoice = $api->post('/self-billed-invoices', [
    'onBehalfSellerId' => $sellerId,  // Not buyerId!
    'invoiceSerialNumber' => 'SBI-2024-001',
    'currencyCode' => 'MYR',
    'autoCalculate' => true,
    'invoiceLines' => [
        [
            'classifications' => ['001'],
            'productDescription' => 'Goods Purchased from Supplier',
            'quantity' => 100,
            'unitCode' => 'H87',
            'unitPrice' => 50.00,
            'invoiceLineTaxes' => [
                ['taxType' => '01', 'taxRate' => 8]
            ]
        ]
    ]
]);
php
$response = $client->post('self-billed-invoices', [
    'json' => [
        'onBehalfSellerId' => $sellerId,  // Not buyerId!
        'invoiceSerialNumber' => 'SBI-2024-001',
        'currencyCode' => 'MYR',
        'autoCalculate' => true,
        'invoiceLines' => [
            [
                'classifications' => ['001'],
                'productDescription' => 'Goods Purchased from Supplier',
                'quantity' => 100,
                'unitCode' => 'H87',
                'unitPrice' => 50.00,
                'invoiceLineTaxes' => [
                    ['taxType' => '01', 'taxRate' => 8]
                ]
            ]
        ]
    ]
]);
$selfBilledInvoice = json_decode($response->getBody(), true)['data'];
java
var invoiceJson = String.format("""
{
    "onBehalfSellerId": "%s",
    "invoiceSerialNumber": "SBI-2024-001",
    "currencyCode": "MYR",
    "autoCalculate": true,
    "invoiceLines": [{
        "classifications": ["001"],
        "productDescription": "Goods Purchased from Supplier",
        "quantity": 100,
        "unitCode": "H87",
        "unitPrice": 50.00,
        "invoiceLineTaxes": [{"taxType": "01", "taxRate": 8}]
    }]
}
""", sellerId);

var request = HttpRequest.newBuilder()
    .uri(URI.create(API_URL + "/self-billed-invoices"))
    .header("Authorization", "Bearer " + API_TOKEN)
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(invoiceJson))
    .build();

var response = client.send(request, HttpResponse.BodyHandlers.ofString());
csharp
var response = await client.PostAsJsonAsync("/self-billed-invoices", new {
    onBehalfSellerId = sellerId,  // Not buyerId!
    invoiceSerialNumber = "SBI-2024-001",
    currencyCode = "MYR",
    autoCalculate = true,
    invoiceLines = new[] {
        new {
            classifications = new[] { "001" },
            productDescription = "Goods Purchased from Supplier",
            quantity = 100,
            unitCode = "H87",
            unitPrice = 50.00,
            invoiceLineTaxes = new[] {
                new { taxType = "01", taxRate = 8 }
            }
        }
    }
});
var selfBilledInvoice = await response.Content.ReadFromJsonAsync<JsonElement>();

Self-Billed Credit Note

javascript
const selfBilledCreditNote = await api('POST', '/self-billed-credit-notes', {
  onBehalfSellerId: sellerId,
  invoiceSerialNumber: 'SBCN-2024-001',
  currencyCode: 'MYR',
  autoCalculate: true,
  documentReferences: [
    {
      referenceNumber: 'SBI-2024-001',
      uuid: 'original-self-billed-invoice-uuid'
    }
  ],
  invoiceLines: [
    {
      classifications: ['001'],
      productDescription: 'Return Credit',
      quantity: 10,
      unitCode: 'H87',
      unitPrice: 50.00,
      invoiceLineTaxes: [
        { taxType: '01', taxRate: 8 }
      ]
    }
  ]
});
python
self_billed_credit_note = api('POST', '/self-billed-credit-notes', {
    'onBehalfSellerId': seller_id,
    'invoiceSerialNumber': 'SBCN-2024-001',
    'currencyCode': 'MYR',
    'autoCalculate': True,
    'documentReferences': [
        {
            'referenceNumber': 'SBI-2024-001',
            'uuid': 'original-self-billed-invoice-uuid'
        }
    ],
    'invoiceLines': [
        {
            'classifications': ['001'],
            'productDescription': 'Return Credit',
            'quantity': 10,
            'unitCode': 'H87',
            'unitPrice': 50.00,
            'invoiceLineTaxes': [
                {'taxType': '01', 'taxRate': 8}
            ]
        }
    ]
})
php
$selfBilledCreditNote = $api->post('/self-billed-credit-notes', [
    'onBehalfSellerId' => $sellerId,
    'invoiceSerialNumber' => 'SBCN-2024-001',
    'currencyCode' => 'MYR',
    'autoCalculate' => true,
    'documentReferences' => [
        [
            'referenceNumber' => 'SBI-2024-001',
            'uuid' => 'original-self-billed-invoice-uuid'
        ]
    ],
    'invoiceLines' => [
        [
            'classifications' => ['001'],
            'productDescription' => 'Return Credit',
            'quantity' => 10,
            'unitCode' => 'H87',
            'unitPrice' => 50.00,
            'invoiceLineTaxes' => [
                ['taxType' => '01', 'taxRate' => 8]
            ]
        ]
    ]
]);
php
$response = $client->post('self-billed-credit-notes', [
    'json' => [
        'onBehalfSellerId' => $sellerId,
        'invoiceSerialNumber' => 'SBCN-2024-001',
        'currencyCode' => 'MYR',
        'autoCalculate' => true,
        'documentReferences' => [
            [
                'referenceNumber' => 'SBI-2024-001',
                'uuid' => 'original-self-billed-invoice-uuid'
            ]
        ],
        'invoiceLines' => [
            [
                'classifications' => ['001'],
                'productDescription' => 'Return Credit',
                'quantity' => 10,
                'unitCode' => 'H87',
                'unitPrice' => 50.00,
                'invoiceLineTaxes' => [
                    ['taxType' => '01', 'taxRate' => 8]
                ]
            ]
        ]
    ]
]);
$selfBilledCreditNote = json_decode($response->getBody(), true)['data'];
java
var creditNoteJson = String.format("""
{
    "onBehalfSellerId": "%s",
    "invoiceSerialNumber": "SBCN-2024-001",
    "currencyCode": "MYR",
    "autoCalculate": true,
    "documentReferences": [{
        "referenceNumber": "SBI-2024-001",
        "uuid": "original-self-billed-invoice-uuid"
    }],
    "invoiceLines": [{
        "classifications": ["001"],
        "productDescription": "Return Credit",
        "quantity": 10,
        "unitCode": "H87",
        "unitPrice": 50.00,
        "invoiceLineTaxes": [{"taxType": "01", "taxRate": 8}]
    }]
}
""", sellerId);

var request = HttpRequest.newBuilder()
    .uri(URI.create(API_URL + "/self-billed-credit-notes"))
    .header("Authorization", "Bearer " + API_TOKEN)
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(creditNoteJson))
    .build();

var response = client.send(request, HttpResponse.BodyHandlers.ofString());
csharp
var response = await client.PostAsJsonAsync("/self-billed-credit-notes", new {
    onBehalfSellerId = sellerId,
    invoiceSerialNumber = "SBCN-2024-001",
    currencyCode = "MYR",
    autoCalculate = true,
    documentReferences = new[] {
        new {
            referenceNumber = "SBI-2024-001",
            uuid = "original-self-billed-invoice-uuid"
        }
    },
    invoiceLines = new[] {
        new {
            classifications = new[] { "001" },
            productDescription = "Return Credit",
            quantity = 10,
            unitCode = "H87",
            unitPrice = 50.00,
            invoiceLineTaxes = new[] {
                new { taxType = "01", taxRate = 8 }
            }
        }
    }
});
var selfBilledCreditNote = await response.Content.ReadFromJsonAsync<JsonElement>();

Self-Billed Debit Note

javascript
const selfBilledDebitNote = await api('POST', '/self-billed-debit-notes', {
  onBehalfSellerId: sellerId,
  invoiceSerialNumber: 'SBDN-2024-001',
  currencyCode: 'MYR',
  autoCalculate: true,
  documentReferences: [
    {
      referenceNumber: 'SBI-2024-001',
      uuid: 'original-self-billed-invoice-uuid'
    }
  ],
  invoiceLines: [
    {
      classifications: ['001'],
      productDescription: 'Additional Charge',
      quantity: 1,
      unitCode: 'H87',
      unitPrice: 25.00,
      invoiceLineTaxes: [
        { taxType: '01', taxRate: 8 }
      ]
    }
  ]
});
python
self_billed_debit_note = api('POST', '/self-billed-debit-notes', {
    'onBehalfSellerId': seller_id,
    'invoiceSerialNumber': 'SBDN-2024-001',
    'currencyCode': 'MYR',
    'autoCalculate': True,
    'documentReferences': [
        {
            'referenceNumber': 'SBI-2024-001',
            'uuid': 'original-self-billed-invoice-uuid'
        }
    ],
    'invoiceLines': [
        {
            'classifications': ['001'],
            'productDescription': 'Additional Charge',
            'quantity': 1,
            'unitCode': 'H87',
            'unitPrice': 25.00,
            'invoiceLineTaxes': [
                {'taxType': '01', 'taxRate': 8}
            ]
        }
    ]
})
php
$selfBilledDebitNote = $api->post('/self-billed-debit-notes', [
    'onBehalfSellerId' => $sellerId,
    'invoiceSerialNumber' => 'SBDN-2024-001',
    'currencyCode' => 'MYR',
    'autoCalculate' => true,
    'documentReferences' => [
        [
            'referenceNumber' => 'SBI-2024-001',
            'uuid' => 'original-self-billed-invoice-uuid'
        ]
    ],
    'invoiceLines' => [
        [
            'classifications' => ['001'],
            'productDescription' => 'Additional Charge',
            'quantity' => 1,
            'unitCode' => 'H87',
            'unitPrice' => 25.00,
            'invoiceLineTaxes' => [
                ['taxType' => '01', 'taxRate' => 8]
            ]
        ]
    ]
]);
php
$response = $client->post('self-billed-debit-notes', [
    'json' => [
        'onBehalfSellerId' => $sellerId,
        'invoiceSerialNumber' => 'SBDN-2024-001',
        'currencyCode' => 'MYR',
        'autoCalculate' => true,
        'documentReferences' => [
            [
                'referenceNumber' => 'SBI-2024-001',
                'uuid' => 'original-self-billed-invoice-uuid'
            ]
        ],
        'invoiceLines' => [
            [
                'classifications' => ['001'],
                'productDescription' => 'Additional Charge',
                'quantity' => 1,
                'unitCode' => 'H87',
                'unitPrice' => 25.00,
                'invoiceLineTaxes' => [
                    ['taxType' => '01', 'taxRate' => 8]
                ]
            ]
        ]
    ]
]);
$selfBilledDebitNote = json_decode($response->getBody(), true)['data'];
java
var debitNoteJson = String.format("""
{
    "onBehalfSellerId": "%s",
    "invoiceSerialNumber": "SBDN-2024-001",
    "currencyCode": "MYR",
    "autoCalculate": true,
    "documentReferences": [{
        "referenceNumber": "SBI-2024-001",
        "uuid": "original-self-billed-invoice-uuid"
    }],
    "invoiceLines": [{
        "classifications": ["001"],
        "productDescription": "Additional Charge",
        "quantity": 1,
        "unitCode": "H87",
        "unitPrice": 25.00,
        "invoiceLineTaxes": [{"taxType": "01", "taxRate": 8}]
    }]
}
""", sellerId);

var request = HttpRequest.newBuilder()
    .uri(URI.create(API_URL + "/self-billed-debit-notes"))
    .header("Authorization", "Bearer " + API_TOKEN)
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(debitNoteJson))
    .build();

var response = client.send(request, HttpResponse.BodyHandlers.ofString());
csharp
var response = await client.PostAsJsonAsync("/self-billed-debit-notes", new {
    onBehalfSellerId = sellerId,
    invoiceSerialNumber = "SBDN-2024-001",
    currencyCode = "MYR",
    autoCalculate = true,
    documentReferences = new[] {
        new {
            referenceNumber = "SBI-2024-001",
            uuid = "original-self-billed-invoice-uuid"
        }
    },
    invoiceLines = new[] {
        new {
            classifications = new[] { "001" },
            productDescription = "Additional Charge",
            quantity = 1,
            unitCode = "H87",
            unitPrice = 25.00,
            invoiceLineTaxes = new[] {
                new { taxType = "01", taxRate = 8 }
            }
        }
    }
});
var selfBilledDebitNote = await response.Content.ReadFromJsonAsync<JsonElement>();

Managing On-Behalf Sellers

List Sellers

javascript
// List all on-behalf sellers
const sellers = await api('GET', '/on-behalf-sellers');

// With filters
const ready = await api('GET', '/on-behalf-sellers?ready=true');
python
# List all on-behalf sellers
sellers = api('GET', '/on-behalf-sellers')

# With filters
ready = api('GET', '/on-behalf-sellers?ready=true')
php
// List all on-behalf sellers
$sellers = $api->get('/on-behalf-sellers');

// With filters
$ready = $api->get('/on-behalf-sellers', ['ready' => true]);
php
// List all on-behalf sellers
$response = $client->get('on-behalf-sellers');
$sellers = json_decode($response->getBody(), true)['data'];

// With filters
$response = $client->get('on-behalf-sellers?ready=true');
$ready = json_decode($response->getBody(), true)['data'];
java
// List all on-behalf sellers
var request = HttpRequest.newBuilder()
    .uri(URI.create(API_URL + "/on-behalf-sellers"))
    .header("Authorization", "Bearer " + API_TOKEN)
    .GET()
    .build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());

// With filters
var filterRequest = HttpRequest.newBuilder()
    .uri(URI.create(API_URL + "/on-behalf-sellers?ready=true"))
    .header("Authorization", "Bearer " + API_TOKEN)
    .GET()
    .build();
var filterResponse = client.send(filterRequest, HttpResponse.BodyHandlers.ofString());
csharp
// List all on-behalf sellers
var response = await client.GetAsync("/on-behalf-sellers");
var sellers = await response.Content.ReadFromJsonAsync<JsonElement>();

// With filters
var readyResponse = await client.GetAsync("/on-behalf-sellers?ready=true");
var ready = await readyResponse.Content.ReadFromJsonAsync<JsonElement>();

Update Seller

javascript
const updated = await api('PUT', `/on-behalf-sellers/${sellerId}`, {
  name: 'Supplier Corp Sdn Bhd (Updated)',
  contact: {
    phone: '+60399999999',
    email: 'updated@supplier.com'
  }
});
python
updated = api('PUT', f'/on-behalf-sellers/{seller_id}', {
    'name': 'Supplier Corp Sdn Bhd (Updated)',
    'contact': {
        'phone': '+60399999999',
        'email': 'updated@supplier.com'
    }
})
php
$updated = $api->put("/on-behalf-sellers/$sellerId", [
    'name' => 'Supplier Corp Sdn Bhd (Updated)',
    'contact' => [
        'phone' => '+60399999999',
        'email' => 'updated@supplier.com'
    ]
]);
php
$response = $client->put("on-behalf-sellers/$sellerId", [
    'json' => [
        'name' => 'Supplier Corp Sdn Bhd (Updated)',
        'contact' => [
            'phone' => '+60399999999',
            'email' => 'updated@supplier.com'
        ]
    ]
]);
$updated = json_decode($response->getBody(), true)['data'];
java
var updateJson = """
{
    "name": "Supplier Corp Sdn Bhd (Updated)",
    "contact": {
        "phone": "+60399999999",
        "email": "updated@supplier.com"
    }
}
""";

var request = HttpRequest.newBuilder()
    .uri(URI.create(API_URL + "/on-behalf-sellers/" + sellerId))
    .header("Authorization", "Bearer " + API_TOKEN)
    .header("Content-Type", "application/json")
    .PUT(HttpRequest.BodyPublishers.ofString(updateJson))
    .build();

var response = client.send(request, HttpResponse.BodyHandlers.ofString());
csharp
var response = await client.PutAsJsonAsync($"/on-behalf-sellers/{sellerId}", new {
    name = "Supplier Corp Sdn Bhd (Updated)",
    contact = new {
        phone = "+60399999999",
        email = "updated@supplier.com"
    }
});
var updated = await response.Content.ReadFromJsonAsync<JsonElement>();

Delete Seller

WARNING

Sellers with existing invoices cannot be deleted.

javascript
await api('DELETE', `/on-behalf-sellers/${sellerId}`);
python
api('DELETE', f'/on-behalf-sellers/{seller_id}')
php
$api->delete("/on-behalf-sellers/$sellerId");
php
$client->delete("on-behalf-sellers/$sellerId");
java
var request = HttpRequest.newBuilder()
    .uri(URI.create(API_URL + "/on-behalf-sellers/" + sellerId))
    .header("Authorization", "Bearer " + API_TOKEN)
    .DELETE()
    .build();

client.send(request, HttpResponse.BodyHandlers.ofString());
csharp
await client.DeleteAsync($"/on-behalf-sellers/{sellerId}");

On-Behalf Seller Fields

Required Fields

FieldTypeDescription
namestringSeller company name
tinstringTax Identification Number
id_typestringBRN, NRIC, PASSPORT, ARMY
id_valuestringID number
address.line1stringStreet address
address.citystringCity
address.statestringState code
address.countryCodestringCountry code
contact.phonestringPhone (E.164)

Optional Fields

FieldTypeDescription
address.line2stringAddress line 2
address.line3stringAddress line 3
address.postCodestringPostal code
contact.emailstringEmail
contact.namestringContact person
contact.faxstringFax number

Self-Billed Document Types

EndpointDescription
/self-billed-invoicesStandard self-billed invoice
/self-billed-credit-notesSelf-billed credit note
/self-billed-debit-notesSelf-billed debit note
/self-billed-refund-notesSelf-billed refund note

Next Steps

InvoisX - Malaysia's Leading e-Invoice Platform