Update Mytpe Pay Instance
Updates an existing Mytpe Pay instance with the provided data.
Update Mytpe Pay Instance
POST
https://dev.mytpe.app/api/v2/mytpe-pay/updateUpdates an existing Mytpe Pay instance. The
idmust be passed in the request body.
Authentication
Authentication: API Key (X-API-KEY + X-API-SECRET headers)
This endpoint requires authentication using X-API-KEY and X-API-SECRET headers.
X-API-KEY: {your_api_key}
X-API-SECRET: {your_api_secret}Request Parameters
Body Parameters
Prop
Type
Instance Default for Inactivity Expiry
What is this?
default_inactivity_timeout_minutes lets you set a single instance-wide policy for how long one_shot and limited links stay active without a successful payment before being auto-closed (status → expired).
Every link in this instance inherits this default automatically — there's no need to repeat the configuration on every link. Individual links can still override it by setting their own inactivity_timeout_minutes (Create Pay Link / Update Pay Link).
Resolution chain (per link)
When the inactivity sweeper runs (every 5 minutes), each link is evaluated against this fallback chain:
- Per-link override (
inactivity_timeout_minuteson the pay link itself) - Instance default (this field,
default_inactivity_timeout_minutes) - Otherwise — the link never inactivity-expires (only
max_paymentsquota can close it)
Rules
- Unit: minutes (integer, range
1–525600= 1 minute to 1 year). - Modes affected: only
one_shotandlimited. Reusable links never inactivity-expire under any circumstance. - Activity definition: the per-link clock resets only on successful payments. Pending/failed/refused transactions do not count. The clock starts at link creation.
- Resulting status: when a link auto-expires, its
statusbecomesexpiredand apay_link.expiredwebhook fires (see Webhook Events). - Reactivation: expired links are terminal — they cannot be reactivated. Create a new link instead.
- Existing links unaffected: changing this default does not retroactively expire active links. New activity (or the next sweeper pass) applies the new policy.
Example: 48-hour default for the whole instance
const formData = new FormData();
formData.append('id', 'INSTANCE_ID');
formData.append('default_inactivity_timeout_minutes', '2880'); // 48h × 60
const response = await fetch('https://dev.mytpe.app/api/v2/mytpe-pay/update', {
method: 'POST',
headers: {
'X-API-KEY': '{your_api_key}',
'X-API-SECRET': '{your_api_secret}',
'Accept': 'application/json',
},
body: formData,
});Example: Clear the instance default
const formData = new FormData();
formData.append('id', 'INSTANCE_ID');
formData.append('default_inactivity_timeout_minutes', ''); // empty = clear
const response = await fetch('https://dev.mytpe.app/api/v2/mytpe-pay/update', {
method: 'POST',
headers: {
'X-API-KEY': '{your_api_key}',
'X-API-SECRET': '{your_api_secret}',
'Accept': 'application/json',
},
body: formData,
});After this, links in this instance with no per-link override will never inactivity-expire.
Example Request
const formData = new FormData();
formData.append('id', 'INSTANCE_ID');
formData.append('name', 'New Instance Name');
const response = await fetch('https://dev.mytpe.app/api/v2/mytpe-pay/update', {
method: 'POST',
headers: {
'X-API-KEY': '{your_api_key}',
'X-API-SECRET': '{your_api_secret}',
'Accept': 'application/json'
},
body: formData
});
const data = await response.json();
console.log(data);interface UpdateInstanceResponse {
success: boolean;
message: string;
data: {
id: string;
name: string;
description: string;
status: string;
logo_url: string;
};
}
const formData = new FormData();
formData.append('id', 'INSTANCE_ID');
formData.append('name', 'New Instance Name');
const response = await fetch('https://dev.mytpe.app/api/v2/mytpe-pay/update', {
method: 'POST',
headers: {
'X-API-KEY': '{your_api_key}',
'X-API-SECRET': '{your_api_secret}',
'Accept': 'application/json'
},
body: formData
});
const data: UpdateInstanceResponse = await response.json();
console.log(data);import requests
files = {
'id': (None, 'INSTANCE_ID'),
'name': (None, 'New Instance Name')
}
headers = {
'X-API-KEY': '{your_api_key}',
'X-API-SECRET': '{your_api_secret}',
'Accept': 'application/json'
}
response = requests.post(
'https://dev.mytpe.app/api/v2/mytpe-pay/update',
files=files,
headers=headers
)
data = response.json()
print(data)use Illuminate\Support\Facades\Http;
$response = Http::withHeaders([
'X-API-KEY' => '{your_api_key}',
'X-API-SECRET' => '{your_api_secret}',
'Accept' => 'application/json',
])->asMultipart()
->attach('id', 'INSTANCE_ID')
->attach('name', 'New Instance Name')
->post('https://dev.mytpe.app/api/v2/mytpe-pay/update');
$data = $response->json();
dd($data);$ch = curl_init();
$postFields = [
'id' => 'INSTANCE_ID',
'name' => 'New Instance Name',
];
curl_setopt_array($ch, [
CURLOPT_URL => 'https://dev.mytpe.app/api/v2/mytpe-pay/update',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $postFields,
CURLOPT_HTTPHEADER => [
'X-API-KEY: {your_api_key}',
'X-API-SECRET: {your_api_secret}',
'Accept: application/json',
],
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);const axios = require('axios');
const FormData = require('form-data');
const formData = new FormData();
formData.append('id', 'INSTANCE_ID');
formData.append('name', 'New Instance Name');
axios.post('https://dev.mytpe.app/api/v2/mytpe-pay/update', formData, {
headers: {
...formData.getHeaders(),
'X-API-KEY': '{your_api_key}',
'X-API-SECRET': '{your_api_secret}',
'Accept': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error.response?.data || error.message);
});Example Success Response
200 OK
{
"success": true,
"message": "MytpePay instance updated successfully",
"data": {
"id": "INSTANCE_ID",
"name": "New Instance Name",
"description": "Updated description",
"status": "active",
"logo_url": "https://example.com/path/to/logo.png"
}
}Error Responses
401 Authentication Failed
{
"errors": [
{
"status": "401",
"code": "API_KEY_INVALID",
"title": "Invalid API key",
"detail": "Authentication failed. Please check your API credentials."
}
]
}422 Validation Error
{
"errors": [
{
"status": "422",
"code": "VALIDATION_ERROR",
"title": "Validation failed",
"detail": "The provided data is invalid",
"meta": {
"id": [
"The id field is required."
]
}
}
]
}404 Not Found
{
"errors": [
{
"status": "404",
"code": "NOT_FOUND",
"title": "MytpePay instance not found",
"detail": "The specified MytpePay instance does not exist or you do not have access to it"
}
]
}