Update a discount code
curl --request PATCH \
--url https://app.rookoo.ai/api/v1/accounts/{account_id}/planning/discount-codes/{id} \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"discount_code": {
"name": "<string>",
"code": "<string>",
"discount_type": "<string>",
"value": 123,
"active": true,
"valid_until": "2023-12-25"
}
}
'const options = {
method: 'PATCH',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
discount_code: {
name: '<string>',
code: '<string>',
discount_type: '<string>',
value: 123,
active: true,
valid_until: '2023-12-25'
}
})
};
fetch('https://app.rookoo.ai/api/v1/accounts/{account_id}/planning/discount-codes/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.rookoo.ai/api/v1/accounts/{account_id}/planning/discount-codes/{id}"
payload = { "discount_code": {
"name": "<string>",
"code": "<string>",
"discount_type": "<string>",
"value": 123,
"active": True,
"valid_until": "2023-12-25"
} }
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": 123,
"name": "<string>",
"code": "<string>",
"discount_type": "<string>",
"value": 123,
"active": true,
"valid_until": "2023-12-25",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Planning Pricing
Update a discount code
PATCH
/
api
/
v1
/
accounts
/
{account_id}
/
planning
/
discount-codes
/
{id}
Update a discount code
curl --request PATCH \
--url https://app.rookoo.ai/api/v1/accounts/{account_id}/planning/discount-codes/{id} \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"discount_code": {
"name": "<string>",
"code": "<string>",
"discount_type": "<string>",
"value": 123,
"active": true,
"valid_until": "2023-12-25"
}
}
'const options = {
method: 'PATCH',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
discount_code: {
name: '<string>',
code: '<string>',
discount_type: '<string>',
value: 123,
active: true,
valid_until: '2023-12-25'
}
})
};
fetch('https://app.rookoo.ai/api/v1/accounts/{account_id}/planning/discount-codes/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.rookoo.ai/api/v1/accounts/{account_id}/planning/discount-codes/{id}"
payload = { "discount_code": {
"name": "<string>",
"code": "<string>",
"discount_type": "<string>",
"value": 123,
"active": True,
"valid_until": "2023-12-25"
} }
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": 123,
"name": "<string>",
"code": "<string>",
"discount_type": "<string>",
"value": 123,
"active": true,
"valid_until": "2023-12-25",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Authorizations
This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user.
Body
application/json
Show child attributes
Show child attributes