PayNow

Webstore

Install marketplace template

POSThttps://api.paynow.gg/v1/stores/{storeId}/webstore/marketplace/templates/{marketplaceTemplateId}/install

Installs a template from the marketplace into the store's webstore and returns the ID of the installed copy.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store to install the template into.
marketplaceTemplateIdFlakeIdRequired
The ID of the marketplace template to install.
Response
200OKInstallMarketplaceTemplateResponseDto
Represents the result of installing a marketplace template into a store's webstore.
Show fields
installed_template_idFlakeIdRequired

Failed requests return a PayNowError body. See the error response guide.

curl -X POST "https://api.paynow.gg/v1/stores/{storeId}/webstore/marketplace/templates/{marketplaceTemplateId}/install" \
  -H "Authorization: APIKey TOKEN"
Response200
{
  "installed_template_id": "411486491630370816"
}

Get webstore modules

GEThttps://api.paynow.gg/v1/stores/{storeId}/webstore/modules

Retrieves all modules on the store's webstore, in sort order.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store whose webstore modules to retrieve.
Response
200OKWebstoreModuleDto[]
Represents a module on a webstore: a self-contained block of content or functionality the template renders.
Show fields
idFlakeIdRequired
created_atstringRequired
The date and time the module was created.
enabledbooleanRequired
Indicates whether the module is rendered. A disabled module keeps its settings but is not shown to customers.
sort_orderintegerRequired
The position of the module among the webstore's modules, lowest first.
typestringRequired
The kind of module. Decides which 'settings' it accepts and how the template renders it.
updated_atstringRequired
The date and time the module was last updated.
webstore_idFlakeIdRequired
ends_atstringOptional
The date and time the module stops being shown, or null to show it indefinitely.
settingsnullOptional
The module's type-specific configuration as a JSON object, or null when it has none.
starts_atstringOptional
The date and time the module starts being shown, or null to show it as soon as it is enabled.

Failed requests return a PayNowError body. See the error response guide.

curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/webstore/modules" \
  -H "Authorization: APIKey TOKEN"
Response200
[
  {
    "id": "411486491630370816",
    "created_at": "2024-01-01T00:00:00Z",
    "enabled": true,
    "sort_order": 0,
    "type": "string",
    "updated_at": "2024-01-01T00:00:00Z",
    "webstore_id": "411486491630370816",
    "ends_at": "2024-01-01T00:00:00Z",
    "settings": {},
    "starts_at": "2024-01-01T00:00:00Z"
  }
]

Create webstore module

PUThttps://api.paynow.gg/v1/stores/{storeId}/webstore/modules

Adds a module to the store's webstore. The module's 'type' decides which 'settings' it accepts.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store whose webstore the module is added to.
Request body
enabledbooleanRequired
Indicates whether the module is rendered. A disabled module keeps its settings but is not shown to customers.
typestringRequired
The kind of module. Decides which 'settings' it accepts and how the template renders it.
ends_atstringOptional
The date and time the module stops being shown, or null to show it indefinitely.
settingsobjectOptional
The module's type-specific configuration as a JSON object, or null when it has none.
starts_atstringOptional
The date and time the module starts being shown, or null to show it as soon as it is enabled.
Response
200OKWebstoreModuleDto
Represents a module on a webstore: a self-contained block of content or functionality the template renders.
Show fields
idFlakeIdRequired
created_atstringRequired
The date and time the module was created.
enabledbooleanRequired
Indicates whether the module is rendered. A disabled module keeps its settings but is not shown to customers.
sort_orderintegerRequired
The position of the module among the webstore's modules, lowest first.
typestringRequired
The kind of module. Decides which 'settings' it accepts and how the template renders it.
updated_atstringRequired
The date and time the module was last updated.
webstore_idFlakeIdRequired
ends_atstringOptional
The date and time the module stops being shown, or null to show it indefinitely.
settingsnullOptional
The module's type-specific configuration as a JSON object, or null when it has none.
starts_atstringOptional
The date and time the module starts being shown, or null to show it as soon as it is enabled.

Failed requests return a PayNowError body. See the error response guide.

curl -X PUT "https://api.paynow.gg/v1/stores/{storeId}/webstore/modules" \
  -H "Authorization: APIKey TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "enabled": true,
  "type": "string",
  "ends_at": "2024-01-01T00:00:00Z",
  "settings": {},
  "starts_at": "2024-01-01T00:00:00Z"
}'
Response200
{
  "id": "411486491630370816",
  "created_at": "2024-01-01T00:00:00Z",
  "enabled": true,
  "sort_order": 0,
  "type": "string",
  "updated_at": "2024-01-01T00:00:00Z",
  "webstore_id": "411486491630370816",
  "ends_at": "2024-01-01T00:00:00Z",
  "settings": {},
  "starts_at": "2024-01-01T00:00:00Z"
}

Update webstore module

PUThttps://api.paynow.gg/v1/stores/{storeId}/webstore/modules/{moduleId}

Performs a delta update of a module on the store's webstore.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
moduleIdFlakeIdRequired
The ID of the module.
Request body
enabledbooleanRequired
Indicates whether the module is rendered. A disabled module keeps its settings but is not shown to customers.
typestringRequired
The kind of module. Decides which 'settings' it accepts and how the template renders it.
ends_atstringOptional
The date and time the module stops being shown, or null to show it indefinitely.
settingsobjectOptional
The module's type-specific configuration as a JSON object, or null when it has none.
starts_atstringOptional
The date and time the module starts being shown, or null to show it as soon as it is enabled.
Response
200OKWebstoreModuleDto
Represents a module on a webstore: a self-contained block of content or functionality the template renders.
Show fields
idFlakeIdRequired
created_atstringRequired
The date and time the module was created.
enabledbooleanRequired
Indicates whether the module is rendered. A disabled module keeps its settings but is not shown to customers.
sort_orderintegerRequired
The position of the module among the webstore's modules, lowest first.
typestringRequired
The kind of module. Decides which 'settings' it accepts and how the template renders it.
updated_atstringRequired
The date and time the module was last updated.
webstore_idFlakeIdRequired
ends_atstringOptional
The date and time the module stops being shown, or null to show it indefinitely.
settingsnullOptional
The module's type-specific configuration as a JSON object, or null when it has none.
starts_atstringOptional
The date and time the module starts being shown, or null to show it as soon as it is enabled.

Failed requests return a PayNowError body. See the error response guide.

