> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kibocommerce.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Flatten Bundle On Convert (After)

This action occurs after [flattening a configurable bundle on a subscription](/concept-guides/subscriptions#configuring-subscriptions). Changes made to the subscription or subscription items in this action persist in Kibo.

Use this flattenBundleOnConvert action for making line item adjustments when a subscription is converted from an order. Use the [validateProduct](/pages/subscriptions-validate-product-after) action for performing lien item adjustments when adding an item, updating a quantity, or creating a subscription.

<table><tbody><tr><th>Action Type</th><td>[Embedded](/pages/types-of-actions)</td></tr><tr><th>Full Action ID</th><td>embedded.commerce.subscription.flattenBundleOnConvertAfter</td></tr><tr><th>Runs multiple custom functions?</th><td>No</td></tr></tbody></table>

## JavaScript File Structure

Action files share the following basic structure:

```
module.exports = _function_(_context_, _callback_) {
   // Your custom code here
   callback();
};
```

When you code the custom function for an action, you have access to two arguments:

`callback`—This argument follows the established JavaScript callback pattern: it takes an error as the first argument (or null if there is no error) and a result as the second argument (if required).

`context`—This argument provides the function access to relevant objects and methods that interface with Kibo.

## Context: Subscription

The methods and objects documented here are available to this action through the use of the `context` argument.

**Microservice Operation**\
This action corresponds to the microservice that performs actions on a subscription.

## Get

### get.subscription

Obtains a response that includes information about the current subscription.

When the subscription includes a [configurable bundle](/concept-guides/subscriptions#configuring-subscriptions), the subscription context usually contains flattened line items while the subscriptionItem context contains data of the parent item. However, if you update an item's quantity then both the subscription and subscriptionItem context will contain the data of flattened items. Refer to item.parentItemCode for identifying the parent item as needed.

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| N/A       | N/A  | N/A         |

Example:

```
context.get.subscription();
```

Response:

```
{
  "id": "string",
  "siteId": 0,
  "tenantId": 0,
  "number": 0,
  "parentOrderId": "string",
  "items": [
    {
      "localeCode": "string",
      "purchaseLocation": "string",
      "lineId": 0,
      "product": {
        "productCode": "string",
        "name": "string",
        "description": "string",
        "goodsType": "string",
        "isPackagedStandAlone": false,
        "stock": {
          "manageStock": false,
          "isOnBackOrder": false,
          "availableDate": "1970-01-01T00:00:00.000Z",
          "stockAvailable": 0,
          "aggregateInventory": 0
        },
        "productReservationId": 0,
        "allocationId": 0,
        "allocationExpiration": "1970-01-01T00:00:00.000Z",
        "measurements": {
          "height": {
            "unit": "string",
            "value": 0
          },
          "width": {
            "unit": "string",
            "value": 0
          },
          "length": {
            "unit": "string",
            "value": 0
          },
          "weight": {
            "unit": "string",
            "value": 0
          }
        },
        "fulfillmentStatus": "string",
        "mfgPartNumber": "string",
        "upc": "string",
        "sku": "string",
        "fulfillmentTypesSupported": [
          "string"
        ],
        "imageAlternateText": "string",
        "imageUrl": "string",
        "variationProductCode": "string",
        "options": [
          {
            "name": "string",
            "value": "?",
            "shopperEnteredValue": "?",
            "attributeFQN": "string",
            "dataType": "string",
            "stringValue": "string"
          }
        ],
        "properties": [
          {
            "attributeFQN": "string",
            "name": "string",
            "dataType": "string",
            "isMultiValue": false,
            "values": [
              {
                "stringValue": "string",
                "value": "?"
              }
            ]
          }
        ],
        "categories": [
          {
            "id": 0,
            "parent": "/specs/openapi_subscription.yaml?ver=1.2218.4#/components/schemas/CommerceRuntimeCategory"
          }
        ],
        "price": {
          "price": 0,
          "salePrice": 0,
          "tenantOverridePrice": 0,
          "msrp": 0,
          "creditValue": 0,
          "priceListCode": "string",
          "priceListEntryMode": "string"
        },
        "discountsRestricted": false,
        "discountsRestrictedStartDate": "1970-01-01T00:00:00.000Z",
        "discountsRestrictedEndDate": "1970-01-01T00:00:00.000Z",
        "isRecurring": false,
        "isTaxable": false,
        "productType": "string",
        "productUsage": "string",
        "bundledProducts": [
          {
            "productCode": "string",
            "name": "string",
            "description": "string",
            "goodsType": "string",
            "isPackagedStandAlone": false,
            "stock": {
              "manageStock": false,
              "isOnBackOrder": false,
              "availableDate": "1970-01-01T00:00:00.000Z",
              "stockAvailable": 0,
              "aggregateInventory": 0
            },
            "productReservationId": 0,
            "allocationId": 0,
            "allocationExpiration": "1970-01-01T00:00:00.000Z",
            "measurements": {
              "height": {
                "unit": "string",
                "value": 0
              },
              "width": {
                "unit": "string",
                "value": 0
              },
              "length": {
                "unit": "string",
                "value": 0
              },
              "weight": {
                "unit": "string",
                "value": 0
              }
            },
            "fulfillmentStatus": "string",
            "quantity": 0,
            "optionAttributeFQN": "string",
            "optionValue": "?",
            "creditValue": 0,
            "deltaPrice": 0
          }
        ],
        "fulfillmentFields": [
          {
            "name": "string",
            "userEnteredValue": "?",
            "required": false
          }
        ]
      },
      "quantity": 0,
      "isRecurring": false,
      "isTaxable": false,
      "subtotal": 0,
      "extendedTotal": 0,
      "taxableTotal": 0,
      "discountTotal": 0,
      "discountedTotal": 0,
      "itemTaxTotal": 0,
      "shippingTaxTotal": 0,
      "shippingTotal": 0,
      "handlingAmount": 0,
      "feeTotal": 0,
      "total": 0,
      "unitPrice": {
        "extendedAmount": 0,
        "listAmount": 0,
        "saleAmount": 0,
        "overrideAmount": 0
      },
      "productDiscount": {
        "impact": 0,
        "discount": {
          "id": 0,
          "name": "string",
          "itemIds": [
            "string"
          ],
          "expirationDate": "1970-01-01T00:00:00.000Z",
          "hasMultipleTargetProducts": false
        },
        "couponCode": "string",
        "excluded": false,
        "appliesToSalePrice": false,
        "discountQuantity": 0
      },
      "productDiscounts": [
        {
          "impact": 0,
          "discount": {
            "id": 0,
            "name": "string",
            "itemIds": [
              "string"
            ],
            "expirationDate": "1970-01-01T00:00:00.000Z",
            "hasMultipleTargetProducts": false
          },
          "couponCode": "string",
          "excluded": false,
          "appliesToSalePrice": false,
          "discountQuantity": 0
        }
      ],
      "shippingDiscounts": [
        {
          "methodCode": "string",
          "discount": {
            "impact": 0,
            "discount": {
              "id": 0,
              "name": "string",
              "itemIds": [
                "string"
              ],
              "expirationDate": "1970-01-01T00:00:00.000Z",
              "hasMultipleTargetProducts": false
            },
            "couponCode": "string",
            "excluded": false
          },
          "discountQuantity": 0,
          "impactPerUnit": 0
        }
      ],
      "data": {},
      "taxData": {},
      "auditInfo": {
        "updateDate": "1970-01-01T00:00:00.000Z",
        "createDate": "1970-01-01T00:00:00.000Z",
        "updateBy": "string",
        "createBy": "string"
      },
      "shippingAmountBeforeDiscountsAndAdjustments": 0,
      "weightedOrderAdjustment": 0,
      "weightedOrderDiscount": 0,
      "adjustedLineItemSubtotal": 0,
      "totalWithoutWeightedShippingAndHandling": 0,
      "weightedOrderTax": 0,
      "weightedOrderShipping": 0,
      "weightedOrderShippingDiscount": 0,
      "weightedOrderShippingManualAdjustment": 0,
      "weightedOrderShippingTax": 0,
      "weightedOrderHandlingFee": 0,
      "weightedOrderHandlingFeeTax": 0,
      "weightedOrderHandlingFeeDiscount": 0,
      "weightedOrderDuty": 0,
      "totalWithWeightedShippingAndHandling": 0,
      "weightedOrderHandlingAdjustment": 0,
      "autoAddDiscountId": 0,
      "isAssemblyRequired": false,
      "childItemIds": [
        "string"
      ],
      "parentItemId": "string",
      "inventoryTags": [
        {
          "name": "string",
          "value": "string"
        }
      ],
      "lineItemAdjustment": 0,
      "id": "string",
      "fulfillmentLocationCode": "string",
      "fulfillmentMethod": "string",
      "parentItemCode": "string"
    }
  ],
  "payment": {
    "id": "string",
    "groupId": {
      "targetType": "string",
      "targetId": "string",
      "targetNumber": 0
    },
    "paymentServiceTransactionId": "string",
    "availableActions": [
      "string"
    ],
    "orderId": "string",
    "paymentType": "string",
    "paymentWorkflow": "string",
    "externalTransactionId": "string",
    "billingInfo": {
      "paymentType": "string",
      "paymentWorkflow": "string",
      "billingContact": {
        "id": 0,
        "email": "string",
        "firstName": "string",
        "middleNameOrInitial": "string",
        "lastNameOrSurname": "string",
        "companyOrOrganization": "string",
        "phoneNumbers": {
          "home": "string",
          "mobile": "string",
          "work": "string"
        },
        "address": {
          "address1": "string",
          "address2": "string",
          "address3": "string",
          "address4": "string",
          "cityOrTown": "string",
          "stateOrProvince": "string",
          "postalOrZipCode": "string",
          "countryCode": "string",
          "addressType": "string",
          "isValidated": false
        }
      },
      "isSameBillingShippingAddress": false,
      "card": {
        "paymentOrCardType": "string",
        "cardNumberPartOrMask": "string",
        "expireMonth": 0,
        "expireYear": 0,
        "bin": "string",
        "paymentServiceCardId": "string",
        "isUsedRecurring": false,
        "nameOnCard": "string",
        "isCardInfoSaved": false,
        "isTokenized": false,
        "ccLastFour": "string"
      },
      "token": {
        "paymentServiceTokenId": "string",
        "type": "string"
      },
      "purchaseOrder": {
        "purchaseOrderNumber": "string",
        "paymentTerm": {
          "code": "string",
          "description": "string"
        },
        "customFields": [
          {
            "code": "string",
            "label": "string",
            "value": "string"
          }
        ]
      },
      "check": {
        "checkNumber": "string"
      },
      "auditInfo": {
        "updateDate": "1970-01-01T00:00:00.000Z",
        "createDate": "1970-01-01T00:00:00.000Z",
        "updateBy": "string",
        "createBy": "string"
      },
      "storeCreditCode": "string",
      "storeCreditType": "string",
      "customCreditType": "string",
      "externalTransactionId": "string",
      "isRecurring": false,
      "recurringTransactionId": "string",
      "data": {}
    },
    "data": {},
    "status": "string",
    "subPayments": [
      {
        "status": "string",
        "amountCollected": 0,
        "amountCredited": 0,
        "amountRequested": 0,
        "amountRefunded": 0,
        "target": {
          "targetType": "string",
          "targetId": "string",
          "targetNumber": 0
        }
      }
    ],
    "interactions": [
      {
        "id": "string",
        "gatewayInteractionId": 0,
        "paymentId": "string",
        "orderId": "string",
        "target": {
          "targetType": "string",
          "targetId": "string",
          "targetNumber": 0
        },
        "currencyCode": "string",
        "interactionType": "string",
        "checkNumber": "string",
        "status": "string",
        "paymentEntryStatus": "string",
        "isRecurring": false,
        "isManual": false,
        "gatewayTransactionId": "string",
        "gatewayAuthCode": "string",
        "gatewayAVSCodes": "string",
        "gatewayCVV2Codes": "string",
        "gatewayResponseCode": "string",
        "gatewayResponseText": "string",
        "gatewayResponseData": [
          {
            "key": "string",
            "value": "string"
          }
        ],
        "paymentTransactionInteractionIdReference": 0,
        "amount": 0,
        "note": "string",
        "interactionDate": "1970-01-01T00:00:00.000Z",
        "auditInfo": {
          "updateDate": "1970-01-01T00:00:00.000Z",
          "createDate": "1970-01-01T00:00:00.000Z",
          "updateBy": "string",
          "createBy": "string"
        },
        "returnId": "string",
        "refundId": "string",
        "capturableShipmentsSummary": [
          {
            "shipmentNumber": 0,
            "shipmentTotal": 0,
            "amountApplied": 0
          }
        ]
      }
    ],
    "isRecurring": false,
    "amountCollected": 0,
    "amountCredited": 0,
    "amountRequested": 0,
    "changeMessages": [
      {
        "id": "string",
        "correlationId": "string",
        "userId": "string",
        "userFirstName": "string",
        "userLastName": "string",
        "userScopeType": "string",
        "appId": "string",
        "appKey": "string",
        "appName": "string",
        "subjectType": "string",
        "success": false,
        "identifier": "string",
        "subject": "string",
        "verb": "string",
        "message": "string",
        "metadata": "?",
        "createDate": "1970-01-01T00:00:00.000Z",
        "attributes": {}
      }
    ],
    "auditInfo": {
      "updateDate": "1970-01-01T00:00:00.000Z",
      "createDate": "1970-01-01T00:00:00.000Z",
      "updateBy": "string",
      "createBy": "string"
    },
    "gatewayGiftCard": {
      "id": "string",
      "cardNumber": "string",
      "cardPin": "string",
      "amount": 0,
      "currencyCode": "string"
    }
  },
  "priceListCode": "string",
  "notes": [
    {
      "id": "string",
      "text": "string",
      "auditInfo": {
        "updateDate": "1970-01-01T00:00:00.000Z",
        "createDate": "1970-01-01T00:00:00.000Z",
        "updateBy": "string",
        "createBy": "string"
      }
    }
  ],
  "oneTimeCouponCodes": [
    "string"
  ],
  "changeMessages": [
    {
      "id": "string",
      "correlationId": "string",
      "userId": "string",
      "userFirstName": "string",
      "userLastName": "string",
      "userScopeType": "string",
      "appId": "string",
      "appKey": "string",
      "appName": "string",
      "subjectType": "string",
      "success": false,
      "identifier": "string",
      "subject": "string",
      "verb": "string",
      "message": "string",
      "metadata": "?",
      "createDate": "1970-01-01T00:00:00.000Z",
      "attributes": {}
    }
  ],
  "auditInfo": {
    "updateDate": "1970-01-01T00:00:00.000Z",
    "createDate": "1970-01-01T00:00:00.000Z",
    "updateBy": "string",
    "createBy": "string"
  },
  "fulfillmentInfo": {
    "fulfillmentContact": {
      "id": 0,
      "email": "string",
      "firstName": "string",
      "middleNameOrInitial": "string",
      "lastNameOrSurname": "string",
      "companyOrOrganization": "string",
      "phoneNumbers": {
        "home": "string",
        "mobile": "string",
        "work": "string"
      },
      "address": {
        "address1": "string",
        "address2": "string",
        "address3": "string",
        "address4": "string",
        "cityOrTown": "string",
        "stateOrProvince": "string",
        "postalOrZipCode": "string",
        "countryCode": "string",
        "addressType": "string",
        "isValidated": false
      }
    },
    "isDestinationCommercial": false,
    "shippingMethodCode": "string",
    "shippingMethodName": "string",
    "data": {},
    "auditInfo": {
      "updateDate": "1970-01-01T00:00:00.000Z",
      "createDate": "1970-01-01T00:00:00.000Z",
      "updateBy": "string",
      "createBy": "string"
    }
  },
  "userId": "string",
  "customerAccountId": 0,
  "email": "string",
  "customerTaxId": "string",
  "isTaxExempt": false,
  "currencyCode": "string",
  "data": {},
  "taxData": {},
  "channelCode": "string",
  "locationCode": "string",
  "ipAddress": "string",
  "sourceDevice": "string",
  "visitId": "string",
  "webSessionId": "string",
  "customerInteractionType": "string",
  "frequency": {
    "unit": "string",
    "value": 0
  },
  "nextOrderDate": "1970-01-01T00:00:00.000Z",
  "ordinal": 0,
  "trial": {
    "enabled": false,
    "duration": 0,
    "substituteProductCode": "string",
    "substituteVariationProductCode": "string",
    "substituteProductOptions": [
      {
        "name": "string",
        "value": "?",
        "shopperEnteredValue": "?",
        "attributeFQN": "string",
        "dataType": "string",
        "stringValue": "string"
      }
    ]
  },
  "orderDiscounts": [
    {
      "impact": 0,
      "discount": {
        "id": 0,
        "name": "string",
        "itemIds": [
          "string"
        ],
        "expirationDate": "1970-01-01T00:00:00.000Z",
        "hasMultipleTargetProducts": false
      },
      "couponCode": "string",
      "excluded": false
    }
  ],
  "subTotal": 0,
  "itemLevelProductDiscountTotal": 0,
  "itemLevelAdjustmentsTotal": 0,
  "orderLevelProductDiscountTotal": 0,
  "itemTaxTotal": 0,
  "adjustment": {
    "amount": 0,
    "description": "string",
    "internalComment": "string"
  },
  "itemTotal": 0,
  "total": 0,
  "shippingDiscounts": [
    {
      "methodCode": "string",
      "discount": {
        "impact": 0,
        "discount": {
          "id": 0,
          "name": "string",
          "itemIds": [
            "string"
          ],
          "expirationDate": "1970-01-01T00:00:00.000Z",
          "hasMultipleTargetProducts": false
        },
        "couponCode": "string",
        "excluded": false
      }
    }
  ],
  "itemLevelShippingDiscountTotal": 0,
  "orderLevelShippingDiscountTotal": 0,
  "shippingAmount": 0,
  "shippingAdjustment": {
    "amount": 0,
    "description": "string",
    "internalComment": "string"
  },
  "shippingSubTotal": 0,
  "shippingTax": 0,
  "shippingTaxTotal": 0,
  "shippingTotal": 0,
  "handlingDiscounts": [
    {
      "impact": 0,
      "discount": {
        "id": 0,
        "name": "string",
        "itemIds": [
          "string"
        ],
        "expirationDate": "1970-01-01T00:00:00.000Z",
        "hasMultipleTargetProducts": false
      },
      "couponCode": "string",
      "excluded": false
    }
  ],
  "itemLevelHandlingDiscountTotal": 0,
  "orderLevelHandlingDiscountTotal": 0,
  "handlingAmount": 0,
  "handlingAdjustment": {
    "amount": 0,
    "description": "string",
    "internalComment": "string"
  },
  "handlingSubTotal": 0,
  "handlingTax": 0,
  "handlingTaxTotal": 0,
  "handlingTotal": 0,
  "dutyAmount": 0,
  "dutyTotal": 0,
  "feeTotal": 0,
  "status": "string",
  "reasons": [
    {
      "reasonCode": "string",
      "description": "string",
      "moreInfo": "string",
      "actionName": "string"
    }
  ],
  "couponCodes": [
    "string"
  ],
  "invalidCoupons": [
    {
      "couponCode": "string",
      "reasonCode": 0,
      "reason": "string",
      "createDate": "1970-01-01T00:00:00.000Z",
      "discountId": 0
    }
  ],
  "isImport": false,
  "externalId": "string",
  "lineItemSubtotalWithOrderAdjustments": 0,
  "discountedSubtotal": 0
}
```

For information about the properties in the response, refer to the [REST API Help](/api-overviews/openapi_subscription_overview).

### get.subscriptionItem

Obtains a response that includes information about the current subscription item.

When the subscription includes a [configurable bundle](/concept-guides/subscriptions#configuring-subscriptions), the subscription context usually contains flattened line items while the subscriptionItem context contains data of the parent item. However, if you update an item's quantity then both the subscription and subscriptionItem context will contain the data of flattened items. Refer to item.parentItemCode for identifying the parent item as needed.

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| N/A       | N/A  | N/A         |

Example:

```
context.get.subscriptionItem();
```

Response:

```
{
  "localeCode": "string",
  "purchaseLocation": "string",
  "lineId": 0,
  "product": {
    "productCode": "string",
    "name": "string",
    "description": "string",
    "goodsType": "string",
    "isPackagedStandAlone": true,
    "stock": {
      "manageStock": true,
      "isOnBackOrder": true,
      "availableDate": "2022-06-13T14:52:15.803Z",
      "stockAvailable": 0,
      "aggregateInventory": 0
    },
    "productReservationId": 0,
    "allocationId": 0,
    "allocationExpiration": "2022-06-13T14:52:15.803Z",
    "measurements": {
      "height": {
        "unit": "string",
        "value": 0
      },
      "width": {
        "unit": "string",
        "value": 0
      },
      "length": {
        "unit": "string",
        "value": 0
      },
      "weight": {
        "unit": "string",
        "value": 0
      }
    },
    "fulfillmentStatus": "string",
    "mfgPartNumber": "string",
    "upc": "string",
    "sku": "string",
    "fulfillmentTypesSupported": [
      "string"
    ],
    "imageAlternateText": "string",
    "imageUrl": "string",
    "variationProductCode": "string",
    "options": [
      {
        "name": "string",
        "attributeFQN": "string",
        "dataType": "string",
        "stringValue": "string"
      }
    ],
    "properties": [
      {
        "attributeFQN": "string",
        "name": "string",
        "dataType": "string",
        "isMultiValue": true,
        "values": [
          {
            "stringValue": "string"
          }
        ]
      }
    ],
    "categories": [
      {
        "id": 0
      }
    ],
    "price": {
      "price": 0,
      "salePrice": 0,
      "tenantOverridePrice": 0,
      "msrp": 0,
      "creditValue": 0,
      "priceListCode": "string",
      "priceListEntryMode": "string"
    },
    "discountsRestricted": true,
    "discountsRestrictedStartDate": "2022-06-13T14:52:15.803Z",
    "discountsRestrictedEndDate": "2022-06-13T14:52:15.803Z",
    "isRecurring": true,
    "isTaxable": true,
    "productType": "string",
    "productUsage": "string",
    "bundledProducts": [
      {
        "productCode": "string",
        "name": "string",
        "description": "string",
        "goodsType": "string",
        "isPackagedStandAlone": true,
        "stock": {
          "manageStock": true,
          "isOnBackOrder": true,
          "availableDate": "2022-06-13T14:52:15.803Z",
          "stockAvailable": 0,
          "aggregateInventory": 0
        },
        "productReservationId": 0,
        "allocationId": 0,
        "allocationExpiration": "2022-06-13T14:52:15.803Z",
        "measurements": {
          "height": {
            "unit": "string",
            "value": 0
          },
          "width": {
            "unit": "string",
            "value": 0
          },
          "length": {
            "unit": "string",
            "value": 0
          },
          "weight": {
            "unit": "string",
            "value": 0
          }
        },
        "fulfillmentStatus": "string",
        "quantity": 0,
        "optionAttributeFQN": "string",
        "creditValue": 0,
        "deltaPrice": 0
      }
    ],
    "fulfillmentFields": [
      {
        "name": "string",
        "required": true
      }
    ]
  },
  "quantity": 0,
  "isRecurring": true,
  "isTaxable": true,
  "subtotal": 0,
  "extendedTotal": 0,
  "taxableTotal": 0,
  "discountTotal": 0,
  "discountedTotal": 0,
  "itemTaxTotal": 0,
  "shippingTaxTotal": 0,
  "shippingTotal": 0,
  "handlingAmount": 0,
  "feeTotal": 0,
  "total": 0,
  "unitPrice": {
    "extendedAmount": 0,
    "listAmount": 0,
    "saleAmount": 0,
    "overrideAmount": 0
  },
  "productDiscount": {
    "impact": 0,
    "discount": {
      "id": 0,
      "name": "string",
      "itemIds": [
        "string"
      ],
      "expirationDate": "2022-06-13T14:52:15.803Z",
      "hasMultipleTargetProducts": true
    },
    "couponCode": "string",
    "excluded": true,
    "appliesToSalePrice": true,
    "discountQuantity": 0
  },
  "productDiscounts": [
    {
      "impact": 0,
      "discount": {
        "id": 0,
        "name": "string",
        "itemIds": [
          "string"
        ],
        "expirationDate": "2022-06-13T14:52:15.803Z",
        "hasMultipleTargetProducts": true
      },
      "couponCode": "string",
      "excluded": true,
      "appliesToSalePrice": true,
      "discountQuantity": 0
    }
  ],
  "shippingDiscounts": [
    {
      "methodCode": "string",
      "discount": {
        "impact": 0,
        "discount": {
          "id": 0,
          "name": "string",
          "itemIds": [
            "string"
          ],
          "expirationDate": "2022-06-13T14:52:15.803Z",
          "hasMultipleTargetProducts": true
        },
        "couponCode": "string",
        "excluded": true
      },
      "discountQuantity": 0,
      "impactPerUnit": 0
    }
  ],
  "data": {},
  "taxData": {},
  "auditInfo": {
    "updateDate": "2022-06-13T14:52:15.803Z",
    "createDate": "2022-06-13T14:52:15.803Z",
    "updateBy": "string",
    "createBy": "string"
  },
  "shippingAmountBeforeDiscountsAndAdjustments": 0,
  "weightedOrderAdjustment": 0,
  "weightedOrderDiscount": 0,
  "adjustedLineItemSubtotal": 0,
  "totalWithoutWeightedShippingAndHandling": 0,
  "weightedOrderTax": 0,
  "weightedOrderShipping": 0,
  "weightedOrderShippingDiscount": 0,
  "weightedOrderShippingManualAdjustment": 0,
  "weightedOrderShippingTax": 0,
  "weightedOrderHandlingFee": 0,
  "weightedOrderHandlingFeeTax": 0,
  "weightedOrderHandlingFeeDiscount": 0,
  "weightedOrderDuty": 0,
  "totalWithWeightedShippingAndHandling": 0,
  "weightedOrderHandlingAdjustment": 0,
  "autoAddDiscountId": 0,
  "isAssemblyRequired": true,
  "childItemIds": [
    "string"
  ],
  "parentItemId": "string",
  "inventoryTags": [
    {
      "name": "string",
      "value": "string"
    }
  ],
  "lineItemAdjustment": 0,
  "id": "string",
  "fulfillmentLocationCode": "string",
  "fulfillmentMethod": "string",
  "parentItemCode": "string"
}
```

For information about the properties in the response, refer to the [REST API Help](/api-overviews/openapi_subscription_overview).

## Exec

### exec.setItemOverridePrice

Sets the price on a line item that overrides the catalog or distributed bundle price.

| Parameter     | Type   | Description                                                        |
| ------------- | ------ | ------------------------------------------------------------------ |
| itemId        | string | The unique identifier of the item whose price is being overridden. |
| overridePrice | object | The new price of the item.                                         |

Example:

```
context.exec.setItemOverridePrice("123", overridePrice);
```

Response:

```
{
  "localeCode": "string",
  "purchaseLocation": "string",
  "lineId": 0,
  "product": {
    "productCode": "string",
    "name": "string",
    "description": "string",
    "goodsType": "string",
    "isPackagedStandAlone": true,
    "stock": {
      "manageStock": true,
      "isOnBackOrder": true,
      "availableDate": "2022-06-13T14:52:15.803Z",
      "stockAvailable": 0,
      "aggregateInventory": 0
    },
    "productReservationId": 0,
    "allocationId": 0,
    "allocationExpiration": "2022-06-13T14:52:15.803Z",
    "measurements": {
      "height": {
        "unit": "string",
        "value": 0
      },
      "width": {
        "unit": "string",
        "value": 0
      },
      "length": {
        "unit": "string",
        "value": 0
      },
      "weight": {
        "unit": "string",
        "value": 0
      }
    },
    "fulfillmentStatus": "string",
    "mfgPartNumber": "string",
    "upc": "string",
    "sku": "string",
    "fulfillmentTypesSupported": [
      "string"
    ],
    "imageAlternateText": "string",
    "imageUrl": "string",
    "variationProductCode": "string",
    "options": [
      {
        "name": "string",
        "attributeFQN": "string",
        "dataType": "string",
        "stringValue": "string"
      }
    ],
    "properties": [
      {
        "attributeFQN": "string",
        "name": "string",
        "dataType": "string",
        "isMultiValue": true,
        "values": [
          {
            "stringValue": "string"
          }
        ]
      }
    ],
    "categories": [
      {
        "id": 0
      }
    ],
    "price": {
      "price": 0,
      "salePrice": 0,
      "tenantOverridePrice": 0,
      "msrp": 0,
      "creditValue": 0,
      "priceListCode": "string",
      "priceListEntryMode": "string"
    },
    "discountsRestricted": true,
    "discountsRestrictedStartDate": "2022-06-13T14:52:15.803Z",
    "discountsRestrictedEndDate": "2022-06-13T14:52:15.803Z",
    "isRecurring": true,
    "isTaxable": true,
    "productType": "string",
    "productUsage": "string",
    "bundledProducts": [
      {
        "productCode": "string",
        "name": "string",
        "description": "string",
        "goodsType": "string",
        "isPackagedStandAlone": true,
        "stock": {
          "manageStock": true,
          "isOnBackOrder": true,
          "availableDate": "2022-06-13T14:52:15.803Z",
          "stockAvailable": 0,
          "aggregateInventory": 0
        },
        "productReservationId": 0,
        "allocationId": 0,
        "allocationExpiration": "2022-06-13T14:52:15.803Z",
        "measurements": {
          "height": {
            "unit": "string",
            "value": 0
          },
          "width": {
            "unit": "string",
            "value": 0
          },
          "length": {
            "unit": "string",
            "value": 0
          },
          "weight": {
            "unit": "string",
            "value": 0
          }
        },
        "fulfillmentStatus": "string",
        "quantity": 0,
        "optionAttributeFQN": "string",
        "creditValue": 0,
        "deltaPrice": 0
      }
    ],
    "fulfillmentFields": [
      {
        "name": "string",
        "required": true
      }
    ]
  },
  "quantity": 0,
  "isRecurring": true,
  "isTaxable": true,
  "subtotal": 0,
  "extendedTotal": 0,
  "taxableTotal": 0,
  "discountTotal": 0,
  "discountedTotal": 0,
  "itemTaxTotal": 0,
  "shippingTaxTotal": 0,
  "shippingTotal": 0,
  "handlingAmount": 0,
  "feeTotal": 0,
  "total": 0,
  "unitPrice": {
    "extendedAmount": 0,
    "listAmount": 0,
    "saleAmount": 0,
    "overrideAmount": 0
  },
  "productDiscount": {
    "impact": 0,
    "discount": {
      "id": 0,
      "name": "string",
      "itemIds": [
        "string"
      ],
      "expirationDate": "2022-06-13T14:52:15.803Z",
      "hasMultipleTargetProducts": true
    },
    "couponCode": "string",
    "excluded": true,
    "appliesToSalePrice": true,
    "discountQuantity": 0
  },
  "productDiscounts": [
    {
      "impact": 0,
      "discount": {
        "id": 0,
        "name": "string",
        "itemIds": [
          "string"
        ],
        "expirationDate": "2022-06-13T14:52:15.803Z",
        "hasMultipleTargetProducts": true
      },
      "couponCode": "string",
      "excluded": true,
      "appliesToSalePrice": true,
      "discountQuantity": 0
    }
  ],
  "shippingDiscounts": [
    {
      "methodCode": "string",
      "discount": {
        "impact": 0,
        "discount": {
          "id": 0,
          "name": "string",
          "itemIds": [
            "string"
          ],
          "expirationDate": "2022-06-13T14:52:15.803Z",
          "hasMultipleTargetProducts": true
        },
        "couponCode": "string",
        "excluded": true
      },
      "discountQuantity": 0,
      "impactPerUnit": 0
    }
  ],
  "data": {},
  "taxData": {},
  "auditInfo": {
    "updateDate": "2022-06-13T14:52:15.803Z",
    "createDate": "2022-06-13T14:52:15.803Z",
    "updateBy": "string",
    "createBy": "string"
  },
  "shippingAmountBeforeDiscountsAndAdjustments": 0,
  "weightedOrderAdjustment": 0,
  "weightedOrderDiscount": 0,
  "adjustedLineItemSubtotal": 0,
  "totalWithoutWeightedShippingAndHandling": 0,
  "weightedOrderTax": 0,
  "weightedOrderShipping": 0,
  "weightedOrderShippingDiscount": 0,
  "weightedOrderShippingManualAdjustment": 0,
  "weightedOrderShippingTax": 0,
  "weightedOrderHandlingFee": 0,
  "weightedOrderHandlingFeeTax": 0,
  "weightedOrderHandlingFeeDiscount": 0,
  "weightedOrderDuty": 0,
  "totalWithWeightedShippingAndHandling": 0,
  "weightedOrderHandlingAdjustment": 0,
  "autoAddDiscountId": 0,
  "isAssemblyRequired": true,
  "childItemIds": [
    "string"
  ],
  "parentItemId": "string",
  "inventoryTags": [
    {
      "name": "string",
      "value": "string"
    }
  ],
  "lineItemAdjustment": 0,
  "id": "string",
  "fulfillmentLocationCode": "string",
  "fulfillmentMethod": "string",
  "parentItemCode": "string"
}
```

For information about the properties in the response, refer to the [REST API Help](/api-overviews/openapi_subscription_overview).

### exec.setLineItemAdjustment

Adjusts a line item that overrides the catalog or distributed bundle amount.

| Parameter       | Type   | Description                                       |
| --------------- | ------ | ------------------------------------------------- |
| itemId          | string | The unique identifier of the item being adjusted. |
| adjustmentPrice | object | The adjusted price of the item.                   |

Example:

```
context.exec.setItemOverridePrice("123", adjustmentPrice);
```

Response:

```
{
  "localeCode": "string",
  "purchaseLocation": "string",
  "lineId": 0,
  "product": {
    "productCode": "string",
    "name": "string",
    "description": "string",
    "goodsType": "string",
    "isPackagedStandAlone": true,
    "stock": {
      "manageStock": true,
      "isOnBackOrder": true,
      "availableDate": "2022-06-13T14:52:15.803Z",
      "stockAvailable": 0,
      "aggregateInventory": 0
    },
    "productReservationId": 0,
    "allocationId": 0,
    "allocationExpiration": "2022-06-13T14:52:15.803Z",
    "measurements": {
      "height": {
        "unit": "string",
        "value": 0
      },
      "width": {
        "unit": "string",
        "value": 0
      },
      "length": {
        "unit": "string",
        "value": 0
      },
      "weight": {
        "unit": "string",
        "value": 0
      }
    },
    "fulfillmentStatus": "string",
    "mfgPartNumber": "string",
    "upc": "string",
    "sku": "string",
    "fulfillmentTypesSupported": [
      "string"
    ],
    "imageAlternateText": "string",
    "imageUrl": "string",
    "variationProductCode": "string",
    "options": [
      {
        "name": "string",
        "attributeFQN": "string",
        "dataType": "string",
        "stringValue": "string"
      }
    ],
    "properties": [
      {
        "attributeFQN": "string",
        "name": "string",
        "dataType": "string",
        "isMultiValue": true,
        "values": [
          {
            "stringValue": "string"
          }
        ]
      }
    ],
    "categories": [
      {
        "id": 0
      }
    ],
    "price": {
      "price": 0,
      "salePrice": 0,
      "tenantOverridePrice": 0,
      "msrp": 0,
      "creditValue": 0,
      "priceListCode": "string",
      "priceListEntryMode": "string"
    },
    "discountsRestricted": true,
    "discountsRestrictedStartDate": "2022-06-13T14:52:15.803Z",
    "discountsRestrictedEndDate": "2022-06-13T14:52:15.803Z",
    "isRecurring": true,
    "isTaxable": true,
    "productType": "string",
    "productUsage": "string",
    "bundledProducts": [
      {
        "productCode": "string",
        "name": "string",
        "description": "string",
        "goodsType": "string",
        "isPackagedStandAlone": true,
        "stock": {
          "manageStock": true,
          "isOnBackOrder": true,
          "availableDate": "2022-06-13T14:52:15.803Z",
          "stockAvailable": 0,
          "aggregateInventory": 0
        },
        "productReservationId": 0,
        "allocationId": 0,
        "allocationExpiration": "2022-06-13T14:52:15.803Z",
        "measurements": {
          "height": {
            "unit": "string",
            "value": 0
          },
          "width": {
            "unit": "string",
            "value": 0
          },
          "length": {
            "unit": "string",
            "value": 0
          },
          "weight": {
            "unit": "string",
            "value": 0
          }
        },
        "fulfillmentStatus": "string",
        "quantity": 0,
        "optionAttributeFQN": "string",
        "creditValue": 0,
        "deltaPrice": 0
      }
    ],
    "fulfillmentFields": [
      {
        "name": "string",
        "required": true
      }
    ]
  },
  "quantity": 0,
  "isRecurring": true,
  "isTaxable": true,
  "subtotal": 0,
  "extendedTotal": 0,
  "taxableTotal": 0,
  "discountTotal": 0,
  "discountedTotal": 0,
  "itemTaxTotal": 0,
  "shippingTaxTotal": 0,
  "shippingTotal": 0,
  "handlingAmount": 0,
  "feeTotal": 0,
  "total": 0,
  "unitPrice": {
    "extendedAmount": 0,
    "listAmount": 0,
    "saleAmount": 0,
    "overrideAmount": 0
  },
  "productDiscount": {
    "impact": 0,
    "discount": {
      "id": 0,
      "name": "string",
      "itemIds": [
        "string"
      ],
      "expirationDate": "2022-06-13T14:52:15.803Z",
      "hasMultipleTargetProducts": true
    },
    "couponCode": "string",
    "excluded": true,
    "appliesToSalePrice": true,
    "discountQuantity": 0
  },
  "productDiscounts": [
    {
      "impact": 0,
      "discount": {
        "id": 0,
        "name": "string",
        "itemIds": [
          "string"
        ],
        "expirationDate": "2022-06-13T14:52:15.803Z",
        "hasMultipleTargetProducts": true
      },
      "couponCode": "string",
      "excluded": true,
      "appliesToSalePrice": true,
      "discountQuantity": 0
    }
  ],
  "shippingDiscounts": [
    {
      "methodCode": "string",
      "discount": {
        "impact": 0,
        "discount": {
          "id": 0,
          "name": "string",
          "itemIds": [
            "string"
          ],
          "expirationDate": "2022-06-13T14:52:15.803Z",
          "hasMultipleTargetProducts": true
        },
        "couponCode": "string",
        "excluded": true
      },
      "discountQuantity": 0,
      "impactPerUnit": 0
    }
  ],
  "data": {},
  "taxData": {},
  "auditInfo": {
    "updateDate": "2022-06-13T14:52:15.803Z",
    "createDate": "2022-06-13T14:52:15.803Z",
    "updateBy": "string",
    "createBy": "string"
  },
  "shippingAmountBeforeDiscountsAndAdjustments": 0,
  "weightedOrderAdjustment": 0,
  "weightedOrderDiscount": 0,
  "adjustedLineItemSubtotal": 0,
  "totalWithoutWeightedShippingAndHandling": 0,
  "weightedOrderTax": 0,
  "weightedOrderShipping": 0,
  "weightedOrderShippingDiscount": 0,
  "weightedOrderShippingManualAdjustment": 0,
  "weightedOrderShippingTax": 0,
  "weightedOrderHandlingFee": 0,
  "weightedOrderHandlingFeeTax": 0,
  "weightedOrderHandlingFeeDiscount": 0,
  "weightedOrderDuty": 0,
  "totalWithWeightedShippingAndHandling": 0,
  "weightedOrderHandlingAdjustment": 0,
  "autoAddDiscountId": 0,
  "isAssemblyRequired": true,
  "childItemIds": [
    "string"
  ],
  "parentItemId": "string",
  "inventoryTags": [
    {
      "name": "string",
      "value": "string"
    }
  ],
  "lineItemAdjustment": 0,
  "id": "string",
  "fulfillmentLocationCode": "string",
  "fulfillmentMethod": "string",
  "parentItemCode": "string"
}
```

For information about the properties in the response, refer to the [REST API Help](/api-overviews/openapi_subscription_overview).

## Context Objects Available to All Actions

### apiContext

Accesses tenant information.

| Property            | Type      | Description                                                                                                                                              |
| ------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| baseUrl             | string    | The base URL for the site.                                                                                                                               |
| basePciUrl          | string    | The base PCI URL for the site.                                                                                                                           |
| tenantPod           | string    | The name of the tenant pod in which the tenant resides.                                                                                                  |
| appClaims           | string    | The application claims token.                                                                                                                            |
| appKey              | string    | The application key.                                                                                                                                     |
| tenantId            | integer   | Unique identifier for the tenant.                                                                                                                        |
| siteId              | integer   | Unique identifier for the site. This ID is used at all levels of a store, catalog, and tenant to associate objects to a site.                            |
| masterCatalogId     | integer   | Unique identifier for the master catalog.                                                                                                                |
| catalogId           | integer   | The unique identifier for the product catalog. Catalogs are part of a master catalog.                                                                    |
| currencyCode        | string    | The default three-letter ISO currency code for monetary amounts.                                                                                         |
| previewDate         | date/time | The date and time that the content is being viewed. This might be a future date if the content is previewed with an active date range set in the future. |
| localeCode          | string    | The locale code per the country code provided. This code determines the localized content to use and display.                                            |
| correlationId       | string    | The unique identifier of the API request associated with the event action, which might contain multiple actions.                                         |
| isAuthorizedAsAdmin | Boolean   | Indicates whether the Dev Account user is authorized as an admin.                                                                                        |
| userClaims          | string    | The user claims token.                                                                                                                                   |

Example:

```
context.apiContext.baseUrl;
```

### configuration

Receives a JSON response that contains information about the configuration data set in the Action Management JSON editor.

| Property | Type   | Description                                                                     |
| -------- | ------ | ------------------------------------------------------------------------------- |
| Varies   | object | Custom fields and values that you can set in the Action Management JSON Editor. |

Example:

```
context.configuration.customData;
```
