> ## 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.

# Payout receipt

> This endpoint enables you to generate and send a payout receipt for a business transaction. The receipt will be emailed to the address provided in the request.

### 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

**worker\_full\_name** `string` *required*

Full name of the worker.

**worker\_contact\_number** `string` *required*

Contact number of the worker.

**worker\_email** `string` *required*

Email address of the worker where the receipt will be sent.

**invoice\_date\_time** `string` *required*

Date and time of the invoice (ISO 8601 format).

**invoice\_id** `string` *required*

Unique identifier for the invoice.

**delivery\_type** `string` *required*

Type of delivery (e.g., 'Express', 'Standard').

**pick\_up\_address** `string` *required*

Address of the pickup location.

**pick\_up\_date\_time** `string` *required*

Date and time of the pickup (ISO 8601 format).

**drop\_off\_address** `string` *required*

Address of the drop-off location.

**drop\_off\_date\_time** `string` *required*

Date and time of the drop-off (ISO 8601 format).

**total\_distance** `number` *required*

Total distance covered for the delivery.

**total\_earning\_amount** `number` *required*

Total earning amount for the delivery.

**payout\_amount** `number` *required*

Payout amount transferred to the worker.

**bank\_account\_name** `string` *required*

Name associated with the destination bank account.

**bsb** `string` *required*

The BSB code (6 digits, formatted as XXX-XXX or XXXXXX) for Australian bank accounts.

**account\_number** `string` *required*

Destination bank account number.

### Response Body

The response is in JSON format and contains:

**status** `number`

Indicates the status code of the response.

**message** `string`

Confirmation message indicating whether the receipt was sent successfully.

### Response Codes

| Code | Description |
| - | - |
| 200 | If the request is successful, the payout receipt is generated and sent to the provided email address. |
| 400 | Bad Request. Invalid parameters or validation failure. |
| 401 | Unauthorized. Missing or invalid credentials. |
| 409 | Conflict. Duplicate idempotency key or duplicate receipt ID. |
| 500 | Internal Server Error. |

```bash cURL theme={null}
curl -X POST https://qa-payments.mygigsters.com.au/api/v1/receipt/payout \
  -u "YOUR_UUID:YOUR_SECRET" \
  -H "X-API-Version: 1.2" \
  -H "Content-Type: application/json" \
  -d '{
  "worker_full_name": "John Doe",
  "worker_contact_number": "+1234567890",
  "worker_email": "jane.smith@example.com",
  "invoice_date_time": "2024-03-28T14:30:00Z",
  "invoice_id": "INV12345",
  "delivery_type": "Express",
  "pick_up_address": "123 Main St, City, Country",
  "pick_up_date_time": "2024-03-28T15:00:00Z",
  "drop_off_address": "456 Elm St, City, Country",
  "drop_off_date_time": "2024-03-28T16:30:00Z",
  "total_distance": 12.5,
  "total_earning_amount": 5000,
  "payout_amount": 4500,
  "bank_account_name": "John Doe",
  "bsb": "123-456",
  "account_number": "987654321"
}'
```

```javascript Node.js theme={null}
const response = await fetch("https://qa-payments.mygigsters.com.au/api/v1/receipt/payout", {
  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({
    "worker_full_name": "John Doe",
    "worker_contact_number": "+1234567890",
    "worker_email": "jane.smith@example.com",
    "invoice_date_time": "2024-03-28T14:30:00Z",
    "invoice_id": "INV12345",
    "delivery_type": "Express",
    "pick_up_address": "123 Main St, City, Country",
    "pick_up_date_time": "2024-03-28T15:00:00Z",
    "drop_off_address": "456 Elm St, City, Country",
    "drop_off_date_time": "2024-03-28T16:30:00Z",
    "total_distance": 12.5,
    "total_earning_amount": 5000,
    "payout_amount": 4500,
    "bank_account_name": "John Doe",
    "bsb": "123-456",
    "account_number": "987654321"
  }),
});

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/receipt/payout",
    auth=("YOUR_UUID", "YOUR_SECRET"),
    headers={
        "X-API-Version": "1.2",
    },
    json={
        "worker_full_name": "John Doe",
        "worker_contact_number": "+1234567890",
        "worker_email": "jane.smith@example.com",
        "invoice_date_time": "2024-03-28T14:30:00Z",
        "invoice_id": "INV12345",
        "delivery_type": "Express",
        "pick_up_address": "123 Main St, City, Country",
        "pick_up_date_time": "2024-03-28T15:00:00Z",
        "drop_off_address": "456 Elm St, City, Country",
        "drop_off_date_time": "2024-03-28T16:30:00Z",
        "total_distance": 12.5,
        "total_earning_amount": 5000,
        "payout_amount": 4500,
        "bank_account_name": "John Doe",
        "bsb": "123-456",
        "account_number": "987654321",
    },
)

print(response.json())
```

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