curl -X PUT "https://api.paynow.gg/v1/stores/{storeId}/webstore/modules/{moduleId}" \
  -H "Authorization: APIKey TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "enabled": true,
  "type": "string",
  "ends_at": "2024-01-01T00:00:00Z",
  "settings": {},
  "starts_at": "2024-01-01T00:00:00Z"
}'
Response200
{
  "id": "411486491630370816",
  "created_at": "2024-01-01T00:00:00Z",
  "enabled": true,
  "sort_order": 0,
  "type": "string",
  "updated_at": "2024-01-01T00:00:00Z",
  "webstore_id": "411486491630370816",
  "ends_at": "2024-01-01T00:00:00Z",
  "settings": {},
  "starts_at": "2024-01-01T00:00:00Z"
}

Delete webstore module

DELETEhttps://api.paynow.gg/v1/stores/{storeId}/webstore/modules/{moduleId}

Permanently removes a module from the store's webstore.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
moduleIdFlakeIdRequired
The ID of the module.
Response
204No Content

Failed requests return a PayNowError body. See the error response guide.

curl -X DELETE "https://api.paynow.gg/v1/stores/{storeId}/webstore/modules/{moduleId}" \
  -H "Authorization: APIKey TOKEN"

Get webstore

GEThttps://api.paynow.gg/v1/stores/{storeId}/webstore

Retrieves the store's webstore, covering the slug it is served from, its custom domain state and the template it currently renders.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store to retrieve the webstore for.
Response
200OKWebstoreDto
Represents a store's webstore, the hosted storefront customers browse and buy from.
Show fields
idFlakeIdRequired
custom_domain_verifiedbooleanRequired
Indicates whether ownership of 'custom_domain' has been verified. Until it is, the webstore is only served from its slug.
is_activebooleanRequired
Indicates whether the webstore is being served to customers.
slugstringRequired
The slug the webstore is served from, unique across all webstores.
current_template_idFlakeIdOptional
custom_domainstringOptional
The custom domain the webstore is served from, or null when it is only reachable at its slug.

Failed requests return a PayNowError body. See the error response guide.

curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/webstore" \
  -H "Authorization: APIKey TOKEN"
Response200
{
  "id": "411486491630370816",
  "custom_domain_verified": true,
  "is_active": true,
  "slug": "string",
  "current_template_id": "411486491630370816",
  "custom_domain": "string"
}

Set default template

POSThttps://api.paynow.gg/v1/stores/{storeId}/webstore/set-default-template

Sets the template the webstore renders for customers.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store whose webstore is being changed.
Request body
template_idFlakeIdRequired
Response
204No Content

Failed requests return a PayNowError body. See the error response guide.

curl -X POST "https://api.paynow.gg/v1/stores/{storeId}/webstore/set-default-template" \
  -H "Authorization: APIKey TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "template_id": "411486491630370816"
}'

Set webstore slug

POSThttps://api.paynow.gg/v1/stores/{storeId}/webstore/set-slug

Changes the slug the webstore is reachable at. Slugs are unique across all webstores, so a slug already taken by another store is rejected.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store whose webstore is being changed.
Request body
slugstringRequired
The new slug to serve the webstore from. Slugs are unique across all webstores.
Response
204No Content

Failed requests return a PayNowError body. See the error response guide.

curl -X POST "https://api.paynow.gg/v1/stores/{storeId}/webstore/set-slug" \
  -H "Authorization: APIKey TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "slug": "string"
}'

Get custom domain

GEThttps://api.paynow.gg/v1/stores/{storeId}/webstore/custom-domain

Retrieves the custom domain attached to the store's webstore, along with the records still outstanding for ownership and SSL verification.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store to retrieve the custom domain for.
Response
200OKWebstoreCustomDomainDto
Represents a custom domain attached to a webstore, together with the state of its ownership and SSL verification.
Show fields
idstringRequired
The identifier the domain was registered under with the hosting provider.
hostnamestringRequired
The domain the webstore is served from, without a scheme (e.g., store.example.com).
statusstringRequired
The verification state of the domain as reported by the hosting provider. The domain only serves the webstore once it is active.
verification_errorsstring[]Required
The errors raised by the last ownership verification attempt. Empty when the last attempt raised none.
created_atstringOptional
The date and time the domain was attached to the webstore.
ownership_verificationWebstoreCustomDomainOwnershipVerificationDtoOptional
Represents the DNS record that has to be published to prove ownership of a webstore's custom domain.
namestringRequired
The name to publish the record under.
typestringRequired
The kind of DNS record to publish (e.g., txt).
valuestringRequired
The value the record has to hold.
ownership_verification_httpWebstoreCustomDomainOwnershipVerificationHttpDtoOptional
Represents the token file that has to be served over HTTP to prove ownership of a webstore's custom domain.
http_bodystringRequired
The body that URL has to return.
http_urlstringRequired
The URL on the domain the token file has to be served from.
sslWebstoreCustomDomainSslDtoOptional
Represents the SSL certificate issued for a webstore's custom domain.
idstringRequired
The identifier the certificate was issued under.
methodstringRequired
How control of the domain is validated for the certificate (e.g., txt, http, email).
statusstringRequired
The state of the certificate (e.g., pending_validation, active). The domain only serves traffic over HTTPS once it is active.
validation_errorsstring[]Required
The errors raised by the last certificate validation attempt. Empty when the last attempt raised none.
validation_recordsWebstoreCustomDomainSslValidationRecordDto[]Required
The records that have to be published to validate the certificate. Empty once validation no longer needs them.
emailsstring[]Required
The addresses a validation link can be sent to. Empty when validation is not by email.
http_bodystringOptional
The body that URL has to return, or null when validation is not over HTTP.
http_urlstringOptional
The URL on the domain the token file has to be served from, or null when validation is not over HTTP.
txt_namestringOptional
The name to publish the DNS TXT record under, or null when validation is not by TXT record.
txt_valuestringOptional
The value that TXT record has to hold, or null when validation is not by TXT record.
certificate_authoritystringOptional
The authority issuing the certificate, or null while one has not been chosen.

Failed requests return a PayNowError body. See the error response guide.

curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/webstore/custom-domain" \
  -H "Authorization: APIKey TOKEN"
Response200
{
  "id": "string",
  "hostname": "string",
  "status": "string",
  "verification_errors": [
    "string"
  ],
  "created_at": "2024-01-01T00:00:00Z",
  "ownership_verification": {
    "name": "string",
    "type": "string",
    "value": "string"
  },
  "ownership_verification_http": {
    "http_body": "string",
    "http_url": "string"
  },
  "ssl": {
    "id": "string",
    "method": "string",
    "status": "string",
    "validation_errors": [
      "string"
    ],
    "validation_records": [
      {
        "emails": [
          "string"
        ],
        "http_body": "string",
        "http_url": "string",
        "txt_name": "string",
        "txt_value": "string"
      }
    ],
    "certificate_authority": "string"
  }
}

