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

> This endpoint allows the user to initiate a bank payout for a worker.

### Headers

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

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

### Headers

**idempotency-key** `string` *required*

A unique UUID string used to prevent duplicate operations.

### Request Body Parameters

**worker\_id** `string` *required*

The unique ID of the worker initiating the payout.

**job\_id** `string`

The ID of the job for which the payout is being initiated. Either job ID or reference is required.

**reference** `string`

The reference for the payout request. Either job ID or reference is required.

**amount** `number` *required*

The amount to be transferred in decimal dollars (e.g. 500.00). Do not pass cents.

**currency** `string` *required*

The currency of the payout (e.g. AUD).

**against\_invoice** `boolean`

Indicates whether the payout should be processed against an invoice.

**invoice\_id** `string`

The ID of the invoice against which the payout should be processed. Required when against\_invoice is true.

**mode** `string`

The payout mode. Defaults to `BANK_TRANSFER`. `NPP` is also supported. Make sure the mode you choose is supported in the recipient's country.

### Response Body

| Field | Type | Description |
| - | - | - |
| `status` | number | Indicates the status of the payout request. |
| `message` | string | Provides information about the payout process result. |
| `payout_result`object | object | Contains payout processing result details. |
| ↳`message` | string | Message about the payout process completion. |
| ↳`transfer_results`array | array | Array containing transfer result details. |
| ↳`amount` | number | The amount transferred. |
| ↳`transfer_id` | string | Unique ID for the processed transfer. |
| ↳`message` | string | Indicates if the payout was successful. |

### Response Codes

| Code | Description |
| - | - |
| 200 | If the request is successful, the payout is processed and the response includes the transfer details and results. |
| 400 | Bad Request. Invalid parameters or invalid amount format. |
| 401 | Unauthorized. Missing or invalid credentials. |
| 404 | Not Found. The specified workerId, jobId or invoiceId does not exist. |
| 409 | Conflict. Duplicate idempotency key with mismatching parameters. |
| 500 | Internal Server Error. |

```bash cURL theme={null}
curl -X POST https://qa-payments.mygigsters.com.au/api/v1/worker-bank-payout \
  -u "YOUR_UUID:YOUR_SECRET" \
  -H "idempotency-Key: e82cf5a1-7c22-4a60-b66a-12885fb7383a" \
  -H "X-API-Version: 1.2" \
  -H "Content-Type: application/json" \
  -d '{
  "worker_id": "afd629c6-8e3d-4701-b168-dec8608130a5",
  "reference": "Against job payout",
  "amount": 500,
  "currency": "AUD",
  "job_id": "33267767",
  "against_invoice": false,
  "mode": "BANK_TRANSFER"
}'
```

```javascript Node.js theme={null}
const response = await fetch("https://qa-payments.mygigsters.com.au/api/v1/worker-bank-payout", {
  method: "POST",
  headers: {
    Authorization: "Basic " + Buffer.from("YOUR_UUID:YOUR_SECRET").toString("base64"),
    "idempotency-Key": "e82cf5a1-7c22-4a60-b66a-12885fb7383a",
    "X-API-Version": "1.2",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "worker_id": "afd629c6-8e3d-4701-b168-dec8608130a5",
    "reference": "Against job payout",
    "amount": 500,
    "currency": "AUD",
    "job_id": "33267767",
    "against_invoice": false,
    "mode": "BANK_TRANSFER"
  }),
});

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/worker-bank-payout",
    auth=("YOUR_UUID", "YOUR_SECRET"),
    headers={
        "idempotency-Key": "e82cf5a1-7c22-4a60-b66a-12885fb7383a",
        "X-API-Version": "1.2",
    },
    json={
        "worker_id": "afd629c6-8e3d-4701-b168-dec8608130a5",
        "reference": "Against job payout",
        "amount": 500,
        "currency": "AUD",
        "job_id": "33267767",
        "against_invoice": False,
        "mode": "BANK_TRANSFER",
    },
)

print(response.json())
```

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

