{"id":1107,"url":"https://forum.supero.dev/t/adding-my-own-fields-to-the-cart-and-order-1107","title":"Adding my own fields to the cart and order","type":"question","status":"solved","category":{"slug":"transactions","name":"Transactional Services"},"tags":["cart","data-model","javascript"],"author":{"handle":"supero-support","name":"Supero Support","team":true},"created":"2026-12-04T02:40:38.705Z","updated":"2026-12-04T02:40:38.705Z","upvotes":0,"error_text":null,"environment":{"client":null,"sdk_version":null,"deploy_target":null},"body_markdown":"I need a `gift_wrap` flag on the cart. Do I add it to the platform cart schema, or keep a separate table next to it? And once it's in my own schema, how does `checkout_cart` know to use that schema?","answers":[{"id":"4c35eb0c-35de-4a2f-b54f-c220c0e0058e","url":"https://forum.supero.dev/t/adding-my-own-fields-to-the-cart-and-order-1107#post-4c35eb0c-35de-4a2f-b54f-c220c0e0058e","author":{"handle":"supero-integrations","name":"Supero Integrations team","team":true},"accepted":true,"official":false,"outdated":false,"sdk_version":null,"upvotes":0,"created":"2026-12-04T02:40:38.705Z","updated":"2026-12-04T02:40:38.705Z","body_markdown":"Make your own schema extend the base and add the field there:\n\n```json\n{\"name\": \"luxe_cart\", \"parent_type\": \"tenant\", \"extends\": \"cart:base_cart\",\n \"attributes\": [{\"name\": \"gift_wrap\", \"type\": \"boolean\", \"default-value\": false}]}\n```\n\nYour schema inherits the base's status, timestamps and totals. Operations work out which schema to act on from the `extending_schema` inputs. Cart, order, approval, inventory, loyalty_points and document_signature each take two, a header and a line schema (`cart_item_extending_schema` for the cart). Register them once in the browser client instead of passing them on every call:\n\n```js\nclient.transactional.registerExtensions({\n  cart:  { extending_schema: 'myns:luxe_cart', cart_item_extending_schema: 'myns:luxe_cart_item',\n           customer_extending_schema: 'myns:luxe_customer' },\n  order: { extending_schema: 'myns:luxe_order', order_item_extending_schema: 'myns:luxe_order_item' }\n});\n```\n\n`add_to_cart` needs the customer schema as well. In Python, `register_extensions` takes a tuple for the two-schema services. The service has to be imported into the project before any of this works.","comments":[]}],"licence":"CC BY-SA 4.0 (code: MIT-0)"}