Set custom domain

POSThttps://api.paynow.gg/v1/stores/{storeId}/webstore/custom-domain

Attaches a custom domain to the store's webstore and begins verification.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store whose webstore is being changed.
Request body
domainstringRequired
The domain to serve the webstore from, without a scheme (e.g., store.example.com).
verification_typeenumRequired
Specifies how ownership of a webstore's custom domain is proven. The only officially supported method is the 'http' method.
Possible enum values
  • invalid

    No verification type specified. This value is typically used as a default or uninitialized state.

  • http

    Ownership is proven by serving a token file over HTTP from the domain. This is the RECOMMENDED way to prove ownership, and is used by the dashboard.

  • txt

    Ownership is proven by publishing a DNS TXT record on the domain.

  • email

    Ownership is proven by following a link sent to an administrative address on the domain.

  • cname

    Ownership is proven by publishing a DNS CNAME record on the domain.

Response
200OKWebstoreCustomDomainDto
Represents a custom domain attached to a webstore, together with the state of its ownership and SSL verification.
Show fields
idstringRequired
The identifier the domain was registered under with the hosting provider.
hostnamestringRequired
The domain the webstore is served from, without a scheme (e.g., store.example.com).
statusstringRequired
The verification state of the domain as reported by the hosting provider. The domain only serves the webstore once it is active.
verification_errorsstring[]Required
The errors raised by the last ownership verification attempt. Empty when the last attempt raised none.
created_atstringOptional
The date and time the domain was attached to the webstore.
ownership_verificationWebstoreCustomDomainOwnershipVerificationDtoOptional
Represents the DNS record that has to be published to prove ownership of a webstore's custom domain.
namestringRequired
The name to publish the record under.
typestringRequired
The kind of DNS record to publish (e.g., txt).
valuestringRequired
The value the record has to hold.
ownership_verification_httpWebstoreCustomDomainOwnershipVerificationHttpDtoOptional
Represents the token file that has to be served over HTTP to prove ownership of a webstore's custom domain.
http_bodystringRequired
The body that URL has to return.
http_urlstringRequired
The URL on the domain the token file has to be served from.
sslWebstoreCustomDomainSslDtoOptional
Represents the SSL certificate issued for a webstore's custom domain.
idstringRequired
The identifier the certificate was issued under.
methodstringRequired
How control of the domain is validated for the certificate (e.g., txt, http, email).
statusstringRequired
The state of the certificate (e.g., pending_validation, active). The domain only serves traffic over HTTPS once it is active.
validation_errorsstring[]Required
The errors raised by the last certificate validation attempt. Empty when the last attempt raised none.
validation_recordsWebstoreCustomDomainSslValidationRecordDto[]Required
The records that have to be published to validate the certificate. Empty once validation no longer needs them.
emailsstring[]Required
The addresses a validation link can be sent to. Empty when validation is not by email.
http_bodystringOptional
The body that URL has to return, or null when validation is not over HTTP.
http_urlstringOptional
The URL on the domain the token file has to be served from, or null when validation is not over HTTP.
txt_namestringOptional
The name to publish the DNS TXT record under, or null when validation is not by TXT record.
txt_valuestringOptional
The value that TXT record has to hold, or null when validation is not by TXT record.
certificate_authoritystringOptional
The authority issuing the certificate, or null while one has not been chosen.

Failed requests return a PayNowError body. See the error response guide.

curl -X POST "https://api.paynow.gg/v1/stores/{storeId}/webstore/custom-domain" \
  -H "Authorization: APIKey TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "domain": "string",
  "verification_type": "invalid"
}'
Response200
{
  "id": "string",
  "hostname": "string",
  "status": "string",
  "verification_errors": [
    "string"
  ],
  "created_at": "2024-01-01T00:00:00Z",
  "ownership_verification": {
    "name": "string",
    "type": "string",
    "value": "string"
  },
  "ownership_verification_http": {
    "http_body": "string",
    "http_url": "string"
  },
  "ssl": {
    "id": "string",
    "method": "string",
    "status": "string",
    "validation_errors": [
      "string"
    ],
    "validation_records": [
      {
        "emails": [
          "string"
        ],
        "http_body": "string",
        "http_url": "string",
        "txt_name": "string",
        "txt_value": "string"
      }
    ],
    "certificate_authority": "string"
  }
}

Delete custom domain

DELETEhttps://api.paynow.gg/v1/stores/{storeId}/webstore/custom-domain

Detaches the custom domain from the store's webstore. The webstore stays reachable at its slug.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store to remove the custom domain from.
Response
204No Content

Failed requests return a PayNowError body. See the error response guide.

curl -X DELETE "https://api.paynow.gg/v1/stores/{storeId}/webstore/custom-domain" \
  -H "Authorization: APIKey TOKEN"

Verify custom domain

POSThttps://api.paynow.gg/v1/stores/{storeId}/webstore/custom-domain/verify

Re-checks the verification records for the webstore's custom domain. Call this once the records returned when the domain was set have been published.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store whose custom domain should be re-checked.
Response
204No Content

Failed requests return a PayNowError body. See the error response guide.

curl -X POST "https://api.paynow.gg/v1/stores/{storeId}/webstore/custom-domain/verify" \
  -H "Authorization: APIKey TOKEN"

Get template files

GEThttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/files

Retrieves the files of a template without their content. Fetch a single file to read its content.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template.
Response
200OKWebstoreTemplateFileDto[]
Represents one file within a webstore template, such as a page, stylesheet, script or image.
Show fields
idFlakeIdRequired
content_typestringRequired
The MIME type of the file (e.g., text/html, text/css, application/json). Decides how the file is served and whether it is public.
created_atstringRequired
The date and time the file was created.
file_namestringRequired
The name of the file within the template, without an extension. The extension follows from 'content_type'.
is_deletablebooleanRequired
Indicates whether the file can be deleted. Files the template cannot render without are not deletable.
is_publicbooleanRequired
Indicates whether the file is served directly to browsers as a static asset. Pages and the schema file are private and rendered on the server; styles, scripts and images are public.
template_idFlakeIdRequired
updated_atstringRequired
The date and time the file was last updated.
contentstringOptional
The text content of the file. Null when files are listed; content is only returned when a single file is fetched or the template is fetched with 'include' set to 'files'.

Failed requests return a PayNowError body. See the error response guide.

curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/files" \
  -H "Authorization: APIKey TOKEN"
