> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mygigsters.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create and send invoice

> This endpoint creates an invoice, generates a PDF, and optionally emails it to the customer.

### Headers

**X-API-Version** `string` *required* (default: 1.2)

The API version to use. Supported versions are `1.1` and `1.2`.

### Request Body Parameters

**name** `string` *required*

Name of the business issuing the invoice.

**logo** `string`

URL of the business logo image.

**address** `string` *required*

Address of the business.

**email** `string` *required*

Business email address.

**reg\_number** `string` *required*

Registration number of the business (e.g., ABN for Australia, UEN for Singapore, or GST registration number).

**bank** `object` *required*

Bank details of the business. Object containing: bsb (string), and accountNumber (string).

**customer** `object` *required*

Customer details. Object containing: customerName (string), customerEmail (string), and customerAddress (string).

**invoice\_number** `string` *required*

Unique identifier code for the invoice.

**reference** `string`

Invoice reference code or brief memo.

**reference\_name** `string`

Name of the reference target (e.g. Project Name).

**date** `string` *required*

Date when the invoice is issued (Format: YYYY-MM-DD).

**due\_date** `string` *required*

Due date for payment (Format: YYYY-MM-DD).

**gst\_applicable** `boolean` *required*

Indicates whether Goods and Services Tax (GST) is applied to the items.

**gst** `number` *required*

GST percentage rate (e.g. 10 for 10% GST).

**items** `array` *required*

Array of invoice line items. Each element is an object containing: description (string), quantity (number), and unitPrice (number).

**type** `string`

Type of invoice. Supported values: `cost_of_sales` or `sales`. Default is `sales`.

**notes** `string`

Additional terms or notes shown on the PDF.

**send\_email** `boolean` *required*

If set to true, the system automatically emails the invoice to the customer.

**payment\_link** `boolean` *required*

If set to true, a payment link is automatically generated and embedded directly inside the invoice PDF.

### Response Body

**status** `number`

Indicates the status code of the response.

**message** `string`

Confirmation message indicating the invoice was created successfully.

**invoice\_id** `string`

The unique ID of the created invoice (prefixed with `inv_`).

**pdf\_url** `string`

URL to download the generated invoice PDF file.

**payment\_link** `string`

URL to the generated checkout payment link (returned if `paymentLink` was true in the request).

### Response Codes

| Code | Description |
| - | - |
| 200 | Invoice created successfully and sent to the customer. |
| 400 | Bad Request. Invalid parameters or validation failure. |
| 401 | Unauthorized. Missing or invalid credentials. |
| 409 | Conflict. Duplicate idempotency key or invoice number already exists. |
| 500 | Internal Server Error. |

```bash cURL theme={null}
curl -X POST https://qa-payments.mygigsters.com.au/api/v1/invoice/create-send-invoice \
  -u "YOUR_UUID:YOUR_SECRET" \
  -H "X-API-Version: 1.2" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Your Business Name",
  "logo": "https://app-qa-payments.mygigsters.com.au/assets/AppLogo1_black-BprEQ1v2.png",
  "address": "Your Business Address",
  "email": "jane.smith@example.com",
  "reg_number": "33623510396",
  "bank": {
    "abn": "123456789",
    "bsb_number": "086568",
    "account_number": "77868647"
  },
  "customer": {
    "customer_name": "Jane Smith",
    "customer_email": "jane.smith@example.com",
    "customer_address": "123, Melbourne, AU"
  },
  "invoice_number": "INV-0002",
  "reference": "Test reference",
  "reference_name": "Project Name",
  "date": "2025-11-26",
  "due_date": "2025-12-25",
  "gst_applicable": true,
  "gst": 10,
  "items": [
    {
      "description": "Product A",
      "quantity": 2,
      "unit_price": 5000
    },
    {
      "description": "Product B",
      "quantity": 3,
      "unit_price": 7500
    },
    {
      "description": "Product C",
      "quantity": 43,
      "unit_price": 1500
    }
  ],
  "type": "cost_of_sales",
  "notes": "Add notes here, if any",
  "send_email": false,
  "payment_link": true
}'
```

