🌐REST API

DevPayr provides a robust REST API that allows your backend systems to interact directly with projects, licenses, domains, payments, and injectables without relying on an SDK. This is ideal for teams that want full control, custom integrations, or need to connect DevPayr to existing infrastructure such as billing systems, CRMs, CI/CD pipelines, or internal admin tools.

The REST API is stateless, JSON-based, and secured using API Keys and/or License Keys, depending on the operation being performed.

Base URL

All REST API requests must be sent to the following base URL:

https://api.devpayr.dev/api/v1/

You should always define the base URL explicitly in your integration. DevPayr may introduce newer API versions or project-specific endpoints in the future, and setting the base URL ensures your integration remains stable and predictable.

Request & Response Format

All API requests and responses use JSON.

You must include the following header in all requests:

Accept: application/json

For requests that send data (POST, PUT, PATCH), also include:

Content-Type: application/json

All successful responses return structured JSON. Error responses follow the same format and include an appropriate HTTP status code.

Authentication Overview

DevPayr supports two authentication modes, depending on what you are trying to do.

1. API Key Authentication (Backend / Management)

API Keys are used to manage DevPayr resources such as projects, licenses, domains, injectables, and payment status.

Use this mode when you want to:

  • Create or revoke licenses

  • Manage domains

  • Upload or retrieve injectables

  • Toggle project payment status

  • Automate workflows from your backend

2. License Key Authentication (Runtime Validation)

License Keys are used at runtime to validate whether a copy of your software is allowed to run.

Use this mode when you want to:

  • Check if a license is valid

  • Confirm payment status

  • Retrieve injectables conditionally

Required Headers

API Key Authentication

License Key Authentication


About the X-Devpayr-Domain Header

The X-Devpayr-Domain header is mandatory for all raw HTTP (REST) requests.

It represents the runtime identifier of where the software is running. While it is commonly a domain name, it is not limited to domains.

It can be:

  • A website domain (example.com)

  • A subdomain (client.example.com)

  • A device fingerprint

  • A machine hash

  • An installation ID

  • Any stable identifier you use to represent a unique runtime instance

DevPayr uses this value to enforce domain limits, device limits, environment rules, and usage tracking.

Important: SDKs can automatically attach this header for you, but when using the REST API directly, you must always provide it explicitly.

Authentication Examples (cURL)

API Key Example

License Key Example

Core Resource Categories

The REST API is organized around the following core resources:

  • Projects

  • Project Domains

  • Licenses

  • Injectables

  • Payment Status

  • Webhooks (read-only via logs)

Each resource follows predictable REST conventions.

Projects

Projects represent the software, application, product, or system you want to protect.

List Projects

Returns all projects accessible by the API Key.

Create a Project

Creates a new project under the authenticated account.

Retrieve a Project

Returns details for a specific project.

Update a Project

Updates project metadata, redirect URLs, or webhook settings.

Delete a Project

Deletes a project permanently.

Project Domains

Domains are added after a project is created and are used to control where licenses may run.

List Project Domains

Add a Domain

Domains can be assigned environments such as development, staging, or production.

Update a Domain

Delete a Domain

Licenses

Licenses represent permission for a user, client, or system to run your software.

List Licenses for a Project

Create a License

View a License

Revoke a License

Reactivate a License

Delete a License

Payment Status Checks

DevPayr allows you to check whether a project or domain has been marked as paid.

Check Payment Status via API Key

This is typically used by backend systems.

Check Payment Status via License Key

This is typically used at runtime by applications.

Both endpoints can optionally include injectables if the project or domain is paid.

Injectables (Advanced)

Injectables allow you to deliver dynamic scripts, files, or content only when a project or license is valid and paid.

List Injectables

Create an Injectable

Update an Injectable

Delete an Injectable

Injectables can be streamed dynamically at runtime and should not be permanently written to disk in production systems.

Rate Limiting

All REST API endpoints are rate-limited to protect the platform.

If you exceed the limit, the API will return:

You should implement retries with backoff in production integrations.

Error Handling

DevPayr uses standard HTTP status codes:

  • 200 β€” Success

  • 400 β€” Bad request or missing context

  • 401 β€” Missing authentication

  • 403 β€” Unauthorized or access denied

  • 404 β€” Resource not found

  • 422 β€” Validation error

  • 429 β€” Rate limit exceeded

  • 500 β€” Internal server error

Error responses always return JSON with a clear message field.

When to Use REST API vs SDK

Use the REST API when:

  • You want full control over requests

  • You are integrating from a non-supported language

  • You are building custom automation or tooling

  • You already have a mature backend system

Use an SDK when:

  • You want faster integration

  • You want automatic header handling

  • You want built-in helpers for injectables and validation

Both options are fully supported.

Last updated