Retrieve API Schema
Retrieve the OpenAPI schema for the Omise API. This endpoint returns the complete API specification in OpenAPI 3.0 format, allowing you to discover available endpoints, understand request/response structures, and integrate with API documentation tools.
Request Parametersโ
Optional - 1 fieldOptional Parameters
`format`STRING(optional)
Response format for the schema. Defaults to JSON.
Responsesโ
200
Successful retrievalSchema retrieved successfully. Returns the complete OpenAPI 3.0 specification.
Response structure:
openapi- OpenAPI specification version (e.g., "3.0.0")info- API metadata including title, version, and descriptionservers- Available API server URLspaths- All available API endpoints with methods and parameterscomponents- Reusable schema definitions and security schemessecurity- Global security requirements
400
Bad requestRequest validation failed. Check the error message for details.
Common causes:
- Invalid format parameter value
- Unsupported query parameters
401
UnauthorizedAuthentication failed. Invalid or missing API key.
Common causes:
- Missing Authorization header
- Invalid API key
- Incorrect HTTP Basic Auth format
404
Not foundThe schema endpoint was not found.
Common causes:
- Invalid endpoint URL
- Incorrect API version
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/schema \
-u skey_test_5xuy4w91xqz7d1w9u0t:
require 'net/http'
require 'json'
uri = URI('https://api.omise.co/schema')
request = Net::HTTP::Get.new(uri)
request.basic_auth('skey_test_5xuy4w91xqz7d1w9u0t', '')
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
schema = JSON.parse(response.body)
puts schema['openapi']
import requests
response = requests.get(
'https://api.omise.co/schema',
auth=('skey_test_5xuy4w91xqz7d1w9u0t', '')
)
schema = response.json()
print(schema['openapi'])
const https = require('https');
const options = {
hostname: 'api.omise.co',
path: '/schema',
method: 'GET',
auth: 'skey_test_5xuy4w91xqz7d1w9u0t:'
};
const req = https.request(options, (res) => {
let data = '';
res.on('data', (chunk) => data += chunk);
res.on('end', () => {
const schema = JSON.parse(data);
console.log(schema.openapi);
});
});
req.end();
<?php
$ch = curl_init('https://api.omise.co/schema');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, 'skey_test_5xuy4w91xqz7d1w9u0t:');
$response = curl_exec($ch);
curl_close($ch);
$schema = json_decode($response, true);
echo $schema['openapi'];
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.Base64;
HttpClient client = HttpClient.newHttpClient();
String auth = Base64.getEncoder()
.encodeToString("skey_test_5xuy4w91xqz7d1w9u0t:".getBytes());
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.omise.co/schema"))
.header("Authorization", "Basic " + auth)
.GET()
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
var client = new HttpClient();
var authBytes = Encoding.ASCII.GetBytes("skey_test_5xuy4w91xqz7d1w9u0t:");
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Basic", Convert.ToBase64String(authBytes));
var response = await client.GetAsync("https://api.omise.co/schema");
var schema = await response.Content.ReadAsStringAsync();
Console.WriteLine(schema);
package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.omise.co/schema", nil)
req.SetBasicAuth("skey_test_5xuy4w91xqz7d1w9u0t", "")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var schema map[string]interface{}
json.Unmarshal(body, &schema)
fmt.Println(schema["openapi"])
}
Error and result codesโ
Common Error Codesโ
| Code | Description | Resolution |
|---|---|---|
authentication_failure | Invalid API key | Verify your API key is correct |
bad_request | Invalid request parameters | Check the format parameter value |
Schema Structureโ
| Field | Type | Description |
|---|---|---|
openapi | string | OpenAPI specification version |
info | object | API metadata (title, version, description) |
servers | array | Available API server URLs |
paths | object | All API endpoints with operations |
components | object | Reusable schemas, parameters, and security definitions |
security | array | Global security requirements |
tags | array | API resource groupings |
API Credentials
Try it outโ
Additional - 1 fields
Your IP:
...Loading...