uri = URI("https://qa-payments.mygigsters.com.au/api/v1/worker-bank-payout")
request = Net::HTTP::Post.new(uri)
request.basic_auth("YOUR_UUID", "YOUR_SECRET")
request["idempotency-Key"] = "e82cf5a1-7c22-4a60-b66a-12885fb7383a"
request["X-API-Version"] = "1.2"
request["Content-Type"] = "application/json"
request.body = <<~JSON
  {
    "worker_id": "afd629c6-8e3d-4701-b168-dec8608130a5",
    "reference": "Against job payout",
    "amount": 500,
    "currency": "AUD",
    "job_id": "33267767",
    "against_invoice": false,
    "mode": "BANK_TRANSFER"
  }
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/worker-bank-payout");

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_USERPWD => "YOUR_UUID:YOUR_SECRET",
    CURLOPT_HTTPHEADER => [
        "idempotency-Key: e82cf5a1-7c22-4a60-b66a-12885fb7383a",
        "X-API-Version: 1.2",
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => <<<'JSON'
{
  "worker_id": "afd629c6-8e3d-4701-b168-dec8608130a5",
  "reference": "Against job payout",
  "amount": 500,
  "currency": "AUD",
  "job_id": "33267767",
  "against_invoice": false,
  "mode": "BANK_TRANSFER"
}
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_id\": \"afd629c6-8e3d-4701-b168-dec8608130a5\",",
            "  \"reference\": \"Against job payout\",",
            "  \"amount\": 500,",
            "  \"currency\": \"AUD\",",
            "  \"job_id\": \"33267767\",",
            "  \"against_invoice\": false,",
            "  \"mode\": \"BANK_TRANSFER\"",
            "}"
        );

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://qa-payments.mygigsters.com.au/api/v1/worker-bank-payout"))
            .header("Authorization", "Basic " + credentials)
            .header("idempotency-Key", "e82cf5a1-7c22-4a60-b66a-12885fb7383a")
            .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_id": "afd629c6-8e3d-4701-b168-dec8608130a5",
  "reference": "Against job payout",
  "amount": 500,
  "currency": "AUD",
  "job_id": "33267767",
  "against_invoice": false,
  "mode": "BANK_TRANSFER"
}`)

	req, err := http.NewRequest("POST", "https://qa-payments.mygigsters.com.au/api/v1/worker-bank-payout", body)
	if err != nil {
		panic(err)
	}
	req.SetBasicAuth("YOUR_UUID", "YOUR_SECRET")
	req.Header.Set("idempotency-Key", "e82cf5a1-7c22-4a60-b66a-12885fb7383a")
	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/worker-bank-payout");
request.Headers.Authorization = new AuthenticationHeaderValue(
    "Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes("YOUR_UUID:YOUR_SECRET")));
request.Headers.Add("idempotency-Key", "e82cf5a1-7c22-4a60-b66a-12885fb7383a");
request.Headers.Add("X-API-Version", "1.2");
request.Content = new StringContent(@"{
  ""worker_id"": ""afd629c6-8e3d-4701-b168-dec8608130a5"",
  ""reference"": ""Against job payout"",
  ""amount"": 500,
  ""currency"": ""AUD"",
  ""job_id"": ""33267767"",
  ""against_invoice"": false,
  ""mode"": ""BANK_TRANSFER""
}", Encoding.UTF8, "application/json");

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

```json 200 theme={null}
{
  "status": 200,
  "message": "Payout processed successfully",
  "payout_result": {
    "message": "Payout process completed.",
    "transfer_results": [
      {
        "amount": 500.00,
        "currency": "AUD",
        "transfer_id": "7f32fd01-7c42-4d60-a66a-30885fb73845",
        "message": "Payout success"
      }
    ]
  }
}
```


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