Update API Version
Updates the default API version for the account. The API version determines response formats and available features. Use the List API Versions endpoint to discover available versions before updating.
Request Parametersโ
Required - 1 fieldRequired Parameters
`api_version`STRING(required)
The API version to set as the default for the account. Must be a valid version returned by the List API Versions endpoint.
Responsesโ
200
Successful updateReturns the updated account object with the new API version setting.
Updated account object contains:
id- Account identifierapi_version- Updated default API versionemail- Account email addresscountry- Two-letter ISO 3166 country codecurrency- Three-letter ISO 4217 currency code- All other account fields (webhook_uri, supported_currencies, etc.)
400
Bad requestRequest validation failed. Check the error message for details.
Common causes:
- Invalid API version specified
- Missing api_version parameter
- API version format is incorrect
401
UnauthorizedAuthentication failed. Invalid or missing API key.
Common causes:
- Missing Authorization header
- Invalid secret key
- Using public key instead of secret key
- Incorrect HTTP Basic Auth format
404
Not foundThe specified API version does not exist.
Common causes:
- API version string is not a valid version
- Typo in the version identifier
- Version has been deprecated and is no longer available
5xx
Server errorServer-side error occurred. These are rare but should be handled gracefully.
How to handle:
- Retry the request with exponential backoff
- Check status.omise.co for service incidents
- See Error Handling for detailed guidance
Code samplesโ
- cURL
- Ruby
- Python
- Node.js
- PHP
- Java
- C#
- Go
curl https://api.omise.co/account/api_version \
-X PATCH \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-d "api_version=2019-05-29"
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
account = Omise::Account.update_api_version(
api_version: '2019-05-29'
)
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
account = omise.Account.update_api_version(
api_version='2019-05-29'
)
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const account = await omise.account.updateApiVersion({
api_version: '2019-05-29'
});
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$account = OmiseAccount::updateApiVersion([
'api_version' => '2019-05-29'
]);
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
Account account = client.account().updateApiVersion()
.apiVersion("2019-05-29")
.send();
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var account = await client.Account.UpdateApiVersion(new UpdateApiVersionRequest
{
ApiVersion = "2019-05-29"
});
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
account, _ := client.Account().UpdateApiVersion(&operations.UpdateApiVersion{
ApiVersion: "2019-05-29",
})
API Credentials
Try it outโ
Required - 1 fields
Your IP:
...Loading...