```javascript Node.js theme={null}
const response = await fetch("https://qa-payments.mygigsters.com.au/api/v1/invoice/create-send-invoice", {
  method: "POST",
  headers: {
    Authorization: "Basic " + Buffer.from("YOUR_UUID:YOUR_SECRET").toString("base64"),
    "X-API-Version": "1.2",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "Your Business Name",
    "logo": "https://app-qa-payments.mygigsters.com.au/assets/AppLogo1_black-BprEQ1v2.png",
    "address": "Your Business Address",
    "email": "jane.smith@example.com",
    "reg_number": "33623510396",
    "bank": {
      "abn": "123456789",
      "bsb_number": "086568",
      "account_number": "77868647"
    },
    "customer": {
      "customer_name": "Jane Smith",
      "customer_email": "jane.smith@example.com",
      "customer_address": "123, Melbourne, AU"
    },
    "invoice_number": "INV-0002",
    "reference": "Test reference",
    "reference_name": "Project Name",
    "date": "2025-11-26",
    "due_date": "2025-12-25",
    "gst_applicable": true,
    "gst": 10,
    "items": [
      {
        "description": "Product A",
        "quantity": 2,
        "unit_price": 5000
      },
      {
        "description": "Product B",
        "quantity": 3,
        "unit_price": 7500
      },
      {
        "description": "Product C",
        "quantity": 43,
        "unit_price": 1500
      }
    ],
    "type": "cost_of_sales",
    "notes": "Add notes here, if any",
    "send_email": false,
    "payment_link": true
  }),
});

const data = await response.json();
console.log(data);
```

```python Python theme={null}
import requests

response = requests.post(
    "https://qa-payments.mygigsters.com.au/api/v1/invoice/create-send-invoice",
    auth=("YOUR_UUID", "YOUR_SECRET"),
    headers={
        "X-API-Version": "1.2",
    },
    json={
        "name": "Your Business Name",
        "logo": "https://app-qa-payments.mygigsters.com.au/assets/AppLogo1_black-BprEQ1v2.png",
        "address": "Your Business Address",
        "email": "jane.smith@example.com",
        "reg_number": "33623510396",
        "bank": {
            "abn": "123456789",
            "bsb_number": "086568",
            "account_number": "77868647",
        },
        "customer": {
            "customer_name": "Jane Smith",
            "customer_email": "jane.smith@example.com",
            "customer_address": "123, Melbourne, AU",
        },
        "invoice_number": "INV-0002",
        "reference": "Test reference",
        "reference_name": "Project Name",
        "date": "2025-11-26",
        "due_date": "2025-12-25",
        "gst_applicable": True,
        "gst": 10,
        "items": [
            {
                "description": "Product A",
                "quantity": 2,
                "unit_price": 5000,
            },
            {
                "description": "Product B",
                "quantity": 3,
                "unit_price": 7500,
            },
            {
                "description": "Product C",
                "quantity": 43,
                "unit_price": 1500,
            },
        ],
        "type": "cost_of_sales",
        "notes": "Add notes here, if any",
        "send_email": False,
        "payment_link": True,
    },
)

print(response.json())
```

```ruby Ruby theme={null}
require "net/http"
require "json"
require "uri"

uri = URI("https://qa-payments.mygigsters.com.au/api/v1/invoice/create-send-invoice")
request = Net::HTTP::Post.new(uri)
request.basic_auth("YOUR_UUID", "YOUR_SECRET")
request["X-API-Version"] = "1.2"
request["Content-Type"] = "application/json"
request.body = <<~JSON
  {
    "name": "Your Business Name",
    "logo": "https://app-qa-payments.mygigsters.com.au/assets/AppLogo1_black-BprEQ1v2.png",
    "address": "Your Business Address",
    "email": "jane.smith@example.com",
    "reg_number": "33623510396",
    "bank": {
      "abn": "123456789",
      "bsb_number": "086568",
      "account_number": "77868647"
    },
    "customer": {
      "customer_name": "Jane Smith",
      "customer_email": "jane.smith@example.com",
      "customer_address": "123, Melbourne, AU"
    },
    "invoice_number": "INV-0002",
    "reference": "Test reference",
    "reference_name": "Project Name",
    "date": "2025-11-26",
    "due_date": "2025-12-25",
    "gst_applicable": true,
    "gst": 10,
    "items": [
      {
        "description": "Product A",
        "quantity": 2,
        "unit_price": 5000
      },
      {
        "description": "Product B",
        "quantity": 3,
        "unit_price": 7500
      },
      {
        "description": "Product C",
        "quantity": 43,
        "unit_price": 1500
      }
    ],
    "type": "cost_of_sales",
    "notes": "Add notes here, if any",
    "send_email": false,
    "payment_link": true
  }
JSON

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

puts JSON.parse(response.body)
```

