API Reference

Our API is Semi-Restful. This means that we use the HTTP verbs to perform actions on our API. We also use the HTTP status codes to return the appropriate response.

The current version of our API is V1.
API versioning uses Semantic Versioning, meaning there are no breaking changes between minor and patch releases.

- All requests to the API must be made over HTTPS.
- All requests must be made with a valid API key.
- All requests must contain the header

"Accept: application/json"
- Requests without this header will be rejected.

Authentication

You can find your API key by logging into your account and clicking on your name in the top right corner of the UI, and selecting "My Profile" link in the dropdown.

This API Key needs to be sent as a bearer token in the Authorization header of your request. This is "Bearer {api_token}". Please take note of the space between "Bearer" and the token.

Note: Only the super admin of your team/company is able to make an API Key.

GET Heartbeat

GET /api/heartbeat

This endpoint is used to check if the API is up and running. It returns a 200 status code if the API is up and running.

Response

 {
	 "status": "success",
	 "message": "Licenex API is up and running!"
 }

Products

GET Get Products

GET /api/products/{product_id}

Please be sure to replace the {product_id} with the actual ID of the product you are trying to retrieve. This ID is the Licenex ID and not your applications product ID

Response

 {
    "data": {
        "id": 53,
        "name": "LmSqueezy Gateway",
        "description": "Test Description",
        "price": "12.99"
    }
}
Parameter Description
id The Licenex ID of the product
name The name of the product
description The description of the product
price The price of the product

GET Get All Products

GET /api/products

Response

 {
    "data": [
        {
            "id": 26,
            "name": "et iusto",
            "description": "numquam nesciunt qui laboriosam facilis qui consequatur voluptatem soluta aliquam iusto consequatur aperiam",
            "price": "525.66"
        },
        {
            "id": 29,
            "name": "eaque est debitis",
            "description": "tempora repudiandae sed laboriosam repudiandae ut iure quia voluptatem dignissimos ipsa modi",
            "price": "383.43"
        },
        // ... Additional Products Show Here
    ],
    "links": {
        "first": "https://licenexv3.test/api/products?page=1",
        "last": "https://licenexv3.test/api/products?page=3",
        "prev": null,
        "next": "https://licenexv3.test/api/products?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 3,
        "links": [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "https://licenexv3.test/api/products?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": "https://licenexv3.test/api/products?page=2",
                "label": "Next »",
                "active": false
            }
        ],
        "path": "https://licenexv3.test/api/products",
        "per_page": 25,
        "to": 25,
        "total": 52
    }
 }
Parameter Description
id The Licenex ID of the product
name The name of the product
description The description of the product
price The price of the product
links The API link to the next or previous pages if enough items are present
meta Meta Data about the current request
meta.current_page Current page for the API request
meta.from The record which the current dataset starts from
meta.last_page The last page in the dataset.
meta.links Links you can use for pagination if using UI
meta.per_page Records being displayed per page. Currently fixed at 25.
meta.to The last record in the current dataset being displayed for the page.
meta.total How many records in total there are. This number can be divided by the `per_page` value to get page count.

POST Create Product

POST /api/products/

Request

 {
    "name": "Product Name 1",
    "description": "Test Product 1",
    "price": 10.99
 } 
Parameter Description Required
name The name of the product Yes
description The name of the description Yes
price The price of the product Yes

Response

 {
    "data": {
        "id": 73,
        "name": "Product Name 1",
        "description": "Test Product 1",
        "price": 10.99
    }
}  
Parameter Description
id The Licenex ID of the product
name The name of the product
description The description of the product
price The price of the product

PUT Update Product

PUT /api/products/{product_id}

Please be sure to replace the {product_id} with the actual Licenex ID of the product you wish to update.

Request

 {
    "name": "A different test",
    "description": "A new description",
    "price": 12.99
} 
Parameter Description Required
name The name of the product Yes
description The description of the product Yes
price The price of the product Yes

Response

		 {
	"data": {
		"id": 73,
		"name": "A different test",
		"description": "A new description",
		"price": 12.99
	}
}  
Parameter Description
id The Licenex ID of the product
name The name of the product
description The description of the product
price The price of the product

DELETE Delete Product

DELETE /api/products/{product_id}

Please be sure to replace the {product_id} with the actual Licenex ID of the product you wish to delete.
This method will delete not only the product but all and any licenses already associated with the product.

Response

 {
    "data": {
        "status": "success",
        "message": "Product and associated licenses deleted"
    }
} 

