Create Partner

Create Partner

POST https://api.ocamba.com/v1/hood/partners
Creates a new Partner object

Note
The billing_address and payment_terms are optional until you fill out at least one field. Once you do, all fields will become required.

Rate limits:

  • Burst: 10/s
  • Steady: 150/m

Request schema

body

Response schemas

curl -X POST \
 "https://api.ocamba.com/v1/hood/partners" \
  -H "Authorization: Bearer {TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
  "manager_ids": [
    "1000220"
  ],
  "name": "test ",
  "description": "test description",
  "type": [
    "publisher"
  ],
  "status": "active",
  "payment_terms": {
    "payment_frequency": "monthly",
    "payment_method": "card",
    "net_terms": "net30",
    "currency_code": "usd"
  },
  "billing_address": {
    "street": "711 Cambridge Drive",
    "city": "New Port Richey",
    "post_code": "34653",
    "country": "US"
  },
  "contacts": [
    {
      "type": "mobile",
      "value": "+38160333444"
    }
  ]
}'
const url = 'https://api.ocamba.com/v1/hood/partners';
const options = {
  method: 'POST',
  headers: {
    Authorization: "Bearer {TOKEN}",
    'Content-Type': "application/json"
  },
  body: JSON.stringify(
    {
      "manager_ids": [
        "1000220"
      ],
      "name": "test ",
      "description": "test description",
      "type": [
        "publisher"
      ],
      "status": "active",
      "payment_terms": {
        "payment_frequency": "monthly",
        "payment_method": "card",
        "net_terms": "net30",
        "currency_code": "usd"
      },
      "billing_address": {
        "street": "711 Cambridge Drive",
        "city": "New Port Richey",
        "post_code": "34653",
        "country": "US"
      },
      "contacts": [
        {
          "type": "mobile",
          "value": "+38160333444"
        }
      ]
    }
  )
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
$ch = curl_init("https://api.ocamba.com/v1/hood/partners");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
  [
    "manager_ids" => [
      "1000220"
    ],
    "name" => "test ",
    "description" => "test description",
    "type" => [
      "publisher"
    ],
    "status" => "active",
    "payment_terms" => [
      "payment_frequency" => "monthly",
      "payment_method" => "card",
      "net_terms" => "net30",
      "currency_code" => "usd"
    ],
    "billing_address" => [
      "street" => "711 Cambridge Drive",
      "city" => "New Port Richey",
      "post_code" => "34653",
      "country" => "US"
    ],
    "contacts" => [
      [
        "type" => "mobile",
        "value" => "+38160333444"
      ]
    ]
  ]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

201 Created

{
  "id": "1000412",
  "company_id": "6197120",
  "manager_ids": [
    "1000220"
  ],
  "managers": [
    {
      "id": "1000220",
      "name": "Andj",
      "email": "[email protected]",
      "status": "active"
    }
  ],
  "name": "test qa",
  "description": "d",
  "type": [
    "publisher"
  ],
  "status": "inactive",
  "payment_terms": {
    "payment_frequency": "quarterly",
    "payment_method": "card",
    "net_terms": "net90",
    "currency_code": "eur"
  },
  "billing_address": {
    "street": "dddddd",
    "city": "test test",
    "post_code": "56-a",
    "country": "RS"
  },
  "contact": {
    "email": "fIS0C1guzHZ6jxidFyOXbFh47nYMzS3ZhUCvKCpwvfuY3s1G9ofAD8sJyjzdWG9J024HroFNBRDg7LNmHiycjBgeUAJ8S13Crgs@fafa.com",
    "mobile": "+785596522",
    "phone": "+1235165336",
    "sip": "5259oskZYi9sw8",
    "skype": "dfa223ghjk",
    "website": "fsf.com"
  },
  "system": 0
}

400 Bad Request

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

500 Internal Server Error

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