```php PHP theme={null}
<?php

$ch = curl_init("https://qa-payments.mygigsters.com.au/api/v1/invoice/create-send-invoice");

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_USERPWD => "YOUR_UUID:YOUR_SECRET",
    CURLOPT_HTTPHEADER => [
        "X-API-Version: 1.2",
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => <<<'JSON'
{
  "name": "Your Business Name",
  "logo": "https://app-qa-payments.mygigsters.com.au/assets/AppLogo1_black-BprEQ1v2.png",
  "address": "Your Business Address",
  "email": "jane.smith@example.com",
  "reg_number": "33623510396",
  "bank": {
    "abn": "123456789",
    "bsb_number": "086568",
    "account_number": "77868647"
  },
  "customer": {
    "customer_name": "Jane Smith",
    "customer_email": "jane.smith@example.com",
    "customer_address": "123, Melbourne, AU"
  },
  "invoice_number": "INV-0002",
  "reference": "Test reference",
  "reference_name": "Project Name",
  "date": "2025-11-26",
  "due_date": "2025-12-25",
  "gst_applicable": true,
  "gst": 10,
  "items": [
    {
      "description": "Product A",
      "quantity": 2,
      "unit_price": 5000
    },
    {
      "description": "Product B",
      "quantity": 3,
      "unit_price": 7500
    },
    {
      "description": "Product C",
      "quantity": 43,
      "unit_price": 1500
    }
  ],
  "type": "cost_of_sales",
  "notes": "Add notes here, if any",
  "send_email": false,
  "payment_link": true
}
JSON,
]);

$response = curl_exec($ch);
curl_close($ch);

print_r(json_decode($response, true));
```

```java Java theme={null}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.Base64;

public class Example {
    public static void main(String[] args) throws Exception {
        String credentials = Base64.getEncoder()
            .encodeToString("YOUR_UUID:YOUR_SECRET".getBytes());

        String body = String.join("\n",
            "{",
            "  \"name\": \"Your Business Name\",",
            "  \"logo\": \"https://app-qa-payments.mygigsters.com.au/assets/AppLogo1_black-BprEQ1v2.png\",",
            "  \"address\": \"Your Business Address\",",
            "  \"email\": \"jane.smith@example.com\",",
            "  \"reg_number\": \"33623510396\",",
            "  \"bank\": {",
            "    \"abn\": \"123456789\",",
            "    \"bsb_number\": \"086568\",",
            "    \"account_number\": \"77868647\"",
            "  },",
            "  \"customer\": {",
            "    \"customer_name\": \"Jane Smith\",",
            "    \"customer_email\": \"jane.smith@example.com\",",
            "    \"customer_address\": \"123, Melbourne, AU\"",
            "  },",
            "  \"invoice_number\": \"INV-0002\",",
            "  \"reference\": \"Test reference\",",
            "  \"reference_name\": \"Project Name\",",
            "  \"date\": \"2025-11-26\",",
            "  \"due_date\": \"2025-12-25\",",
            "  \"gst_applicable\": true,",
            "  \"gst\": 10,",
            "  \"items\": [",
            "    {",
            "      \"description\": \"Product A\",",
            "      \"quantity\": 2,",
            "      \"unit_price\": 5000",
            "    },",
            "    {",
            "      \"description\": \"Product B\",",
            "      \"quantity\": 3,",
            "      \"unit_price\": 7500",
            "    },",
            "    {",
            "      \"description\": \"Product C\",",
            "      \"quantity\": 43,",
            "      \"unit_price\": 1500",
            "    }",
            "  ],",
            "  \"type\": \"cost_of_sales\",",
            "  \"notes\": \"Add notes here, if any\",",
            "  \"send_email\": false,",
            "  \"payment_link\": true",
            "}"
        );

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://qa-payments.mygigsters.com.au/api/v1/invoice/create-send-invoice"))
            .header("Authorization", "Basic " + credentials)
            .header("X-API-Version", "1.2")
            .header("Content-Type", "application/json")
            .method("POST", HttpRequest.BodyPublishers.ofString(body))
            .build();

        HttpResponse<String> response = HttpClient.newHttpClient()
            .send(request, HttpResponse.BodyHandlers.ofString());

        System.out.println(response.body());
    }
}
```