Response200
[
  {
    "id": "411486491630370816",
    "content_type": "string",
    "created_at": "2024-01-01T00:00:00Z",
    "file_name": "string",
    "is_deletable": true,
    "is_public": true,
    "template_id": "411486491630370816",
    "updated_at": "2024-01-01T00:00:00Z",
    "content": "string"
  }
]

Create template file

PUThttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/files

Adds a file to a template. Its 'file_name' and 'content_type' decide where the file is served from and whether it is public.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template to add the file to.
Request body
content_typestringRequired
The MIME type of the file (e.g., text/html, text/css, application/json). Decides how the file is served and whether it is public.
file_namestringRequired
The name of the file within the template, without an extension. The extension follows from 'content_type'.
contentstringOptional
The text content of the file. Null when files are listed; content is only returned when a single file is fetched or the template is fetched with 'include' set to 'files'.
Response
200OKWebstoreTemplateFileDto
Represents one file within a webstore template, such as a page, stylesheet, script or image.
Show fields
idFlakeIdRequired
content_typestringRequired
The MIME type of the file (e.g., text/html, text/css, application/json). Decides how the file is served and whether it is public.
created_atstringRequired
The date and time the file was created.
file_namestringRequired
The name of the file within the template, without an extension. The extension follows from 'content_type'.
is_deletablebooleanRequired
Indicates whether the file can be deleted. Files the template cannot render without are not deletable.
is_publicbooleanRequired
Indicates whether the file is served directly to browsers as a static asset. Pages and the schema file are private and rendered on the server; styles, scripts and images are public.
template_idFlakeIdRequired
updated_atstringRequired
The date and time the file was last updated.
contentstringOptional
The text content of the file. Null when files are listed; content is only returned when a single file is fetched or the template is fetched with 'include' set to 'files'.

Failed requests return a PayNowError body. See the error response guide.

curl -X PUT "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/files" \
  -H "Authorization: APIKey TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "content_type": "string",
  "file_name": "string",
  "content": "string"
}'
Response200
{
  "id": "411486491630370816",
  "content_type": "string",
  "created_at": "2024-01-01T00:00:00Z",
  "file_name": "string",
  "is_deletable": true,
  "is_public": true,
  "template_id": "411486491630370816",
  "updated_at": "2024-01-01T00:00:00Z",
  "content": "string"
}

Get template file

GEThttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/files/{templateFileId}

Retrieves a single template file, content included.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template.
templateFileIdFlakeIdRequired
The ID of the template file.
Response
200OKWebstoreTemplateFileDto
Represents one file within a webstore template, such as a page, stylesheet, script or image.
Show fields
idFlakeIdRequired
content_typestringRequired
The MIME type of the file (e.g., text/html, text/css, application/json). Decides how the file is served and whether it is public.
created_atstringRequired
The date and time the file was created.
file_namestringRequired
The name of the file within the template, without an extension. The extension follows from 'content_type'.
is_deletablebooleanRequired
Indicates whether the file can be deleted. Files the template cannot render without are not deletable.
is_publicbooleanRequired
Indicates whether the file is served directly to browsers as a static asset. Pages and the schema file are private and rendered on the server; styles, scripts and images are public.
template_idFlakeIdRequired
updated_atstringRequired
The date and time the file was last updated.
contentstringOptional
The text content of the file. Null when files are listed; content is only returned when a single file is fetched or the template is fetched with 'include' set to 'files'.

Failed requests return a PayNowError body. See the error response guide.

curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/files/{templateFileId}" \
  -H "Authorization: APIKey TOKEN"
Response200
{
  "id": "411486491630370816",
  "content_type": "string",
  "created_at": "2024-01-01T00:00:00Z",
  "file_name": "string",
  "is_deletable": true,
  "is_public": true,
  "template_id": "411486491630370816",
  "updated_at": "2024-01-01T00:00:00Z",
  "content": "string"
}

Update template file content

PUThttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/files/{templateFileId}

Replaces the content of a template file. If the template is the webstore's current template, customers see the change immediately.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template.
templateFileIdFlakeIdRequired
The ID of the template file.
Request body
contentstringRequired
The full new text content of the file. It replaces the existing content in its entirety.
Response
204No Content

Failed requests return a PayNowError body. See the error response guide.

curl -X PUT "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/files/{templateFileId}" \
  -H "Authorization: APIKey TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "content": "string"
}'

Delete template file

DELETEhttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/files/{templateFileId}

Permanently deletes a template file. Files whose 'is_deletable' is false cannot be removed.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template.
templateFileIdFlakeIdRequired
The ID of the template file.
Response
204No Content

Failed requests return a PayNowError body. See the error response guide.

curl -X DELETE "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/files/{templateFileId}" \
  -H "Authorization: APIKey TOKEN"

Get templates

GEThttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates

Retrieves the templates of the store's webstore, without their files. The one customers see is the webstore's 'current_template_id'.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store whose webstore templates to retrieve.
Response
200OKWebstoreTemplateDto[]
Represents a template a webstore can render: a named set of pages, styles, scripts and assets served to customers while it is the webstore's current template.
Show fields
idFlakeIdRequired
compatibility_modeenumRequired
Specifies the dialect a webstore template is written in.
Possible enum values
  • invalid

    No compatibility mode specified. This value is typically used as a default or uninitialized state.

  • paynow

    A native PayNow template.

  • tebex

    A template written for Tebex, rendered through a compatibility layer so it works without changes.

created_atstringRequired
The date and time the template was created.
is_publicbooleanRequired
Indicates whether the template is shared with every store, as PayNow's built-in templates are, rather than private to this webstore.
namestringRequired
The display name of the template.
updated_atstringRequired
The date and time the template was last updated.
webstore_idFlakeIdRequired
template_filesWebstoreTemplateFileDto[]Optional
The template's files, content included. Only returned when a single template is fetched with 'include' set to 'files'; null otherwise.
idFlakeIdRequired
content_typestringRequired
The MIME type of the file (e.g., text/html, text/css, application/json). Decides how the file is served and whether it is public.
created_atstringRequired
The date and time the file was created.
file_namestringRequired
The name of the file within the template, without an extension. The extension follows from 'content_type'.
is_deletablebooleanRequired
Indicates whether the file can be deleted. Files the template cannot render without are not deletable.
is_publicbooleanRequired
Indicates whether the file is served directly to browsers as a static asset. Pages and the schema file are private and rendered on the server; styles, scripts and images are public.
template_idFlakeIdRequired
updated_atstringRequired
The date and time the file was last updated.
contentstringOptional
The text content of the file. Null when files are listed; content is only returned when a single file is fetched or the template is fetched with 'include' set to 'files'.

