Discounts
Operations related to discounts
Retrieves general product discounts for the store. Use the page parameter to paginate results.
Authorization:
Requires a valid JWT Bearer token.
The token must include the permission:
read-discounts.
The page number to retrieve.
1The maximum number of elements per page. This number must be between 5-50.
50Successful operation
12Missing or invalid Tip4Serv API Key
Internal server error
GET /v1/store/discount/discounts HTTP/1.1
Host: api.tip4serv.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"discounts": [
{
"id": 42,
"name": "Summer Sale",
"value": 20,
"minimum_spending": 50,
"assign": "all_products_and_subscriptions",
"recurring": false,
"start_date": 1758583356,
"expiration_date": 1761234717,
"accepted_categories": [
1,
3
],
"accepted_products": [
10,
25
]
}
],
"discount_count": 12
}Get a store gift card by it's code.
Authorization:
Requires a valid JWT Bearer token.
The token must include the permission:
read-discounts.
The code of the giftcard.
Successful operation
Unique identifier of the gift card.
334Name of the gift card.
£50 Gift CardTimestamp of gift card creation in the store's timezone.
1758563356951Unique code of the gift card.
0M35-HYBA-IYWT-Y280Initial credit value of the gift card in its currency.
50Remaining credit on the gift card in its currency.
43.47Currency of the gift card.
EURInternal identifier of the payment used to purchase the gift card.
30689Timestamp of gift card expiration in the store's timezone.
1758563356951Error in your request
Missing or invalid Tip4Serv API Key
Gift card not found
Internal server error
GET /v1/store/discount/giftcard/{code} HTTP/1.1
Host: api.tip4serv.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": 334,
"name": "£50 Gift Card",
"creation_date": 1758563356951,
"code": "0M35-HYBA-IYWT-Y280",
"initial_credit": 50,
"remaining_credit": 43.47,
"currency": "EUR",
"payment_id": 30689,
"expiration": 1758563356951
}Delete every useless gift cards. This includes, those which expired by their expiration date, but also those which have a remaining credit of 0.
Authorization:
Requires a valid JWT Bearer token.
The token must include the permission:
delete-discounts.
Successful operation
5 gift cards were successfully deleted.5200Error in your request
Missing or invalid Tip4Serv API Key
Internal server error
DELETE /v1/store/discount/giftcard/useless HTTP/1.1
Host: api.tip4serv.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"message": "5 gift cards were successfully deleted.",
"deleted_giftcards": 5,
"status": 200
}Get a store gift card by it's ID.
Authorization:
Requires a valid JWT Bearer token.
The token must include the permission:
read-discounts.
The ID of the giftcard.
Successful operation
Unique identifier of the gift card.
334Name of the gift card.
£50 Gift CardTimestamp of gift card creation in the store's timezone.
1758563356951Unique code of the gift card.
0M35-HYBA-IYWT-Y280Initial credit value of the gift card in its currency.
50Remaining credit on the gift card in its currency.
43.47Currency of the gift card.
EURInternal identifier of the payment used to purchase the gift card.
30689Timestamp of gift card expiration in the store's timezone.
1758563356951Error in your request
Missing or invalid Tip4Serv API Key
Gift card not found
Internal server error
GET /v1/store/discount/giftcard/{id} HTTP/1.1
Host: api.tip4serv.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": 334,
"name": "£50 Gift Card",
"creation_date": 1758563356951,
"code": "0M35-HYBA-IYWT-Y280",
"initial_credit": 50,
"remaining_credit": 43.47,
"currency": "EUR",
"payment_id": 30689,
"expiration": 1758563356951
}Delete a store gift card by it's id.
Authorization:
Requires a valid JWT Bearer token.
The token must include the permission:
delete-discounts.
The id of the giftcard.
Successful operation
The gift card was successfully deleted.200Error in your request
Missing or invalid Tip4Serv API Key
Gift card not found
Internal server error
DELETE /v1/store/discount/giftcard/{id} HTTP/1.1
Host: api.tip4serv.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"message": "The gift card was successfully deleted.",
"status": 200
}Update a store gift card.
Authorization:
Requires a valid JWT Bearer token.
The token must include the permission:
update-discounts.
The ID of the giftcard.
Name of the gift card.
$25 Gift CardInitial credit value of the gift card in its currency.
25Remaining credit on the gift card in its currency
25Indicate if the gift card currency must be modified to the current store currency.
trueTimestamp of gift card expiration in the store's timezone. (Set this to null, to remove expiration)
1758563356951Successful operation
Unique identifier of the gift card.
334Name of the gift card.
£50 Gift CardTimestamp of gift card creation in the store's timezone.
1758563356951Unique code of the gift card.
0M35-HYBA-IYWT-Y280Initial credit value of the gift card in its currency.
50Remaining credit on the gift card in its currency.
43.47Currency of the gift card.
EURInternal identifier of the payment used to purchase the gift card.
30689Timestamp of gift card expiration in the store's timezone.
1758563356951Error in your request
Missing or invalid Tip4Serv API Key
Gift card not found
Internal server error
PATCH /v1/store/discount/giftcard/{id} HTTP/1.1
Host: api.tip4serv.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 116
{
"name": "$25 Gift Card",
"initial_credit": 25,
"remaining_credit": 25,
"update_currency": true,
"expiration": 1758563356951
}{
"id": 334,
"name": "£50 Gift Card",
"creation_date": 1758563356951,
"code": "0M35-HYBA-IYWT-Y280",
"initial_credit": 50,
"remaining_credit": 43.47,
"currency": "EUR",
"payment_id": 30689,
"expiration": 1758563356951
}Update a store coupon.
Authorization:
Requires a valid JWT Bearer token.
The token must include the permission:
read-discounts.
The code of the coupon.
Successful operation
Unique identifier of the coupon.
800Coupon code used by customers.
8H3LLGQXF9Type of discount. Accepted values: percentage, value
percentageDiscount amount (percentage or fixed value depending on type).
30Number of times this coupon has been used.
10Maximum number of uses allowed for this coupon.
100Minimum purchase amount in the store's currency required to use the coupon.
9.99Maximum purchase amount in the store's currency allowed to use the coupon.
49.99Expiration timestamp of the coupon in store timezone.
1758583356951List of category IDs eligible for the coupon. Empty array means all categories.
[0,2]List of product IDs eligible for the coupon. Empty array means all products.
[1,2]Error in your request
Missing or invalid Tip4Serv API Key
Coupon not found
Internal server error
GET /v1/store/discount/coupon/{code} HTTP/1.1
Host: api.tip4serv.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": 800,
"code": "8H3LLGQXF9",
"type": "percentage",
"value": 30,
"used": 10,
"limit": 100,
"minimum": 9.99,
"maximum": 49.99,
"expiration": 1758583356951,
"accepted_categories": [
0,
2
],
"accepted_products": [
1,
2
]
}Update a store coupon.
Authorization:
Requires a valid JWT Bearer token.
The token must include the permission:
read-discounts.
The ID of the coupon.
Successful operation
Unique identifier of the coupon.
800Coupon code used by customers.
8H3LLGQXF9Type of discount. Accepted values: percentage, value
percentageDiscount amount (percentage or fixed value depending on type).
30Number of times this coupon has been used.
10Maximum number of uses allowed for this coupon.
100Minimum purchase amount in the store's currency required to use the coupon.
9.99Maximum purchase amount in the store's currency allowed to use the coupon.
49.99Expiration timestamp of the coupon in store timezone.
1758583356951List of category IDs eligible for the coupon. Empty array means all categories.
[0,2]List of product IDs eligible for the coupon. Empty array means all products.
[1,2]Error in your request
Missing or invalid Tip4Serv API Key
Coupon not found
Internal server error
GET /v1/store/discount/coupon/{id} HTTP/1.1
Host: api.tip4serv.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": 800,
"code": "8H3LLGQXF9",
"type": "percentage",
"value": 30,
"used": 10,
"limit": 100,
"minimum": 9.99,
"maximum": 49.99,
"expiration": 1758583356951,
"accepted_categories": [
0,
2
],
"accepted_products": [
1,
2
]
}Update a store coupon.
Authorization:
Requires a valid JWT Bearer token.
The token must include the permission:
update-discounts.
The ID of the coupon.
Coupon code used by customers
7X2ZZABEF8Type of discount. Accepted values percentage, value
valueDiscount amount (percentage or fixed value depending on type).
10Maximum number of uses allowed for this coupon.
50Minimum purchase amount in the store's currency required to use the coupon.
9.99Maximum purchase amount in the store's currency allowed to use the coupon.
49.99Expiration timestamp of the coupon in store timezone. (Set this to null, to remove expiration)
1758583356951List of category IDs eligible for the coupon. Empty array means all categories. If omitted this property won't be modified.
[1]List of product IDs eligible for the coupon. Empty array means all products. If omitted this property won't be modified.
[7,8]Successful operation
Unique identifier of the coupon.
800Coupon code used by customers.
8H3LLGQXF9Type of discount. Accepted values: percentage, value
percentageDiscount amount (percentage or fixed value depending on type).
30Number of times this coupon has been used.
10Maximum number of uses allowed for this coupon.
100Minimum purchase amount in the store's currency required to use the coupon.
9.99Maximum purchase amount in the store's currency allowed to use the coupon.
49.99Expiration timestamp of the coupon in store timezone.
1758583356951List of category IDs eligible for the coupon. Empty array means all categories.
[0,2]List of product IDs eligible for the coupon. Empty array means all products.
[1,2]Error in your request
Missing or invalid Tip4Serv API Key
Coupon not found
Internal server error
PATCH /v1/store/discount/coupon/{id} HTTP/1.1
Host: api.tip4serv.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 168
{
"code": "7X2ZZABEF8",
"type": "value",
"value": 10,
"limit": 50,
"minimum": 9.99,
"maximum": 49.99,
"expiration": 1758583356951,
"accepted_categories": [
1
],
"accepted_products": [
7,
8
]
}{
"id": 800,
"code": "8H3LLGQXF9",
"type": "percentage",
"value": 30,
"used": 10,
"limit": 100,
"minimum": 9.99,
"maximum": 49.99,
"expiration": 1758583356951,
"accepted_categories": [
0,
2
],
"accepted_products": [
1,
2
]
}Create a new store coupon.
Authorization:
Requires a valid JWT Bearer token.
The token must include the permission:
create-discounts.
Coupon code used by customers. (If not defined a random value will be set)
8H3LLGQXF9Type of discount. Accepted values: percentage, value
percentageDiscount amount (percentage or fixed value depending on type).
30Maximum number of uses allowed for this coupon.
100Minimum purchase amount in the store's currency required to use the coupon.
9.99Maximum purchase amount in the store's currency allowed to use the coupon.
49.99Expiration timestamp of the coupon in store timezone.
1758583356951List of category IDs eligible for the coupon. Empty array means all categories. If omitted will accept every category
[0,2]List of product IDs eligible for the coupon. Empty array means all products. If omitted will accept every product.
[1,2]Successful operation
Unique identifier of the coupon.
800Coupon code used by customers.
8H3LLGQXF9Type of discount. Accepted values: percentage, value
percentageDiscount amount (percentage or fixed value depending on type).
30Number of times this coupon has been used.
10Maximum number of uses allowed for this coupon.
100Minimum purchase amount in the store's currency required to use the coupon.
9.99Maximum purchase amount in the store's currency allowed to use the coupon.
49.99Expiration timestamp of the coupon in store timezone.
1758583356951List of category IDs eligible for the coupon. Empty array means all categories.
[0,2]List of product IDs eligible for the coupon. Empty array means all products.
[1,2]Error in your request
Missing or invalid Tip4Serv API Key
Conflicting conditions
Internal server error
POST /v1/store/discount/coupon HTTP/1.1
Host: api.tip4serv.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 176
{
"code": "8H3LLGQXF9",
"type": "percentage",
"value": 30,
"limit": 100,
"minimum": 9.99,
"maximum": 49.99,
"expiration": 1758583356951,
"accepted_categories": [
0,
2
],
"accepted_products": [
1,
2
]
}{
"id": 800,
"code": "8H3LLGQXF9",
"type": "percentage",
"value": 30,
"used": 10,
"limit": 100,
"minimum": 9.99,
"maximum": 49.99,
"expiration": 1758583356951,
"accepted_categories": [
0,
2
],
"accepted_products": [
1,
2
]
}Retrieves detailed information about all of your coupons. Use the page parameter to paginate results.
Authorization:
Requires a valid JWT Bearer token.
The token must include the permission:
read-discounts.
The page number to retrieve.
1The maximum number of elements per page. This number must be between 5-50.
50Successful operation
23Missing or invalid Tip4Serv API Key
Internal server error
GET /v1/store/discount/coupons HTTP/1.1
Host: api.tip4serv.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"coupons": [
{
"id": 800,
"code": "8H3LLGQXF9",
"type": "percentage",
"value": 30,
"used": 10,
"limit": 100,
"minimum": 9.99,
"maximum": 49.99,
"expiration": 1758583356951,
"accepted_categories": [
0,
2
],
"accepted_products": [
1,
2
]
}
],
"coupon_count": 23
}Create store gift card.
Authorization:
Requires a valid JWT Bearer token.
The token must include the permission:
create-discounts.
Name of the gift card.
£50 Gift CardInitial credit value of the gift card in its currency.
50Timestamp of gift card expiration in the store's timezone.
1758563356951Successful operation
Unique identifier of the gift card.
334Name of the gift card.
£50 Gift CardTimestamp of gift card creation in the store's timezone.
1758563356951Unique code of the gift card.
0M35-HYBA-IYWT-Y280Initial credit value of the gift card in its currency.
50Remaining credit on the gift card in its currency.
43.47Currency of the gift card.
EURInternal identifier of the payment used to purchase the gift card.
30689Timestamp of gift card expiration in the store's timezone.
1758563356951Error in your request
Missing or invalid Tip4Serv API Key
Internal server error
POST /v1/store/discount/giftcard HTTP/1.1
Host: api.tip4serv.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 72
{
"name": "£50 Gift Card",
"initial_credit": 50,
"expiration": 1758563356951
}{
"id": 334,
"name": "£50 Gift Card",
"creation_date": 1758563356951,
"code": "0M35-HYBA-IYWT-Y280",
"initial_credit": 50,
"remaining_credit": 43.47,
"currency": "EUR",
"payment_id": 30689,
"expiration": 1758563356951
}Retrieves detailed information about all of your gift cards. Use the page parameter to paginate results.
Authorization:
Requires a valid JWT Bearer token.
The token must include the permission:
read-discounts.
The page number to retrieve.
1The maximum number of elements per page. This number must be between 5-50.
50Successful operation
44Error in your request
Missing or invalid Tip4Serv API Key
Internal server error
GET /v1/store/discount/giftcards HTTP/1.1
Host: api.tip4serv.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"giftcards": [
{
"id": 334,
"name": "£50 Gift Card",
"creation_date": 1758563356951,
"code": "0M35-HYBA-IYWT-Y280",
"initial_credit": 50,
"remaining_credit": 43.47,
"currency": "EUR",
"payment_id": 30689,
"expiration": 1758563356951
}
],
"giftcard_count": 44
}Last updated
