Shopify Code Discount : entrées et champs
The store’s discounts, and the basic discount a customer enters a code for. Narrow with method:code.
Lecture
List Code Discounts
Fetch code discounts from Shopify.
Route: GET /codeDiscounts
Formule Excel: =LF.shopify.codeDiscounts("selection", "fields")
Entrees configurables
| Name | Type | Required | Description |
|---|---|---|---|
link | string | Yes | - |
first | number | No | The first n elements from the paginated list. Default: 250 |
after | string | No | The elements that come after the specified cursor. |
last | number | No | The last n elements from the paginated list. |
before | string | No | The elements that come before the specified cursor. |
reverse | boolean | No | Reverse the order of the underlying list. Default: false |
sortKey | enum | No | Sort the underlying list using a key. If your query is slow or returns an error, then [try specifying a sort key that matches the field used... Values: CREATED_AT, ENDS_AT, ID, RELEVANCE, STARTS_AT |
query.code | string | No | Filter by the discount code. Not supported for bulk discounts. Example: - code:WELCOME10 |
query.combines_with | enum | No | Filter by the Shopify Functions discount classes that the [discount type](... Values: order_discounts, product_discounts, shipping_discounts |
query.combines_with.product_discounts_with_tags_on_same_cart_line | string | No | Filter by a combines with tag applied to discounts on the same cart line. Supports multiple tags separated by commas (e.g., combines_with.pr... |
query.context | enum | No | Filter by the context type. Supports multiple values separated by commas (e.g., context:all,market). When multiple values are provided, resu... Values: all, customer, segment, market |
query.created_at | date | No | Filter by the date and time, in the shop's timezone, when the discount was created. Example: - created_at:>'2020-10-21T23:39:20Z' - ... |
query.customer_ids | string | No | Filter by specific customer IDs that are eligible for the discount. Example: - customer_ids:123456789 - customer_ids:123,456 |
query.default | string | No | Filter by a case-insensitive search of multiple fields in a document. Example: - query=Bob Norman - query=title:green hoodie |
query.discount_class | enum | No | Filter by the discount class. Supports multiple classes separated by comma... Values: order, product, shipping |
query.discount_type | enum | No | Filter by the discount type. Supports multiple types separated by commas (e.g.,... Values: app, bogo, fixed_amount, free_shipping, percentage |
query.ends_at | date | No | Filter by the date and time, in the shop's timezone, when the discount ends. Example: - ends_at:>'2020-10-21T23:39:20Z' - ends_at:<n... |
query.id | id | No | Filter by id range. Example: - id:1234 - id:>=1234 - id:<=1234 |
query.market_ids | string | No | Filter by specific market IDs that are eligible for the discount. Supports multiple IDs separated by commas (e.g., market_ids:123,456). Exam... |
query.method | enum | No | Filter by the discount method. Supports multiple methods separated by comm... Values: automatic, code |
query.segment_ids | string | No | Filter by specific segment IDs that are eligible for the discount. Supports multiple IDs separated by commas (e.g., segment_ids:123,456). Ex... |
query.starts_at | date | No | Filter by the date and time, in the shop's timezone, when the discount becomes active and is available for customer use. Example: - starts_... |
query.status | enum | No | Filter by the status of the discount. Supports multiple statuses separated by commas (e.g., status:active,scheduled). Example: - status:sch... Values: active, expired, scheduled |
query.tag | string | No | Filter by a tag applied to the discount. Supports multiple tags separated by commas (e.g., tag:loyalty,clearance). Example: - tag:loyalty<... |
query.times_used | number | No | Filter by the number of times the discount has been used. For example, if a "Buy 3, Get 1 Free" t-shirt discount is automatically applied in... |
query.title | string | No | Filter by the discount name that displays to merchants in the Shopify admin and to customers. Example: - title:Black Friday Sale |
query.type | enum | No | Filter by the discount type. Supports multiple types separated by commas (e.g.,... Values: all, all_with_app, app, bxgy, fixed_amount |
query.updated_at | date | No | Filter by the date and time, in the shop's timezone, when the discount was last updated. Example: - updated_at:>'2020-10-21T23:39:20Z'<br/... |
savedSearchId | string | No | The ID of a saved search. The search’s query string is used as... |
Donnees retournees dans Excel
| Field | Type | Relations | Description |
|---|---|---|---|
appliesOnOneTimePurchasedefault | boolean | — | - |
appliesOnSubscriptiondefault | boolean | — | - |
asyncUsageCountdefault | number | — | - |
createdAtdefault | date | — | - |
discountClassdefault | enum | — | - |
discountClassesdefault | string | — | - |
discountIddefault | string | — | - |
endsAtdefault | date | — | - |
recurringCycleLimitdefault | number | — | - |
startsAtdefault | date | — | - |
statusdefault | enum | — | - |
tagsdefault | string[] | — | - |
titledefault | string | — | - |
updatedAtdefault | date | — | - |
actiondefault | string | — | - |
additionalContentdefault | string | — | - |
additionalDatadefault | string | — | - |
appTitledefault | string | — | - |
argumentsdefault | string | — | - |
attributeToAppdefault | boolean | — | - |
attributeToUserdefault | boolean | — | - |
authordefault | string | — | - |
createdAtdefault | date | — | - |
criticalAlertdefault | boolean | — | - |
hasAdditionalContentdefault | boolean | — | - |
iddefault | id | — | - |
messagedefault | string | — | - |
secondaryMessagedefault | string | — | - |
subjectIddefault | string | — | - |
subjectTypedefault | enum | — | - |
iddefault | id | — | - |
compareDigestdefault | string | — | - |
createdAtdefault | date | — | - |
descriptiondefault | string | — | - |
iddefault | id | — | - |
jsonValuedefault | string | — | - |
keydefault | string | — | - |
namespacedefault | string | — | - |
ownerTypedefault | enum | — | - |
sizeInBytesdefault | number | — | - |
translatabledefault | boolean | — | - |
typedefault | string | — | - |
updatedAtdefault | date | — | - |
valuedefault | string | — | - |
descriptiondefault | string | — | - |
iddefault | id | → metafieldDefinitions | - |
keydefault | string | — | - |
namedefault | string | — | - |
namespacedefault | string | — | - |
ownerTypedefault | enum | — | - |
pinnedPositiondefault | number | — | - |
useAsCollectionConditiondefault | boolean | — | - |
validationStatusdefault | enum | — | - |
compareDigestdefault | string | — | - |
createdAtdefault | date | — | - |
descriptiondefault | string | — | - |
iddefault | id | → metafields | - |
jsonValuedefault | string | — | - |
keydefault | string | — | - |
namespacedefault | string | — | - |
ownerTypedefault | enum | — | - |
sizeInBytesdefault | number | — | - |
translatabledefault | boolean | — | - |
typedefault | string | — | - |
updatedAtdefault | date | — | - |
valuedefault | string | — | - |
Creation
Create Code Discount
Create a new code discount in Shopify.
Route: POST /codeDiscounts
Entrees configurables
| Name | Type | Required | Description |
|---|---|---|---|
basicCodeDiscount.appliesOncePerCustomer | boolean | No | - |
basicCodeDiscount.code | string | No | - |
basicCodeDiscount.combinesWith.orderDiscounts | boolean | No | - |
basicCodeDiscount.combinesWith.productDiscounts | boolean | No | - |
basicCodeDiscount.combinesWith.productDiscountsWithTagsOnSameCartLine.add | string[] | No | - |
basicCodeDiscount.combinesWith.productDiscountsWithTagsOnSameCartLine.remove | string[] | No | - |
basicCodeDiscount.combinesWith.shippingDiscounts | boolean | No | - |
basicCodeDiscount.context.all | enum | No | Values: ALL |
basicCodeDiscount.context.customers.add | string[] | No | - |
basicCodeDiscount.context.customers.remove | string[] | No | - |
basicCodeDiscount.context.customerSegments.add | string[] | No | - |
basicCodeDiscount.context.customerSegments.remove | string[] | No | - |
basicCodeDiscount.context.markets.add | string[] | No | - |
basicCodeDiscount.context.markets.remove | string[] | No | - |
basicCodeDiscount.customerGets.appliesOnOneTimePurchase | boolean | No | - |
basicCodeDiscount.customerGets.appliesOnSubscription | boolean | No | - |
basicCodeDiscount.customerGets.items.all | boolean | No | - |
basicCodeDiscount.customerGets.items.collections.add | string[] | No | - |
basicCodeDiscount.customerGets.items.collections.remove | string[] | No | - |
basicCodeDiscount.customerGets.items.products.productsToAdd | string[] | No | - |
basicCodeDiscount.customerGets.items.products.productsToRemove | string[] | No | - |
basicCodeDiscount.customerGets.items.products.productVariantsToAdd | string[] | No | - |
basicCodeDiscount.customerGets.items.products.productVariantsToRemove | string[] | No | - |
basicCodeDiscount.customerGets.value.discountAmount.amount | number | No | - |
basicCodeDiscount.customerGets.value.discountAmount.appliesOnEachItem | boolean | No | - |
basicCodeDiscount.customerGets.value.discountOnQuantity.effect.amount | number | No | - |
basicCodeDiscount.customerGets.value.discountOnQuantity.effect.percentage | number | No | - |
basicCodeDiscount.customerGets.value.discountOnQuantity.quantity | string | No | - |
basicCodeDiscount.customerGets.value.percentage | number | No | - |
basicCodeDiscount.endsAt | date | No | - |
basicCodeDiscount.minimumRequirement.quantity.greaterThanOrEqualToQuantity | string | No | - |
basicCodeDiscount.minimumRequirement.subtotal.greaterThanOrEqualToSubtotal | number | No | - |
basicCodeDiscount.recurringCycleLimit | number | No | - |
basicCodeDiscount.startsAt | date | No | - |
basicCodeDiscount.tags | string[] | No | - |
basicCodeDiscount.title | string | No | - |
basicCodeDiscount.usageLimit | number | No | - |
Donnees retournees dans Excel
Cette action retourne une confirmation plutot qu une table selectionnable.
Modification
Update Code Discount
Update an existing code discount in Shopify.
Route: PATCH /codeDiscounts/{id}
Entrees configurables
| Name | Type | Required | Description |
|---|---|---|---|
basicCodeDiscount.appliesOncePerCustomer | boolean | No | - |
basicCodeDiscount.code | string | No | - |
basicCodeDiscount.combinesWith.orderDiscounts | boolean | No | - |
basicCodeDiscount.combinesWith.productDiscounts | boolean | No | - |
basicCodeDiscount.combinesWith.productDiscountsWithTagsOnSameCartLine.add | string[] | No | - |
basicCodeDiscount.combinesWith.productDiscountsWithTagsOnSameCartLine.remove | string[] | No | - |
basicCodeDiscount.combinesWith.shippingDiscounts | boolean | No | - |
basicCodeDiscount.context.all | enum | No | Values: ALL |
basicCodeDiscount.context.customers.add | string[] | No | - |
basicCodeDiscount.context.customers.remove | string[] | No | - |
basicCodeDiscount.context.customerSegments.add | string[] | No | - |
basicCodeDiscount.context.customerSegments.remove | string[] | No | - |
basicCodeDiscount.context.markets.add | string[] | No | - |
basicCodeDiscount.context.markets.remove | string[] | No | - |
basicCodeDiscount.customerGets.appliesOnOneTimePurchase | boolean | No | - |
basicCodeDiscount.customerGets.appliesOnSubscription | boolean | No | - |
basicCodeDiscount.customerGets.items.all | boolean | No | - |
basicCodeDiscount.customerGets.items.collections.add | string[] | No | - |
basicCodeDiscount.customerGets.items.collections.remove | string[] | No | - |
basicCodeDiscount.customerGets.items.products.productsToAdd | string[] | No | - |
basicCodeDiscount.customerGets.items.products.productsToRemove | string[] | No | - |
basicCodeDiscount.customerGets.items.products.productVariantsToAdd | string[] | No | - |
basicCodeDiscount.customerGets.items.products.productVariantsToRemove | string[] | No | - |
basicCodeDiscount.customerGets.value.discountAmount.amount | number | No | - |
basicCodeDiscount.customerGets.value.discountAmount.appliesOnEachItem | boolean | No | - |
basicCodeDiscount.customerGets.value.discountOnQuantity.effect.amount | number | No | - |
basicCodeDiscount.customerGets.value.discountOnQuantity.effect.percentage | number | No | - |
basicCodeDiscount.customerGets.value.discountOnQuantity.quantity | string | No | - |
basicCodeDiscount.customerGets.value.percentage | number | No | - |
basicCodeDiscount.endsAt | date | No | - |
basicCodeDiscount.minimumRequirement.quantity.greaterThanOrEqualToQuantity | string | No | - |
basicCodeDiscount.minimumRequirement.subtotal.greaterThanOrEqualToSubtotal | number | No | - |
basicCodeDiscount.recurringCycleLimit | number | No | - |
basicCodeDiscount.startsAt | date | No | - |
basicCodeDiscount.tags | string[] | No | - |
basicCodeDiscount.title | string | No | - |
basicCodeDiscount.usageLimit | number | No | - |
id | string | Yes | - |
Donnees retournees dans Excel
Cette action retourne une confirmation plutot qu une table selectionnable.
Modification
Delete Code Discount
Delete an existing code discount in Shopify.
Route: DELETE /codeDiscounts/{id}
Entrees configurables
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | - |
Donnees retournees dans Excel
Cette action retourne une confirmation plutot qu une table selectionnable.