Failed requests return a PayNowError body. See the error response guide.

curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates" \
  -H "Authorization: APIKey TOKEN"
Response200
[
  {
    "id": "411486491630370816",
    "compatibility_mode": "invalid",
    "created_at": "2024-01-01T00:00:00Z",
    "is_public": true,
    "name": "string",
    "updated_at": "2024-01-01T00:00:00Z",
    "webstore_id": "411486491630370816",
    "template_files": [
      {
        "id": "411486491630370816",
        "content_type": "string",
        "created_at": "2024-01-01T00:00:00Z",
        "file_name": "string",
        "is_deletable": true,
        "is_public": true,
        "template_id": "411486491630370816",
        "updated_at": "2024-01-01T00:00:00Z",
        "content": "string"
      }
    ]
  }
]

Create template

PUThttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates

Creates an empty template on the store's webstore. Add files to it, then set it as the webstore's default template to serve it to customers.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store whose webstore the template is added to.
Request body
compatibility_modeenumRequired
Specifies the dialect a webstore template is written in.
Possible enum values
  • invalid

    No compatibility mode specified. This value is typically used as a default or uninitialized state.

  • paynow

    A native PayNow template.

  • tebex

    A template written for Tebex, rendered through a compatibility layer so it works without changes.

namestringRequired
The display name of the template.
Response
200OKWebstoreTemplateDto
Represents a template a webstore can render: a named set of pages, styles, scripts and assets served to customers while it is the webstore's current template.
Show fields
idFlakeIdRequired
compatibility_modeenumRequired
Specifies the dialect a webstore template is written in.
Possible enum values
  • invalid

    No compatibility mode specified. This value is typically used as a default or uninitialized state.

  • paynow

    A native PayNow template.

  • tebex

    A template written for Tebex, rendered through a compatibility layer so it works without changes.

created_atstringRequired
The date and time the template was created.
is_publicbooleanRequired
Indicates whether the template is shared with every store, as PayNow's built-in templates are, rather than private to this webstore.
namestringRequired
The display name of the template.
updated_atstringRequired
The date and time the template was last updated.
webstore_idFlakeIdRequired
template_filesWebstoreTemplateFileDto[]Optional
The template's files, content included. Only returned when a single template is fetched with 'include' set to 'files'; null otherwise.
idFlakeIdRequired
content_typestringRequired
The MIME type of the file (e.g., text/html, text/css, application/json). Decides how the file is served and whether it is public.
created_atstringRequired
The date and time the file was created.
file_namestringRequired
The name of the file within the template, without an extension. The extension follows from 'content_type'.
is_deletablebooleanRequired
Indicates whether the file can be deleted. Files the template cannot render without are not deletable.
is_publicbooleanRequired
Indicates whether the file is served directly to browsers as a static asset. Pages and the schema file are private and rendered on the server; styles, scripts and images are public.
template_idFlakeIdRequired
updated_atstringRequired
The date and time the file was last updated.
contentstringOptional
The text content of the file. Null when files are listed; content is only returned when a single file is fetched or the template is fetched with 'include' set to 'files'.

Failed requests return a PayNowError body. See the error response guide.

curl -X PUT "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates" \
  -H "Authorization: APIKey TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "compatibility_mode": "invalid",
  "name": "string"
}'
Response200
{
  "id": "411486491630370816",
  "compatibility_mode": "invalid",
  "created_at": "2024-01-01T00:00:00Z",
  "is_public": true,
  "name": "string",
  "updated_at": "2024-01-01T00:00:00Z",
  "webstore_id": "411486491630370816",
  "template_files": [
    {
      "id": "411486491630370816",
      "content_type": "string",
      "created_at": "2024-01-01T00:00:00Z",
      "file_name": "string",
      "is_deletable": true,
      "is_public": true,
      "template_id": "411486491630370816",
      "updated_at": "2024-01-01T00:00:00Z",
      "content": "string"
    }
  ]
}

Get template

GEThttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}

Retrieves a template. Pass 'include' as 'files' to embed its files, content included, in 'template_files'.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template.
Query parameters
includestringOptional
Set to 'files' to include the template's files in the response.
Response
200OKWebstoreTemplateDto
Represents a template a webstore can render: a named set of pages, styles, scripts and assets served to customers while it is the webstore's current template.
Show fields
idFlakeIdRequired
compatibility_modeenumRequired
Specifies the dialect a webstore template is written in.
Possible enum values
  • invalid

    No compatibility mode specified. This value is typically used as a default or uninitialized state.

  • paynow

    A native PayNow template.

  • tebex

    A template written for Tebex, rendered through a compatibility layer so it works without changes.

created_atstringRequired
The date and time the template was created.
is_publicbooleanRequired
Indicates whether the template is shared with every store, as PayNow's built-in templates are, rather than private to this webstore.
namestringRequired
The display name of the template.
updated_atstringRequired
The date and time the template was last updated.
webstore_idFlakeIdRequired
template_filesWebstoreTemplateFileDto[]Optional
The template's files, content included. Only returned when a single template is fetched with 'include' set to 'files'; null otherwise.
idFlakeIdRequired
content_typestringRequired
The MIME type of the file (e.g., text/html, text/css, application/json). Decides how the file is served and whether it is public.
created_atstringRequired
The date and time the file was created.
file_namestringRequired
The name of the file within the template, without an extension. The extension follows from 'content_type'.
is_deletablebooleanRequired
Indicates whether the file can be deleted. Files the template cannot render without are not deletable.
is_publicbooleanRequired
Indicates whether the file is served directly to browsers as a static asset. Pages and the schema file are private and rendered on the server; styles, scripts and images are public.
template_idFlakeIdRequired
updated_atstringRequired
The date and time the file was last updated.
contentstringOptional
The text content of the file. Null when files are listed; content is only returned when a single file is fetched or the template is fetched with 'include' set to 'files'.

Failed requests return a PayNowError body. See the error response guide.

curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}" \
  -H "Authorization: APIKey TOKEN"
Response200
{
  "id": "411486491630370816",
  "compatibility_mode": "invalid",
  "created_at": "2024-01-01T00:00:00Z",
  "is_public": true,
  "name": "string",
  "updated_at": "2024-01-01T00:00:00Z",
  "webstore_id": "411486491630370816",
  "template_files": [
    {
      "id": "411486491630370816",
      "content_type": "string",
      "created_at": "2024-01-01T00:00:00Z",
      "file_name": "string",
      "is_deletable": true,
      "is_public": true,
      "template_id": "411486491630370816",
      "updated_at": "2024-01-01T00:00:00Z",
      "content": "string"
    }
  ]
}

