discounts
GET
https://linkyhub.net/api/v3 /discounts Scope discounts:readDiscount codes, what they take off, and how often they were used.
Code samples
cURL
curl -X GET "https://linkyhub.net/api/v3/discounts" \
-H "Authorization: Bearer $LINKYHUB_API_KEY"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Done.
Example
{
"data": [
{}
]
}Schema
dataobject[]requiredHeaders
RateLimit-LimitintegerRequests allowed in the current window.
RateLimit-RemainingintegerRequests left in the current window.
RateLimit-ResetintegerSeconds until the window resets.
default An error.
Example
{
"error": "string",
"message": "string"
}Schema
errorstringrequiredA stable code to branch on, e.g. insufficient_scope.
messagestringrequiredA sentence to show a person.
Headers
RateLimit-LimitintegerRequests allowed in the current window.
RateLimit-RemainingintegerRequests left in the current window.
RateLimit-ResetintegerSeconds until the window resets.
POST
https://linkyhub.net/api/v3 /discounts Scope discounts:writeCreate a code buyers enter at checkout. Live immediately; it costs the creator real money.
Request body
application/json
codestringrequiredkindstringrequiredvalueintegerrequired1–100 for PERCENT; minor units for FIXED.
currencystringmaxRedemptionsintegermaxPerBuyerintegerminSubtotalCentsintegerstartsAtstringendsAtstringproductIdsstring[]Omitted: every product.
{
"code": "string",
"kind": "PERCENT",
"value": 0,
"currency": "string",
"maxRedemptions": 0,
"maxPerBuyer": 0,
"minSubtotalCents": 0,
"startsAt": "2024-01-01T00:00:00Z",
"endsAt": "2024-01-01T00:00:00Z",
"productIds": [
"string"
]
}Code samples
cURL
curl -X POST "https://linkyhub.net/api/v3/discounts" \
-H "Authorization: Bearer $LINKYHUB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"code":"string","kind":"PERCENT","value":0,"currency":"string","maxRedemptions":0,"maxPerBuyer":0,"minSubtotalCents":0,"startsAt":"2024-01-01T00:00:00Z","endsAt":"2024-01-01T00:00:00Z","productIds":["string"]}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
201 Done.
{}Headers
RateLimit-LimitintegerRequests allowed in the current window.
RateLimit-RemainingintegerRequests left in the current window.
RateLimit-ResetintegerSeconds until the window resets.
default An error.
Same as default · GET /discounts
Headers
RateLimit-LimitintegerRequests allowed in the current window.
RateLimit-RemainingintegerRequests left in the current window.
RateLimit-ResetintegerSeconds until the window resets.
DELETE
https://linkyhub.net/api/v3 /discounts/{discountId} Scope discounts:writeDelete a code. Orders that used it keep their price.
Parameters
discountIdstringpathrequiredCode samples
cURL
curl -X DELETE "https://linkyhub.net/api/v3/discounts/{discountId}" \
-H "Authorization: Bearer $LINKYHUB_API_KEY"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Done.
{}Headers
RateLimit-LimitintegerRequests allowed in the current window.
RateLimit-RemainingintegerRequests left in the current window.
RateLimit-ResetintegerSeconds until the window resets.
default An error.
Same as default · GET /discounts
Headers
RateLimit-LimitintegerRequests allowed in the current window.
RateLimit-RemainingintegerRequests left in the current window.
RateLimit-ResetintegerSeconds until the window resets.
PATCH
https://linkyhub.net/api/v3 /discounts/{discountId} Scope discounts:writeSwitch a code on or off.
Parameters
discountIdstringpathrequiredRequest body
application/json
isActivebooleanrequired{
"isActive": true
}Code samples
cURL
curl -X PATCH "https://linkyhub.net/api/v3/discounts/{discountId}" \
-H "Authorization: Bearer $LINKYHUB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"isActive":true}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Done.
{}Headers
RateLimit-LimitintegerRequests allowed in the current window.
RateLimit-RemainingintegerRequests left in the current window.
RateLimit-ResetintegerSeconds until the window resets.
default An error.
Same as default · GET /discounts
Headers
RateLimit-LimitintegerRequests allowed in the current window.
RateLimit-RemainingintegerRequests left in the current window.
RateLimit-ResetintegerSeconds until the window resets.
Updated