The Aryeo API provides access to the Aryeo platform.
https://docs.aryeo.com/_mock/api/aryeo/
https://api.aryeo.com/v1/
Return coupons that have a name matching this field.
Comma separated list of optional data to include in the response.
Comma separated list of fields used for sorting. Placing a minus symbol in front of a field name sorts in descending order. Defaults to -created_at
.
The number of items per page. Defaults to 25.
https://docs.aryeo.com/_mock/api/aryeo/coupons
https://api.aryeo.com/v1/coupons
const resp = await fetch(
`https://docs.aryeo.com/_mock/api/aryeo/coupons`,
{
method: 'GET',
headers: {
Authorization: 'Bearer <YOUR_TOKEN_HERE>'
}
}
);
const data = await resp.text();
console.log(data);
{ "status": "success", "data": [ { "id": "00000000-0000-4000-8000-000000000000", "name": "VIP Customer Discount", "is_active": true, "is_percent_off": true, "percent_off": 0.075, "amount_off": 2500, "amount_off_formatted": "$25.00", "promotion_codes": [ { "id": "00000000-0000-4000-8000-000000000000", "code": "SPRING_SALE", "times_redeemed": 10, "start_at": "2021-06-30T20:30:00Z", "end_at": "2021-06-30T20:30:00Z", "max_redemptions": 10, "max_redemptions_per_customer": 10, "first_time_only": true, "minimum_amount": 1000, "is_portal_mobile_app_only": true } ], "discountables": [ { "object": "DISCOUNTABLE", "id": "00000000-0000-4000-8000-000000000000", "discountable": { … } } ], "times_redeemed": 10, "created_at": "2021-06-30T20:30:00Z" } ], "meta": { "total": 50, "per_page": 15, "current_page": 1, "last_page": 4, "from": 1, "to": 15, "path": "https://api.aryeo.com/v1/{path}", "links": [ { "url": "https://admin.aryeo.test/api/v1/companies?page=2", "label": "2", "active": true } ] }, "links": { "first": "https://api.aryeo.com/v1/{path}?page=1", "last": "https://api.aryeo.com/v1/{path}?page=10", "prev": "https://api.aryeo.com/v1/{path}?page=2", "next": "https://api.aryeo.com/v1/{path}?page=3" }, "timestamp": "2021-06-30T20:30:00Z" }
DiscountPostPayload
ID of the order apply this coupon to. UUID Version 4.
ID of the coupon to apply. UUID Version 4.
https://docs.aryeo.com/_mock/api/aryeo/discounts
https://api.aryeo.com/v1/discounts
const resp = await fetch(
`https://docs.aryeo.com/_mock/api/aryeo/discounts`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer <YOUR_TOKEN_HERE>'
},
body: JSON.stringify({
order_id: '00000000-0000-4000-8000-000000000000',
coupon_id: '00000000-0000-4000-8000-000000000000',
coupon_data: {
name: 'VIP Customer Discount',
percent_off: 0.075,
amount_off: 2500
}
})
}
);
const data = await resp.json();
console.log(data);
{ "status": "success", "data": { "object": "DISCOUNT", "id": "00000000-0000-4000-8000-000000000000", "total_discount_amount": 1000, "coupon": { "id": "00000000-0000-4000-8000-000000000000", "name": "VIP Customer Discount", "is_active": true, "is_percent_off": true, "percent_off": 0.075, "amount_off": 2500, "amount_off_formatted": "$25.00", "promotion_codes": [ { "id": "00000000-0000-4000-8000-000000000000", "code": "SPRING_SALE", "times_redeemed": 10, "start_at": "2021-06-30T20:30:00Z", "end_at": "2021-06-30T20:30:00Z", "max_redemptions": 10, "max_redemptions_per_customer": 10, "first_time_only": true, "minimum_amount": 1000, "is_portal_mobile_app_only": true } ], "discountables": [ { "object": "DISCOUNTABLE", "id": "00000000-0000-4000-8000-000000000000", "discountable": { … } } ], "times_redeemed": 10, "created_at": "2021-06-30T20:30:00Z" } }, "timestamp": "2021-06-30T20:30:00Z" }
https://docs.aryeo.com/_mock/api/aryeo/discounts/{discount_id}
https://api.aryeo.com/v1/discounts/{discount_id}
const discountId = '00000000-0000-4000-8000-000000000000';
const resp = await fetch(
`https://docs.aryeo.com/_mock/api/aryeo/discounts/${discountId}`,
{
method: 'DELETE',
headers: {
Authorization: 'Bearer <YOUR_TOKEN_HERE>'
}
}
);
if (resp.status === 204) {
console.log('success');
} else {
const data = await resp.text();
console.log(data);
}
https://docs.aryeo.com/_mock/api/aryeo/orders/{order}/discounts/{discount}
https://api.aryeo.com/v1/orders/{order}/discounts/{discount}
const order = '00000000-0000-4000-8000-000000000000';
const discount = '00000000-0000-4000-8000-000000000000';
const resp = await fetch(
`https://docs.aryeo.com/_mock/api/aryeo/orders/${order}/discounts/${discount}`,
{
method: 'DELETE',
headers: {
Authorization: 'Bearer <YOUR_TOKEN_HERE>'
}
}
);
const data = await resp.text();
console.log(data);
https://docs.aryeo.com/_mock/api/aryeo/promotion-codes/redeem/{discountedType}/{discounted}
https://api.aryeo.com/v1/promotion-codes/redeem/{discountedType}/{discounted}
const discountedType = 'product';
const discounted = '00000000-0000-4000-8000-000000000000';
const resp = await fetch(
`https://docs.aryeo.com/_mock/api/aryeo/promotion-codes/redeem/${discountedType}/${discounted}`,
{method: 'POST'}
);
const data = await resp.text();
console.log(data);
https://docs.aryeo.com/_mock/api/aryeo/refunds/{orderPayment}
https://api.aryeo.com/v1/refunds/{orderPayment}
const orderPayment = '00000000-0000-4000-8000-000000000000';
const resp = await fetch(
`https://docs.aryeo.com/_mock/api/aryeo/refunds/${orderPayment}`,
{
method: 'POST',
headers: {
Authorization: 'Bearer <YOUR_TOKEN_HERE>'
}
}
);
const data = await resp.text();
console.log(data);