Create a basket offer
Creates a basket offer together with its nested promotion, condition, and benefit in a single atomic request.
Offer type rules (validated against user and voucher_code):
sitewide— neitherusernorvoucher_codemay be provided.voucher_code—voucher_codeis required andusermust not be provided.coupon— eitheruseror abulk_coupon_fileis required, andvoucher_codemust not be provided.coupon_code— bothuserandvoucher_codeare required.
When offer_type is omitted, the server derives it from the presence of user and voucher_code.
Bulk coupons: when a base64-encoded bulk_coupon_file is uploaded (CSV or spreadsheet with an email column header), the offer is stored as bulk_coupon and personal coupons are generated for the matching users asynchronously. The file must contain at least one email belonging to an existing user, and bulk_coupon_file cannot be combined with user.
Date rules: end_datetime must be after start_datetime, and an end_datetime in the past is only accepted for offers created with passive status.
Condition and benefit payloads: the kwargs object of the condition and the benefit must contain the keys required for the chosen condition_type / benefit_type (see the schema descriptions of the Condition and Benefit objects). Amount-based conditions and fixed-amount benefits are rejected when more than one currency is specified in currencies.
Coupon / voucher benefits: a benefit of type coupon or voucher embeds an inner basket offer under kwargs.coupon that is granted after purchase. The inner offer must define exactly one of (start_datetime & end_datetime) or (start_timedelta & end_timedelta), and exactly one of activation_date or activation_timedelta. The inner offer's end date must not precede its activation date or the outer campaign's end date.
Sample product benefits: the benefit and condition must reference different product collections, every product in the benefit collection must have a zero price, and allowed_quantity_per_basket must be 1.
Currencies: when the currencies field is omitted, it defaults to a single-element list containing the shop's default currency, taken from the DEFAULT_CURRENCY dynamic setting (see the Dynamic Settings & Environment Variables section).
Uniqueness: the promotion slug (derived from the promotion name when not sent) and the voucher_code must be unique across all basket offers; violations are reported as business rule errors with the codes promotion_100_1 and promotion_100_2 respectively.
Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.
The payload accepted when creating or updating a basket offer.
Administrative label of the offer. Stored per language; the request language selects the translation being written.
The lifecycle status of a basket offer.
active— eligible for application on the storefrontpassive— disabled (expired offers are moved here automatically)used— single-use offer that has been consumed; cannot be changed againrevoked— withdrawn
How the offer is matched to a customer. See the Offer Types section under Basket Offers.
Voucher code redeeming the offer. Must be unique across all basket offers.
Identifier of the user the offer is assigned to, for personal offer types.
Whether the offer is visible on the storefront.
trueWhether the offer is visible on storefront listing pages.
falseCampaign start. Must precede end_datetime.
Campaign end. A past end date is only accepted together with passive status.
Application priority; offers with higher priority are evaluated first on the storefront.
0When false, no further offers are applied to a basket after this offer.
trueThe maximum number of times the offer may be applied within a single basket.
1The maximum number of times a single user may benefit from the offer. 0 means unlimited.
0The maximum total number of applications across all baskets. 0 means unlimited.
The currencies the offer is valid in. Defaults to the shop's default currency (see the DEFAULT_CURRENCY dynamic setting).
tryWhether the offer is exposed to marketplace data sources. When true, both the condition and the benefit must reference a static product collection.
falseFree-form extra configuration. When data_source_discount_sharing_rate is present it must be a number between 0 and 100.
Only for inner offers embedded in coupon / voucher benefits — validity start, in seconds relative to activation.
Only for inner offers embedded in coupon / voucher benefits — validity end, in seconds relative to activation.
Only for inner offers embedded in coupon / voucher benefits — activation delay after purchase, in seconds. Exactly one of activation_timedelta and activation_date must be provided on the inner offer.
Only for inner offers embedded in coupon / voucher benefits — absolute activation moment. Exactly one of activation_timedelta and activation_date must be provided on the inner offer.
Base64-encoded CSV or spreadsheet with an email column, listing the users that receive personal coupons. Cannot be combined with user. Turns the offer into a bulk_coupon offer; coupons are generated asynchronously.
Base64-encoded file of customer emails imported into the condition as a bulk_email__in rule. Processing is asynchronous; the offer is passive while the file is processed.
Base64-encoded file of customer phone numbers imported into the condition as a bulk_phone_number__in rule. Processing is asynchronous; the offer is passive while the file is processed.
The created basket offer.
A basket offer as returned by the API.
Administrative label of the offer. Stored per language; the request language selects the translation being written.
The lifecycle status of a basket offer.
active— eligible for application on the storefrontpassive— disabled (expired offers are moved here automatically)used— single-use offer that has been consumed; cannot be changed againrevoked— withdrawn
How the offer is matched to a customer. See the Offer Types section under Basket Offers.
Voucher code redeeming the offer. Must be unique across all basket offers.
When the offer is assigned to a user, the user is returned expanded as an object (identifier, email, name fields) rather than as a bare identifier.
Whether the offer is visible on the storefront.
trueWhether the offer is visible on storefront listing pages.
falseCampaign start. Must precede end_datetime.
Campaign end. A past end date is only accepted together with passive status.
Application priority; offers with higher priority are evaluated first on the storefront.
0When false, no further offers are applied to a basket after this offer.
trueThe maximum number of times the offer may be applied within a single basket.
1The maximum number of times a single user may benefit from the offer. 0 means unlimited.
0The maximum total number of applications across all baskets. 0 means unlimited.
The currencies the offer is valid in. Defaults to the shop's default currency (see the DEFAULT_CURRENCY dynamic setting).
tryWhether the offer is exposed to marketplace data sources. When true, both the condition and the benefit must reference a static product collection.
falseFree-form extra configuration. When data_source_discount_sharing_rate is present it must be a number between 0 and 100.
Only for inner offers embedded in coupon / voucher benefits — validity start, in seconds relative to activation.
Only for inner offers embedded in coupon / voucher benefits — validity end, in seconds relative to activation.
Only for inner offers embedded in coupon / voucher benefits — activation delay after purchase, in seconds. Exactly one of activation_timedelta and activation_date must be provided on the inner offer.
Only for inner offers embedded in coupon / voucher benefits — absolute activation moment. Exactly one of activation_timedelta and activation_date must be provided on the inner offer.
Base64-encoded CSV or spreadsheet with an email column, listing the users that receive personal coupons. Cannot be combined with user. Turns the offer into a bulk_coupon offer; coupons are generated asynchronously.
Base64-encoded file of customer emails imported into the condition as a bulk_email__in rule. Processing is asynchronous; the offer is passive while the file is processed.
Base64-encoded file of customer phone numbers imported into the condition as a bulk_phone_number__in rule. Processing is asynchronous; the offer is passive while the file is processed.
Unique basket offer identifier.
The moment the offer was last modified.
Only present when max_stock_limit is positive — the number of applications still available.
The request contains invalid or missing data, or violates a business rule — for example a promotion slug that already exists (promotion_100_1) or a voucher code that already exists (promotion_100_2).
Authentication credentials were not provided or are invalid.
The authenticated user does not have administrator privileges.
POST /api/v1/remote/1/basket_offers/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 884
{
"label": null,
"promotion": {
"name": "text",
"slug": "text"
},
"condition": {
"condition_type": "distinct",
"product_collection": null,
"upsell_message": "text",
"kwargs": {
"value": 100,
"price_type": "unit_price",
"consume_type": "locally",
"sub_conditions": [
[
"retail_store_erp_code_in",
[
"BGD-01",
"ATS-03"
]
]
]
}
},
"benefit": {
"benefit_type": "multibuy",
"product_collection": null,
"kwargs": {}
},
"status": "active",
"offer_type": "sitewide",
"voucher_code": null,
"user": null,
"is_visible": true,
"is_visible_on_list": false,
"start_datetime": null,
"end_datetime": null,
"priority": 0,
"is_mergable": true,
"allowed_quantity_per_basket": 1,
"max_usage_per_user": 0,
"max_stock_limit": null,
"currencies": [
"try"
],
"is_available_for_data_sources": false,
"kwargs": null,
"start_timedelta": null,
"end_timedelta": null,
"activation_timedelta": null,
"activation_date": null,
"bulk_coupon_file": "text",
"bulk_email_file": null,
"bulk_phone_number_file": null
}{
"label": null,
"promotion": {
"pk": 1,
"name": "text",
"slug": "text"
},
"condition": {
"pk": 1,
"condition_type": "distinct",
"product_collection": null,
"upsell_message": "text",
"kwargs": {
"value": 100,
"price_type": "unit_price",
"consume_type": "locally",
"sub_conditions": [
[
"retail_store_erp_code_in",
[
"BGD-01",
"ATS-03"
]
]
]
}
},
"benefit": {
"pk": 1,
"benefit_type": "multibuy",
"product_collection": null,
"kwargs": {}
},
"status": "active",
"offer_type": "sitewide",
"voucher_code": null,
"user": null,
"is_visible": true,
"is_visible_on_list": false,
"start_datetime": null,
"end_datetime": null,
"priority": 0,
"is_mergable": true,
"allowed_quantity_per_basket": 1,
"max_usage_per_user": 0,
"max_stock_limit": null,
"currencies": [
"try"
],
"is_available_for_data_sources": false,
"kwargs": null,
"start_timedelta": null,
"end_timedelta": null,
"activation_timedelta": null,
"activation_date": null,
"bulk_coupon_file": "text",
"bulk_email_file": null,
"bulk_phone_number_file": null,
"pk": 1,
"modified_date": "2026-01-01T00:00:00.000Z",
"remaining_stock_limit": 1
}Last updated
Was this helpful?

