curl -X PUT 'https://services.leadconnectorhq.com/invoices/YOUR_invoiceId' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"altId": "6578278e879ad2646715ba9c",
"altType": "account",
"name": "New Invoice",
"title": "INVOICE",
"currency": "USD",
"description": "ABC Corp payments",
"businessDetails": {
"name": "Alex",
"address": {
"addressLine1": "9931 Beechwood",
"city": "St. Houston",
"state": "TX",
"countryCode": "USA",
"postalCode": "559-6993"
},
"phoneNo": "+1-214-559-6993",
"website": "www.example.com"
},
"invoiceNumber": "1001",
"contactId": "6578278e879ad2646715ba9c",
"contactDetails": {
"id": "6578278e879ad2646715ba9c",
"name": "Alex",
"phoneNo": "+1234567890",
"email": "alex@example.com",
"additionalEmails": [
{
"email": "alex@example.com"
}
],
"companyName": "ABC Corp.",
"address": {
"addressLine1": "9931 Beechwood",
"addressLine2": "Beechwood",
"city": "St. Houston",
"state": "TX",
"countryCode": "US",
"postalCode": "559-6993"
},
"customFields": [
"string"
]
},
"termsNotes": "<p>This is a default terms.</p>",
"discount": {
"value": 10,
"type": "percentage",
"validOnProductIds": "[ '6579751d56f60276e5bd4154' ]"
},
"invoiceItems": [
{
"name": "ABC Product",
"description": "ABC Corp.",
"productId": "6578278e879ad2646715ba9c",
"priceId": "6578278e879ad2646715ba9c",
"currency": "USD",
"amount": 999,
"qty": 1,
"taxes": [
{}
],
"automaticTaxCategoryId": "6578278e879ad2646715ba9c",
"isSetupFeeItem": true,
"type": "one_time",
"taxInclusive": true
}
],
"automaticTaxesEnabled": true,
"liveMode": true,
"issueDate": "2023-01-01",
"dueDate": "2023-01-14",
"xeroDetails": {},
"invoiceNumberPrefix": "INV-",
"attachments": [
{
"id": "6241712be68f7a98102ba272",
"name": "Electronics.pdf",
"url": "https://example.com/digital-delivery",
"type": "string",
"size": 10000
}
]
}'
const response = await fetch('https://services.leadconnectorhq.com/invoices/YOUR_invoiceId', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"altId": "6578278e879ad2646715ba9c", "altType": "account", "name": "New Invoice", "title": "INVOICE", "currency": "USD", "description": "ABC Corp payments", "businessDetails": {"name": "Alex", "address": {"addressLine1": "9931 Beechwood", "city": "St. Houston", "state": "TX", "countryCode": "USA", "postalCode": "559-6993"}, "phoneNo": "+1-214-559-6993", "website": "www.example.com"}, "invoiceNumber": "1001", "contactId": "6578278e879ad2646715ba9c", "contactDetails": {"id": "6578278e879ad2646715ba9c", "name": "Alex", "phoneNo": "+1234567890", "email": "alex@example.com", "additionalEmails": [{"email": "alex@example.com"}], "companyName": "ABC Corp.", "address": {"addressLine1": "9931 Beechwood", "addressLine2": "Beechwood", "city": "St. Houston", "state": "TX", "countryCode": "US", "postalCode": "559-6993"}, "customFields": ["string"]}, "termsNotes": "<p>This is a default terms.</p>", "discount": {"value": 10, "type": "percentage", "validOnProductIds": "[ '6579751d56f60276e5bd4154' ]"}, "invoiceItems": [{"name": "ABC Product", "description": "ABC Corp.", "productId": "6578278e879ad2646715ba9c", "priceId": "6578278e879ad2646715ba9c", "currency": "USD", "amount": 999, "qty": 1, "taxes": [{}], "automaticTaxCategoryId": "6578278e879ad2646715ba9c", "isSetupFeeItem": true, "type": "one_time", "taxInclusive": true}], "automaticTaxesEnabled": true, "liveMode": true, "issueDate": "2023-01-01", "dueDate": "2023-01-14", "xeroDetails": {}, "invoiceNumberPrefix": "INV-", "attachments": [{"id": "6241712be68f7a98102ba272", "name": "Electronics.pdf", "url": "https://example.com/digital-delivery", "type": "string", "size": 10000}]}),
});
const data = await response.json();
import os, requests
response = requests.request(
'PUT',
'https://services.leadconnectorhq.com/invoices/YOUR_invoiceId',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"altId": "6578278e879ad2646715ba9c", "altType": "account", "name": "New Invoice", "title": "INVOICE", "currency": "USD", "description": "ABC Corp payments", "businessDetails": {"name": "Alex", "address": {"addressLine1": "9931 Beechwood", "city": "St. Houston", "state": "TX", "countryCode": "USA", "postalCode": "559-6993"}, "phoneNo": "+1-214-559-6993", "website": "www.example.com"}, "invoiceNumber": "1001", "contactId": "6578278e879ad2646715ba9c", "contactDetails": {"id": "6578278e879ad2646715ba9c", "name": "Alex", "phoneNo": "+1234567890", "email": "alex@example.com", "additionalEmails": [{"email": "alex@example.com"}], "companyName": "ABC Corp.", "address": {"addressLine1": "9931 Beechwood", "addressLine2": "Beechwood", "city": "St. Houston", "state": "TX", "countryCode": "US", "postalCode": "559-6993"}, "customFields": ["string"]}, "termsNotes": "<p>This is a default terms.</p>", "discount": {"value": 10, "type": "percentage", "validOnProductIds": "[ '6579751d56f60276e5bd4154' ]"}, "invoiceItems": [{"name": "ABC Product", "description": "ABC Corp.", "productId": "6578278e879ad2646715ba9c", "priceId": "6578278e879ad2646715ba9c", "currency": "USD", "amount": 999, "qty": 1, "taxes": [{}], "automaticTaxCategoryId": "6578278e879ad2646715ba9c", "isSetupFeeItem": true, "type": "one_time", "taxInclusive": true}], "automaticTaxesEnabled": true, "liveMode": true, "issueDate": "2023-01-01", "dueDate": "2023-01-14", "xeroDetails": {}, "invoiceNumberPrefix": "INV-", "attachments": [{"id": "6241712be68f7a98102ba272", "name": "Electronics.pdf", "url": "https://example.com/digital-delivery", "type": "string", "size": 10000}]},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/invoices/YOUR_invoiceId');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'altId': '6578278e879ad2646715ba9c', 'altType': 'account', 'name': 'New Invoice', 'title': 'INVOICE', 'currency': 'USD', 'description': 'ABC Corp payments', 'businessDetails': {'name': 'Alex', 'address': {'addressLine1': '9931 Beechwood', 'city': 'St. Houston', 'state': 'TX', 'countryCode': 'USA', 'postalCode': '559-6993'}, 'phoneNo': '+1-214-559-6993', 'website': 'www.example.com'}, 'invoiceNumber': '1001', 'contactId': '6578278e879ad2646715ba9c', 'contactDetails': {'id': '6578278e879ad2646715ba9c', 'name': 'Alex', 'phoneNo': '+1234567890', 'email': 'alex@example.com', 'additionalEmails': [{'email': 'alex@example.com'}], 'companyName': 'ABC Corp.', 'address': {'addressLine1': '9931 Beechwood', 'addressLine2': 'Beechwood', 'city': 'St. Houston', 'state': 'TX', 'countryCode': 'US', 'postalCode': '559-6993'}, 'customFields': ['string']}, 'termsNotes': '<p>This is a default terms.</p>', 'discount': {'value': 10, 'type': 'percentage', 'validOnProductIds': '[ '6579751d56f60276e5bd4154' ]'}, 'invoiceItems': [{'name': 'ABC Product', 'description': 'ABC Corp.', 'productId': '6578278e879ad2646715ba9c', 'priceId': '6578278e879ad2646715ba9c', 'currency': 'USD', 'amount': 999, 'qty': 1, 'taxes': [{}], 'automaticTaxCategoryId': '6578278e879ad2646715ba9c', 'isSetupFeeItem': true, 'type': 'one_time', 'taxInclusive': true}], 'automaticTaxesEnabled': true, 'liveMode': true, 'issueDate': '2023-01-01', 'dueDate': '2023-01-14', 'xeroDetails': {}, 'invoiceNumberPrefix': 'INV-', 'attachments': [{'id': '6241712be68f7a98102ba272', 'name': 'Electronics.pdf', 'url': 'https://example.com/digital-delivery', 'type': 'string', 'size': 10000}]}),
]);
$data = json_decode(curl_exec($ch), true);