PATCH /product_pitches/:id/assign_affiliate
Assign affiliate to product pitch
Path parameters
-
ID of the resource to fetch
Body Required
-
coupon_code string
PATCH /product_pitches/{id}/assign_affiliate
curl \
-X PATCH https://api.cosmily.com/api/v1/product_pitches/{id}/assign_affiliate \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"affiliate_url":"string","coupon_code":"string"}'
Request example
{
"affiliate_url": "string",
"coupon_code": "string"
}
Request examples
{
"affiliate_url": "string",
"coupon_code": "string"
}
Response examples (201)
{
"data": [
{
"id": 1,
"product_id": 1,
"user_id": 1,
"effects": [
{
"effect": "effect",
"ingredient_ids": "[1,2]"
}
],
"affiliate_url": "http://some.url.com",
"coupon_code": "new_coupon_code",
"created_at": "2021-10-04T13:24:22.000Z",
"updated_at": "2021-11-13T20:23:18.000Z"
}
]
}
Response examples (201)
{
"data": [
{
"id": 1,
"effects": [
{
"effect": "effect",
"ingredient_ids": "[1,2]"
}
],
"user_id": 1,
"created_at": "2021-10-04T13:24:22.000Z",
"product_id": 1,
"updated_at": "2021-11-13T20:23:18.000Z",
"coupon_code": "new_coupon_code",
"affiliate_url": "http://some.url.com"
}
]
}