Create Deal

Create Deal

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

Creates a new Deal object

Rate limits:

Burst: 10/s
Steady: 150/m

Request schema

body

Response schemas

POST https://api.ocamba.com/v1/hood/deals HTTP/1.1
Host: api.ocamba.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
{
  "partner_id": 1000232,
  "name": "Example Name",
  "description": "The description of a Deal has the max of 2000 characters",
  "status": "active",
  "type": "ssp",
  "structure": "cpi",
  "frequency_cap": {},
  "clickthrough": true,
  "time_window": 3600,
  "base_price": 2.24,
  "country_price": {},
  "event_price": {},
  "device_price": {},
  "base_price_priority": true,
  "budget": 2321,
  "unique_conversion": true,
  "performance_conditions": {}
}
curl -X POST "https://api.ocamba.com/v1/hood/deals" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"partner_id":1000232,"name":"Example Name","description":"The description of a Deal has the max of 2000 characters","status":"active","type":"ssp","structure":"cpi","frequency_cap":{},"clickthrough":true,"time_window":3600,"base_price":2.24,"country_price":{},"event_price":{},"device_price":{},"base_price_priority":true,"budget":2321,"unique_conversion":true,"performance_conditions":{}}'
fetch("https://api.ocamba.com/v1/hood/deals", {
  method: "POST",
  headers: { Authorization: `Bearer ${TOKEN}`, "Content-Type": "application/json" },
  body: JSON.stringify(
    {
      "partner_id": 1000232,
      "name": "Example Name",
      "description": "The description of a Deal has the max of 2000 characters",
      "status": "active",
      "type": "ssp",
      "structure": "cpi",
      "frequency_cap": {},
      "clickthrough": true,
      "time_window": 3600,
      "base_price": 2.24,
      "country_price": {},
      "event_price": {},
      "device_price": {},
      "base_price_priority": true,
      "budget": 2321,
      "unique_conversion": true,
      "performance_conditions": {}
    }
  )
}).then(r => r.json());
$ch = curl_init("https://api.ocamba.com/v1/hood/deals");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer $token",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
  [
    "partner_id" => 1000232,
    "name" => "Example Name",
    "description" => "The description of a Deal has the max of 2000 characters",
    "status" => "active",
    "type" => "ssp",
    "structure" => "cpi",
    "frequency_cap" => [],
    "clickthrough" => true,
    "time_window" => 3600,
    "base_price" => 2.24,
    "country_price" => [],
    "event_price" => [],
    "device_price" => [],
    "base_price_priority" => true,
    "budget" => 2321,
    "unique_conversion" => true,
    "performance_conditions" => []
  ]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

201 Created

HTTP/1.1 201 Created
Content-Type: application/json

{
  "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"
}

400 Bad Request

HTTP/1.1 400 Bad Request
Content-Type: application/json

{
  "code": 400,
  "title": "Bad request.",
  "message": "The request body is not valid.",
  "trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}

500 Internal Server Error

HTTP/1.1 500 Internal Server Error
Content-Type: application/json

{
  "code": 500,
  "title": "Internal server error.",
  "trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
Responses