Update template

PUThttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}

Performs a delta update of a template's name and compatibility mode.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template.
Request body
compatibility_modeenumRequired
Specifies the dialect a webstore template is written in.
Possible enum values
  • invalid

    No compatibility mode specified. This value is typically used as a default or uninitialized state.

  • paynow

    A native PayNow template.

  • tebex

    A template written for Tebex, rendered through a compatibility layer so it works without changes.

namestringRequired
The display name of the template.
Response
200OKWebstoreTemplateDto
Represents a template a webstore can render: a named set of pages, styles, scripts and assets served to customers while it is the webstore's current template.
Show fields
idFlakeIdRequired
compatibility_modeenumRequired
Specifies the dialect a webstore template is written in.
Possible enum values
  • invalid

    No compatibility mode specified. This value is typically used as a default or uninitialized state.

  • paynow

    A native PayNow template.

  • tebex

    A template written for Tebex, rendered through a compatibility layer so it works without changes.

created_atstringRequired
The date and time the template was created.
is_publicbooleanRequired
Indicates whether the template is shared with every store, as PayNow's built-in templates are, rather than private to this webstore.
namestringRequired
The display name of the template.
updated_atstringRequired
The date and time the template was last updated.
webstore_idFlakeIdRequired
template_filesWebstoreTemplateFileDto[]Optional
The template's files, content included. Only returned when a single template is fetched with 'include' set to 'files'; null otherwise.
idFlakeIdRequired
content_typestringRequired
The MIME type of the file (e.g., text/html, text/css, application/json). Decides how the file is served and whether it is public.
created_atstringRequired
The date and time the file was created.
file_namestringRequired
The name of the file within the template, without an extension. The extension follows from 'content_type'.
is_deletablebooleanRequired
Indicates whether the file can be deleted. Files the template cannot render without are not deletable.
is_publicbooleanRequired
Indicates whether the file is served directly to browsers as a static asset. Pages and the schema file are private and rendered on the server; styles, scripts and images are public.
template_idFlakeIdRequired
updated_atstringRequired
The date and time the file was last updated.
contentstringOptional
The text content of the file. Null when files are listed; content is only returned when a single file is fetched or the template is fetched with 'include' set to 'files'.

Failed requests return a PayNowError body. See the error response guide.

curl -X PUT "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}" \
  -H "Authorization: APIKey TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "compatibility_mode": "invalid",
  "name": "string"
}'
Response200
{
  "id": "411486491630370816",
  "compatibility_mode": "invalid",
  "created_at": "2024-01-01T00:00:00Z",
  "is_public": true,
  "name": "string",
  "updated_at": "2024-01-01T00:00:00Z",
  "webstore_id": "411486491630370816",
  "template_files": [
    {
      "id": "411486491630370816",
      "content_type": "string",
      "created_at": "2024-01-01T00:00:00Z",
      "file_name": "string",
      "is_deletable": true,
      "is_public": true,
      "template_id": "411486491630370816",
      "updated_at": "2024-01-01T00:00:00Z",
      "content": "string"
    }
  ]
}

Delete template

DELETEhttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}

Permanently deletes a template and all of its files. Switch the webstore to another template first if this one is its current template.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template.
Response
204No Content

Failed requests return a PayNowError body. See the error response guide.

curl -X DELETE "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}" \
  -H "Authorization: APIKey TOKEN"

Get latest template version

GEThttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/update

Retrieves the newest published version available for a template installed from the marketplace. 'version' is null when there is no update or the template is not marketplace-based.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template.
Response
200OKWebstoreTemplateLatestVersionDto
Represents the newest version available for a template installed from the marketplace.
Show fields
versionstringOptional
The newest published version of the template, or null when no update is available or the template was not installed from the marketplace.

Failed requests return a PayNowError body. See the error response guide.

curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/update" \
  -H "Authorization: APIKey TOKEN"
Response200
{
  "version": "string"
}

Update template to latest version

POSThttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/update

Downloads the newest published version of a marketplace template over the installed copy, replacing its files.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template to update.
Response
204No Content

Failed requests return a PayNowError body. See the error response guide.

curl -X POST "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/update" \
  -H "Authorization: APIKey TOKEN"

Get template schema

GEThttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/schema

Retrieves the schema a template declares: its author, support contacts, update source and the settings a store can configure.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template.
Response
200OKWebstoreTemplateSchemaDto
Represents a template's schema, declared by its author: who maintains it, how it receives updates and the settings a store can configure without editing the template's files.
Show fields
authorstringRequired
The name of the template's author.
configWebstoreTemplateSchemaSectionDto[]Required
The sections of settings the template exposes, in display order.
headerstringRequired
The heading shown above the section.
optionsWebstoreTemplateSchemaOptionDto[]Required
The settings in the section, in display order.
idstringRequired
The key the setting's value is stored under. Use it as the variable name when setting values through the schema variables endpoint.
namestringRequired
The label shown for the setting.
nested_optionsWebstoreTemplateSchemaOptionDto[]Required
The settings nested under this one. Empty when it has none.
→ WebstoreTemplateSchemaOptionDto
typestringRequired
The kind of control used to edit the setting (e.g., text, toggle, select, color).
valuesstring[]Required
The choices a select-style setting offers. Empty for other kinds of setting.
defaultnullOptional
The value used while the store has not set one, or null when there is no default.
descriptionstringOptional
A longer explanation of the setting, or null when the template gives none.
maxnumberOptional
The highest value a numeric setting accepts, or null when it is unbounded.
minnumberOptional
The lowest value a numeric setting accepts, or null when it is unbounded.
multilinebooleanOptional
Indicates whether a text setting accepts multiple lines, or null when it does not apply.
numericbooleanOptional
Indicates whether a text setting only accepts numbers, or null when it does not apply.
support_emailstringOptional
The email address to contact for support with the template, or null when none is given.
support_urlstringOptional
The URL to visit for support with the template, or null when none is given.
updatesWebstoreTemplateSchemaUpdatesDtoOptional
Represents how a template receives updates from its author.
github_branchstringRequired
The branch of the repository updates are pulled from.
supportedbooleanRequired
Indicates whether the template can be updated in place.
version_check_supportedbooleanRequired
Indicates whether the newest available version can be looked up before updating.
github_tokenstringOptional
The token used to read a private repository, or null when the repository is public.
github_urlstringOptional
The URL of the GitHub repository updates are pulled from, or null when updates do not come from GitHub.
versionstringOptional
The version of the template currently installed, or null when the template does not declare one.

