POST
/
suppliers
/
{id}
/
relationships
cURL
curl --request POST \
  --url https://api.daraa.io/suppliers/{id}/relationships \
  --header 'Content-Type: application/json' \
  --data '{
  "id": "<string>",
  "supplierId": "<string>",
  "merchantId": "<string>",
  "relationshipType": "primary",
  "contractStartDate": "2023-12-25",
  "contractEndDate": "2023-12-25",
  "discountRate": 123,
  "isActive": true,
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}'
{
  "identifiers": [
    {}
  ],
  "generatedMaps": [
    {}
  ],
  "raw": "<any>"
}

Path Parameters

id
string
required

Body

application/json
id
string
required

Unique identifier for the relationship

supplierId
string
required

ID of the supplier

merchantId
string
required

ID of the merchant/brand

relationshipType
enum<string>
required

Type of relationship

Available options:
primary,
secondary,
backup,
exclusive
isActive
boolean
required

Whether relationship is active

contractStartDate
string<date>

Contract start date

contractEndDate
string<date>

Contract end date

discountRate
number

Discount rate (0-1)

createdAt
string<date-time>
updatedAt
string<date-time>

Response

200 - application/json

Ok

Result object returned by InsertQueryBuilder execution.

identifiers
object[]
required

Contains inserted entity id. Has entity-like structure (not just column database name and values).

generatedMaps
object[]
required

Generated values returned by a database. Has entity-like structure (not just column database name and values).

raw
any
required

Raw SQL result returned by executed query.