uri = URI("https://qa-payments.mygigsters.com.au/api/v1/receipt/payout")
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
  {
    "worker_full_name": "John Doe",
    "worker_contact_number": "+1234567890",
    "worker_email": "jane.smith@example.com",
    "invoice_date_time": "2024-03-28T14:30:00Z",
    "invoice_id": "INV12345",
    "delivery_type": "Express",
    "pick_up_address": "123 Main St, City, Country",
    "pick_up_date_time": "2024-03-28T15:00:00Z",
    "drop_off_address": "456 Elm St, City, Country",
    "drop_off_date_time": "2024-03-28T16:30:00Z",
    "total_distance": 12.5,
    "total_earning_amount": 5000,
    "payout_amount": 4500,
    "bank_account_name": "John Doe",
    "bsb": "123-456",
    "account_number": "987654321"
  }
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/receipt/payout");

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'
{
  "worker_full_name": "John Doe",
  "worker_contact_number": "+1234567890",
  "worker_email": "jane.smith@example.com",
  "invoice_date_time": "2024-03-28T14:30:00Z",
  "invoice_id": "INV12345",
  "delivery_type": "Express",
  "pick_up_address": "123 Main St, City, Country",
  "pick_up_date_time": "2024-03-28T15:00:00Z",
  "drop_off_address": "456 Elm St, City, Country",
  "drop_off_date_time": "2024-03-28T16:30:00Z",
  "total_distance": 12.5,
  "total_earning_amount": 5000,
  "payout_amount": 4500,
  "bank_account_name": "John Doe",
  "bsb": "123-456",
  "account_number": "987654321"
}
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",
            "{",
            "  \"worker_full_name\": \"John Doe\",",
            "  \"worker_contact_number\": \"+1234567890\",",
            "  \"worker_email\": \"jane.smith@example.com\",",
            "  \"invoice_date_time\": \"2024-03-28T14:30:00Z\",",
            "  \"invoice_id\": \"INV12345\",",
            "  \"delivery_type\": \"Express\",",
            "  \"pick_up_address\": \"123 Main St, City, Country\",",
            "  \"pick_up_date_time\": \"2024-03-28T15:00:00Z\",",
            "  \"drop_off_address\": \"456 Elm St, City, Country\",",
            "  \"drop_off_date_time\": \"2024-03-28T16:30:00Z\",",
            "  \"total_distance\": 12.5,",
            "  \"total_earning_amount\": 5000,",
            "  \"payout_amount\": 4500,",
            "  \"bank_account_name\": \"John Doe\",",
            "  \"bsb\": \"123-456\",",
            "  \"account_number\": \"987654321\"",
            "}"
        );

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://qa-payments.mygigsters.com.au/api/v1/receipt/payout"))
            .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(`{
  "worker_full_name": "John Doe",
  "worker_contact_number": "+1234567890",
  "worker_email": "jane.smith@example.com",
  "invoice_date_time": "2024-03-28T14:30:00Z",
  "invoice_id": "INV12345",
  "delivery_type": "Express",
  "pick_up_address": "123 Main St, City, Country",
  "pick_up_date_time": "2024-03-28T15:00:00Z",
  "drop_off_address": "456 Elm St, City, Country",
  "drop_off_date_time": "2024-03-28T16:30:00Z",
  "total_distance": 12.5,
  "total_earning_amount": 5000,
  "payout_amount": 4500,
  "bank_account_name": "John Doe",
  "bsb": "123-456",
  "account_number": "987654321"
}`)

	req, err := http.NewRequest("POST", "https://qa-payments.mygigsters.com.au/api/v1/receipt/payout", 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/receipt/payout");
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(@"{
  ""worker_full_name"": ""John Doe"",
  ""worker_contact_number"": ""+1234567890"",
  ""worker_email"": ""jane.smith@example.com"",
  ""invoice_date_time"": ""2024-03-28T14:30:00Z"",
  ""invoice_id"": ""INV12345"",
  ""delivery_type"": ""Express"",
  ""pick_up_address"": ""123 Main St, City, Country"",
  ""pick_up_date_time"": ""2024-03-28T15:00:00Z"",
  ""drop_off_address"": ""456 Elm St, City, Country"",
  ""drop_off_date_time"": ""2024-03-28T16:30:00Z"",
  ""total_distance"": 12.5,
  ""total_earning_amount"": 5000,
  ""payout_amount"": 4500,
  ""bank_account_name"": ""John Doe"",
  ""bsb"": ""123-456"",
  ""account_number"": ""987654321""
}", Encoding.UTF8, "application/json");

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

```json 200 theme={null}
{
  "status": 200,
  "message": "Receipt sent successfully"
}
```


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