Get Configuration Templates
1 min
GET
https://api.upstartcommerce.com/v1/tenants/cfg/templates
Header Parameters
- x-upstart-tenantstringrequiredDescription
Responses
200
- CfgTemplate[]Example
[ { "tenant": "acme001", "domain": "acme-retail", "templateId": "payment-cybersource", "name": "Cybersource Payment Gateway", "propertiesDec": { "type": "object", "properties": { "merchantId": { "type": "string" }, "apiKey": { "type": "string", "format": "password" } }, "required": [ "merchantId", "apiKey" ] }, "enabled": true, "version": 2, "accessControl": { "read": true, "modify": false }, "audit": { "by": "[email protected]", "byAnonymous": false, "at": "2024-01-15T10:00:00Z", "traceId": "abc123", "serviceName": "tenant-svc", "serviceVersion": "1.0.0" } }, { "tenant": "acme001", "domain": "acme-retail", "templateId": "media-cloudinary", "name": "Cloudinary Media Storage", "propertiesDec": { "type": "object", "properties": { "cloudName": { "type": "string" }, "apiKey": { "type": "string" } }, "required": [ "cloudName" ] }, "enabled": true, "version": 1, "accessControl": { "read": true, "modify": true }, "audit": { "by": "[email protected]", "byAnonymous": false, "at": "2024-01-10T08:00:00Z", "traceId": "def456", "serviceName": "tenant-svc", "serviceVersion": "1.0.0" } } ]Description- tenantstringExampleDescription
- domainstringrequiredExampleDescription
- templateIdstringrequiredExampleDescription
- namestringrequiredExampleDescription
- propertiesDecobjectrequiredExample
{ "type": "object", "properties": { "merchantId": { "type": "string", "description": "Cybersource merchant identifier" }, "apiKey": { "type": "string", "description": "API key for authentication", "format": "password" }, "apiUrl": { "type": "string", "format": "uri", "default": "https://api.cybersource.com" } }, "required": [ "merchantId", "apiKey" ] }Description - enabledbooleanrequiredExampleDescription
- versionintegerrequiredExampleDescription
- accessControlCfgAccessControlrequiredDescription
- readbooleanrequiredExampleDescription
- modifybooleanrequiredDescription
- auditAuditrequiredDescription
- byIdstringDescription
- bystringrequiredDescription
- byAnonymousbooleanrequiredDescription
- atstring<date-time>requiredExampleDescriptionFormatdate-time
- traceIdstringrequiredExampleDescription
- serviceNamestringrequiredExampleDescription
- serviceVersionstringrequiredExampleDescription
- byDomainstringExampleDescription
- bySubjectTypestringExampleDescription
400
- ValidationErrorResponseExample
{ "name": "ValidationError", "code": "SCHEMA_VALIDATION_FAILED", "detail": "Configuration data validation failed: data.apiKey is required but was not provided. Expected string with minimum length 32." }Description- namestringrequiredExampleDescription
- codestringrequiredExampleDescription
- detailstringExampleDescription
401
- ErrorResponseExample
{ "name": "AuthorizationError", "code": "INSUFFICIENT_PERMISSIONS", "detail": "User does not have the required tenant.cfg.modify permission to perform this operation.", "reason": "Your access token does not include the necessary permissions. Contact your administrator to request access." }Description- namestringrequiredExampleDescription
- codestringrequiredExampleDescription
- detailstringrequiredExampleDescription
- reasonstringExampleDescription
404
- ErrorResponseExample
{ "name": "ResourceNotFoundError", "code": "TEMPLATE_NOT_FOUND", "detail": "The configuration template with ID \"payment-stripe\" was not found in the system.", "reason": "The template may have been deleted or you may not have permission to access it. Verify the template ID using GET /tenants/cfg/templates." }Description- namestringrequiredExampleDescription
- codestringrequiredExampleDescription
- detailstringrequiredExampleDescription
- reasonstringExampleDescription
curl
curl --request GET \
--url https://api.upstartcommerce.com/v1/tenants/cfg/templates \
--header 'accept: application/json' \
--header 'x-upstart-tenant: string'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
myHeaders.append("x-upstart-tenant", "string");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.upstartcommerce.com/v1/tenants/cfg/templates", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.upstartcommerce.com/v1/tenants/cfg/templates")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request["x-upstart-tenant"] = "string"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.upstartcommerce.com/v1/tenants/cfg/templates"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json',
'x-upstart-tenant': 'string'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
200
// Success-templates returned.
[
{
"tenant": "acme-retail",
"domain": "acme",
"templateId": "payment-cybersource",
"name": "Cybersource Payment Gateway Configuration",
"propertiesDec": {},
"enabled": true,
"version": 3,
"accessControl": {
"read": true,
"modify": false
},
"audit": {
"byId": "",
"by": "",
"byAnonymous": false,
"at": "2024-01-15T10:30:00Z",
"traceId": "550e8400-e29b-41d4-a716-446655440000",
"serviceName": "tenant-svc",
"serviceVersion": "1.2.3",
"byDomain": "example-store",
"bySubjectType": "USER"
}
}
]400
// The request contained information that the server was unable to process. Appropriate errors are provided in the response body.
{
"name": "ValidationError",
"code": "SCHEMA_VALIDATION_FAILED",
"detail": "Configuration data validation failed: data.apiKey is required but was not provided. Expected string with minimum length 32."
}401
// The provided credentials were not valid for this endpoint. It may be that they are expired or that the user's roles are insufficient.
{
"name": "ResourceNotFoundError",
"code": "TEMPLATE_NOT_FOUND",
"detail": "The configuration template with ID \"payment-stripe\" was not found in the system.",
"reason": "The template may have been deleted or you may not have permission to access it. Verify the template ID using GET /tenants/cfg/templates."
}404
// The requested resource was not found in the NoChannel system.
{
"name": "ResourceNotFoundError",
"code": "TEMPLATE_NOT_FOUND",
"detail": "The configuration template with ID \"payment-stripe\" was not found in the system.",
"reason": "The template may have been deleted or you may not have permission to access it. Verify the template ID using GET /tenants/cfg/templates."
}