Create Deal


                https://api.ocamba.com/v1/hood/deals
            

Creates a new Deal object


Name
Description
base_pricenumber (decimal)required
Describes the base price that is set for the deal. Priority depends on field base_price_priority. Value must be between 0.01 and 10000.


Example: 2.24

base_price_priorityboolean
Describes if prices set in base_price or country_price have priority over the one sent as a query parameter.


Example: true

Possible values: true | false

budgetnumber (integer)
Value representing maximum total value a deal should earn. Minimum value 0, maximum 1000000.


Example: 2321

clickthroughbooleanrequired
Describes if a click event is required for a deal to be attributed.


Example: true

Possible values: true | false

country_priceobject

Name
Description
keystring
Country code supported by the Ocamba platform (ISO 3166-1, 2 letter country codes).


Example: DE

valuenumber (decimal)
Value of price per country, minimum 0.1, maximum 10000.


Example: 12.53

descriptionstring
Deal Description


Example: The description of a Deal has the max of 2000 characters

device_priceobject

Name
Description
keystring
Device type, possible values are mobile and desktop.


Example: desktop

valuenumber (decimal)
Value of price per device, minimum 0, maximum 100.


Example: 12.53

event_priceobject

Name
Description
keystring
Event name, maximum length 32 characters.


Example: click

valuenumber (decimal)
Value of price per event, minimum 0.1, maximum 10000.


Example: 12.53

frequency_capobject

Name
Description
max_valuenumber (int)
Describes the maximum number of time units that frequency cap will account for. Minimum 0, maximum 1.


Example: 12

per_unitstring
Describes the time unit used for frequency capping.


Example: day

Possible values: hour | day | week | month | session | campaign

namestringrequired
Deal name, maximum 100 characters


Example: Example Name

partner_idstringrequired
Valid partner id, supported by the Ocamba platform.


Example: 1000232

performance_conditionsobject

Name
Description
keystring
Event name, maximum length 32 characters.


Example: click

valuenumber (integer)
Value of score per event, minimum 1, maximum 100.


Example: 12

statusstringrequired
Deal Status can be active or inactive. Default value is 'active'.


Example: active

Possible values: active | inactive

structurestringrequired
Deal payment structure. Describes the basis on which the price is calculated.


Example: cpi

Possible values: cpc | cpm | cpi | cpl | cpe | cps | cpv | performance-based | subscription-based | flat-fee | hybrid

time_windownumber (integer)required
Describes how much time in seconds can pass between a click event and attribution, every attribution after that time window will be marked as spam. Value of 0 means there is no limit. Minimum value 0, maximum value 2592000.


Example: 3600

Possible values: 3600 | 21600 | 43200 | 86400 | 604800 | 1209600 | 2592000 | 5184000 | 7776000

typestringrequired
Deal type, can be ssp or dsp.


Example: ssp

Possible values: ssp | dsp

unique_conversionboolean
Toggles check if deal is unique. Uniqueness is determined by reference provided by user when attributing deal. Default value false.


Example: true

201 - Created
Arrow
Name
Description
base_pricenumber (decimal)required
Describes the base price that is set for the deal. Priority depends on field base_price_priority. Value must be between 0.01 and 10000.


Example: 2.24

base_price_priorityboolean
Describes if prices set in base_price or country_price have priority over the one sent as a query parameter.


Example: true

Possible values: true | false

budgetnumber (integer)
Value representing maximum total value a deal should earn. Minimum value 0, maximum 1000000.


Example: 2321

clickthroughbooleanrequired
Describes if a click event is required for a deal to be attributed.


Example: true

Possible values: true | false

country_priceobject

Name
Description
keystring
Country code supported by the Ocamba platform (ISO 3166-1, 2 letter country codes).


Example: DE

valuenumber (decimal)
Value of price per country, minimum 0.1, maximum 10000.


Example: 12.53

descriptionstring
Deal Description


Example: The description of a Deal has the max of 2000 characters

device_priceobject

Name
Description
keystring
Device type, possible values are mobile and desktop.


Example: desktop

valuenumber (decimal)
Value of price per device, minimum 0, maximum 100.


Example: 12.53

event_priceobject

Name
Description
keystring
Event name, maximum length 32 characters.


Example: click

valuenumber (decimal)
Value of price per event, minimum 0.1, maximum 10000.


Example: 12.53

frequency_capobject

Name
Description
max_valuenumber (int)
Describes the maximum number of time units that frequency cap will account for. Minimum 0, maximum 1.


Example: 12

per_unitstring
Describes the time unit used for frequency capping.


Example: day

Possible values: hour | day | week | month | session | campaign

namestringrequired
Deal name, maximum 100 characters


Example: Example Name

partner_idstringrequired
Valid partner id, supported by the Ocamba platform.


Example: 1000232

performance_conditionsobject

Name
Description
keystring
Event name, maximum length 32 characters.


Example: click

