{"openapi":"3.1.0","info":{"title":"Terminal API","description":"The Terminal API gives you access to the same API that powers the award winning Terminal SSH shop.","version":"1.0.3"},"components":{"securitySchemes":{"Bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Product":{"type":"object","properties":{"id":{"type":"string","description":"Unique object identifier.\nThe format and length of IDs may change over time.","example":"prd_XXXXXXXXXXXXXXXXXXXXXXXXX"},"name":{"type":"string","description":"Name of the product.","example":"[object Object]"},"description":{"type":"string","description":"Description of the product.","example":"The interpolation of Caturra and Castillo varietals from Las Cochitas creates this refreshing citrusy and complex coffee."},"variants":{"type":"array","items":{"$ref":"#/components/schemas/ProductVariant"},"description":"List of variants of the product.","example":[{"id":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"12oz","price":2200}]},"order":{"type":"integer","description":"Order of the product used when displaying a sorted list of products.","example":100},"subscription":{"type":"string","enum":["allowed","required"],"description":"Whether the product must be or can be subscribed to.","example":"allowed"},"tags":{"type":"object","properties":{"app":{"type":"string"},"color":{"type":"string"},"featured":{"type":"boolean"},"market_na":{"type":"boolean"},"market_eu":{"type":"boolean"},"market_global":{"type":"boolean"}},"description":"Tags for the product.","example":{"featured":true}},"timeHidden":{"type":"string","description":"Timestamp when the product was hidden from public view."}},"required":["id","name","description","variants"],"description":"Product sold in the Terminal shop.","example":{"id":"prd_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"[object Object]","description":"The interpolation of Caturra and Castillo varietals from Las Cochitas creates this refreshing citrusy and complex coffee.","variants":[{"id":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"12oz","price":2200}],"order":100,"subscription":"allowed","tags":{"featured":true},"filters":[]}},"ProductVariant":{"type":"object","properties":{"id":{"type":"string","description":"Unique object identifier.\nThe format and length of IDs may change over time.","example":"var_XXXXXXXXXXXXXXXXXXXXXXXXX"},"name":{"type":"string","description":"Name of the product variant.","example":"12oz"},"price":{"type":"integer","minimum":0,"description":"Price of the product variant in cents (USD).","example":2200},"tags":{"type":"object","properties":{"app":{"type":"string"},"market_na":{"type":"boolean"},"market_eu":{"type":"boolean"},"market_global":{"type":"boolean"}},"description":"Tags for the product variant."}},"required":["id","name","price"],"description":"Variant of a product in the Terminal shop.","example":{"id":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"12oz","price":2200}},"ErrorResponse":{"type":"object","properties":{"type":{"type":"string","enum":["validation","authentication","forbidden","not_found","rate_limit","internal"],"description":"The error type category","examples":["validation","authentication"]},"code":{"type":"string","description":"Machine-readable error code identifier","examples":["invalid_parameter","missing_required_field","unauthorized"]},"message":{"type":"string","description":"Human-readable error message","examples":["The request was invalid","Authentication required"]},"param":{"type":"string","description":"The parameter that caused the error (if applicable)","examples":["email","user_id"]},"details":{"description":"Additional error context information"}},"required":["type","code","message"]},"Profile":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}},"required":["user"],"description":"A Terminal shop user's profile. (We have users, btw.)","example":{"user":{"id":"usr_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"John Doe","email":"john@example.com","fingerprint":"183ded44-24d0-480e-9908-c022eff8d111","stripeCustomerID":"cus_XXXXXXXXXXXXXXXXX"}}},"User":{"type":"object","properties":{"id":{"type":"string","description":"Unique object identifier.\nThe format and length of IDs may change over time.","example":"usr_XXXXXXXXXXXXXXXXXXXXXXXXX"},"name":{"type":["string","null"],"description":"Name of the user.","example":"John Doe"},"email":{"type":["string","null"],"description":"Email address of the user.","example":"john@example.com"},"fingerprint":{"type":["string","null"],"description":"The user's fingerprint, derived from their public SSH key.","example":"183ded44-24d0-480e-9908-c022eff8d111"},"stripeCustomerID":{"type":"string","description":"Stripe customer ID of the user.","example":"cus_XXXXXXXXXXXXXXXXX"}},"required":["id","name","email","fingerprint","stripeCustomerID"],"description":"A Terminal shop user. (We have users, btw.)","example":{"id":"usr_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"John Doe","email":"john@example.com","fingerprint":"183ded44-24d0-480e-9908-c022eff8d111","stripeCustomerID":"cus_XXXXXXXXXXXXXXXXX"}},"Address":{"type":"object","properties":{"id":{"type":"string","description":"Unique object identifier.\nThe format and length of IDs may change over time.","example":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX"},"name":{"type":"string","description":"The recipient's name.","example":"John Doe"},"street1":{"type":"string","description":"Street of the address.","example":"123 Main St"},"street2":{"type":"string","description":"Apartment, suite, etc. of the address.","example":"Apt 1"},"city":{"type":"string","description":"City of the address.","example":"Anytown"},"province":{"type":"string","description":"Province or state of the address.","example":"CA"},"country":{"type":"string","minLength":2,"maxLength":2,"description":"ISO 3166-1 alpha-2 country code of the address.","example":"US"},"zip":{"type":"string","description":"Zip code of the address.","example":"12345"},"phone":{"type":"string","description":"Phone number of the recipient.","example":"5555555555"},"created":{"type":"string","description":"Date the address was created.","example":"2024-06-29T19:36:19.000Z"}},"required":["id","name","street1","city","country","zip","created"],"description":"Physical address associated with a Terminal shop user.","example":{"id":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"John Doe","street1":"123 Main St","street2":"Apt 1","city":"Anytown","province":"CA","zip":"12345","country":"US","phone":"5555555555","created":"2024-06-29T19:36:19.000Z"}},"Card":{"type":"object","properties":{"id":{"type":"string","description":"Unique object identifier.\nThe format and length of IDs may change over time.","example":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX"},"brand":{"type":"string","description":"Brand of the card.","example":"Visa"},"expiration":{"type":"object","properties":{"year":{"type":"integer","description":"Expiration year of the card.","example":2023},"month":{"type":"integer","description":"Expiration month of the card.","example":12}},"required":["year","month"],"description":"Expiration of the card.","example":{"month":12,"year":2023}},"last4":{"type":"string","description":"Last four digits of the card.","example":"1234"},"created":{"type":"string","description":"Date the card was created.","example":"2024-06-29T19:36:19.000Z"}},"required":["id","brand","expiration","last4","created"],"description":"Credit card used for payments in the Terminal shop.","example":{"id":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","brand":"Visa","expiration":{"month":12,"year":2023},"last4":"1234","created":"2024-06-29T19:36:19.000Z"}},"Cart":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CartItem"},"description":"An array of items in the current user's cart.","example":[{"id":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX","productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","quantity":2,"subtotal":4400}]},"subtotal":{"type":"integer","minimum":0,"description":"The subtotal of all items in the current user's cart, in cents (USD).","example":4400},"addressID":{"type":"string","description":"ID of the shipping address selected on the current user's cart.","example":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX"},"cardID":{"type":"string","description":"ID of the card selected on the current user's cart.","example":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX"},"amount":{"type":"object","properties":{"subtotal":{"type":"integer","description":"Subtotal of the current user's cart, in cents (USD).","example":4400},"shipping":{"type":"integer","description":"Shipping amount of the current user's cart, in cents (USD).","example":800},"total":{"type":"integer","description":"Total amount after any discounts, in cents (USD)."}},"required":["subtotal"],"description":"The subtotal and shipping amounts for the current user's cart.","example":{"subtotal":4400,"shipping":800}},"shipping":{"type":"object","properties":{"service":{"type":"string","description":"Shipping service name.","example":"USPS Ground Advantage"},"timeframe":{"type":"string","description":"Shipping timeframe provided by the shipping carrier.","example":"3-5 days"}},"description":"Shipping information for the current user's cart.","example":{"service":"USPS Ground Advantage","timeframe":"3-5 days"}}},"required":["items","subtotal","amount"],"description":"The current Terminal shop user's cart.","example":{"subtotal":4400,"items":[{"id":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX","productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","quantity":2,"subtotal":4400}],"amount":{"subtotal":4400,"shipping":800},"addressID":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","cardID":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","shipping":{"service":"USPS Ground Advantage","timeframe":"3-5 days"}}},"CartItem":{"type":"object","properties":{"id":{"type":"string","description":"Unique object identifier.\nThe format and length of IDs may change over time.","example":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX"},"productVariantID":{"type":"string","description":"ID of the product variant for this item in the current user's cart.","example":"var_XXXXXXXXXXXXXXXXXXXXXXXXX"},"quantity":{"type":"integer","minimum":0,"description":"Quantity of the item in the current user's cart.","example":2},"subtotal":{"type":"integer","description":"Subtotal of the item in the current user's cart, in cents (USD).","example":4400}},"required":["id","productVariantID","quantity","subtotal"],"description":"An item in the current Terminal shop user's cart.","example":{"id":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX","productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","quantity":2,"subtotal":4400}},"Order":{"type":"object","properties":{"id":{"type":"string","description":"Unique object identifier.\nThe format and length of IDs may change over time.","example":"ord_XXXXXXXXXXXXXXXXXXXXXXXXX"},"index":{"type":"integer","description":"Zero-based index of the order for this user only.","example":0},"shipping":{"type":"object","properties":{"name":{"type":"string","description":"The recipient's name.","example":"John Doe"},"street1":{"type":"string","description":"Street of the address.","example":"123 Main St"},"street2":{"type":"string","description":"Apartment, suite, etc. of the address.","example":"Apt 1"},"city":{"type":"string","description":"City of the address.","example":"Anytown"},"province":{"type":"string","description":"Province or state of the address.","example":"CA"},"country":{"type":"string","minLength":2,"maxLength":2,"description":"ISO 3166-1 alpha-2 country code of the address.","example":"US"},"zip":{"type":"string","description":"Zip code of the address.","example":"12345"},"phone":{"type":"string","description":"Phone number of the recipient.","example":"5555555555"}},"required":["name","street1","city","country","zip"],"description":"Shipping address of the order.","example":{"name":"John Doe","street1":"123 Main St","street2":"Apt 1","city":"Anytown","province":"CA","zip":"12345","country":"US","phone":"5555555555"}},"created":{"type":"string","description":"Date the order was created.","example":"2024-06-29T19:36:19.000Z"},"amount":{"type":"object","properties":{"shipping":{"type":"integer","description":"Shipping amount of the order, in cents (USD).","example":800},"subtotal":{"type":"integer","description":"Subtotal amount of the order, in cents (USD).","example":4400}},"required":["shipping","subtotal"],"description":"The subtotal and shipping amounts of the order.","example":{"subtotal":4400,"shipping":800}},"tracking":{"type":"object","properties":{"service":{"type":"string","description":"Shipping service of the order.","example":"USPS Ground Advantage"},"number":{"type":"string","description":"Tracking number of the order.","example":"92346903470167000000000019"},"url":{"type":"string","description":"Tracking URL of the order.","example":"https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=92346903470167000000000019"},"status":{"type":"string","enum":["PRE_TRANSIT","TRANSIT","DELIVERED","RETURNED","FAILURE","UNKNOWN"],"description":"Current tracking status of the shipment.","example":"DELIVERED"},"statusDetails":{"type":"string","description":"Additional details about the tracking status.","example":"Your shipment has been delivered."},"statusUpdatedAt":{"type":"string","description":"When the tracking status was last updated.","example":"2025-04-08T12:00:00.000Z"}},"description":"Tracking information of the order.","example":{"service":"USPS Ground Advantage","number":"92346903470167000000000019","url":"https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=92346903470167000000000019","status":"DELIVERED","statusDetails":"Your shipment has been delivered.","statusUpdatedAt":"2025-04-08T12:00:00.000Z"}},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderItem"},"description":"Items in the order.","example":[{"id":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX","amount":4400,"quantity":2,"productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX"}]}},"required":["id","shipping","created","amount","tracking","items"],"description":"An order from the Terminal shop.","example":{"id":"ord_XXXXXXXXXXXXXXXXXXXXXXXXX","index":0,"shipping":{"name":"John Doe","street1":"123 Main St","street2":"Apt 1","city":"Anytown","province":"CA","zip":"12345","country":"US","phone":"5555555555"},"amount":{"subtotal":4400,"shipping":800},"created":"2024-06-29T19:36:19.000Z","tracking":{"service":"USPS Ground Advantage","number":"92346903470167000000000019","url":"https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=92346903470167000000000019","status":"DELIVERED","statusDetails":"Your shipment has been delivered.","statusUpdatedAt":"2025-04-08T12:00:00.000Z"},"items":[{"id":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX","amount":4400,"quantity":2,"productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX"}]}},"OrderItem":{"type":"object","properties":{"id":{"type":"string","description":"Unique object identifier.\nThe format and length of IDs may change over time.","example":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX"},"description":{"type":"string","description":"Description of the item in the order."},"amount":{"type":"integer","description":"Amount of the item in the order, in cents (USD).","example":4400},"quantity":{"type":"integer","minimum":1,"description":"Quantity of the item in the order.","example":2},"productVariantID":{"type":"string","description":"ID of the product variant of the item in the order.","example":"var_XXXXXXXXXXXXXXXXXXXXXXXXX"}},"required":["id","amount","quantity"],"example":{"id":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX","amount":4400,"quantity":2,"productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX"}},"Subscription":{"type":"object","properties":{"id":{"type":"string","description":"Unique object identifier.\nThe format and length of IDs may change over time.","example":"sub_XXXXXXXXXXXXXXXXXXXXXXXXX"},"productVariantID":{"type":"string","description":"ID of the product variant being subscribed to.","example":"var_XXXXXXXXXXXXXXXXXXXXXXXXX"},"price":{"type":"integer","description":"Price of the subscription in cents (USD).","example":2200},"quantity":{"type":"integer","minimum":1,"description":"Quantity of the subscription.","example":1},"addressID":{"type":"string","description":"ID of the shipping address used for the subscription.","example":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX"},"cardID":{"type":"string","description":"ID of the card used for the subscription.","example":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX"},"schedule":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"fixed"}},"required":["type"],"title":"fixed"},{"type":"object","properties":{"type":{"type":"string","const":"weekly"},"interval":{"type":"integer","minimum":1}},"required":["type","interval"],"title":"weekly"}],"description":"Schedule of the subscription.","example":{"type":"weekly","interval":3}},"next":{"type":"string","description":"Next shipment and billing date for the subscription.","example":"2025-02-01T19:36:19.000Z"},"created":{"type":"string","description":"Date the subscription was created.","example":"2024-06-29T19:36:19.000Z"}},"required":["id","productVariantID","price","quantity","addressID","cardID","created"],"description":"Subscription to a Terminal shop product.","example":{"id":"sub_XXXXXXXXXXXXXXXXXXXXXXXXX","productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","price":2200,"quantity":1,"addressID":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","cardID":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","schedule":{"type":"weekly","interval":3},"next":"2025-02-01T19:36:19.000Z","created":"2024-06-29T19:36:19.000Z"}},"Token":{"type":"object","properties":{"id":{"type":"string","description":"Unique object identifier.\nThe format and length of IDs may change over time.","example":"pat_XXXXXXXXXXXXXXXXXXXXXXXXX"},"created":{"type":"string","description":"The created time for the token.","example":"2024-06-29T19:36:19.000Z"},"token":{"type":"string","description":"Personal access token (obfuscated).","example":"trm_test_******XXXX"}},"required":["id","created","token"],"description":"A personal access token used to access the Terminal API. If you leak this, expect large sums of coffee to be ordered on your credit card.","example":{"id":"pat_XXXXXXXXXXXXXXXXXXXXXXXXX","token":"trm_test_******XXXX","created":"2024-06-29T19:36:19.000Z"}},"App":{"type":"object","properties":{"id":{"type":"string","description":"Unique object identifier.\nThe format and length of IDs may change over time.","example":"cli_XXXXXXXXXXXXXXXXXXXXXXXXX"},"name":{"type":"string","description":"Name of the app.","example":"Example App"},"redirectURI":{"type":"string","description":"Redirect URI of the app.","example":"https://example.com/callback"},"secret":{"type":"string","description":"OAuth 2.0 client secret of the app (obfuscated).","example":"sec_******XXXX"}},"required":["id","name","redirectURI","secret"],"description":"A Terminal App used for configuring an OAuth 2.0 client.","example":{"id":"cli_XXXXXXXXXXXXXXXXXXXXXXXXX","secret":"sec_******XXXX","name":"Example App","redirectURI":"https://example.com/callback"}},"Region":{"type":"string","enum":["eu","na","global"],"description":"A Terminal shop user's region.","examples":["na","eu","global"]}}},"security":[{"Bearer":[]}],"servers":[{"description":"Dev Sandbox","url":"https://api.dev.terminal.shop"},{"description":"Production","url":"https://api.terminal.shop"}],"paths":{"/product":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"},"description":"A list of products.","example":[{"id":"prd_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"[object Object]","description":"The interpolation of Caturra and Castillo varietals from Las Cochitas creates this refreshing citrusy and complex coffee.","variants":[{"id":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"12oz","price":2200}],"order":100,"subscription":"allowed","tags":{"featured":true},"filters":[]}]}},"required":["data"]},"example":{"data":[{"id":"prd_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"[object Object]","description":"The interpolation of Caturra and Castillo varietals from Las Cochitas creates this refreshing citrusy and complex coffee.","variants":[{"id":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"12oz","price":2200}],"order":100,"subscription":"allowed","tags":{"featured":true},"filters":[]}]}}},"description":"A list of products."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"getProduct","tags":["Product"],"summary":"List products","description":"List all products for sale in the Terminal shop.","security":[]}},"/product/{id}":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Product"}],"description":"The requested product.","example":{"id":"prd_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"[object Object]","description":"The interpolation of Caturra and Castillo varietals from Las Cochitas creates this refreshing citrusy and complex coffee.","variants":[{"id":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"12oz","price":2200}],"order":100,"subscription":"allowed","tags":{"featured":true},"filters":[]}}},"required":["data"]},"example":{"data":{"id":"prd_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"[object Object]","description":"The interpolation of Caturra and Castillo varietals from Las Cochitas creates this refreshing citrusy and complex coffee.","variants":[{"id":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"12oz","price":2200}],"order":100,"subscription":"allowed","tags":{"featured":true},"filters":[]}}}},"description":"The requested product."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Not found error"},"example":{"type":"not_found","code":"resource_not_found","message":"The requested resource could not be found"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"getProductById","tags":["Product"],"summary":"Get product","description":"Get a product by ID from the Terminal shop.","security":[],"parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"ID of the product to get.","example":"prd_XXXXXXXXXXXXXXXXXXXXXXXXX"},"required":true}]}},"/profile":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Profile"}],"description":"User profile information.","example":{"user":{"id":"usr_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"John Doe","email":"john@example.com","fingerprint":"183ded44-24d0-480e-9908-c022eff8d111","stripeCustomerID":"cus_XXXXXXXXXXXXXXXXX"}}}},"required":["data"]},"example":{"data":{"user":{"id":"usr_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"John Doe","email":"john@example.com","fingerprint":"183ded44-24d0-480e-9908-c022eff8d111","stripeCustomerID":"cus_XXXXXXXXXXXXXXXXX"}}}}},"description":"User profile information."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"getProfile","tags":["Profile"],"summary":"Get profile","description":"Get the current user's profile."},"put":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Profile"}],"description":"Updated user profile information.","example":{"user":{"id":"usr_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"John Doe","email":"john@example.com","fingerprint":"183ded44-24d0-480e-9908-c022eff8d111","stripeCustomerID":"cus_XXXXXXXXXXXXXXXXX"}}}},"required":["data"]},"example":{"data":{"user":{"id":"usr_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"John Doe","email":"john@example.com","fingerprint":"183ded44-24d0-480e-9908-c022eff8d111","stripeCustomerID":"cus_XXXXXXXXXXXXXXXXX"}}}}},"description":"Updated user profile information."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Validation error"},"example":{"type":"validation","code":"invalid_parameter","message":"The request was invalid","param":"email"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"putProfile","tags":["Profile"],"summary":"Update profile","description":"Update the current user's profile.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"}},"required":["name","email"],"description":"The user's updated profile information.","example":{"name":"John Doe","email":"john@example.com"}}}}}}},"/address":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Address"},"description":"Shipping addresses.","example":[{"id":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"John Doe","street1":"123 Main St","street2":"Apt 1","city":"Anytown","province":"CA","zip":"12345","country":"US","phone":"5555555555","created":"2024-06-29T19:36:19.000Z"}]}},"required":["data"]},"example":{"data":[{"id":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"John Doe","street1":"123 Main St","street2":"Apt 1","city":"Anytown","province":"CA","zip":"12345","country":"US","phone":"5555555555","created":"2024-06-29T19:36:19.000Z"}]}}},"description":"Shipping addresses."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"getAddress","tags":["Address"],"summary":"Get addresses","description":"Get the shipping addresses associated with the current user."},"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"string","description":"Shipping address ID.","example":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX"}},"required":["data"]},"example":{"data":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX"}}},"description":"Shipping address ID."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Validation error"},"example":{"type":"validation","code":"invalid_parameter","message":"The request was invalid","param":"email"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"postAddress","tags":["Address"],"summary":"Create address","description":"Create and add a shipping address to the current user.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The recipient's name.","example":"John Doe"},"street1":{"type":"string","description":"Street of the address.","example":"123 Main St"},"street2":{"type":"string","description":"Apartment, suite, etc. of the address.","example":"Apt 1"},"city":{"type":"string","description":"City of the address.","example":"Anytown"},"province":{"type":"string","description":"Province or state of the address.","example":"CA"},"country":{"type":"string","minLength":2,"maxLength":2,"description":"ISO 3166-1 alpha-2 country code of the address.","example":"US"},"zip":{"type":"string","description":"Zip code of the address.","example":"12345"},"phone":{"type":"string","description":"Phone number of the recipient.","example":"5555555555"}},"required":["name","street1","city","country","zip"],"description":"Address information.","example":{"name":"John Doe","street1":"123 Main St","street2":"Apt 1","city":"Anytown","province":"CA","zip":"12345","country":"US","phone":"5555555555"}}}}}}},"/address/{id}":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Address"}],"description":"Shipping address.","example":{"id":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"John Doe","street1":"123 Main St","street2":"Apt 1","city":"Anytown","province":"CA","zip":"12345","country":"US","phone":"5555555555","created":"2024-06-29T19:36:19.000Z"}}},"required":["data"]},"example":{"data":{"id":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"John Doe","street1":"123 Main St","street2":"Apt 1","city":"Anytown","province":"CA","zip":"12345","country":"US","phone":"5555555555","created":"2024-06-29T19:36:19.000Z"}}}},"description":"Shipping address."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Not found error"},"example":{"type":"not_found","code":"resource_not_found","message":"The requested resource could not be found"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"getAddressById","tags":["Address"],"summary":"Get address","description":"Get the shipping address with the given ID.","parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"ID of the shipping address to get.","example":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX"},"required":true}]},"delete":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"string","const":"ok"}},"required":["data"]},"example":{"data":"ok"}}},"description":"Shipping address was deleted successfully."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Permission error"},"example":{"type":"forbidden","code":"permission_denied","message":"You do not have permission to access this resource"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Not found error"},"example":{"type":"not_found","code":"resource_not_found","message":"The requested resource could not be found"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"deleteAddressById","tags":["Address"],"summary":"Delete address","description":"Delete a shipping address from the current user.","parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"ID of the shipping address to delete.","example":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX"},"required":true}]}},"/card":{"get":{"responses":{"200":{"description":"List of cards associated with the user.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Card"},"example":[{"id":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","brand":"Visa","expiration":{"month":12,"year":2023},"last4":"1234","created":"2024-06-29T19:36:19.000Z"}],"description":"List of cards associated with the user."}},"required":["data"]},"example":{"data":[{"id":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","brand":"Visa","expiration":{"month":12,"year":2023},"last4":"1234","created":"2024-06-29T19:36:19.000Z"}]}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"getCard","tags":["Card"],"summary":"List cards","description":"List the credit cards associated with the current user."},"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"string","example":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","description":"ID of the card."}},"required":["data"]},"example":{"data":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX"}}},"description":"ID of the card."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Validation error"},"example":{"type":"validation","code":"invalid_parameter","message":"The request was invalid","param":"email"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"postCard","tags":["Card"],"summary":"Create card","description":"Attach a credit card (tokenized via Stripe) to the current user.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"Stripe card token. Learn how to [create one here](https://docs.stripe.com/api/tokens/create_card).","example":"tok_1N3T00LkdIwHu7ixt44h1F8k","externalDocs":{"description":"Learn how to create a new Stripe card token here.","url":"https://docs.stripe.com/api/tokens/create_card"}}},"required":["token"]}}}}}},"/card/{id}":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Card"}],"description":"Credit card.","example":{"id":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","brand":"Visa","expiration":{"month":12,"year":2023},"last4":"1234","created":"2024-06-29T19:36:19.000Z"}}},"required":["data"]},"example":{"data":{"id":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","brand":"Visa","expiration":{"month":12,"year":2023},"last4":"1234","created":"2024-06-29T19:36:19.000Z"}}}},"description":"Credit card details."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Not found error"},"example":{"type":"not_found","code":"resource_not_found","message":"The requested resource could not be found"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"getCardById","tags":["Card"],"summary":"Get card","description":"Get a credit card by ID associated with the current user.","parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"ID of the card to get.","example":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX"},"required":true}]},"delete":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"string","const":"ok"}},"required":["data"]},"example":{"data":"ok"}}},"description":"Card was deleted successfully."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Validation error"},"example":{"type":"validation","code":"invalid_parameter","message":"The request was invalid","param":"email"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Permission error"},"example":{"type":"forbidden","code":"permission_denied","message":"You do not have permission to access this resource"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Not found error"},"example":{"type":"not_found","code":"resource_not_found","message":"The requested resource could not be found"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"deleteCardById","tags":["Card"],"summary":"Delete card","description":"Delete a credit card associated with the current user.","parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"ID of the card to delete.","example":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX"},"required":true}]}},"/card/collect":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string","format":"uri","example":"https://trm.sh/XXXXXXXXXX","description":"Temporary URL that allows a user to enter credit card details over https at terminal.shop."}},"required":["url"],"example":{"url":"https://trm.sh/XXXXXXXXXX"},"description":"URL for collecting card information."}},"required":["data"]},"example":{"data":{"url":"https://trm.sh/XXXXXXXXXX"}}}},"description":"URL for collecting card information."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"postCardCollect","tags":["Card"],"summary":"Collect card","description":"Create a temporary URL for collecting credit card information for the current user."}},"/cart":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Cart"}],"description":"The current user's cart.","example":{"subtotal":4400,"items":[{"id":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX","productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","quantity":2,"subtotal":4400}],"amount":{"subtotal":4400,"shipping":800},"addressID":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","cardID":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","shipping":{"service":"USPS Ground Advantage","timeframe":"3-5 days"}}}},"required":["data"]},"example":{"data":{"subtotal":4400,"items":[{"id":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX","productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","quantity":2,"subtotal":4400}],"amount":{"subtotal":4400,"shipping":800},"addressID":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","cardID":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","shipping":{"service":"USPS Ground Advantage","timeframe":"3-5 days"}}}}},"description":"The current user's cart."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"getCart","tags":["Cart"],"summary":"Get cart","description":"Get the current user's cart."},"delete":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"string","const":"ok"}},"required":["data"]},"example":{"data":"ok"}}},"description":"Cart was cleared successfully."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"deleteCart","tags":["Cart"],"summary":"Clear cart","description":"Clear the current user's cart."}},"/cart/item":{"put":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Cart"}],"description":"The updated cart.","example":{"subtotal":4400,"items":[{"id":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX","productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","quantity":2,"subtotal":4400}],"amount":{"subtotal":4400,"shipping":800},"addressID":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","cardID":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","shipping":{"service":"USPS Ground Advantage","timeframe":"3-5 days"}}}},"required":["data"]},"example":{"data":{"subtotal":4400,"items":[{"id":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX","productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","quantity":2,"subtotal":4400}],"amount":{"subtotal":4400,"shipping":800},"addressID":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","cardID":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","shipping":{"service":"USPS Ground Advantage","timeframe":"3-5 days"}}}}},"description":"The updated cart."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Validation error"},"example":{"type":"validation","code":"invalid_parameter","message":"The request was invalid","param":"email"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"putCartItem","tags":["Cart"],"summary":"Add item","description":"Add an item to the current user's cart.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"productVariantID":{"type":"string","description":"ID of the product variant to add to the cart.","example":"var_XXXXXXXXXXXXXXXXXXXXXXXXX"},"quantity":{"type":"integer","minimum":0,"description":"Quantity of the item to add to the cart.","example":2}},"required":["productVariantID","quantity"]}}}}}},"/cart/address":{"put":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"string","const":"ok"}},"required":["data"]},"example":{"data":"ok"}}},"description":"Address was set successfully."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Validation error"},"example":{"type":"validation","code":"invalid_parameter","message":"The request was invalid","param":"email"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"putCartAddress","tags":["Cart"],"summary":"Set address","description":"Set the shipping address for the current user's cart.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"addressID":{"type":"string","description":"ID of the shipping address to set for the current user's cart.","example":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX"}},"required":["addressID"]}}}}}},"/cart/card":{"put":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"string","const":"ok"}},"required":["data"]},"example":{"data":"ok"}}},"description":"Card was set successfully."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Validation error"},"example":{"type":"validation","code":"invalid_parameter","message":"The request was invalid","param":"email"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"putCartCard","tags":["Cart"],"summary":"Set card","description":"Set the credit card for the current user's cart.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"cardID":{"type":"string","description":"ID of the credit card to set for the current user's cart.","example":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX"}},"required":["cardID"]}}}}}},"/cart/convert":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Order"}],"description":"New order information.","example":{"id":"ord_XXXXXXXXXXXXXXXXXXXXXXXXX","index":0,"shipping":{"name":"John Doe","street1":"123 Main St","street2":"Apt 1","city":"Anytown","province":"CA","zip":"12345","country":"US","phone":"5555555555"},"amount":{"subtotal":4400,"shipping":800},"created":"2024-06-29T19:36:19.000Z","tracking":{"service":"USPS Ground Advantage","number":"92346903470167000000000019","url":"https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=92346903470167000000000019","status":"DELIVERED","statusDetails":"Your shipment has been delivered.","statusUpdatedAt":"2025-04-08T12:00:00.000Z"},"items":[{"id":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX","amount":4400,"quantity":2,"productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX"}]}}},"required":["data"]},"example":{"data":{"id":"ord_XXXXXXXXXXXXXXXXXXXXXXXXX","index":0,"shipping":{"name":"John Doe","street1":"123 Main St","street2":"Apt 1","city":"Anytown","province":"CA","zip":"12345","country":"US","phone":"5555555555"},"amount":{"subtotal":4400,"shipping":800},"created":"2024-06-29T19:36:19.000Z","tracking":{"service":"USPS Ground Advantage","number":"92346903470167000000000019","url":"https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=92346903470167000000000019","status":"DELIVERED","statusDetails":"Your shipment has been delivered.","statusUpdatedAt":"2025-04-08T12:00:00.000Z"},"items":[{"id":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX","amount":4400,"quantity":2,"productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX"}]}}}},"description":"Cart was converted successfully."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Validation error"},"example":{"type":"validation","code":"invalid_parameter","message":"The request was invalid","param":"email"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"postCartConvert","tags":["Cart"],"summary":"Convert to order","description":"Convert the current user's cart to an order."}},"/order":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Order"},"description":"List of orders.","example":[{"id":"ord_XXXXXXXXXXXXXXXXXXXXXXXXX","index":0,"shipping":{"name":"John Doe","street1":"123 Main St","street2":"Apt 1","city":"Anytown","province":"CA","zip":"12345","country":"US","phone":"5555555555"},"amount":{"subtotal":4400,"shipping":800},"created":"2024-06-29T19:36:19.000Z","tracking":{"service":"USPS Ground Advantage","number":"92346903470167000000000019","url":"https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=92346903470167000000000019","status":"DELIVERED","statusDetails":"Your shipment has been delivered.","statusUpdatedAt":"2025-04-08T12:00:00.000Z"},"items":[{"id":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX","amount":4400,"quantity":2,"productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX"}]}]}},"required":["data"]},"example":{"data":[{"id":"ord_XXXXXXXXXXXXXXXXXXXXXXXXX","index":0,"shipping":{"name":"John Doe","street1":"123 Main St","street2":"Apt 1","city":"Anytown","province":"CA","zip":"12345","country":"US","phone":"5555555555"},"amount":{"subtotal":4400,"shipping":800},"created":"2024-06-29T19:36:19.000Z","tracking":{"service":"USPS Ground Advantage","number":"92346903470167000000000019","url":"https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=92346903470167000000000019","status":"DELIVERED","statusDetails":"Your shipment has been delivered.","statusUpdatedAt":"2025-04-08T12:00:00.000Z"},"items":[{"id":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX","amount":4400,"quantity":2,"productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX"}]}]}}},"description":"List of orders."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"getOrder","tags":["Order"],"summary":"List orders","description":"List the orders associated with the current user."},"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"string","description":"Order ID.","example":"ord_XXXXXXXXXXXXXXXXXXXXXXXXX"}},"required":["data"]},"example":{"data":"ord_XXXXXXXXXXXXXXXXXXXXXXXXX"}}},"description":"Order ID."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Validation error"},"example":{"type":"validation","code":"invalid_parameter","message":"The request was invalid","param":"email"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"postOrder","tags":["Order"],"summary":"Create order","description":"Create an order without a cart. The order will be placed immediately.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"variants":{"type":"object","additionalProperties":{"type":"integer","minimum":1},"description":"Product variants to include in the order, along with their quantities.","example":{"var_XXXXXXXXXXXXXXXXXXXXXXXXX":1}},"cardID":{"type":"string","description":"Card ID.","example":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX"},"addressID":{"type":"string","description":"Shipping address ID.","example":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX"}},"required":["variants","cardID","addressID"],"description":"Order information.","example":{"cardID":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","addressID":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","variants":{"var_XXXXXXXXXXXXXXXXXXXXXXXXX":1}}}}}}}},"/order/{id}":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Order"}],"description":"Order information.","example":{"id":"ord_XXXXXXXXXXXXXXXXXXXXXXXXX","index":0,"shipping":{"name":"John Doe","street1":"123 Main St","street2":"Apt 1","city":"Anytown","province":"CA","zip":"12345","country":"US","phone":"5555555555"},"amount":{"subtotal":4400,"shipping":800},"created":"2024-06-29T19:36:19.000Z","tracking":{"service":"USPS Ground Advantage","number":"92346903470167000000000019","url":"https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=92346903470167000000000019","status":"DELIVERED","statusDetails":"Your shipment has been delivered.","statusUpdatedAt":"2025-04-08T12:00:00.000Z"},"items":[{"id":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX","amount":4400,"quantity":2,"productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX"}]}}},"required":["data"]},"example":{"data":{"id":"ord_XXXXXXXXXXXXXXXXXXXXXXXXX","index":0,"shipping":{"name":"John Doe","street1":"123 Main St","street2":"Apt 1","city":"Anytown","province":"CA","zip":"12345","country":"US","phone":"5555555555"},"amount":{"subtotal":4400,"shipping":800},"created":"2024-06-29T19:36:19.000Z","tracking":{"service":"USPS Ground Advantage","number":"92346903470167000000000019","url":"https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=92346903470167000000000019","status":"DELIVERED","statusDetails":"Your shipment has been delivered.","statusUpdatedAt":"2025-04-08T12:00:00.000Z"},"items":[{"id":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX","amount":4400,"quantity":2,"productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX"}]}}}},"description":"Order information."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Not found error"},"example":{"type":"not_found","code":"resource_not_found","message":"The requested resource could not be found"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"getOrderById","tags":["Order"],"summary":"Get order","description":"Get the order with the given ID.","parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"ID of the order to get.","example":"ord_XXXXXXXXXXXXXXXXXXXXXXXXX"},"required":true}]}},"/subscription":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Subscription"},"description":"List of subscriptions.","example":[{"id":"sub_XXXXXXXXXXXXXXXXXXXXXXXXX","productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","price":2200,"quantity":1,"addressID":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","cardID":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","schedule":{"type":"weekly","interval":3},"next":"2025-02-01T19:36:19.000Z","created":"2024-06-29T19:36:19.000Z"}]}},"required":["data"]},"example":{"data":[{"id":"sub_XXXXXXXXXXXXXXXXXXXXXXXXX","productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","price":2200,"quantity":1,"addressID":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","cardID":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","schedule":{"type":"weekly","interval":3},"next":"2025-02-01T19:36:19.000Z","created":"2024-06-29T19:36:19.000Z"}]}}},"description":"List of subscriptions."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"getSubscription","tags":["Subscription"],"summary":"List subscriptions","description":"List the subscriptions associated with the current user."},"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"string","const":"ok"}},"required":["data"]},"example":{"data":"ok"}}},"description":"Subscription was created successfully."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Validation error"},"example":{"type":"validation","code":"invalid_parameter","message":"The request was invalid","param":"email"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"postSubscription","tags":["Subscription"],"summary":"Subscribe","description":"Create a subscription for the current user.","requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Subscription"}],"description":"Subscription information.","example":{"productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","quantity":1,"addressID":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","cardID":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","schedule":{"type":"weekly","interval":3}}}}}}}},"/subscription/{id}":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Subscription"}],"description":"Subscription information.","example":{"id":"sub_XXXXXXXXXXXXXXXXXXXXXXXXX","productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","price":2200,"quantity":1,"addressID":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","cardID":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","schedule":{"type":"weekly","interval":3},"next":"2025-02-01T19:36:19.000Z","created":"2024-06-29T19:36:19.000Z"}}},"required":["data"]},"example":{"data":{"id":"sub_XXXXXXXXXXXXXXXXXXXXXXXXX","productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","price":2200,"quantity":1,"addressID":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","cardID":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","schedule":{"type":"weekly","interval":3},"next":"2025-02-01T19:36:19.000Z","created":"2024-06-29T19:36:19.000Z"}}}},"description":"Subscription information."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Not found error"},"example":{"type":"not_found","code":"resource_not_found","message":"The requested resource could not be found"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"getSubscriptionById","tags":["Subscription"],"summary":"Get subscription","description":"Get the subscription with the given ID.","parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"ID of the subscription to get.","example":"sub_XXXXXXXXXXXXXXXXXXXXXXXXX"},"required":true}]},"delete":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"string","const":"ok"}},"required":["data"]},"example":{"data":"ok"}}},"description":"Subscription was cancelled successfully."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Not found error"},"example":{"type":"not_found","code":"resource_not_found","message":"The requested resource could not be found"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"deleteSubscriptionById","tags":["Subscription"],"summary":"Cancel","description":"Cancel a subscription for the current user.","parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"ID of the subscription to cancel.","example":"sub_XXXXXXXXXXXXXXXXXXXXXXXXX"},"required":true}]},"put":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Subscription"}],"description":"Updated subscription information.","example":{"id":"sub_XXXXXXXXXXXXXXXXXXXXXXXXX","productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","price":2200,"quantity":1,"addressID":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","cardID":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","schedule":{"type":"weekly","interval":3},"next":"2025-02-01T19:36:19.000Z","created":"2024-06-29T19:36:19.000Z"}}},"required":["data"]},"example":{"data":{"id":"sub_XXXXXXXXXXXXXXXXXXXXXXXXX","productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","price":2200,"quantity":1,"addressID":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","cardID":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","schedule":{"type":"weekly","interval":3},"next":"2025-02-01T19:36:19.000Z","created":"2024-06-29T19:36:19.000Z"}}}},"description":"Updated subscription information."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Validation error"},"example":{"type":"validation","code":"invalid_parameter","message":"The request was invalid","param":"email"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Not found error"},"example":{"type":"not_found","code":"resource_not_found","message":"The requested resource could not be found"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"putSubscriptionById","tags":["Subscription"],"summary":"Update subscription","description":"Update card, address, or interval for an existing subscription.","parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"ID of the subscription to update.","example":"sub_XXXXXXXXXXXXXXXXXXXXXXXXX"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"cardID":{"type":"string","description":"New payment method ID for the subscription.","example":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX"},"addressID":{"type":"string","description":"New shipping address ID for the subscription.","example":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX"},"schedule":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"fixed"}},"required":["type"],"title":"fixed"},{"type":"object","properties":{"type":{"type":"string","const":"weekly"},"interval":{"type":"integer","minimum":1}},"required":["type","interval"],"title":"weekly"}],"description":"New schedule for the subscription.","example":{"type":"weekly","interval":3}}}}}}}}},"/token":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Token"},"description":"List of personal access tokens.","example":[{"id":"pat_XXXXXXXXXXXXXXXXXXXXXXXXX","token":"trm_test_******XXXX","created":"2024-06-29T19:36:19.000Z"}]}},"required":["data"]},"example":{"data":[{"id":"pat_XXXXXXXXXXXXXXXXXXXXXXXXX","token":"trm_test_******XXXX","created":"2024-06-29T19:36:19.000Z"}]}}},"description":"List of personal access tokens."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"getToken","tags":["Token"],"summary":"List tokens","description":"List the current user's personal access tokens."},"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Personal token ID.","example":"pat_XXXXXXXXXXXXXXXXXXXXXXXXX"},"token":{"type":"string","description":"Personal access token. Include this in the Authorization header (`Bearer <token>`) when accessing the Terminal API.","example":"trm_test_******XXXX"}},"required":["id","token"]}},"required":["data"]},"example":{"data":{"id":"pat_XXXXXXXXXXXXXXXXXXXXXXXXX","token":"trm_test_******XXXX"}}}},"description":"Personal access token ID and value."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"postToken","tags":["Token"],"summary":"Create token","description":"Create a personal access token."}},"/token/{id}":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Token"}],"description":"Personal access token.","example":{"id":"pat_XXXXXXXXXXXXXXXXXXXXXXXXX","token":"trm_test_******XXXX","created":"2024-06-29T19:36:19.000Z"}}},"required":["data"]},"example":{"data":{"id":"pat_XXXXXXXXXXXXXXXXXXXXXXXXX","token":"trm_test_******XXXX","created":"2024-06-29T19:36:19.000Z"}}}},"description":"Personal access token."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Not found error"},"example":{"type":"not_found","code":"resource_not_found","message":"The requested resource could not be found"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"getTokenById","tags":["Token"],"summary":"Get token","description":"Get the personal access token with the given ID.","parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"ID of the personal token to get.","example":"pat_XXXXXXXXXXXXXXXXXXXXXXXXX"},"required":true}]},"delete":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"string","const":"ok"}},"required":["data"]},"example":{"data":"ok"}}},"description":"Personal access token was deleted successfully."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Not found error"},"example":{"type":"not_found","code":"resource_not_found","message":"The requested resource could not be found"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"deleteTokenById","tags":["Token"],"summary":"Delete token","description":"Delete the personal access token with the given ID.","parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"ID of the personal token to delete.","example":"pat_XXXXXXXXXXXXXXXXXXXXXXXXX"},"required":true}]}},"/app":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/App"},"description":"List of apps.","example":[{"id":"cli_XXXXXXXXXXXXXXXXXXXXXXXXX","secret":"sec_******XXXX","name":"Example App","redirectURI":"https://example.com/callback"}]}},"required":["data"]},"example":{"data":[{"id":"cli_XXXXXXXXXXXXXXXXXXXXXXXXX","secret":"sec_******XXXX","name":"Example App","redirectURI":"https://example.com/callback"}]}}},"description":"List of apps."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"getApp","tags":["App (OAuth)"],"summary":"List apps","description":"List the current user's registered apps."},"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"OAuth 2.0 client ID.","example":"cli_XXXXXXXXXXXXXXXXXXXXXXXXX"},"secret":{"type":"string","description":"OAuth 2.0 client secret.","example":"sec_******XXXX"}},"required":["id","secret"]}},"required":["data"]},"example":{"data":{"id":"cli_XXXXXXXXXXXXXXXXXXXXXXXXX","secret":"sec_******XXXX"}}}},"description":"OAuth 2.0 client ID and secret."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Validation error"},"example":{"type":"validation","code":"invalid_parameter","message":"The request was invalid","param":"email"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"postApp","tags":["App (OAuth)"],"summary":"Create app","description":"Create an app.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"redirectURI":{"type":"string"}},"required":["name","redirectURI"],"description":"Basic app information.","example":{"name":"Example App","redirectURI":"https://example.com/callback"}}}}}}},"/app/{id}":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/App"}],"description":"App.","example":{"id":"cli_XXXXXXXXXXXXXXXXXXXXXXXXX","secret":"sec_******XXXX","name":"Example App","redirectURI":"https://example.com/callback"}}},"required":["data"]},"example":{"data":{"id":"cli_XXXXXXXXXXXXXXXXXXXXXXXXX","secret":"sec_******XXXX","name":"Example App","redirectURI":"https://example.com/callback"}}}},"description":"App."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Not found error"},"example":{"type":"not_found","code":"resource_not_found","message":"The requested resource could not be found"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"getAppById","tags":["App (OAuth)"],"summary":"Get app","description":"Get the app with the given ID.","parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"ID of the app to get.","example":"cli_XXXXXXXXXXXXXXXXXXXXXXXXX"},"required":true}]},"delete":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"string","const":"ok"}},"required":["data"]},"example":{"data":"ok"}}},"description":"App was deleted successfully."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Validation error"},"example":{"type":"validation","code":"invalid_parameter","message":"The request was invalid","param":"email"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Permission error"},"example":{"type":"forbidden","code":"permission_denied","message":"You do not have permission to access this resource"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Not found error"},"example":{"type":"not_found","code":"resource_not_found","message":"The requested resource could not be found"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"deleteAppById","tags":["App (OAuth)"],"summary":"Delete app","description":"Delete the app with the given ID.","parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"ID of the app to delete.","example":"cli_XXXXXXXXXXXXXXXXXXXXXXXXX"},"required":true}]}},"/view/init":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"profile":{"$ref":"#/components/schemas/Profile"},"products":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"cart":{"$ref":"#/components/schemas/Cart"},"addresses":{"type":"array","items":{"$ref":"#/components/schemas/Address"}},"cards":{"type":"array","items":{"$ref":"#/components/schemas/Card"}},"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/Subscription"}},"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"tokens":{"type":"array","items":{"$ref":"#/components/schemas/Token"}},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}},"region":{"$ref":"#/components/schemas/Region"}},"required":["profile","products","cart","addresses","cards","subscriptions","orders","tokens","apps","region"],"description":"Initial app data.","examples":[{"profile":{"user":{"id":"usr_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"John Doe","email":"john@example.com","fingerprint":"183ded44-24d0-480e-9908-c022eff8d111","stripeCustomerID":"cus_XXXXXXXXXXXXXXXXX"}},"products":[{"id":"prd_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"[object Object]","description":"The interpolation of Caturra and Castillo varietals from Las Cochitas creates this refreshing citrusy and complex coffee.","variants":[{"id":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"12oz","price":2200}],"order":100,"subscription":"allowed","tags":{"featured":true},"filters":[]}],"cart":{"subtotal":4400,"items":[{"id":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX","productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","quantity":2,"subtotal":4400}],"amount":{"subtotal":4400,"shipping":800},"addressID":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","cardID":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","shipping":{"service":"USPS Ground Advantage","timeframe":"3-5 days"}},"addresses":[{"id":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"John Doe","street1":"123 Main St","street2":"Apt 1","city":"Anytown","province":"CA","zip":"12345","country":"US","phone":"5555555555","created":"2024-06-29T19:36:19.000Z"}],"cards":[{"id":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","brand":"Visa","expiration":{"month":12,"year":2023},"last4":"1234","created":"2024-06-29T19:36:19.000Z"}],"subscriptions":[{"id":"sub_XXXXXXXXXXXXXXXXXXXXXXXXX","productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","price":2200,"quantity":1,"addressID":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","cardID":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","schedule":{"type":"weekly","interval":3},"next":"2025-02-01T19:36:19.000Z","created":"2024-06-29T19:36:19.000Z"}],"orders":[{"id":"ord_XXXXXXXXXXXXXXXXXXXXXXXXX","index":0,"shipping":{"name":"John Doe","street1":"123 Main St","street2":"Apt 1","city":"Anytown","province":"CA","zip":"12345","country":"US","phone":"5555555555"},"amount":{"subtotal":4400,"shipping":800},"created":"2024-06-29T19:36:19.000Z","tracking":{"service":"USPS Ground Advantage","number":"92346903470167000000000019","url":"https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=92346903470167000000000019","status":"DELIVERED","statusDetails":"Your shipment has been delivered.","statusUpdatedAt":"2025-04-08T12:00:00.000Z"},"items":[{"id":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX","amount":4400,"quantity":2,"productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX"}]}],"tokens":[{"id":"pat_XXXXXXXXXXXXXXXXXXXXXXXXX","token":"trm_test_******XXXX","created":"2024-06-29T19:36:19.000Z"}],"apps":[{"id":"cli_XXXXXXXXXXXXXXXXXXXXXXXXX","secret":"sec_******XXXX","name":"Example App","redirectURI":"https://example.com/callback"}],"region":"na"}]}},"required":["data"]},"example":{"data":{"profile":{"user":{"id":"usr_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"John Doe","email":"john@example.com","fingerprint":"183ded44-24d0-480e-9908-c022eff8d111","stripeCustomerID":"cus_XXXXXXXXXXXXXXXXX"}},"products":[{"id":"prd_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"[object Object]","description":"The interpolation of Caturra and Castillo varietals from Las Cochitas creates this refreshing citrusy and complex coffee.","variants":[{"id":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"12oz","price":2200}],"order":100,"subscription":"allowed","tags":{"featured":true},"filters":[]}],"cart":{"subtotal":4400,"items":[{"id":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX","productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","quantity":2,"subtotal":4400}],"amount":{"subtotal":4400,"shipping":800},"addressID":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","cardID":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","shipping":{"service":"USPS Ground Advantage","timeframe":"3-5 days"}},"addresses":[{"id":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","name":"John Doe","street1":"123 Main St","street2":"Apt 1","city":"Anytown","province":"CA","zip":"12345","country":"US","phone":"5555555555","created":"2024-06-29T19:36:19.000Z"}],"cards":[{"id":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","brand":"Visa","expiration":{"month":12,"year":2023},"last4":"1234","created":"2024-06-29T19:36:19.000Z"}],"subscriptions":[{"id":"sub_XXXXXXXXXXXXXXXXXXXXXXXXX","productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX","price":2200,"quantity":1,"addressID":"shp_XXXXXXXXXXXXXXXXXXXXXXXXX","cardID":"crd_XXXXXXXXXXXXXXXXXXXXXXXXX","schedule":{"type":"weekly","interval":3},"next":"2025-02-01T19:36:19.000Z","created":"2024-06-29T19:36:19.000Z"}],"orders":[{"id":"ord_XXXXXXXXXXXXXXXXXXXXXXXXX","index":0,"shipping":{"name":"John Doe","street1":"123 Main St","street2":"Apt 1","city":"Anytown","province":"CA","zip":"12345","country":"US","phone":"5555555555"},"amount":{"subtotal":4400,"shipping":800},"created":"2024-06-29T19:36:19.000Z","tracking":{"service":"USPS Ground Advantage","number":"92346903470167000000000019","url":"https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=92346903470167000000000019","status":"DELIVERED","statusDetails":"Your shipment has been delivered.","statusUpdatedAt":"2025-04-08T12:00:00.000Z"},"items":[{"id":"itm_XXXXXXXXXXXXXXXXXXXXXXXXX","amount":4400,"quantity":2,"productVariantID":"var_XXXXXXXXXXXXXXXXXXXXXXXXX"}]}],"tokens":[{"id":"pat_XXXXXXXXXXXXXXXXXXXXXXXXX","token":"trm_test_******XXXX","created":"2024-06-29T19:36:19.000Z"}],"apps":[{"id":"cli_XXXXXXXXXXXXXXXXXXXXXXXXX","secret":"sec_******XXXX","name":"Example App","redirectURI":"https://example.com/callback"}],"region":"na"}}}},"description":"Initial app data."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Authentication error"},"example":{"type":"authentication","code":"unauthorized","message":"Authentication required"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"getViewInit","tags":["Miscellaneous"],"summary":"Get app data","description":"Get initial app data, including user, products, cart, addresses, cards, subscriptions, and orders."}},"/email":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"string","const":"ok"}},"required":["data"]},"example":{"data":"ok"}}},"description":"Email subscription was created."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Validation error"},"example":{"type":"validation","code":"invalid_parameter","message":"The request was invalid","param":"email"}}},"description":"Bad Request"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Rate limit error"},"example":{"type":"rate_limit","code":"too_many_requests","message":"Rate limit exceeded"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse","description":"Server error"},"example":{"type":"internal","code":"internal_error","message":"Internal server error"}}},"description":"Internal Server Error"}},"operationId":"postEmail","tags":["Miscellaneous"],"summary":"Subscribe email","description":"Subscribe to email updates from Terminal.","security":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","minLength":1,"description":"Email address to subscribe to Terminal updates with.","example":"john@example.com"}},"required":["email"]}}}}}}}}