Failed requests return a PayNowError body. See the error response guide.

curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/schema" \
  -H "Authorization: APIKey TOKEN"
Response200
{
  "author": "string",
  "config": [
    {
      "header": "string",
      "options": [
        {
          "id": "string",
          "name": "string",
          "nested_options": [
            {}
          ],
          "type": "string",
          "values": [
            "string"
          ],
          "default": {},
          "description": "string",
          "max": 0,
          "min": 0,
          "multiline": true,
          "numeric": true
        }
      ]
    }
  ],
  "support_email": "string",
  "support_url": "string",
  "updates": {
    "github_branch": "string",
    "supported": true,
    "version_check_supported": true,
    "github_token": "string",
    "github_url": "string",
    "version": "string"
  }
}

Update template schema variables

PUThttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/schema/variables

Sets values for the settings the template's schema defines.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template.
Request body
bodyobjectOptional
Response
204No Content

Failed requests return a PayNowError body. See the error response guide.

curl -X PUT "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/schema/variables" \
  -H "Authorization: APIKey TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Duplicate template

POSThttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/duplicate

Copies a template and its files into a new template on the same webstore and returns it.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template to copy.
Response
200OKWebstoreTemplateDto
Represents a template a webstore can render: a named set of pages, styles, scripts and assets served to customers while it is the webstore's current template.
Show fields
idFlakeIdRequired
compatibility_modeenumRequired
Specifies the dialect a webstore template is written in.
Possible enum values
  • invalid

    No compatibility mode specified. This value is typically used as a default or uninitialized state.

  • paynow

    A native PayNow template.

  • tebex

    A template written for Tebex, rendered through a compatibility layer so it works without changes.

created_atstringRequired
The date and time the template was created.
is_publicbooleanRequired
Indicates whether the template is shared with every store, as PayNow's built-in templates are, rather than private to this webstore.
namestringRequired
The display name of the template.
updated_atstringRequired
The date and time the template was last updated.
webstore_idFlakeIdRequired
template_filesWebstoreTemplateFileDto[]Optional
The template's files, content included. Only returned when a single template is fetched with 'include' set to 'files'; null otherwise.
idFlakeIdRequired
content_typestringRequired
The MIME type of the file (e.g., text/html, text/css, application/json). Decides how the file is served and whether it is public.
created_atstringRequired
The date and time the file was created.
file_namestringRequired
The name of the file within the template, without an extension. The extension follows from 'content_type'.
is_deletablebooleanRequired
Indicates whether the file can be deleted. Files the template cannot render without are not deletable.
is_publicbooleanRequired
Indicates whether the file is served directly to browsers as a static asset. Pages and the schema file are private and rendered on the server; styles, scripts and images are public.
template_idFlakeIdRequired
updated_atstringRequired
The date and time the file was last updated.
contentstringOptional
The text content of the file. Null when files are listed; content is only returned when a single file is fetched or the template is fetched with 'include' set to 'files'.

Failed requests return a PayNowError body. See the error response guide.

curl -X POST "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/duplicate" \
  -H "Authorization: APIKey TOKEN"
Response200
{
  "id": "411486491630370816",
  "compatibility_mode": "invalid",
  "created_at": "2024-01-01T00:00:00Z",
  "is_public": true,
  "name": "string",
  "updated_at": "2024-01-01T00:00:00Z",
  "webstore_id": "411486491630370816",
  "template_files": [
    {
      "id": "411486491630370816",
      "content_type": "string",
      "created_at": "2024-01-01T00:00:00Z",
      "file_name": "string",
      "is_deletable": true,
      "is_public": true,
      "template_id": "411486491630370816",
      "updated_at": "2024-01-01T00:00:00Z",
      "content": "string"
    }
  ]
}

Get template archive

GEThttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/archive

Creates a temporary URL to download the template's files as an archive.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template.
Response
200OKGetWebstoreTemplateArchiveResponseDto
Represents a link to download a template's files as an archive.
Show fields
download_urlstringRequired
The temporary URL the archive can be downloaded from.

Failed requests return a PayNowError body. See the error response guide.

curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/archive" \
  -H "Authorization: APIKey TOKEN"
Response200
{
  "download_url": "string"
}

Get template upload URL

GEThttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/upload_url

Creates a pre-signed URL for uploading an archive of template files. Upload the archive to it, then finish the upload to import the files into the template.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template the files are imported into.
Query parameters
content_lengthintegerOptional
The size of the archive to be uploaded, in bytes.
Response
200OKGetWebstoreTemplateUploadUrlResponseDto
Represents a pre-signed URL for uploading a template archive.
Show fields
upload_urlstringRequired
The URL to upload the archive to with an HTTP PUT. Once the upload completes, finish it through the upload finish endpoint to import the files into the template.

Failed requests return a PayNowError body. See the error response guide.

curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/upload_url" \
  -H "Authorization: APIKey TOKEN"
Response200
{
  "upload_url": "string"
}

Finish template upload

POSThttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/upload_finish

Imports the files from an archive uploaded to the URL returned by the upload URL endpoint into the template, and reports any files that could not be imported.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template the files are imported into.
Response
200OKFinishWebstoreTemplateUploadResponseDto
Represents the result of importing an uploaded template archive into a template.
Show fields
failed_filesstring[]Required
The names of the files in the archive that could not be imported. Empty when every file was imported.

Failed requests return a PayNowError body. See the error response guide.

curl -X POST "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/upload_finish" \
  -H "Authorization: APIKey TOKEN"
Response200
{
  "failed_files": [
    "string"
  ]
}

Create template preview URL

POSThttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/preview

Creates a short-lived link that renders the template without caching. The link expires after 15 minutes.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template to preview.
Response
200OKGetWebstoreTemplatePreviewUrlResponseDto
Represents a short-lived link that renders a template preview without caching.
Show fields
expires_atstringRequired
The date and time the link stops working.
slugstringRequired
The preview slug the link is keyed by.
urlstringRequired
The URL to open the preview at.

Failed requests return a PayNowError body. See the error response guide.

curl -X POST "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/preview" \
  -H "Authorization: APIKey TOKEN"
Response200
{
  "expires_at": "2024-01-01T00:00:00Z",
  "slug": "string",
  "url": "string"
}

Get template variables

GEThttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/variables