GET Get Customer

GET /api/customers/{customer_id}

Please be sure to replace the {customer_id} with the actual ID of the customer you are trying to retrieve. This ID is the Licenex ID and not your applications customer ID

Response

 {
    "data": {
        "id": 1110,
        "first_name": "Javier",
        "last_name": "O'Reilly",
        "email": "vrowe@example.com",
        "phone": "281.507.1025",
        "created_at": "2023-11-19T15:03:49.000000Z",
        "updated_at": "2024-01-19T20:37:53.000000Z"
    }
 }
Parameter Description
id The Licenex id of the customer
first_name Customers first name
last_name Customers last name
email Customers email address
phone Customers phone number. Format of phone number is not strict and therefore can be different from customer to customer
created_at When the customer was created in Licenex
updated_at When the customer was last updated in Licenex

GET Get All Customers

GET /api/customers

Response

 {
    "data": [
        {
            "id": 1097,
            "first_name": "Carlo",
            "last_name": "Leffler",
            "email": "kadin42@example.org",
            "phone": "+1-680-338-7085",
            "created_at": "2023-10-19T10:05:31.000000Z",
            "updated_at": "2024-01-19T20:37:53.000000Z"
        },
        {
            "id": 1098,
            "first_name": "Benny",
            "last_name": "Renner",
            "email": "salvador67@example.com",
            "phone": "(283) 231-0106",
            "created_at": "2023-10-19T17:57:41.000000Z",
            "updated_at": "2024-01-19T20:37:53.000000Z"
        },
        // ... Additional Customers Here
    ],
    "links": {
        "first": "https://licenexv3.test/api/customers?page=1",
        "last": "https://licenexv3.test/api/customers?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "https://licenexv3.test/api/customers?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next »",
                "active": false
            }
        ],
        "path": "https://licenexv3.test/api/customers",
        "per_page": 25,
        "to": 24,
        "total": 24
    }
}
Parameter Description
id The Licenex ID of the customer
first_name Customers first name
last_name Customers last name
email Customers email address
phone Customers phone number. Format of phone number is not strict and therefore can be different from customer to customer
created_at When the customer was created in Licenex
updated_at When the customer was last updated in Licenex
links The API link to the next or previous pages if enough items are present
meta Meta Data about the current request
meta.current_page Current page for the API request
meta.from The record which the current dataset starts from
meta.last_page The last page in the dataset.
meta.links Links you can use for pagination if using UI
meta.per_page Records being displayed per page. Currently fixed at 25.
meta.to The last record in the current dataset being displayed for the page.
meta.total How many records in total there are. This number can be divided by the `per_page` value to get page count.

POST Create Product

POST /api/products/

Request

 {
    "first_name": "John",
    "last_name": "Smith",
    "email": "john@example.com",
    "phone": "1234567890"
} 
Parameter Description Required
first_name The first name of the customer Yes
last_name The last name of the customer Yes
email The email address of the customer Yes
phone The phone number of the customer as a string. Format not strict.3 Yes

Response

 {
    "data": {
        "id": 1198,
        "first_name": "John",
        "last_name": "Smith",
        "email": "johnn@example.com",
        "phone": "1234567890",
        "created_at": "2024-01-26T13:24:12.000000Z",
        "updated_at": "2024-01-26T13:24:12.000000Z"
    }
}  
Parameter Description
id The Licenex ID of the customer
first_name Customers first name
last_name Customers last name
email Customers email address
phone Customers phone number. Format of phone number is not strict and therefore can be different from customer to customer
created_at When the customer was created in Licenex
updated_at When the customer was last updated in Licenex

PUT Update Customer

PUT /api/customers/{customer_id}

Please be sure to replace the {customer_id} with the actual Licenex ID of the product you wish to update.

Request

 {
    "first_name": "Johnathon",
    "last_name": "Smithson",
    "email": "johnn@example.com",
    "phone": "1234567890"
} 
Parameter Description Required
first_name The first name of the customer Yes
last_name The last name of the customer Yes
email Customers email address Yes
phone Customers phone number. Format of phone number is not strict and therefore can be different from customer to customer Yes

Response

		 {
    "data": {
        "id": 1198,
        "first_name": "Johnathon",
        "last_name": "Smithson",
        "email": "johnn@example.com",
        "phone": "1234567890",
        "created_at": "2024-01-26T13:24:12.000000Z",
        "updated_at": "2024-01-26T13:32:51.000000Z"
    }
}  
Parameter Description
id The Licenex ID of the customer
first_name Customers first name
last_name Customers last name
email Customers email address
phone Customers phone number. Format of phone number is not strict and therefore can be different from customer to customer
created_at When the customer was created in Licenex
updated_at When the customer was last updated in Licenex

DELETE Delete Customer

DELETE /api/customers/{customer_id}

Please be sure to replace the {customer_id} with the actual Licenex ID of the customer you wish to delete.
This method will delete not only the customer but all and any licenses already associated with the customer.

Response

 {
    "data": {
        "status": "success",
        "message": "Customer and associated licenses deleted"
    }
} 

GET Get License

GET /api/licenses/{license_id}

Please be sure to replace the {license_id} with the actual ID of the license you are trying to retrieve. This ID is the Licenex ID and not your applications license ID

Response

 {
    "data": {
        "license": {
            "id": 637,
            "key": "018d237-6ab3712-a1b1-8a3dcd8-1bf5a8b",
            "status": "active",
            "activated_at": "2023-11-04T02:55:02.000000Z",
            "suspended": 0,
            "suspension_datetime": null,
            "suspension_reason": null,
            "expires_at": "2025-05-14T22:47:48.000000Z",
            "product": {
                "name": "eaque est debitis",
                "description": "tempora repudiandae sed laboriosam repudiandae ut iure quia voluptatem dignissimos ipsa modi",
                "price": "383.43"
            },
            "customer": {
                "first_name": "Austen",
                "last_name": "Treutel",
                "email": "hessel.elmo@example.org",
                "phone": "+19299146334"
            }
        }
    }
}}
Parameter Description
license.id The Licenex license id
license.key The license key which should be used to activate applications/software
license.activated_at The time the license was activated
license.suspended The suspension status of the license. 0 = Not Suspended. 1 = Suspended
license.suspension_datetime The date and time the license was or will be suspended
license.suspension_reason (Optional) The reason for the suspension.
license.expires_at The expiration date of the license.
license.product.name The name of the product
license.product.description The description of the product
license.product.price The price of the product
license.customer.first_name Customers first name
license.customer.last_name Customers last name
license.customer.email Customers email address
license.customer.phone Customers phone number. Format of phone number is not strict and therefore can be different from customer to customer

GET Get All Licenses

GET /api/customers

Response

 {
    "data": [
        {
            "id": 3,
            "product_id": 30,
            "customer_id": 1099,
            "key": "018d237-84a06cb-7597-83eec15-1be1874",
            "status": "inactive",
            "activated_at": null,
            "suspended": 0,
            "suspension_datetime": null,
            "suspension_reason": null,
            "expires_at": "2025-01-30T16:21:23.000000Z"
        },
        {
            "id": 36,
            "product_id": 30,
            "customer_id": 1098,
            "key": "018d237-efc1a6c-f240-d6fad14-1be29ee",
            "status": "active",
            "activated_at": "2023-03-19T08:19:59.000000Z",
            "suspended": 0,
            "suspension_datetime": null,
            "suspension_reason": null,
            "expires_at": "2025-04-27T01:31:28.000000Z"
        },
        // ... Additional Licenses Here
    ],
    "links": {
        "first": "https://licenexv3.test/api/licenses?page=1",
        "last": "https://licenexv3.test/api/licenses?page=3",
        "prev": null,
        "next": "https://licenexv3.test/api/licenses?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 3,
        "links": [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "https://licenexv3.test/api/licenses?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": "https://licenexv3.test/api/licenses?page=2",
                "label": "2",
                "active": false
            },
            {
                "url": "https://licenexv3.test/api/licenses?page=3",
                "label": "3",
                "active": false
            },
            {
                "url": "https://licenexv3.test/api/licenses?page=2",
                "label": "Next »",
                "active": false
            }
        ],
        "path": "https://licenexv3.test/api/licenses",
        "per_page": 25,
        "to": 25,
        "total": 60
    }
} 
Parameter Description
id The Licenex license id
key The license key which should be used to activate applications/software
activated_at The time the license was activated
suspended The suspension status of the license. 0 = Not Suspended. 1 = Suspended
suspension_datetime The date and time the license was or will be suspended
suspension_reason (Optional) The reason for the suspension.
expires_at The expiration date of the license.
links The API link to the next or previous pages if enough items are present
meta Meta Data about the current request
meta.current_page Current page for the API request
meta.from The record which the current dataset starts from
meta.last_page The last page in the dataset.
meta.links Links you can use for pagination if using UI
meta.per_page Records being displayed per page. Currently fixed at 25.
meta.to The last record in the current dataset being displayed for the page.
meta.total How many records in total there are. This number can be divided by the `per_page` value to get page count.

POST Create License, Existing User

POST /api/licenses/

Request

 {
    "product_id": 30,
    "customer_id": 1199,
    "license": {
        "activate": true,
        "duration": "year",
        "value":  2
    }
} 
Parameter Description Required
product_id The Licenex ID of the product you would like to assign a license too Yes
customer_id The Licenex ID of the customer you would like the license to be attached too Yes
license.activate Options: true/false. Determines whether the license is activated immediately or not Yes
license.duration Options: day, week, month, year, lifetime. Determines the license length. Complimented by "license.value" Yes
license.value Options: digits between 1 and 31. Determines the license length. Complimented by "license.duration" Yes

Response

 {
    "data": {
        "customer": {
            "id": 1199,
            "first_name": "John",
            "last_name": "Smith",
            "email": "johnny@example.com",
            "phone": "1234567890"
        },
        "product": {
            "id": 30,
            "name": "voluptas blanditiis",
            "description": "consectetur ratione quidem deserunt in nostrum et dicta nihil animi repellat laudantium",
            "license": {
                "id": 1011,
                "key": "018d463-1f0ff6a-86e6-5836c32-caa8e6b",
                "status": "active",
                "activated_at": "2024-01-26T14:46:37.000000Z",
                "expires_at": "2024-02-02T14:46:37.000000Z"
            }
        }
    }
}  
Parameter Description
customer.id The Licenex ID of the customer
customer.first_name Customers first name
customer.last_name Customers last name
customer.email Customers email address
customer.phone Customers phone number. Format of phone number is not strict and therefore can be different from customer to customer
product.id The Licenex ID of the product
product.name The products name
product.description Description of the product
license.id The Licenex ID of the license
license.key The license key that is used to activate software/apps
license.status Status of the license. Can be: activated, expired, suspended, inactive
license.activated_at When the license was activated
license.expires_at Expiration date of the License

PUT Activate License

PUT /api/licenses/acivate/{license_id}

Please be sure to replace the {license_id} with the actual Licenex ID of the license you wish to update.

Response

		 {
    "data": {
        "license": {
            "id": 1011,
            "key": "018d463-1f0ff6a-86e6-5836c32-caa8e6b",
            "status": "active",
            "activated_at": "2024-01-26T15:21:12.000000Z",
            "suspended": 0,
            "suspension_datetime": null,
            "suspension_reason": null,
            "expires_at": "2024-02-02T14:46:37.000000Z",
            "product": {
                "name": "voluptas blanditiis",
                "description": "consectetur ratione quidem deserunt in nostrum et dicta nihil animi repellat laudantium",
                "price": "280.90"
            },
            "customer": {
                "first_name": "John",
                "last_name": "Smith",
                "email": "johnny@example.com",
                "phone": "1234567890"
            }
        }
    }
}  
Parameter Description
license.id The Licenex ID of the license
license.key The license key that is used to activate software/apps
license.status Status of the license. Can be: activated, expired, suspended, inactive
license.activated_at When the license was activated
license.suspended Whether the license is currently suspended or not
license.suspension_datetime The date and time the license will be or was suspended
license.suspension_reason Optional reason
license.expires_at Expiration date of the License
id The Licenex ID of the customer
product.name Customers first name
product.description Customers last name
product.price Customers email address
customer.first_name Customers first name
customer.last_name Customers last name
customer.email Customers email address
customer.phone Customers phone number. Format of phone number is not strict and therefore can be different from customer to customer

PUT Extend License

PUT /api/licenses/extend/{license_id}

Request

 {
    "value": 3,
    "duration": "month"
} 
Parameter Description Required
value Options are integer between 1 and 31. Yes
duration Options: day, week, month, year, lifetime. Compliments value above. E.g. 3 day, 3 week, etc... Yes

Response

		 {
    "data": {
        "license": {
            "id": 1011,
            "key": "018d463-1f0ff6a-86e6-5836c32-caa8e6b",
            "status": "active",
            "activated_at": "2024-01-26T15:21:12.000000Z",
            "suspended": 0,
            "suspension_datetime": null,
            "suspension_reason": null,
            "expires_at": "2024-08-02T14:46:37.000000Z",
            "product": {
                "name": "voluptas blanditiis",
                "description": "consectetur ratione quidem deserunt in nostrum et dicta nihil animi repellat laudantium",
                "price": "280.90"
            },
            "customer": {
                "first_name": "John",
                "last_name": "Smith",
                "email": "johnny@example.com",
                "phone": "1234567890"
            }
        }
    }
}  
Parameter Description
license.id The Licenex ID of the license
license.key The license key that is used to activate software/apps
license.status Status of the license. Can be: activated, expired, suspended, inactive
license.activated_at When the license was activated
license.suspended Whether the license is currently suspended or not
license.suspension_datetime The date and time the license will be or was suspended
license.suspension_reason Optional reason
license.expires_at Expiration date of the License
id The Licenex ID of the customer
product.name Customers first name
product.description Customers last name
product.price Customers email address
customer.first_name Customers first name
customer.last_name Customers last name
customer.email Customers email address
customer.phone Customers phone number. Format of phone number is not strict and therefore can be different from customer to customer

PUT Suspend License

PUT /api/licenses/suspend/{license_id}

Please be sure to replace the {license_id} with the actual Licenex ID of the license you wish to update.

Request

 {
    "suspend": "datetime",
    "datetime": "2024-01-30 00:00:00",
    "reason": "Unpaid"
} 
Parameter Description Required
suspend Options: immediately or datetime. datetime will suspend the license at a time in the future. Yes
datetime The date/time in YYYY-MM-DD HH-MM-SS format. Must be a future date/time from the moment of the request Yes if suspend is "datetime"
reason: Customers email address Yes
phone Customers phone number. Format of phone number is not strict and therefore can be different from customer to customer Yes

Response

Response if "datetime" is used:
		 {
    "data": {
        "id": 1011,
        "product_id": 30,
        "customer_id": 1199,
        "key": "018d463-1f0ff6a-86e6-5836c32-caa8e6b",
        "status": "active",
        "activated_at": "2024-01-26T15:21:12.000000Z",
        "suspended": false,
        "suspension_datetime": "2024-01-30 00:00:00",
        "suspension_reason": "Unpaid",
        "expires_at": "2024-08-02T14:46:37.000000Z"
    }
}
		 
Response if "immediately" is used:
		 {
    "data": {
        "id": 1011,
        "product_id": 30,
        "customer_id": 1199,
        "key": "018d463-1f0ff6a-86e6-5836c32-caa8e6b",
        "status": "suspended",
        "activated_at": "2024-01-26T15:21:12.000000Z",
        "suspended": true,
        "suspension_datetime": "2024-01-26T16:38:29.933478Z",
        "suspension_reason": "Unpaid",
        "expires_at": "2024-08-02T14:46:37.000000Z"
    }
}
		 
Parameter Description
id The Licenex ID of the License
product_id The Licenex ID of the Product associated with the license
customer_id The Licenex Customers ID the license is associated with
key The license key
status When "datetime" is used, this may remain as "Active". If "immediately" is selected, this will show "suspended"
activated_at The datetime the license was activated at
suspended true/false. Indicates if license is suspended
suspension_datetime The datetime the license was or will be suspended
suspension_reason Reason for the suspension. Optional.
expires_at datetime the license expires at,

PUT Reinstate License

PUT /api/licenses/reinstate/{license_id}

Please be sure to replace the {license_id} with the actual Licenex ID of the license you wish to update.

Response

		{
    "data": {
        "id": 1011,
        "product_id": 30,
        "customer_id": 1199,
        "key": "018d463-1f0ff6a-86e6-5836c32-caa8e6b",
        "status": "active",
        "activated_at": "2024-01-26T15:21:12.000000Z",
        "suspended": false,
        "suspension_datetime": null,
        "suspension_reason": null,
        "expires_at": "2024-08-02T14:46:37.000000Z"
    }
}  
Parameter Description
id The Licenex ID of the License
product_id The Licenex ID of the Product associated with the license
customer_id The Licenex Customers ID the license is associated with
key The license key
status When "datetime" is used, this may remain as "Active". If "immediately" is selected, this will show "suspended"
activated_at The datetime the license was activated at
suspended true/false. Indicates if license is suspended
suspension_datetime The datetime the license was or will be suspended
suspension_reason Reason for the suspension. Optional.
expires_at datetime the license expires at,

DELETE Delete License

DELETE /api/licenses/{license_id}

Please be sure to replace the {license_id} with the actual license id of the license.

Response

 {
    "data": {
        "status": "success",
        "message": "License deleted successfully"
    }
}