Mytpe Pay
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
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"
}
]
}