Retrieves the variables of a template with their current values.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template.
Response
200OKWebstoreTemplateVariableDto[]
Represents a value a template's files can reference, letting a store customise a template without editing its files.
Show fields
idFlakeIdRequired
created_atstringRequired
The date and time the variable was created.
namestringRequired
The label shown for the variable in the editor.
template_idFlakeIdRequired
typeenumRequired
Specifies how a template variable's 'value' is interpreted when the template renders.
Possible enum values
  • invalid

    No type specified. This value is typically used as a default or uninitialized state.

  • string

    The value is used as plain text.

  • html

    The value is inserted as raw HTML without escaping.

  • number

    The value is parsed as a number.

  • boolean

    The value is parsed as a boolean; 'true' is true, anything else is false.

  • json

    The value is parsed as a JSON document.

updated_atstringRequired
The date and time the variable was last updated.
valuestringRequired
The value of the variable, always stored as a string and parsed according to 'type' when the template renders.
variablestringRequired
The name the template's files reference the value by.
webstore_idFlakeIdRequired

Failed requests return a PayNowError body. See the error response guide.

curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/variables" \
  -H "Authorization: APIKey TOKEN"
Response200
[
  {
    "id": "411486491630370816",
    "created_at": "2024-01-01T00:00:00Z",
    "name": "string",
    "template_id": "411486491630370816",
    "type": "invalid",
    "updated_at": "2024-01-01T00:00:00Z",
    "value": "string",
    "variable": "string",
    "webstore_id": "411486491630370816"
  }
]

Create template variable

PUThttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/variables

Adds a variable to a template. Its 'variable' is the name the template's files reference it by, and 'type' decides how 'value' is parsed when the template renders.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template to add the variable to.
Request body
namestringRequired
The label shown for the variable in the editor.
typeenumRequired
Specifies how a template variable's 'value' is interpreted when the template renders.
Possible enum values
  • invalid

    No type specified. This value is typically used as a default or uninitialized state.

  • string

    The value is used as plain text.

  • html

    The value is inserted as raw HTML without escaping.

  • number

    The value is parsed as a number.

  • boolean

    The value is parsed as a boolean; 'true' is true, anything else is false.

  • json

    The value is parsed as a JSON document.

valuestringRequired
The value of the variable, always stored as a string and parsed according to 'type' when the template renders.
variablestringRequired
The name the template's files reference the value by.
Response
200OKWebstoreTemplateVariableDto
Represents a value a template's files can reference, letting a store customise a template without editing its files.
Show fields
idFlakeIdRequired
created_atstringRequired
The date and time the variable was created.
namestringRequired
The label shown for the variable in the editor.
template_idFlakeIdRequired
typeenumRequired
Specifies how a template variable's 'value' is interpreted when the template renders.
Possible enum values
  • invalid

    No type specified. This value is typically used as a default or uninitialized state.

  • string

    The value is used as plain text.

  • html

    The value is inserted as raw HTML without escaping.

  • number

    The value is parsed as a number.

  • boolean

    The value is parsed as a boolean; 'true' is true, anything else is false.

  • json

    The value is parsed as a JSON document.

updated_atstringRequired
The date and time the variable was last updated.
valuestringRequired
The value of the variable, always stored as a string and parsed according to 'type' when the template renders.
variablestringRequired
The name the template's files reference the value by.
webstore_idFlakeIdRequired

Failed requests return a PayNowError body. See the error response guide.

curl -X PUT "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/variables" \
  -H "Authorization: APIKey TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "type": "invalid",
  "value": "string",
  "variable": "string"
}'
Response200
{
  "id": "411486491630370816",
  "created_at": "2024-01-01T00:00:00Z",
  "name": "string",
  "template_id": "411486491630370816",
  "type": "invalid",
  "updated_at": "2024-01-01T00:00:00Z",
  "value": "string",
  "variable": "string",
  "webstore_id": "411486491630370816"
}

Update template variable

PUThttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/variables/{templateVariableId}

Performs a delta update of a template variable.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template.
templateVariableIdFlakeIdRequired
The ID of the template variable.
Request body
namestringRequired
The label shown for the variable in the editor.
typeenumRequired
Specifies how a template variable's 'value' is interpreted when the template renders.
Possible enum values
  • invalid

    No type specified. This value is typically used as a default or uninitialized state.

  • string

    The value is used as plain text.

  • html

    The value is inserted as raw HTML without escaping.

  • number

    The value is parsed as a number.

  • boolean

    The value is parsed as a boolean; 'true' is true, anything else is false.

  • json

    The value is parsed as a JSON document.

valuestringRequired
The value of the variable, always stored as a string and parsed according to 'type' when the template renders.
variablestringRequired
The name the template's files reference the value by.
Response
200OKWebstoreTemplateVariableDto
Represents a value a template's files can reference, letting a store customise a template without editing its files.
Show fields
idFlakeIdRequired
created_atstringRequired
The date and time the variable was created.
namestringRequired
The label shown for the variable in the editor.
template_idFlakeIdRequired
typeenumRequired
Specifies how a template variable's 'value' is interpreted when the template renders.
Possible enum values
  • invalid

    No type specified. This value is typically used as a default or uninitialized state.

  • string

    The value is used as plain text.

  • html

    The value is inserted as raw HTML without escaping.

  • number

    The value is parsed as a number.

  • boolean

    The value is parsed as a boolean; 'true' is true, anything else is false.

  • json

    The value is parsed as a JSON document.

updated_atstringRequired
The date and time the variable was last updated.
valuestringRequired
The value of the variable, always stored as a string and parsed according to 'type' when the template renders.
variablestringRequired
The name the template's files reference the value by.
webstore_idFlakeIdRequired

Failed requests return a PayNowError body. See the error response guide.

curl -X PUT "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/variables/{templateVariableId}" \
  -H "Authorization: APIKey TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "type": "invalid",
  "value": "string",
  "variable": "string"
}'
Response200
{
  "id": "411486491630370816",
  "created_at": "2024-01-01T00:00:00Z",
  "name": "string",
  "template_id": "411486491630370816",
  "type": "invalid",
  "updated_at": "2024-01-01T00:00:00Z",
  "value": "string",
  "variable": "string",
  "webstore_id": "411486491630370816"
}

Delete template variable

DELETEhttps://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/variables/{templateVariableId}

Permanently deletes a template variable.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the webstore belongs to.
templateIdFlakeIdRequired
The ID of the template.
templateVariableIdFlakeIdRequired
The ID of the template variable.
Response
204No Content

Failed requests return a PayNowError body. See the error response guide.

curl -X DELETE "https://api.paynow.gg/v1/stores/{storeId}/webstore/templates/{templateId}/variables/{templateVariableId}" \
  -H "Authorization: APIKey TOKEN"