You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The discount ID, required by every other discount endpoint.
[optional]
code
str
The discount code customers enter at checkout.
[optional]
name
str
The discount name, or null.
[optional]
type
str
The discount type, or null.
[optional]
value
int
The discount value, or null. Percentage is 1-100; fixed is in the smallest currency unit.
[optional]
allocation
str
Whether the discount applies to the cart total or to each item, or null.
[optional]
is_disabled
bool
Whether the discount is disabled.
[optional]
starts_at
datetime
When the discount becomes active.
[optional]
ends_at
datetime
When the discount expires, or null.
[optional]
usage_limit
int
Maximum number of redemptions, or null for unlimited.
[optional]
usage_count
int
Number of times the discount has been redeemed.
[optional]
Example
fromhostinger_api.models.ecommerce_v1_discount_discount_resourceimportEcommerceV1DiscountDiscountResource# TODO update the JSON string belowjson="{}"# create an instance of EcommerceV1DiscountDiscountResource from a JSON stringecommerce_v1_discount_discount_resource_instance=EcommerceV1DiscountDiscountResource.from_json(json)
# print the JSON string representation of the objectprint(EcommerceV1DiscountDiscountResource.to_json())
# convert the object into a dictecommerce_v1_discount_discount_resource_dict=ecommerce_v1_discount_discount_resource_instance.to_dict()
# create an instance of EcommerceV1DiscountDiscountResource from a dictecommerce_v1_discount_discount_resource_from_dict=EcommerceV1DiscountDiscountResource.from_dict(ecommerce_v1_discount_discount_resource_dict)