Agent: Promotions¶
Read affiliate partners¶
GET /api/v1/agent/affiliates/
Requires promotions: view. Same body, rules and refusals as the creator-studio endpoint /api/v1/affiliates/.
Authentication: API key — Authorization: Bearer <key>
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/affiliates/`, {
method: "GET",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
201 |
No response body |
204 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Read affiliate commissions¶
GET /api/v1/agent/affiliates/commissions/
Requires promotions: view. Same body, rules and refusals as the creator-studio endpoint /api/v1/affiliates/commissions/.
Authentication: API key — Authorization: Bearer <key>
import os
import requests
url = f"https://www-dev.yoshuko.com/api/v1/agent/affiliates/commissions/"
response = requests.get(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/affiliates/commissions/`, {
method: "GET",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
201 |
No response body |
204 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Read per-course commission rules¶
GET /api/v1/agent/affiliates/course-rules/
Requires promotions: view. Same body, rules and refusals as the creator-studio endpoint /api/v1/affiliates/course-rules/.
Authentication: API key — Authorization: Bearer <key>
import os
import requests
url = f"https://www-dev.yoshuko.com/api/v1/agent/affiliates/course-rules/"
response = requests.get(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/affiliates/course-rules/`, {
method: "GET",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
201 |
No response body |
204 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Replace per-course commission rules¶
PUT /api/v1/agent/affiliates/course-rules/
Requires promotions: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/affiliates/course-rules/.
Authentication: API key — Authorization: Bearer <key>
import os
import requests
url = f"https://www-dev.yoshuko.com/api/v1/agent/affiliates/course-rules/"
response = requests.put(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/affiliates/course-rules/`, {
method: "PUT",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
201 |
No response body |
204 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Delete per-course commission rules¶
DELETE /api/v1/agent/affiliates/course-rules/
Requires promotions: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/affiliates/course-rules/.
Authentication: API key — Authorization: Bearer <key>
import os
import requests
url = f"https://www-dev.yoshuko.com/api/v1/agent/affiliates/course-rules/"
response = requests.delete(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/affiliates/course-rules/`, {
method: "DELETE",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
201 |
No response body |
204 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Read a course's affiliate summary¶
GET /api/v1/agent/affiliates/courses/{id}/
Requires promotions: view. Same body, rules and refusals as the creator-studio endpoint /api/v1/affiliates/courses/<pk>/.
Authentication: API key — Authorization: Bearer <key>
| Parameter | In | Required | Description |
|---|---|---|---|
id |
path | yes |
import os
import requests
id = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/affiliates/courses/{id}/"
response = requests.get(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const id = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/affiliates/courses/${id}/`, {
method: "GET",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
201 |
No response body |
204 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Read affiliate invite codes¶
GET /api/v1/agent/affiliates/invites/
Requires promotions: view. Same body, rules and refusals as the creator-studio endpoint /api/v1/affiliates/invites/.
Authentication: API key — Authorization: Bearer <key>
import os
import requests
url = f"https://www-dev.yoshuko.com/api/v1/agent/affiliates/invites/"
response = requests.get(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/affiliates/invites/`, {
method: "GET",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
201 |
No response body |
204 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Create or run affiliate invite codes¶
POST /api/v1/agent/affiliates/invites/
Requires promotions: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/affiliates/invites/.
Authentication: API key — Authorization: Bearer <key>
import os
import requests
url = f"https://www-dev.yoshuko.com/api/v1/agent/affiliates/invites/"
response = requests.post(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/affiliates/invites/`, {
method: "POST",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
201 |
No response body |
204 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Update an affiliate invite code¶
PATCH /api/v1/agent/affiliates/invites/{id}/
Requires promotions: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/affiliates/invites/<pk>/.
Authentication: API key — Authorization: Bearer <key>
| Parameter | In | Required | Description |
|---|---|---|---|
id |
path | yes |
import os
import requests
id = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/affiliates/invites/{id}/"
response = requests.patch(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const id = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/affiliates/invites/${id}/`, {
method: "PATCH",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
201 |
No response body |
204 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Delete an affiliate invite code¶
DELETE /api/v1/agent/affiliates/invites/{id}/
Requires promotions: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/affiliates/invites/<pk>/.
Authentication: API key — Authorization: Bearer <key>
| Parameter | In | Required | Description |
|---|---|---|---|
id |
path | yes |
import os
import requests
id = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/affiliates/invites/{id}/"
response = requests.delete(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const id = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/affiliates/invites/${id}/`, {
method: "DELETE",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
201 |
No response body |
204 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Read affiliate links¶
GET /api/v1/agent/affiliates/links/
Requires promotions: view. Same body, rules and refusals as the creator-studio endpoint /api/v1/affiliates/links/.
Authentication: API key — Authorization: Bearer <key>
import os
import requests
url = f"https://www-dev.yoshuko.com/api/v1/agent/affiliates/links/"
response = requests.get(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/affiliates/links/`, {
method: "GET",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
201 |
No response body |
204 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Create or run affiliate links¶
POST /api/v1/agent/affiliates/links/
Requires promotions: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/affiliates/links/.
Authentication: API key — Authorization: Bearer <key>
import os
import requests
url = f"https://www-dev.yoshuko.com/api/v1/agent/affiliates/links/"
response = requests.post(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/affiliates/links/`, {
method: "POST",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
201 |
No response body |
204 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Read the affiliate programme overview¶
GET /api/v1/agent/affiliates/overview/
Requires promotions: view. Same body, rules and refusals as the creator-studio endpoint /api/v1/affiliates/overview/.
Authentication: API key — Authorization: Bearer <key>
import os
import requests
url = f"https://www-dev.yoshuko.com/api/v1/agent/affiliates/overview/"
response = requests.get(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/affiliates/overview/`, {
method: "GET",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
201 |
No response body |
204 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Read affiliate programme settings¶
GET /api/v1/agent/affiliates/program/
Requires promotions: view. Same body, rules and refusals as the creator-studio endpoint /api/v1/affiliates/program/.
Authentication: API key — Authorization: Bearer <key>
import os
import requests
url = f"https://www-dev.yoshuko.com/api/v1/agent/affiliates/program/"
response = requests.get(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/affiliates/program/`, {
method: "GET",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
201 |
No response body |
204 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Update affiliate programme settings¶
PATCH /api/v1/agent/affiliates/program/
Requires promotions: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/affiliates/program/.
Authentication: API key — Authorization: Bearer <key>
import os
import requests
url = f"https://www-dev.yoshuko.com/api/v1/agent/affiliates/program/"
response = requests.patch(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/affiliates/program/`, {
method: "PATCH",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
201 |
No response body |
204 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Update an affiliate partner¶
PATCH /api/v1/agent/affiliates/{id}/
Requires promotions: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/affiliates/<pk>/.
Authentication: API key — Authorization: Bearer <key>
| Parameter | In | Required | Description |
|---|---|---|---|
id |
path | yes |
import os
import requests
id = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/affiliates/{id}/"
response = requests.patch(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const id = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/affiliates/${id}/`, {
method: "PATCH",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
201 |
No response body |
204 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Read course coupons¶
GET /api/v1/agent/courses/{course_pk}/coupons/
Requires promotions: view. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/coupons/.
Authentication: API key — Authorization: Bearer <key>
| Parameter | In | Required | Description |
|---|---|---|---|
course_pk |
path | yes |
import os
import requests
course_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/coupons/"
response = requests.get(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/coupons/`, {
method: "GET",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
201 |
No response body |
204 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Create or run course coupons¶
POST /api/v1/agent/courses/{course_pk}/coupons/
Requires promotions: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/coupons/.
Authentication: API key — Authorization: Bearer <key>
| Parameter | In | Required | Description |
|---|---|---|---|
course_pk |
path | yes |
import os
import requests
course_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/coupons/"
response = requests.post(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/coupons/`, {
method: "POST",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
201 |
No response body |
204 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
Delete a course coupon¶
DELETE /api/v1/agent/courses/{course_pk}/coupons/{id}/
Requires promotions: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/coupons/<pk>/.
Authentication: API key — Authorization: Bearer <key>
| Parameter | In | Required | Description |
|---|---|---|---|
course_pk |
path | yes | |
id |
path | yes |
import os
import requests
course_pk = "..."
id = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/coupons/{id}/"
response = requests.delete(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const id = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/coupons/${id}/`, {
method: "DELETE",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
201 |
No response body |
204 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
404 |
No such object in this key's organisation. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |