Skip to content

Instantly share code, notes, and snippets.

@viggin543
Created April 19, 2021 09:23
Show Gist options
  • Save viggin543/f2a8677c9a6ee8a3fbb5e4094a540c30 to your computer and use it in GitHub Desktop.
Save viggin543/f2a8677c9a6ee8a3fbb5e4094a540c30 to your computer and use it in GitHub Desktop.
cart_with_absolute_discount_code_and_a_relative_discount_code.json
{
"version": 17,
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 4930000
},
"taxedPrice": {
"totalNet": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 4930000
},
"totalGross": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 5312075
},
"taxPortions": [
{
"rate": 0,
"name": "StateSalesTaxRate",
"amount": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 0
}
},
{
"rate": 0,
"name": "CountyTaxRate",
"amount": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 0
}
},
{
"rate": 0,
"name": "SpecialTaxRate",
"amount": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 0
}
},
{
"rate": 0,
"name": "CityTaxRate",
"amount": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 0
}
},
{
"rate": 0.005,
"name": "SpecialTaxRate",
"amount": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 24650
}
},
{
"rate": 0.01,
"name": "CountyTaxRate",
"amount": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 49300
}
},
{
"rate": 0.0625,
"name": "StateSalesTaxRate",
"amount": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 308125
}
}
]
},
"taxRoundingMode": "HalfEven",
"taxMode": "External",
"taxCalculationMode": "LineItemLevel",
"store": {
"typeId": "store",
"key": "test_store"
},
"shippingInfo": {
"taxedPrice": {
"totalNet": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 0
},
"totalGross": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 0
}
},
"taxRate": {
"subRates": [
{
"name": "CityTaxRate",
"amount": 0
},
{
"name": "StateSalesTaxRate",
"amount": 0
},
{
"name": "CountyTaxRate",
"amount": 0
},
{
"name": "SpecialTaxRate",
"amount": 0
}
],
"state": "CA",
"name": "shipping tax",
"includedInPrice": false,
"country": "US",
"amount": 0
},
"shippingRate": {
"tiers": [],
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 700
},
"isMatching": false,
"freeAbove": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 7000
}
},
"shippingMethodState": "MatchesCart",
"shippingMethodName": "Fedex standard shipping method",
"shippingMethod": {
"typeId": "shipping-method",
"id": "85d162d0-59dd-49e4-be67-f174cc046d08"
},
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 0
}
},
"shippingAddress": {
"title": "Home sweet home",
"streetNumber": "9501",
"streetName": "Gilman Drive",
"state": "CA",
"postalCode": "92093",
"country": "US",
"city": "La Jolla"
},
"refusedGifts": [],
"origin": "Customer",
"lineItems": [
{
"variant": {
"sku": "slug-iddq1d-black-stone",
"scopedPriceDiscounted": false,
"prices": [
{
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 987
},
"id": "c5144973-95d2-465c-be4c-89e744dde79a",
"country": "US",
"channel": {
"typeId": "channel",
"id": "3adf70cf-7047-4b05-a0d6-77ea0a5aabac"
}
}
],
"key": "key-iddq1d-black-stone",
"isMatchingVariant": false,
"id": 1,
"availability": {
"isOnStock": false,
"channels": {
"fff3e19c-f565-42b3-b0be-be66f4343145": {
"availableQuantity": 97,
"isOnStock": true
}
}
},
"attributes": [
{
"value": {
"key": "search",
"label": "search"
},
"name": "visibility"
},
{
"value": "53121600A0000",
"name": "us_tax_code"
},
{
"value": false,
"name": "isArchived"
},
{
"value": "CN",
"name": "manufacturerCountry"
},
{
"value": "stone",
"name": "material"
},
{
"value": 500,
"name": "weight"
},
{
"value": {
"key": "adika",
"label": "adika"
},
"name": "vendor"
},
{
"value": {
"key": "black",
"label": {
"en": "black"
}
},
"name": "color"
}
]
},
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 4930000
},
"taxedPrice": {
"totalNet": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 4930000
},
"totalGross": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 5312075
}
},
"taxRate": {
"subRates": [
{
"name": "CityTaxRate",
"amount": 0
},
{
"name": "StateSalesTaxRate",
"amount": 0.0625
},
{
"name": "CountyTaxRate",
"amount": 0.01
},
{
"name": "SpecialTaxRate",
"amount": 0.005
}
],
"state": "CA",
"name": "d49f3fa3-6e6a-4645-acf9-f965cb4100d0",
"includedInPrice": false,
"country": "US",
"amount": 0.0775
},
"state": [
{
"state": {
"typeId": "state",
"id": "8a39e467-348c-4217-839f-a3a55452ec92"
},
"quantity": 10000
}
],
"quantity": 10000,
"productType": {
"typeId": "product-type",
"id": "72bbdeab-0c62-42df-91d0-361015375c84"
},
"productSlug": {
"en": "slug-iddq1d"
},
"productId": "54e26071-eb8d-46ca-b23b-18ab1f28cec0",
"priceMode": "Platform",
"price": {
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 987
},
"id": "c5144973-95d2-465c-be4c-89e744dde79a",
"country": "US",
"channel": {
"typeId": "channel",
"id": "3adf70cf-7047-4b05-a0d6-77ea0a5aabac"
}
},
"name": {
"en": "a very nice bag"
},
"lineItemMode": "Standard",
"id": "d49f3fa3-6e6a-4645-acf9-f965cb4100d0",
"distributionChannel": {
"typeId": "channel",
"id": "3adf70cf-7047-4b05-a0d6-77ea0a5aabac"
},
"discountedPricePerQuantity": [
{
"quantity": 10000,
"discountedPrice": {
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 493
},
"includedDiscounts": [
{
"discountedAmount": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 1
},
"discount": {
"typeId": "cart-discount",
"id": "e6bddbb2-60a5-4169-8ca0-1c6f8eab9802"
}
},
{
"discountedAmount": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 493
},
"discount": {
"typeId": "cart-discount",
"id": "08e7bfe0-782c-4813-be51-437bdda68da4"
}
}
]
}
}
],
"addedAt": "2021-04-19T09:21:36.448Z"
}
],
"lastModifiedBy": {
"clientId": "eJCWl209M2WeNpLPhcwDVKvk"
},
"lastModifiedAt": "2021-04-19T09:21:38.793Z",
"inventoryMode": "None",
"id": "ff294542-b329-48e6-9687-3712bd603d7d",
"discountCodes": [
{
"state": "MatchesCart",
"discountCode": {
"typeId": "discount-code",
"id": "8d67273b-2985-4861-a03a-2a0b24493980",
"obj": {
"version": 6,
"references": [],
"name": {
"en": "test_discount_code DONT DELETE ME",
"he": ""
},
"lastModifiedBy": {},
"lastModifiedAt": "2021-04-19T06:34:04.206Z",
"isActive": true,
"id": "8d67273b-2985-4861-a03a-2a0b24493980",
"groups": [],
"description": {
"en": "DONT DELETE ME",
"he": ""
},
"createdBy": {},
"createdAt": "2021-03-04T11:57:42.54Z",
"code": "test_discount_code_50_percent_off",
"cartDiscounts": [
{
"typeId": "cart-discount",
"id": "08e7bfe0-782c-4813-be51-437bdda68da4",
"obj": {
"version": 6,
"value": {
"type": "relative",
"permyriad": 5000
},
"target": {
"type": "lineItems",
"predicate": "1 = 1"
},
"stackingMode": "Stacking",
"sortOrder": "0.99",
"requiresDiscountCode": true,
"references": [],
"name": {
"en": "test discount DONT DELETE ME",
"he": ""
},
"lastModifiedBy": {},
"lastModifiedAt": "2021-04-19T05:05:22.243Z",
"isActive": true,
"id": "08e7bfe0-782c-4813-be51-437bdda68da4",
"description": {
"en": "test discount 50%",
"he": ""
},
"createdBy": {},
"createdAt": "2021-03-04T11:57:02.032Z",
"cartPredicate": "1 = 1"
}
}
]
}
}
},
{
"state": "MatchesCart",
"discountCode": {
"typeId": "discount-code",
"id": "719badc2-7ccd-408b-b60a-1074dbb3a6cc",
"obj": {
"version": 3,
"references": [],
"name": {
"en": "customer_service_compensation_100_usd DONT DELETE ME",
"he": ""
},
"maxApplicationsPerCustomer": 1,
"lastModifiedBy": {},
"lastModifiedAt": "2021-04-19T05:05:41.008Z",
"isActive": true,
"id": "719badc2-7ccd-408b-b60a-1074dbb3a6cc",
"groups": [],
"description": {
"en": "customer_service_compensation_100_usd",
"he": ""
},
"createdBy": {},
"createdAt": "2021-04-18T11:38:58.804Z",
"code": "customer_service_compensation_100_usd",
"cartDiscounts": [
{
"typeId": "cart-discount",
"id": "e6bddbb2-60a5-4169-8ca0-1c6f8eab9802",
"obj": {
"version": 6,
"value": {
"type": "absolute",
"money": [
{
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 10000
}
]
},
"target": {
"type": "lineItems",
"predicate": "1 = 1"
},
"stackingMode": "Stacking",
"sortOrder": "0.999999",
"requiresDiscountCode": true,
"references": [],
"name": {
"en": "customer_service_compensation_100_usd DONT DELETE ME",
"he": ""
},
"lastModifiedBy": {},
"lastModifiedAt": "2021-04-19T06:34:37.225Z",
"key": "customer_service_compensation_100_usd",
"isActive": true,
"id": "e6bddbb2-60a5-4169-8ca0-1c6f8eab9802",
"description": {
"en": "customer_service_compensation_100_usd",
"he": ""
},
"createdBy": {},
"createdAt": "2021-04-18T11:38:37.353Z",
"cartPredicate": "1 = 1"
}
}
]
}
}
}
],
"deleteDaysAfterLastModification": 90,
"customLineItems": [],
"createdBy": {
"clientId": "0bqrNAj0vFBHsTIlPvd2Wxm9",
"anonymousId": "af10fcfc-2e21-4e6e-8003-8ad6734621d8"
},
"createdAt": "2021-04-19T09:21:36.452Z",
"country": "US",
"cartState": "Active",
"anonymousId": "af10fcfc-2e21-4e6e-8003-8ad6734621d8"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment