← All tool references

Generators · not_available

Coupon Code Generator

Generate batches of readable coupon codes.

Open public tool

Overview

Category
Generators
API mode
not_available
Processing
client-side
Privacy
no-data-stored

Public descriptor

The descriptor is available without an API key and supplies this tool’s metadata, schemas, modes, and examples.

GET /api/v1/tools/coupon-code-generator

View this descriptor as JSON

Execute availability

This tool is documented as a browser capability. Its execute route does not produce a server-side result; when execution is enabled, it responds with browser_interaction_required and points callers to the public tool page.

POST /api/v1/tools/coupon-code-generator/execute

Authentication is not issued during the preview. A bearer API key is planned for execution after launch.

Input schema

object object; additional properties are not accepted.

prefix · string · required
Enter prefix.
random_length · number · required
Enter random portion length.
quantity · number · required
Enter quantity.
separator · string · required
Enter separator. Accepted values: -, _, none.
{
    "type": "object",
    "properties": {
        "prefix": {
            "type": "string",
            "description": "Enter prefix."
        },
        "random_length": {
            "type": "number",
            "description": "Enter random portion length.",
            "minimum": 4,
            "maximum": 24
        },
        "quantity": {
            "type": "number",
            "description": "Enter quantity.",
            "minimum": 1,
            "maximum": 100
        },
        "separator": {
            "type": "string",
            "description": "Enter separator.",
            "enum": [
                "-",
                "_",
                "none"
            ]
        }
    },
    "required": [
        "prefix",
        "random_length",
        "quantity",
        "separator"
    ],
    "additionalProperties": false
}

Output schema

On a successful execution, schema values appear in data.result.values.

codes · array
Coupon codes produced by the tool.
quantity · number
Codes generated produced by the tool.
alphabet_size · number
Alphabet size produced by the tool.
{
    "type": "object",
    "properties": {
        "codes": {
            "type": "array",
            "description": "Coupon codes produced by the tool."
        },
        "quantity": {
            "type": "number",
            "description": "Codes generated produced by the tool."
        },
        "alphabet_size": {
            "type": "number",
            "description": "Alphabet size produced by the tool."
        }
    },
    "additionalProperties": false
}

Coupon Code Generator worked example

The request body follows the published input schema. The response below shows the success-envelope shape returned after execution is available.

curl -X POST "https://utilitypages.org/api/v1/tools/coupon-code-generator/execute" \
  -H "Content-Type: application/json" \
  -d '{
    "prefix": "SAVE",
    "random_length": 8,
    "quantity": 10,
    "separator": "-"
}'
{
    "ok": true,
    "data": {
        "slug": "coupon-code-generator",
        "result": {
            "values": {
                "codes": [
                    {
                        "number": 1,
                        "code": "SAVE-W47KBD2C"
                    },
                    {
                        "number": 2,
                        "code": "SAVE-CYRG463T"
                    },
                    {
                        "number": 3,
                        "code": "SAVE-V5RH5HA3"
                    },
                    {
                        "number": 4,
                        "code": "SAVE-2REK37MB"
                    },
                    {
                        "number": 5,
                        "code": "SAVE-B6KZCKBY"
                    },
                    {
                        "number": 6,
                        "code": "SAVE-6FHXXQN6"
                    },
                    {
                        "number": 7,
                        "code": "SAVE-AAHPG7AQ"
                    },
                    {
                        "number": 8,
                        "code": "SAVE-7WWJJUDR"
                    }
                ],
                "quantity": 10,
                "alphabet_size": 32
            },
            "display": {
                "display": "[{\"number\":1,\"code\":\"SAVE-W47KBD2C\"},{\"number\":2,\"code\":\"SAVE-CYRG463T\"},{\"number\":3,\"code\":\"SAVE-V5RH5HA3\"},{\"number\":4,\"code\":\"SAVE-2REK37MB\"},{\"number\":5,\"code\":\"SAVE-B6KZCKBY\"},{\"number\":6,\"code\":\"SAVE-6FHXXQN6\"},{\"number\":7,\"code\":\"SAVE-AAHPG7AQ\"},{\"number\":8,\"code\":\"SAVE-7WWJJUDR\"}]"
            },
            "warnings": [],
            "assumptions": [],
            "steps": []
        }
    },
    "meta": [],
    "request_id": "req_example_123"
}

Errors

api_not_launched · 503
Returned by the current launch gate for every execute request.
invalid_json · 400
Returned when an enabled execute request does not contain valid JSON.
validation_failed · 422
Returned when a request does not satisfy the input schema.
browser_interaction_required · 422
Returned for browser capability tools instead of inventing a server-side result.
tool_not_found · 404
Returned when a requested descriptor slug does not exist.
execution_failed · 503
Returned when an enabled server-side execution cannot complete.