const response = await fetch('https://service.pcibooking.net/api/resources/stylesheet/BrandCSS', {
method: 'PUT',
headers: {
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
Description: 'Brand-specific card form styles',
ContentLTR: 'body { background-color: #f5f5f5; } h1 { color: #333; }',
ContentRTL: '',
IsDefault: false
})
});
console.log(response.status); // 201 created, 200 updated
import requests
response = requests.put(
'https://service.pcibooking.net/api/resources/stylesheet/BrandCSS',
headers={
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'application/json'
},
json={
'Description': 'Brand-specific card form styles',
'ContentLTR': 'body { background-color: #f5f5f5; } h1 { color: #333; }',
'ContentRTL': '',
'IsDefault': False
}
)
print(response.status_code) # 201 created, 200 updated
// Empty body. Returned when a new CSS resource is created (the ResourceName did not exist before).
// Empty body. Returned when an existing CSS resource is updated (the ResourceName already existed).
{
"Message": "The request is invalid.",
"ModelState": {
"model": [
"Required property 'IsDefault' not found in JSON. Path '', line 6, position 1."
],
"model.ContentLTR": [
"The ContentLTR field is required."
]
}
}
{
"Message": "The request is invalid.",
"ModelState": {
"ContentError": [
"At least one of the fields, ContentLTR or ContentRTL, must have valid CSS content"
]
}
}
{
"Message": "Invalid CSS: Line number: 1<br />Error: invalid selector after \n"
}
{
"code": -1003,
"message": "Not authorized to access this resource",
"moreInfo": "Bad or missing authorization data, expected APIKEY",
"errorList": null
}
CSS Stylesheets
Add or update CSS
Create a new CSS record or update an existing one by replacing its content.
PUT
/
api
/
resources
/
stylesheet
/
{ResourceName}
const response = await fetch('https://service.pcibooking.net/api/resources/stylesheet/BrandCSS', {
method: 'PUT',
headers: {
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
Description: 'Brand-specific card form styles',
ContentLTR: 'body { background-color: #f5f5f5; } h1 { color: #333; }',
ContentRTL: '',
IsDefault: false
})
});
console.log(response.status); // 201 created, 200 updated
import requests
response = requests.put(
'https://service.pcibooking.net/api/resources/stylesheet/BrandCSS',
headers={
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'application/json'
},
json={
'Description': 'Brand-specific card form styles',
'ContentLTR': 'body { background-color: #f5f5f5; } h1 { color: #333; }',
'ContentRTL': '',
'IsDefault': False
}
)
print(response.status_code) # 201 created, 200 updated
// Empty body. Returned when a new CSS resource is created (the ResourceName did not exist before).
// Empty body. Returned when an existing CSS resource is updated (the ResourceName already existed).
{
"Message": "The request is invalid.",
"ModelState": {
"model": [
"Required property 'IsDefault' not found in JSON. Path '', line 6, position 1."
],
"model.ContentLTR": [
"The ContentLTR field is required."
]
}
}
{
"Message": "The request is invalid.",
"ModelState": {
"ContentError": [
"At least one of the fields, ContentLTR or ContentRTL, must have valid CSS content"
]
}
}
{
"Message": "Invalid CSS: Line number: 1<br />Error: invalid selector after \n"
}
{
"code": -1003,
"message": "Not authorized to access this resource",
"moreInfo": "Bad or missing authorization data, expected APIKEY",
"errorList": null
}
Stylesheets Guide
Customize the appearance of hosted forms
Error Responses
| HTTP Status | Error Code | Description |
|---|---|---|
| 400 | Missing required fields. One or more required properties (ContentLTR, ContentRTL, IsDefault) are missing from the request body. | |
| 400 | No CSS content. Both ContentLTR and ContentRTL are empty. At least one must contain valid CSS. | |
| 400 | Invalid CSS syntax. The provided CSS content could not be parsed. The response includes the line number and error details. | |
| 401 | -1003 | Not authenticated. The API key is missing or invalid. |
| 403 | -1003 | Not authorized. The API key does not have the CanConfigureSettings permission. |
| 500 | Internal server error. The resource could not be saved. |
Parameter Constraints
| Parameter | Constraint |
|---|---|
ResourceName | Required. Must contain only alphanumeric characters ([a-zA-Z0-9]+). |
ContentLTR | Required (may be empty string). At least one of ContentLTR or ContentRTL must contain valid CSS. |
ContentRTL | Required (may be empty string). At least one of ContentLTR or ContentRTL must contain valid CSS. |
Please be aware that the same method is used for both creating a new CSS and updating an existing one.
If you update an existing CSS, the content of it will be replaced with the uploaded content and this action cannot be undone.
Parameters
Headers
string
required
Your API key prefixed with
APIKEY. Example: APIKEY your-api-key. See the Authentication guide.Path Parameters
string
required
The resource name to assign to this CSS record.
Request Body
string
required
Description of this CSS resource, displayed in the user’s site.
string
required
Stylesheet configuration for LTR content. At least one of
ContentLTR or ContentRTL must contain valid CSS.string
required
Stylesheet configuration for RTL content. At least one of
ContentLTR or ContentRTL must contain valid CSS. Typically left blank unless you use RTL pages.boolean
required
Sets this CSS resource as the default CSS for your account.
const response = await fetch('https://service.pcibooking.net/api/resources/stylesheet/BrandCSS', {
method: 'PUT',
headers: {
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
Description: 'Brand-specific card form styles',
ContentLTR: 'body { background-color: #f5f5f5; } h1 { color: #333; }',
ContentRTL: '',
IsDefault: false
})
});
console.log(response.status); // 201 created, 200 updated
import requests
response = requests.put(
'https://service.pcibooking.net/api/resources/stylesheet/BrandCSS',
headers={
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'application/json'
},
json={
'Description': 'Brand-specific card form styles',
'ContentLTR': 'body { background-color: #f5f5f5; } h1 { color: #333; }',
'ContentRTL': '',
'IsDefault': False
}
)
print(response.status_code) # 201 created, 200 updated
Response
// Empty body. Returned when a new CSS resource is created (the ResourceName did not exist before).
// Empty body. Returned when an existing CSS resource is updated (the ResourceName already existed).
{
"Message": "The request is invalid.",
"ModelState": {
"model": [
"Required property 'IsDefault' not found in JSON. Path '', line 6, position 1."
],
"model.ContentLTR": [
"The ContentLTR field is required."
]
}
}
{
"Message": "The request is invalid.",
"ModelState": {
"ContentError": [
"At least one of the fields, ContentLTR or ContentRTL, must have valid CSS content"
]
}
}
{
"Message": "Invalid CSS: Line number: 1<br />Error: invalid selector after \n"
}
{
"code": -1003,
"message": "Not authorized to access this resource",
"moreInfo": "Bad or missing authorization data, expected APIKEY",
"errorList": null
}

