API documentation  POST /offers/create

Create a new offer in the system by providing detailed offer information through a POST request.

POST https://demo.trafficmanager.com/api/v1/offers/create

This endpoint allows the creation of new offers, accepting a wide range of parameters to specify the details of the offer being created.

Authentication:

The request must be authenticated with the following HTTP headers:
  • x-api-key: Your API key, found in the Security page
  • x-user-id: Your User ID, found in the Security page
If the HTTP headers are not passed, but you are logged in to the TrafficManager panel, the current user is used instead (so you can easily preview or download the data using your browser)

POST Body Parameters:

The request body must be a JSON object with the following structure, including detailed specifications of the offer to be created:

{
    "offer": {
        "status": [numeric, required],
        "visibility": [numeric, required],
        "payout": [string, required],
        "payoutMode": [numeric, required],
        "mainCategory": {
            "name": [string, required, "Main category name"],
            "categories": [array, required, "Subcategories related to the main category"]
        },
        "name": [string, required],
        "allowMultipleConversions": [boolean, required],
        "description": [string, required]
        // To see a more detailed list of parameters, go to marketplace and export an offer in json format
        // Additional parameters as needed
    },
    "importAllowedBlockedUsers": [boolean, optional] // If true, the offer will be imported with the allowed/blocked users provided in the allowedUsers and blockerUsers arrays. Default false
    "importCustomPayouts": [boolean, optional] // If true, the offer will be imported with the custom payouts provided in the customPayouts array. Default false
}

Note: This JSON structure is a simplified example. Replace placeholder text with actual data for the offer being created.

Success Response:

{
    "status": 201,
    "message": "Operation successful",
    "offer": {
        "id": 100,
        "status": 1,
        "visibility": 1,
        "payout": "1.00",
        "mainCategory": {
            "name": "Test",
            "categories": [
                {"name": "Mixed (All Categories)"},
                {"name": "Test one"},
                {"name": "Example test"},
                // More categories as defined in the request
            ]
        },
        "name": "offer test",
        "allowMultipleConversions": true,
        "description": "Test description",
        // More offer details as defined in the request
        "landingPages": [
            {
                "id": 100,
                "name": "test",
                "url": "https://local-offers.trafficmanager.dev/forms/?clickid={clickid}&formid=9f719127-b40f-4e0e-a792-5f01565bd4ce",
                "description": "Autogenerated based on offer forms."
            }
        ],
        "settings": {
            "leadApi": "{\"url\":\"https:\\/\\/local-offers.trafficmanager.dev\\/forms\\/api\\/\",\"params\":{\"uid\":\"ab0d1b6c-0b0b-404d-a668-5acf6682115a\",\"key\":\"7e5a9e027dccb44dc0623ee11070924afb4f4c95\"}}"
            // Additional settings as defined in the request
        }
    }
}

This response indicates that the offer has been successfully created, detailing the properties of the newly created offer, including its ID, status, and other relevant details.

Error Response:

{
    "status": [error code],
    "message": [error message]
}

Explains why the request failed, such as missing required fields, authentication issues, or invalid parameters.