valuenumber (integer)
Value of score per event, minimum 1, maximum 100.


Example: 12

statusstringrequired
Deal Status can be active or inactive. Default value is 'active'.


Example: active

Possible values: active | inactive

structurestringrequired
Deal payment structure. Describes the basis on which the price is calculated.


Example: cpi

Possible values: cpc | cpm | cpi | cpl | cpe | cps | cpv | performance-based | subscription-based | flat-fee | hybrid

time_windownumber (integer)required
Describes how much time in seconds can pass between a click event and attribution, every attribution after that time window will be marked as spam. Value of 0 means there is no limit. Minimum value 0, maximum value 2592000.


Example: 3600

Possible values: 3600 | 21600 | 43200 | 86400 | 604800 | 1209600 | 2592000 | 5184000 | 7776000

typestringrequired
Deal type, can be ssp or dsp.


Example: ssp

Possible values: ssp | dsp

unique_conversionboolean
Toggles check if deal is unique. Uniqueness is determined by reference provided by user when attributing deal. Default value false.


Example: true

400 - Bad Request
Arrow
Name
Description
codeinteger
Http response status code.


Example: 400

messagestring
The human readable message that describes how to deal with error.


Example: The request body is not valid.

titlestring
The error title.


Example: Bad request.

trace_idstring
Error trace id.


Example: 99a84211-f73d-4ff8-acdf-eb3e06bb9d62

500 - Internal Server Error
Arrow
Name
Description
codeinteger
Http response status code.


Example: 500

messagestring
The human readable message that describes how to deal with error.


Example: Internal server error.

titlestring
The error title.


Example: Internal server error.
200 Arrow
{
  "name": "example deal name",
  "description": "example description",
  "type": "dsp",
  "structure": "cpa",
  "partner_id": "1000232",
  "frequency_cap": {
    "max_value": 12,
    "per_unit": "week"
  },
  "time_window": 3600,
  "status": "active",
  "effective_status": "active",
  "base_price": 1.12,
  "clickthrough": false,
  "system": 0,
  "base_price_priority": true,
  "country_price": {
      "RS": 12.11
  },
  "device_price": {
      "desktop": 2.11,
      "mobile": 1.55
  },
  "event_price": {
      "click": 1.15,
      "view": 0.1
  },
  "unique_conversion": true,
  "total_spend_cap": 12551
}
201 Arrow
{
    "id": "1000251",
    "company_id": "6197120",
    "name": "example deal name",
    "description": "example description",
    "type": "dsp",
    "structure": "cpa",
    "partner_id": "1000232",
    "status": "active",
    "effective_status": "active",
    "postback": "https://dev-t.ocmhood.com/conv?click_id={OCMH_CLICK_ID}&price={PRICE}&currency={CURRENCY}&ref={REFERENCE}&event={EVENT}&device={DEVICE}&session_id={SESSION_ID}",
    "frequency_cap": {
      "max_value": 12,
      "per_unit": "week"
    },
    "clickthrough": false,
    "time_window": 3600,
    "country_price": {
        "RS": 12.11
    },
    "device_price": {
        "desktop": 2.11,
        "mobile": 1.55
    },
    "event_price": {
        "click": 1.15,
        "view": 0.1
    },
    "unique_conversion": true,
    "total_spend_cap": 12551
    "base_price": 1.12,
    "system": 0,
    "base_price_priority": true,
    "create_time": "2024-07-18 11:27:55",
    "update_time": "2024-07-18 11:27:55"
}
{
  "id": "13472",
  "company_id": "6197120",
  "partner_id": "1000232",
  "name": "Example Name",
  "description": "The description of a Deal has the max of 2000 characters",
  "status": "active",
  "effective_status": "suspended",
  "type": "ssp",
  "structure": "cpi",
  "postback": "https://ocm.com/conv?click_id={OCMH_CLICK_ID}&price={PRICE}&currency={CURRENCY}",
  "frequency_cap": {
    "max_value": 12,
    "per_unit": "day"
  },
  "clickthrough": true,
  "time_window": 3600,
  "base_price": 2.24,
  "country_price": {
    "key": "DE",
    "value": 12.53
  },
  "event_price": {
    "key": "click",
    "value": 12.53
  },
  "device_price": {
    "key": "desktop",
    "value": 12.53
  },
  "base_price_priority": true,
  "budget": 2321,
  "unique_conversion": true,
  "performance_conditions": {
    "key": "click",
    "value": 12
  },
  "system": 1,
  "stats": {
    "roi": 229.2,
    "revenue": 34.1,
    "cost": 11.1
  },
  "archived": 1,
  "create_time": "2021-10-29 15:40:10",
  "update_time": "2021-10-29 15:40:10"
}
{
  "code": 400,
  "title": "Bad request.",
  "message": "The request body is not valid.",
  "trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
{
  "code": 500,
  "title": "Internal server error.",
  "message": "Internal server error."
}