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

# Update subscription

> The Update Subscription endpoint is used to update an existing subscription's parameters such as amount, frequency, start date, and end date.

### Headers

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

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

### Path Parameters

**id** `string` *required*

The unique identifier of the subscription to update (e.g. `2`).

### Request Body Parameters

**customer\_id** `string` *required*

The unique identifier of the customer.

**amount** `number` *required*

The updated recurring amount of the subscription.

**frequency** `string` *required*

The frequency of billing cycles: `daily`, `weekly`, or `monthly`.

**start\_date** `string` *required*

The start date of the subscription in ISO 8601 format.

**end\_date** `string` *required*

The end date of the subscription in ISO 8601 format. Must be greater than `start_date`.

**currency** `string` *required*

Three-letter ISO currency code (e.g. `AUD`).

### Response Body

The response for the Update Subscription request is a JSON object with the following schema:

| Field | Type | Description |
| - | - | - |
| `status` | number | Indicates the status code of the update request. |
| `message` | string | Success message. |
| `data`object | object | The details of the updated subscription. |
| ↳`id` | number | Subscription unique ID. |
| ↳`client_id` | string | Client identifier. |
| ↳`customer_id` | string | Customer identifier. |
| ↳`amount` | number | Updated subscription amount. |
| ↳`frequency` | string | Billing frequency (e.g. `weekly`). |
| ↳`start_date` | string | Start date timestamp. |
| ↳`end_date` | string | End date timestamp. |
| ↳`status` | string | Subscription status (e.g. `active`). |
| ↳`currency` | string | Currency code (e.g. `AUD`). |

### Response Codes

| Code | Description |
| - | - |
| 200 | OK. The subscription has been successfully updated. |
| 400 | Bad Request. Validation error (e.g. endDate must be greater than startDate). |
| 401 | Unauthorized. Missing or invalid credentials. |
| 404 | Not Found. The specified subscription ID does not exist. |
| 500 | Internal Server Error. |

```bash cURL theme={null}
curl -X PUT https://qa-payments.mygigsters.com.au/api/v1/update/2/subscription \
  -u "YOUR_UUID:YOUR_SECRET" \
  -H "X-API-Version: 1.2" \
  -H "Content-Type: application/json" \
  -d '{
  "customer_id": "cus_hkdmgcfzjhhmn1t6osi",
  "amount": 100.5,
  "frequency": "weekly",
  "start_date": "2026-05-20T00:00:00.000Z",
  "end_date": "2026-12-20T00:00:00.000Z",
  "currency": "AUD"
}'
```

```javascript Node.js theme={null}
const response = await fetch("https://qa-payments.mygigsters.com.au/api/v1/update/2/subscription", {
  method: "PUT",
  headers: {
    Authorization: "Basic " + Buffer.from("YOUR_UUID:YOUR_SECRET").toString("base64"),
    "X-API-Version": "1.2",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "customer_id": "cus_hkdmgcfzjhhmn1t6osi",
    "amount": 100.5,
    "frequency": "weekly",
    "start_date": "2026-05-20T00:00:00.000Z",
    "end_date": "2026-12-20T00:00:00.000Z",
    "currency": "AUD"
  }),
});

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

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

response = requests.put(
    "https://qa-payments.mygigsters.com.au/api/v1/update/2/subscription",
    auth=("YOUR_UUID", "YOUR_SECRET"),
    headers={
        "X-API-Version": "1.2",
    },
    json={
        "customer_id": "cus_hkdmgcfzjhhmn1t6osi",
        "amount": 100.5,
        "frequency": "weekly",
        "start_date": "2026-05-20T00:00:00.000Z",
        "end_date": "2026-12-20T00:00:00.000Z",
        "currency": "AUD",
    },
)

print(response.json())
```

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

uri = URI("https://qa-payments.mygigsters.com.au/api/v1/update/2/subscription")
request = Net::HTTP::Put.new(uri)
request.basic_auth("YOUR_UUID", "YOUR_SECRET")
request["X-API-Version"] = "1.2"
request["Content-Type"] = "application/json"
request.body = <<~JSON
  {
    "customer_id": "cus_hkdmgcfzjhhmn1t6osi",
    "amount": 100.5,
    "frequency": "weekly",
    "start_date": "2026-05-20T00:00:00.000Z",
    "end_date": "2026-12-20T00:00:00.000Z",
    "currency": "AUD"
  }
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/update/2/subscription");

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_USERPWD => "YOUR_UUID:YOUR_SECRET",
    CURLOPT_HTTPHEADER => [
        "X-API-Version: 1.2",
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => <<<'JSON'
{
  "customer_id": "cus_hkdmgcfzjhhmn1t6osi",
  "amount": 100.5,
  "frequency": "weekly",
  "start_date": "2026-05-20T00:00:00.000Z",
  "end_date": "2026-12-20T00:00:00.000Z",
  "currency": "AUD"
}
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",
            "{",
            "  \"customer_id\": \"cus_hkdmgcfzjhhmn1t6osi\",",
            "  \"amount\": 100.5,",
            "  \"frequency\": \"weekly\",",
            "  \"start_date\": \"2026-05-20T00:00:00.000Z\",",
            "  \"end_date\": \"2026-12-20T00:00:00.000Z\",",
            "  \"currency\": \"AUD\"",
            "}"
        );

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://qa-payments.mygigsters.com.au/api/v1/update/2/subscription"))
            .header("Authorization", "Basic " + credentials)
            .header("X-API-Version", "1.2")
            .header("Content-Type", "application/json")
            .method("PUT", 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(`{
  "customer_id": "cus_hkdmgcfzjhhmn1t6osi",
  "amount": 100.5,
  "frequency": "weekly",
  "start_date": "2026-05-20T00:00:00.000Z",
  "end_date": "2026-12-20T00:00:00.000Z",
  "currency": "AUD"
}`)

	req, err := http.NewRequest("PUT", "https://qa-payments.mygigsters.com.au/api/v1/update/2/subscription", 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.Put, "https://qa-payments.mygigsters.com.au/api/v1/update/2/subscription");
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(@"{
  ""customer_id"": ""cus_hkdmgcfzjhhmn1t6osi"",
  ""amount"": 100.5,
  ""frequency"": ""weekly"",
  ""start_date"": ""2026-05-20T00:00:00.000Z"",
  ""end_date"": ""2026-12-20T00:00:00.000Z"",
  ""currency"": ""AUD""
}", Encoding.UTF8, "application/json");

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

```json 200 theme={null}
{
  "status": 200,
  "message": "Subscription updated successfully",
  "data": {
    "id": 2,
    "client_id": "1",
    "customer_id": "cus_hkdmgcfzjhhmn1t6osi",
    "amount": 100.5,
    "frequency": "weekly",
    "start_date": "2026-05-20T00:00:00.000Z",
    "end_date": "2026-12-20T00:00:00.000Z",
    "next_charge_date": "2026-06-13T00:00:00.000Z",
    "last_charge_date": "2026-05-13T11:55:32.000Z",
    "status": "active",
    "retry_count": 0,
    "max_retries": 3,
    "currency": "AUD",
    "remarks": null,
    "deleted_at": null,
    "created_at": "2026-05-13T11:53:32.000Z",
    "updated_at": "2026-09-14T11:02:07.220Z"
  }
}
```


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