```go Go theme={null}
package main

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

func main() {
	body := strings.NewReader(`{
  "name": "Your Business Name",
  "logo": "https://app-qa-payments.mygigsters.com.au/assets/AppLogo1_black-BprEQ1v2.png",
  "address": "Your Business Address",
  "email": "jane.smith@example.com",
  "reg_number": "33623510396",
  "bank": {
    "abn": "123456789",
    "bsb_number": "086568",
    "account_number": "77868647"
  },
  "customer": {
    "customer_name": "Jane Smith",
    "customer_email": "jane.smith@example.com",
    "customer_address": "123, Melbourne, AU"
  },
  "invoice_number": "INV-0002",
  "reference": "Test reference",
  "reference_name": "Project Name",
  "date": "2025-11-26",
  "due_date": "2025-12-25",
  "gst_applicable": true,
  "gst": 10,
  "items": [
    {
      "description": "Product A",
      "quantity": 2,
      "unit_price": 5000
    },
    {
      "description": "Product B",
      "quantity": 3,
      "unit_price": 7500
    },
    {
      "description": "Product C",
      "quantity": 43,
      "unit_price": 1500
    }
  ],
  "type": "cost_of_sales",
  "notes": "Add notes here, if any",
  "send_email": false,
  "payment_link": true
}`)

	req, err := http.NewRequest("POST", "https://qa-payments.mygigsters.com.au/api/v1/invoice/create-send-invoice", body)
	if err != nil {
		panic(err)
	}
	req.SetBasicAuth("YOUR_UUID", "YOUR_SECRET")
	req.Header.Set("X-API-Version", "1.2")
	req.Header.Set("Content-Type", "application/json")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	data, _ := io.ReadAll(res.Body)
	fmt.Println(string(data))
}
```

```csharp .NET theme={null}
using System.Net.Http.Headers;
using System.Text;

using var client = new HttpClient();

var request = new HttpRequestMessage(HttpMethod.Post, "https://qa-payments.mygigsters.com.au/api/v1/invoice/create-send-invoice");
request.Headers.Authorization = new AuthenticationHeaderValue(
    "Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes("YOUR_UUID:YOUR_SECRET")));
request.Headers.Add("X-API-Version", "1.2");
request.Content = new StringContent(@"{
  ""name"": ""Your Business Name"",
  ""logo"": ""https://app-qa-payments.mygigsters.com.au/assets/AppLogo1_black-BprEQ1v2.png"",
  ""address"": ""Your Business Address"",
  ""email"": ""jane.smith@example.com"",
  ""reg_number"": ""33623510396"",
  ""bank"": {
    ""abn"": ""123456789"",
    ""bsb_number"": ""086568"",
    ""account_number"": ""77868647""
  },
  ""customer"": {
    ""customer_name"": ""Jane Smith"",
    ""customer_email"": ""jane.smith@example.com"",
    ""customer_address"": ""123, Melbourne, AU""
  },
  ""invoice_number"": ""INV-0002"",
  ""reference"": ""Test reference"",
  ""reference_name"": ""Project Name"",
  ""date"": ""2025-11-26"",
  ""due_date"": ""2025-12-25"",
  ""gst_applicable"": true,
  ""gst"": 10,
  ""items"": [
    {
      ""description"": ""Product A"",
      ""quantity"": 2,
      ""unit_price"": 5000
    },
    {
      ""description"": ""Product B"",
      ""quantity"": 3,
      ""unit_price"": 7500
    },
    {
      ""description"": ""Product C"",
      ""quantity"": 43,
      ""unit_price"": 1500
    }
  ],
  ""type"": ""cost_of_sales"",
  ""notes"": ""Add notes here, if any"",
  ""send_email"": false,
  ""payment_link"": true
}", Encoding.UTF8, "application/json");

var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

```json 200 theme={null}
{
  "status": 200,
  "message": "Invoice created and sent successfully",
  "invoice_id": "d24152f8-7e53-4952-a0b2-e9895365bdea",
  "pdf_url": "https://qa-payments.mygigsters.com.au/api/v1/download-invoice?id=d24152f8-7e53-4952-a0b2-e9895365bdea",
  "payment_link": "https://pay-demo.airwallex.com/hkhixsm2kmf6"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.