Advertisement
Guest User

swagger 2 spaces

a guest
Jan 25th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 51.75 KB | None | 0 0
  1. swagger: "2.0"
  2. info:
  3.   description: "Sylius Shop API documentation"
  4.   version: "1.0.0"
  5.   title: "Sylius Shop API"
  6.   contact:
  7.     email: "lukasz.chrusciel@sylius.com"
  8.   license:
  9.     name: "MIT"
  10.     url: "https://opensource.org/licenses/MIT"
  11. host: "demo.sylius.org"
  12. basePath: "/shop-api"
  13. consumes:
  14.  - "application/json"
  15. produces:
  16.  - "application/json"
  17. tags:
  18.   - name: "cart"
  19.     description: "All actions related to cart management."
  20.     externalDocs:
  21.       description: "Find out more"
  22.       url: "http://docs.sylius.org/en/latest/book/orders/index.html"
  23.   - name: "products"
  24.     description: "Show product catalog and add product reviews."
  25.     externalDocs:
  26.       description: "Find out more"
  27.       url: "http://docs.sylius.org/en/latest/book/products/index.html"
  28.   - name: "taxons"
  29.     description: "Show taxon tree"
  30.     externalDocs:
  31.       description: "Find out more"
  32.       url: "http://docs.sylius.org/en/latest/book/products/taxons.html"
  33.   - name: "checkout"
  34.     description: "All actions related to checkout fulfillment. It is important, to execute them in given order (address, choose shipment, choose payment and complete)."
  35.     externalDocs:
  36.       description: "Find out more"
  37.       url: "http://docs.sylius.org/en/latest/book/orders/checkout.html"
  38.   - name: "order"
  39.     description: "Showing the order information"
  40.     externalDocs:
  41.       description: "Find out more"
  42.       url: "http://docs.sylius.com/en/latest/book/orders/orders.html"
  43.   - name: "users"
  44.     description: "All actions related to user functionality."
  45.     externalDocs:
  46.       description: "Find out more"
  47.       url: "http://docs.sylius.org/en/latest/book/customers/customer_and_shopuser.html"
  48.   - name: "address"
  49.     description: "All functions related to the Sylius Customer Address Book"
  50.     externalDocs:
  51.       description: "Find out more"
  52.       url: "https://docs.sylius.com/en/latest/book/customers/addresses/address_book.html"
  53. schemes:
  54.  - "https"
  55. parameters:
  56.   ChannelCode:
  57.     in: "path"
  58.     description: "The request channel code"
  59.     name: "channelCode"
  60.     required: true
  61.     type: "string"
  62.   CartToken:
  63.     in: "path"
  64.     name: "token"
  65.     description: "Cart identifier."
  66.     required: true
  67.     type: "string"
  68. paths:
  69.   /{channelCode}/carts:
  70.     parameters:
  71.       - $ref: "#/parameters/ChannelCode"
  72.     post:
  73.       tags:
  74.        - "cart"
  75.       summary: "Pick up your cart from the store"
  76.       description: "This endpoint will allow you to create a new cart."
  77.       operationId: "cartPickUp"
  78.       responses:
  79.         201:
  80.           description: "Cart has been picked up"
  81.           schema:
  82.             $ref: "#/definitions/Cart"
  83.         400:
  84.           description: "Invalid input"
  85.           schema:
  86.             $ref: "#/definitions/GeneralError"
  87.   /{channelCode}/carts/{token}:
  88.     parameters:
  89.       - $ref: "#/parameters/ChannelCode"
  90.       - $ref: "#/parameters/CartToken"
  91.     post:
  92.       deprecated: true
  93.       tags:
  94.        - "cart"
  95.       summary: "Pick up your cart from the store"
  96.       description: "This endpoint will allow you to assign a new cart to the provided token. We recommend using UUID as a token to avoid duplication. If any of previous carts or orders already have the same token value an exception will be thrown."
  97.       operationId: "deprecatedCartPickUp"
  98.       responses:
  99.         201:
  100.           description: "Cart has been picked up and assigned to given token"
  101.         400:
  102.           description: "Invalid input"
  103.           schema:
  104.             $ref: "#/definitions/GeneralError"
  105.     get:
  106.       tags:
  107.        - "cart"
  108.       summary: "Show summarized cart."
  109.       description: "This endpoint shows you the current calculated state of cart."
  110.       operationId: "cartSummarize"
  111.       responses:
  112.         200:
  113.           description: "Current state of the cart, with calculated prices and related items."
  114.           schema:
  115.             $ref: "#/definitions/Cart"
  116.         400:
  117.           description: "Invalid input (E.g. token has not been found)"
  118.           schema:
  119.             $ref: "#/definitions/GeneralError"
  120.     delete:
  121.       tags:
  122.        - "cart"
  123.       summary: "Drop your cart."
  124.       description: "This endpoint will remove the cart and all of the related cart items."
  125.       operationId: "cartDrop"
  126.       responses:
  127.         204:
  128.           description: "Cart has been dropped."
  129.         400:
  130.           description: "Invalid input (E.g. token has not been found)"
  131.           schema:
  132.             $ref: "#/definitions/GeneralError"
  133.   /{channelCode}/carts/{token}/items:
  134.     parameters:
  135.       - $ref: "#/parameters/ChannelCode"
  136.       - $ref: "#/parameters/CartToken"
  137.     post:
  138.       tags:
  139.        - "cart"
  140.       summary: "Add an item to your cart."
  141.       description: "This endpoint will allow you to add a new item to your cart."
  142.       operationId: "cartAddItem"
  143.       parameters:
  144.         - in: "body"
  145.           name: "content"
  146.           description: "Description of an item. The smallest required amount of data is a product code and quantity for a simple product. Configurable products will require an additional `variant_code` or `options` field, but never both."
  147.           required: true
  148.           schema:
  149.             $ref: "#/definitions/PutItemToCartRequest"
  150.       responses:
  151.         201:
  152.           description: "Item has been added to the cart"
  153.           schema:
  154.             $ref: "#/definitions/Cart"
  155.         400:
  156.           description: "Invalid input, validation failed."
  157.           schema:
  158.             $ref: "#/definitions/GeneralError"
  159.   /{channelCode}/carts/{token}/multiple-items:
  160.     parameters:
  161.       - $ref: "#/parameters/ChannelCode"
  162.       - $ref: "#/parameters/CartToken"
  163.     post:
  164.       tags:
  165.        - "cart"
  166.       summary: "Add multiple items to your cart."
  167.       description: "This endpoint will allow you to add a new item to your cart."
  168.       operationId: "cartPutItems"
  169.       parameters:
  170.         - in: "body"
  171.           name: "content"
  172.           description: "Description of items. The same rules applied to each of the array values as to the previous point."
  173.           required: true
  174.           schema:
  175.             $ref: "#/definitions/PutItemsToCartRequest"
  176.       responses:
  177.         201:
  178.           description: "Item has been added to the cart"
  179.           schema:
  180.             $ref: "#/definitions/Cart"
  181.         400:
  182.           description: "Invalid input, validation failed."
  183.           schema:
  184.             $ref: "#/definitions/GeneralError"
  185.   /{channelCode}/carts/{token}/items/{identifier}:
  186.     parameters:
  187.       - $ref: "#/parameters/ChannelCode"
  188.       - $ref: "#/parameters/CartToken"
  189.       - name: "identifier"
  190.         in: "path"
  191.         description: "Identifier of a specific item. Can be found in the cart summary."
  192.         required: true
  193.         type: "string"
  194.     put:
  195.       tags:
  196.        - "cart"
  197.       summary: "Change quantity of a cart item."
  198.       operationId: "cartUpdateItem"
  199.       parameters:
  200.         - in: "body"
  201.           name: "content"
  202.           required: true
  203.           schema:
  204.             $ref: "#/definitions/ChangeItemQuantityRequest"
  205.       responses:
  206.         204:
  207.           description: "Quantity has been changed."
  208.         400:
  209.           description: "Invalid input, validation failed."
  210.           schema:
  211.             $ref: "#/definitions/GeneralError"
  212.     delete:
  213.       tags:
  214.        - "cart"
  215.       summary: "Remove cart item."
  216.       operationId: "cartDeleteItem"
  217.       description: "This endpoint will remove one item from your cart"
  218.       responses:
  219.         204:
  220.           description: "Cart item has been removed."
  221.         400:
  222.           description: "Invalid input (E.g. token has not been found)"
  223.           schema:
  224.             $ref: "#/definitions/GeneralError"
  225.   /{channelCode}/carts/{token}/estimated-shipping-cost:
  226.     parameters:
  227.       - $ref: "#/parameters/ChannelCode"
  228.       - $ref: "#/parameters/CartToken"
  229.     get:
  230.       tags:
  231.        - "cart"
  232.       summary: "Estimates the shipping cost of the cart"
  233.       operationId: "estimateShippingCost"
  234.       parameters:
  235.         - name: "countryCode"
  236.           in: "query"
  237.           description: "Shipping Country"
  238.           required: true
  239.           type: "string"
  240.         - name: "provinceCode"
  241.           in: "query"
  242.           description: "Province to ship to"
  243.           required: true
  244.           type: "string"
  245.       responses:
  246.         200:
  247.           description: "Price was calculated"
  248.           schema:
  249.             $ref: "#/definitions/EstimatedShippingCost"
  250.         400:
  251.           description: "Invalid input (E.g. token has not been found)"
  252.           schema:
  253.             $ref: "#/definitions/GeneralError"
  254.  
  255.   /{channelCode}/carts/{token}/coupon:
  256.     parameters:
  257.       - $ref: "#/parameters/ChannelCode"
  258.       - $ref: "#/parameters/CartToken"
  259.     put:
  260.       tags:
  261.        - "cart"
  262.       summary: "Add a promotion coupon code to the cart."
  263.       description: "This endpoint will allow you to add a promotion coupon code to the cart and receive the discount."
  264.       operationId: "cartAddCoupon"
  265.       parameters:
  266.         - in: "body"
  267.           name: "content"
  268.           required: true
  269.           schema:
  270.             $ref: "#/definitions/AddCouponRequest"
  271.       responses:
  272.         204:
  273.           description: "Coupon has been assigned to the cart."
  274.         400:
  275.           description: "Invalid input, validation failed."
  276.           schema:
  277.             $ref: "#/definitions/GeneralError"
  278.     delete:
  279.       tags:
  280.        - "cart"
  281.       summary: "Remove a promotion coupon code from the cart."
  282.       description: "This endpoint will allow you to remove a promotion coupon code from the cart."
  283.       operationId: "cartRemoveCoupon"
  284.       responses:
  285.         204:
  286.           description: "Coupon has been removed from the cart."
  287.         400:
  288.           description: "Invalid input, validation failed."
  289.           schema:
  290.             $ref: "#/definitions/GeneralError"
  291.   /{channelCode}/checkout/{token}:
  292.     parameters:
  293.       - $ref: "#/parameters/ChannelCode"
  294.       - $ref: "#/parameters/CartToken"
  295.     get:
  296.       tags:
  297.        - "checkout"
  298.       summary: "Show checkout summary"
  299.       description: "This endpoint will show the summarized cart during checkout. This action is an equivalent of cart summarize action."
  300.       operationId: "checkoutSummarize"
  301.       responses:
  302.         200:
  303.           description: "Current state of the cart, with calculated prices and related items."
  304.           schema:
  305.             $ref: "#/definitions/Cart"
  306.         400:
  307.           description: "Invalid input (E.g. token has not been found)"
  308.           schema:
  309.             $ref: "#/definitions/GeneralError"
  310.   /{channelCode}/checkout/{token}/address:
  311.     parameters:
  312.       - $ref: "#/parameters/ChannelCode"
  313.       - $ref: "#/parameters/CartToken"
  314.     put:
  315.       tags:
  316.        - "checkout"
  317.       summary: "Address cart."
  318.       description: "This endpoint will allow you to add billing and shipping addresses to the cart and begin the checkout process. You can either define the same shipping and billing address or specify them separately."
  319.       operationId: "checkoutAddress"
  320.       parameters:
  321.         - in: "body"
  322.           name: "content"
  323.           required: true
  324.           schema:
  325.             $ref: "#/definitions/CheckoutAddressRequest"
  326.       responses:
  327.         204:
  328.           description: "Cart has been addressed."
  329.         400:
  330.           description: "Invalid input, validation failed."
  331.           schema:
  332.             $ref: "#/definitions/GeneralError"
  333.   /{channelCode}/checkout/{token}/shipping/:
  334.     parameters:
  335.       - $ref: "#/parameters/ChannelCode"
  336.       - $ref: "#/parameters/CartToken"
  337.     get:
  338.       tags:
  339.        - "checkout"
  340.       summary: "Get available shipping methods."
  341.       description: "This endpoint will show you available shipping methods for all cart shipments."
  342.       operationId: "checkoutShowAvailableShippingMethods"
  343.       responses:
  344.         200:
  345.           description: "Get available shipping methods."
  346.           schema:
  347.             $ref: "#/definitions/AvailableShippingMethods"
  348.         400:
  349.           description: "Invalid input, validation failed."
  350.           schema:
  351.             $ref: "#/definitions/GeneralError"
  352.   /{channelCode}/checkout/{token}/shipping/{id}:
  353.     parameters:
  354.       - $ref: "#/parameters/ChannelCode"
  355.       - $ref: "#/parameters/CartToken"
  356.     put:
  357.       tags:
  358.        - "checkout"
  359.       summary: "Choosing a cart shipping method."
  360.       description: "This endpoint will allow you to choose a cart shipping method."
  361.       operationId: "checkoutChooseShippingMethod"
  362.       parameters:
  363.         - name: "id"
  364.           in: "path"
  365.           description: "Order number of shipment for which shipping method should be specified."
  366.           required: true
  367.           type: "string"
  368.         - in: "body"
  369.           name: "content"
  370.           required: true
  371.           schema:
  372.             $ref: "#/definitions/CheckoutChooseShippingMethodRequest"
  373.       responses:
  374.         204:
  375.           description: "Shipping method has been chosen."
  376.         400:
  377.           description: "Invalid input, validation failed."
  378.           schema:
  379.             $ref: "#/definitions/GeneralError"
  380.   /{channelCode}/checkout/{token}/payment/:
  381.     parameters:
  382.       - $ref: "#/parameters/ChannelCode"
  383.       - $ref: "#/parameters/CartToken"
  384.     get:
  385.       tags:
  386.        - "checkout"
  387.       summary: "Get available payment methods."
  388.       description: "This endpoint will show you available payment methods for all cart payments."
  389.       operationId: "checkoutShowAvailablePaymentMethods"
  390.       responses:
  391.         200:
  392.           description: "Get available payment methods."
  393.           schema:
  394.             $ref: "#/definitions/AvailablePaymentMethods"
  395.         400:
  396.           description: "Invalid input, validation failed."
  397.           schema:
  398.             $ref: "#/definitions/GeneralError"
  399.   /{channelCode}/checkout/{token}/payment/{id}:
  400.     parameters:
  401.       - $ref: "#/parameters/ChannelCode"
  402.       - $ref: "#/parameters/CartToken"
  403.     put:
  404.       tags:
  405.        - "checkout"
  406.       summary: "Choosing cart payment method."
  407.       description: "This endpoint will allow you to choose cart a payment method."
  408.       operationId: "checkoutChoosePaymentMethod"
  409.       parameters:
  410.         - name: "id"
  411.           in: "path"
  412.           description: "Order number of payment for which payment method should be specified."
  413.           required: true
  414.           type: "string"
  415.         - in: "body"
  416.           name: "content"
  417.           required: true
  418.           schema:
  419.             $ref: "#/definitions/CheckoutChoosePaymentMethodRequest"
  420.       responses:
  421.         204:
  422.           description: "Payment method has been chosen."
  423.         400:
  424.           description: "Invalid input, validation failed."
  425.           schema:
  426.             $ref: "#/definitions/GeneralError"
  427.   /{channelCode}/checkout/{token}/complete:
  428.     parameters:
  429.       - $ref: "#/parameters/ChannelCode"
  430.       - $ref: "#/parameters/CartToken"
  431.     put:
  432.       tags:
  433.        - "checkout"
  434.       summary: "Completing checkout."
  435.       description: "This endpoint will allow you to complete the checkout."
  436.       operationId: "checkoutComplete"
  437.       parameters:
  438.         - in: "body"
  439.           name: "content"
  440.           required: true
  441.           schema:
  442.             $ref: "#/definitions/CheckoutCompleteRequest"
  443.       responses:
  444.         204:
  445.           description: "Checkout has been completed."
  446.         400:
  447.           description: "Invalid input, validation failed."
  448.           schema:
  449.             $ref: "#/definitions/GeneralError"
  450.         403:
  451.           description: "Not logged in or wrong email"
  452.   /{channelCode}/taxon-products-by-slug/{slug}:
  453.     parameters:
  454.       - $ref: "#/parameters/ChannelCode"
  455.     get:
  456.       tags:
  457.        - "products"
  458.       summary: "Show product catalog."
  459.       description: "This endpoint will return a paginated list of products for given taxon."
  460.       operationId: "productCatalogBySlug"
  461.       parameters:
  462.         - name: "slug"
  463.           in: "path"
  464.           description: "Slug of taxonomy for which products should be listed."
  465.           required: true
  466.           type: "string"
  467.         - name: "locale"
  468.           in: "query"
  469.           description: "Locale in which products should be shown."
  470.           required: false
  471.           type: "string"
  472.         - name: "limit"
  473.           in: "query"
  474.           description: "Number of expected products per page."
  475.           required: false
  476.           type: "integer"
  477.         - name: "page"
  478.           in: "query"
  479.           description: "Page number."
  480.           required: false
  481.           type: "integer"
  482.       responses:
  483.         200:
  484.           description: "Paginated product list."
  485.           schema:
  486.             $ref: "#/definitions/ProductsPage"
  487.   /{channelCode}/taxon-products/{code}:
  488.     parameters:
  489.       - $ref: "#/parameters/ChannelCode"
  490.     get:
  491.       tags:
  492.        - "products"
  493.       summary: "Show product catalog."
  494.       description: "This endpoint will return a paginated list of products for given taxon."
  495.       operationId: "productCatalog"
  496.       parameters:
  497.         - name: "code"
  498.           in: "path"
  499.           description: "Code of taxonomy for which products should be listed."
  500.           required: true
  501.           type: "string"
  502.         - name: "locale"
  503.           in: "query"
  504.           description: "Locale in which products should be shown."
  505.           required: false
  506.           type: "string"
  507.         - name: "limit"
  508.           in: "query"
  509.           description: "Number of expected products per page."
  510.           required: false
  511.           type: "integer"
  512.         - name: "page"
  513.           in: "query"
  514.           description: "Page number."
  515.           required: false
  516.           type: "integer"
  517.       responses:
  518.         200:
  519.           description: "Paginated product list."
  520.           schema:
  521.             $ref: "#/definitions/ProductsPage"
  522.   /{channelCode}/products-by-slug/{slug}:
  523.     parameters:
  524.       - $ref: "#/parameters/ChannelCode"
  525.     get:
  526.       tags:
  527.        - "products"
  528.       summary: "Show a product with the given slug."
  529.       description: "This endpoint will return a product with the given slug."
  530.       operationId: "productDetailsBySlug"
  531.       parameters:
  532.         - name: "slug"
  533.           in: "path"
  534.           description: "Slug of expected product."
  535.           required: true
  536.           type: "string"
  537.         - name: "locale"
  538.           in: "query"
  539.           description: "Locale in which products should be shown."
  540.           required: false
  541.           type: "string"
  542.       responses:
  543.         200:
  544.           description: "Show a product with the given slug."
  545.           schema:
  546.             $ref: "#/definitions/ProductDetails"
  547.   /{channelCode}/products/{code}:
  548.     parameters:
  549.       - $ref: "#/parameters/ChannelCode"
  550.     get:
  551.       tags:
  552.        - "products"
  553.       summary: "Show a product with the given code."
  554.       description: "This endpoint will return a product with the given code."
  555.       operationId: "productDetails"
  556.       parameters:
  557.         - name: "code"
  558.           in: "path"
  559.           description: "Code of expected product."
  560.           required: true
  561.           type: "string"
  562.         - name: "locale"
  563.           in: "query"
  564.           description: "Locale in which products should be shown."
  565.           required: false
  566.           type: "string"
  567.       responses:
  568.         200:
  569.           description: "Show a product with the given code."
  570.           schema:
  571.             $ref: "#/definitions/ProductDetails"
  572.   /{channelCode}/product-reviews-by-slug/{slug}:
  573.     parameters:
  574.       - $ref: "#/parameters/ChannelCode"
  575.       - name: "slug"
  576.         in: "path"
  577.         description: "Slug of expected product."
  578.         required: true
  579.         type: "string"
  580.     post:
  581.       tags:
  582.        - "products"
  583.       summary: "Add a review to the product."
  584.       description: "This endpoint will allow you to add a new review to the product. Remember, that it should be accepted by an administrator before it will be available in the review list."
  585.       operationId: "productAddReviewBySlug"
  586.       parameters:
  587.         - in: "body"
  588.           name: "content"
  589.           required: true
  590.           schema:
  591.             $ref: "#/definitions/AddReviewRequest"
  592.       responses:
  593.         201:
  594.           description: "Review has been added to the product."
  595.         400:
  596.           description: "Invalid input, validation failed."
  597.           schema:
  598.             $ref: "#/definitions/GeneralError"
  599.     get:
  600.       tags:
  601.        - "products"
  602.       summary: "Show reviews."
  603.       description: "This endpoint will return a paginated list of all reviews related to the product identified by slug."
  604.       operationId: "productReviewsBySlug"
  605.       responses:
  606.         200:
  607.           description: "A paginated list of all reviews related to the product identified by slug."
  608.           schema:
  609.             $ref: "#/definitions/ProductReviewsPage"
  610.   /{channelCode}/product/{code}/reviews:
  611.     parameters:
  612.       - $ref: "#/parameters/ChannelCode"
  613.       - name: "code"
  614.         in: "path"
  615.         description: "Code of expected product."
  616.         required: true
  617.         type: "string"
  618.     post:
  619.       tags:
  620.        - "products"
  621.       summary: "Add a review to the product."
  622.       description: "This endpoint will allow you to add a new review to the product. Remember, that it should be accepted by an administrator before it will be available in the review list."
  623.       operationId: "productAddReview"
  624.       parameters:
  625.         - in: "body"
  626.           name: "content"
  627.           required: true
  628.           schema:
  629.             $ref: "#/definitions/AddReviewRequest"
  630.       responses:
  631.         201:
  632.           description: "Review has been added to the product."
  633.         400:
  634.           description: "Invalid input, validation failed."
  635.           schema:
  636.             $ref: "#/definitions/GeneralError"
  637.     get:
  638.       tags:
  639.        - "products"
  640.       summary: "Show reviews."
  641.       description: "This endpoint will return a paginated list of all reviews related to the product identified by slug."
  642.       operationId: "productReviews"
  643.       responses:
  644.         200:
  645.           description: "A paginated list of all reviews related to the product identified by slug."
  646.           schema:
  647.             $ref: "#/definitions/ProductReviewsPage"
  648.   /{channelCode}/taxons:
  649.     parameters:
  650.       - $ref: "#/parameters/ChannelCode"
  651.     get:
  652.       tags:
  653.        - "taxons"
  654.       summary: "Show taxon tree."
  655.       description: "This endpoint will return an array of all available taxon roots with all of its children."
  656.       operationId: "taxonTree"
  657.       parameters:
  658.         - name: "locale"
  659.           in: "query"
  660.           description: "Locale in which taxons should be shown."
  661.           required: false
  662.           type: "string"
  663.       responses:
  664.         200:
  665.           description: "Array of all available taxons."
  666.           schema:
  667.             type: "array"
  668.             items:
  669.               $ref: "#/definitions/Taxon"
  670.   /{channelCode}/taxons/{code}:
  671.     parameters:
  672.       - $ref: "#/parameters/ChannelCode"
  673.     get:
  674.       tags:
  675.        - "taxons"
  676.       summary: "Show taxon with given code."
  677.       description: "This endpoint will return a taxon with given code, children and the root node with direct path to this taxon."
  678.       operationId: "taxonDetails"
  679.       parameters:
  680.         - name: "code"
  681.           in: "path"
  682.           description: "Code of expected taxon."
  683.           required: true
  684.           type: "string"
  685.         - name: "locale"
  686.           in: "query"
  687.           description: "Locale in which taxons should be shown."
  688.           required: false
  689.           type: "string"
  690.       responses:
  691.         200:
  692.           description: "Requested taxon with children."
  693.           schema:
  694.             $ref: "#/definitions/Taxon"
  695.   /{channelCode}/request-password-reset:
  696.     parameters:
  697.       - $ref: "#/parameters/ChannelCode"
  698.     put:
  699.       tags:
  700.        - "users"
  701.       summary: "Request resetting password of user with passed email."
  702.       description: "Email with reset password path will be sent to user. Default path for password resetting is `/password-reset/{token}`. To change it, you need to override template `@SyliusShopApi\\Email\\passwordReset.html.twig`."
  703.       operationId: "requestPasswordReset"
  704.       parameters:
  705.         - name: "email"
  706.           in: "body"
  707.           description: "Email of user which want to reset password."
  708.           required: true
  709.           schema:
  710.             $ref: "#/definitions/RequestPasswordResetting"
  711.       responses:
  712.         204:
  713.           description: "Reset password request has been sent."
  714.         500:
  715.           description: "User with provided email has not been found."
  716.   /{channelCode}/register:
  717.     parameters:
  718.       - $ref: "#/parameters/ChannelCode"
  719.     post:
  720.       tags:
  721.        - "users"
  722.       summary: "Registering a new user"
  723.       description: "This creates a new user that can log in the shop"
  724.       operationId: "registerUser"
  725.       parameters:
  726.         - name: "content"
  727.           in: "body"
  728.           required: true
  729.           schema:
  730.             $ref: "#/definitions/RegisterRequest"
  731.       responses:
  732.         204:
  733.           description: "The user was successfully created"
  734.         400:
  735.           description: "There were validation errors"
  736.         500:
  737.           description: "Channel not found"
  738.   /{channelCode}/orders:
  739.     parameters:
  740.       - $ref: "#/parameters/ChannelCode"
  741.     get:
  742.       tags:
  743.        - "order"
  744.       summary: "Shows a list of orders of the customer"
  745.       operationId: "orders"
  746.       responses:
  747.         200:
  748.           description: "Shows a list of placed orders of the customer"
  749.           schema:
  750.             type: "array"
  751.             items:
  752.               $ref: "#/definitions/PlacedOrder"
  753.         401:
  754.           description: "User token invalid"
  755.   /{channelCode}/orders/{tokenValue}:
  756.     parameters:
  757.       - $ref: "#/parameters/ChannelCode"
  758.       - in: "path"
  759.         name: "tokenValue"
  760.         description: "Order token."
  761.         required: true
  762.         type: "string"
  763.     get:
  764.       tags:
  765.        - "order"
  766.       summary: "Shows details of specific customer's order"
  767.       operationId: "order"
  768.       responses:
  769.         200:
  770.           description: "Shows details of specific customer's order with given tokenValue"
  771.           schema:
  772.             $ref: "#/definitions/PlacedOrder"
  773.         401:
  774.           description: "User token invalid"
  775.         404:
  776.           description: "Order with given tokenValue not found"
  777.   /{channelCode}/me:
  778.     parameters:
  779.       - $ref: "#/parameters/ChannelCode"
  780.     get:
  781.       tags:
  782.        - "users"
  783.       summary: "Provides currently logged in user details."
  784.       operationId: "me"
  785.       responses:
  786.         200:
  787.           description: "Provides currently logged in user details."
  788.           schema:
  789.             $ref: "#/definitions/LoggedInCustomerDetails"
  790.         500:
  791.           description: "There is no currently logged in user."
  792.       security:
  793.         - bearerAuth: []
  794.     put:
  795.       tags:
  796.        - "users"
  797.       summary: "Updates currently logged in users details."
  798.       operationId: "updateUser"
  799.       parameters:
  800.         - name: "content"
  801.           in: "body"
  802.           required: true
  803.           schema:
  804.             $ref: "#/definitions/UpdateUserRequest"
  805.       responses:
  806.         200:
  807.           description: "User successfully updated."
  808.           schema:
  809.             $ref: "#/definitions/LoggedInCustomerDetails"
  810.         401:
  811.           description: "User token is invalid."
  812.         500:
  813.           description: "There is no currently logged in user."
  814.       security:
  815.         - bearerAuth: []
  816.   /{channelCode}/address-book:
  817.     parameters:
  818.       - $ref: "#/parameters/ChannelCode"
  819.     get:
  820.       tags:
  821.        - "address"
  822.       summary: "Gets the address book of the currently logged in user"
  823.       operationId: "addressBook"
  824.       responses:
  825.         200:
  826.           description: "Successfully fetched Address Book"
  827.           schema:
  828.             $ref: "#/definitions/LoggedInCustomerAddressBook"
  829.         500:
  830.           description: "User not logged in"
  831.       security:
  832.         - bearerAuth: []
  833.     post:
  834.       tags:
  835.        - "address"
  836.       summary: "Creates a new address in the the address book"
  837.       operationId: "createAddress"
  838.       parameters:
  839.         - name: "content"
  840.           in: "body"
  841.           required: true
  842.           schema:
  843.             $ref: "#/definitions/LoggedInCustomerAddressBookAddress"
  844.       responses:
  845.         201:
  846.           description: "Successfully created the address"
  847.           schema:
  848.             $ref: "#/definitions/LoggedInCustomerAddressBookAddress"
  849.         400:
  850.           description: "Validation failed"
  851.           schema:
  852.             $ref: "#/definitions/GeneralError"
  853.         401:
  854.           description: "No user is logged in"
  855.         500:
  856.           description: "The user does not own the address"
  857.       security:
  858.         - bearerAuth: []
  859.   /{channelCode}/address-book/{id}:
  860.     parameters:
  861.       - $ref: "#/parameters/ChannelCode"
  862.     put:
  863.       tags:
  864.        - "address"
  865.       summary: "Updates an address in the address book"
  866.       operationId: "updateAddressBook"
  867.       parameters:
  868.         - name: "id"
  869.           in: "path"
  870.           required: true
  871.           type: "integer"
  872.           description: "Id of the address to update"
  873.         - name: "content"
  874.           in: "body"
  875.           required: true
  876.           schema:
  877.             $ref: "#/definitions/LoggedInCustomerAddressBookAddress"
  878.       responses:
  879.         200:
  880.           description: "Successfully updated the address"
  881.           schema:
  882.             $ref: "#/definitions/LoggedInCustomerAddressBookAddress"
  883.         400:
  884.           description: "Validation failed"
  885.           schema:
  886.             $ref: "#/definitions/GeneralError"
  887.         401:
  888.           description: "No user is logged in"
  889.         500:
  890.           description: "The user does not own the address"
  891.       security:
  892.         - bearerAuth: []
  893.     delete:
  894.       tags:
  895.        - "address"
  896.       summary: "Deletes an address from the address book"
  897.       operationId: "deleteAddress"
  898.       parameters:
  899.         - name: "id"
  900.           in: "path"
  901.           required: true
  902.           type: "integer"
  903.           description: "Id of the address to update"
  904.       responses:
  905.         204:
  906.           description: "Successfully removed the address"
  907.         400:
  908.           description: "Validation failed"
  909.           schema:
  910.             $ref: "#/definitions/GeneralError"
  911.         401:
  912.           description: "No user is logged in"
  913.         500:
  914.           description: "The user does not own the address"
  915.       security:
  916.         - bearerAuth: []
  917.   /{channelCode}/address-book/{id}/default:
  918.     parameters:
  919.       - $ref: "#/parameters/ChannelCode"
  920.     patch:
  921.       tags:
  922.        - "address"
  923.       summary: "Change the default address in the address book"
  924.       operationId: "updateDefaultAddress"
  925.       parameters:
  926.         - name: "id"
  927.           in: "path"
  928.           required: true
  929.           type: "integer"
  930.           description: "Id of the address to be the default address"
  931.       responses:
  932.         204:
  933.           description: "Successfully updated the address"
  934.         400:
  935.           description: "Validation failed"
  936.           schema:
  937.             $ref: "#/definitions/GeneralError"
  938.         401:
  939.           description: "No user is logged in"
  940.         500:
  941.           description: "The user does not own the address"
  942.       security:
  943.         - bearerAuth: []
  944.  
  945. securityDefinitions:
  946.   bearerAuth:
  947.     type: "apiKey"
  948.     name: "Authorization"
  949.     in: "header"
  950.  
  951. definitions:
  952.   AddReviewRequest:
  953.     type: "object"
  954.     description: "Body of request with a channel code."
  955.     required:
  956.      - "title"
  957.       - "rating"
  958.       - "comment"
  959.       - "email"
  960.     properties:
  961.       title:
  962.         type: "string"
  963.         example: "Awesome product"
  964.       rating:
  965.         type: "integer"
  966.         example: 5
  967.       comment:
  968.         type: "string"
  969.         example: "If I were a mug, I would like to be like this one!"
  970.       email:
  971.         type: "string"
  972.         description: "Email of an author."
  973.         example: "customer@example.com"
  974.   PutItemToCartRequest:
  975.     type: "object"
  976.     description: "Body of request used to put item to the cart."
  977.     required:
  978.      - "productCode"
  979.     properties:
  980.       productCode:
  981.         type: "string"
  982.         example: "LOGAN_HAT_CODE"
  983.       quantity:
  984.         type: "integer"
  985.         minimum: 1
  986.         example: 3
  987.         default: 1
  988.       variantCode:
  989.         type: "string"
  990.         example: "SMALL_LOGAN_T_SHIRT_CODE"
  991.       options:
  992.         type: "object"
  993.         description: "Keys reference to the code of an option and values to the code of option value."
  994.         additionalProperties:
  995.           type: "string"
  996.           example: "HAT_SIZE_S"
  997.   PutItemsToCartRequest:
  998.     type: "array"
  999.     description: "Body of request used to put item to the cart."
  1000.     items:
  1001.       type: "object"
  1002.       $ref: "#/definitions/PutItemToCartRequest"
  1003.   ChangeItemQuantityRequest:
  1004.     type: "object"
  1005.     description: "Body of request used to change quantity of an item."
  1006.     required:
  1007.      - "quantity"
  1008.     properties:
  1009.       quantity:
  1010.         type: "integer"
  1011.         example: 2
  1012.   AddCouponRequest:
  1013.     type: "object"
  1014.     description: "Body of request used to add promotion coupon code to cart."
  1015.     required:
  1016.      - "coupon"
  1017.     properties:
  1018.       coupon:
  1019.         type: "string"
  1020.         example: "BANANAS"
  1021.   CheckoutAddressRequest:
  1022.     type: "object"
  1023.     description: "Body of request used for cart addressing."
  1024.     required:
  1025.      - "shippingAddress"
  1026.     properties:
  1027.       shippingAddress:
  1028.         type: "object"
  1029.         $ref: "#/definitions/Address"
  1030.       billingAddress:
  1031.         type: "object"
  1032.         $ref: "#/definitions/Address"
  1033.   CheckoutChooseShippingMethodRequest:
  1034.     type: "object"
  1035.     description: "Body of request used to choose shipping method."
  1036.     required:
  1037.      - "method"
  1038.     properties:
  1039.       method:
  1040.         type: "string"
  1041.         description: "Code of chosen shipping method."
  1042.         example: "DHL"
  1043.   CheckoutChoosePaymentMethodRequest:
  1044.     type: "object"
  1045.     description: "Body of request used to choose payment method."
  1046.     required:
  1047.      - "method"
  1048.     properties:
  1049.       method:
  1050.         type: "string"
  1051.         description: "Code of chosen payment method."
  1052.         example: "PBC"
  1053.   CheckoutCompleteRequest:
  1054.     type: "object"
  1055.     description: "Body of request used to complete checkout."
  1056.     required:
  1057.      - "email"
  1058.     properties:
  1059.       email:
  1060.         type: "string"
  1061.         description: "Email of a customer."
  1062.         example: "customer@example.com"
  1063.       notes:
  1064.         type: "string"
  1065.         description: "Additional notes."
  1066.         example: "I'm only available between 3 and 8 PM."
  1067.  
  1068.   AvailableShippingMethods:
  1069.     type: "object"
  1070.     description: "Available shipping methods for each shipment."
  1071.     properties:
  1072.       shipments:
  1073.         type: "array"
  1074.         items:
  1075.           type: "object"
  1076.           properties:
  1077.             methods:
  1078.               type: "object"
  1079.               $ref: "#/definitions/ShippingMethod"
  1080.   Shipment:
  1081.     type: "object"
  1082.     properties:
  1083.       state:
  1084.         description: "Current state of a shipment."
  1085.         type: "string"
  1086.         default: "cart"
  1087.         externalDocs:
  1088.           description: "Find out more about shipment states in the Sylius documentation."
  1089.           url: "http://docs.sylius.org/en/latest/book/orders/shipments.html#the-shipment-state-machine"
  1090.         enum:
  1091.          - "cart"
  1092.           - "ready"
  1093.           - "cancelled"
  1094.           - "shipped"
  1095.       method:
  1096.         type: "object"
  1097.         $ref: "#/definitions/ShippingMethod"
  1098.   AvailablePaymentMethods:
  1099.     type: "object"
  1100.     description: "Available payment methods for each payment."
  1101.     properties:
  1102.       payments:
  1103.         type: "array"
  1104.         items:
  1105.           type: "object"
  1106.           properties:
  1107.             methods:
  1108.               type: "object"
  1109.               additionalProperties:
  1110.                 type: "object"
  1111.                 $ref: "#/definitions/PaymentMethod"
  1112.   Payment:
  1113.     type: "object"
  1114.     properties:
  1115.       state:
  1116.         description: "Current state of a payment."
  1117.         type: "string"
  1118.         default: "cart"
  1119.         externalDocs:
  1120.           description: "Find out more about payment states in the Sylius documentation."
  1121.           url: "http://docs.sylius.org/en/latest/book/orders/payments.html#payment-state-machine"
  1122.         enum:
  1123.          - "cart"
  1124.           - "new"
  1125.           - "processing"
  1126.           - "completed"
  1127.           - "failed"
  1128.           - "cancelled"
  1129.           - "refunded"
  1130.       method:
  1131.         type: "object"
  1132.         $ref: "#/definitions/PaymentMethod"
  1133.   Cart:
  1134.     type: "object"
  1135.     description: "Cart with information about items, current state, totals and more."
  1136.     properties:
  1137.       tokenValue:
  1138.         type: "string"
  1139.         example: "SDAOSLEFNWU35H3QLI5325"
  1140.       channel:
  1141.         type: "string"
  1142.         example: "WEB_GB"
  1143.         externalDocs:
  1144.           description: "Find out more about channels in the Sylius documentation."
  1145.           url: "http://docs.sylius.org/en/latest/book/configuration/channels.html"
  1146.       currency:
  1147.         description: "Code of the cart currency according to ISO 4217. This value is inherited from channel"
  1148.         type: "string"
  1149.         example: "GBP"
  1150.       locale:
  1151.         description: "Code of the cart locale. This value is inherited from channel"
  1152.         type: "string"
  1153.         example: "en_GB"
  1154.       checkoutState:
  1155.         description: "Current state of a checkout."
  1156.         type: "string"
  1157.         default: "cart"
  1158.         externalDocs:
  1159.           description: "Find out more about checkout states in the Sylius documentation."
  1160.           url: "http://docs.sylius.org/en/latest/book/orders/checkout.html#checkout-state-machine"
  1161.         enum:
  1162.          - "cart"
  1163.           - "addressed"
  1164.           - "shipping_selected"
  1165.           - "payment_selected"
  1166.           - "completed"
  1167.       items:
  1168.         type: "array"
  1169.         items:
  1170.           $ref: "#/definitions/Item"
  1171.       totals:
  1172.         type: "object"
  1173.         $ref: "#/definitions/TotalsView"
  1174.       shippingAddress:
  1175.         type: "object"
  1176.         $ref: "#/definitions/Address"
  1177.       billingAddress:
  1178.         type: "object"
  1179.         $ref: "#/definitions/Address"
  1180.       payments:
  1181.         type: "array"
  1182.         items:
  1183.           $ref: "#/definitions/Payment"
  1184.       shipments:
  1185.         type: "array"
  1186.         items:
  1187.           $ref: "#/definitions/Shipment"
  1188.       cartDiscounts:
  1189.         type: "array"
  1190.         items:
  1191.           type: "object"
  1192.           additionalProperties:
  1193.             type: "object"
  1194.             $ref: "#/definitions/Discount"
  1195.   Item:
  1196.     type: "object"
  1197.     description: "Item with calculated prices, quantity and related product."
  1198.     properties:
  1199.       id:
  1200.         type: "integer"
  1201.         example: 1
  1202.       quantity:
  1203.         type: "integer"
  1204.         example: 2
  1205.       total:
  1206.         type: "integer"
  1207.         example: 1000
  1208.       product:
  1209.         $ref: "#/definitions/Product"
  1210.   Product:
  1211.     type: "object"
  1212.     description: "Product with its basic information, variants, attributes, association and images."
  1213.     properties:
  1214.       code:
  1215.         type: "string"
  1216.         example: "LOGAN_MUG_CODE"
  1217.       name:
  1218.         type: "string"
  1219.         example: "Logan Mug"
  1220.       slug:
  1221.         type: "string"
  1222.         example: "logan-mug"
  1223.       averageRating:
  1224.         type: "string"
  1225.         example: "4.5"
  1226.       taxons:
  1227.         $ref: "#/definitions/ProductTaxon"
  1228.       variants:
  1229.         description: "Keys reference to code of a variant."
  1230.         type: "object"
  1231.         additionalProperties:
  1232.           type: "array"
  1233.           items:
  1234.             $ref: "#/definitions/Variant"
  1235.       attributes:
  1236.         type: "array"
  1237.         items:
  1238.           $ref: "#/definitions/Attribute"
  1239.       associations:
  1240.         description: "Keys reference to code of an association."
  1241.         type: "object"
  1242.         additionalProperties:
  1243.           type: "array"
  1244.           items:
  1245.             $ref: "#/definitions/Product"
  1246.       images:
  1247.         type: "array"
  1248.         items:
  1249.           $ref: "#/definitions/Image"
  1250.   Image:
  1251.     type: "object"
  1252.     properties:
  1253.       code:
  1254.         type: "string"
  1255.         example: "thumbnail"
  1256.       path:
  1257.         type: "string"
  1258.         example: "/uo/mug.jpg"
  1259.   Variant:
  1260.     type: "object"
  1261.     description: "If the product is simple it will have only one variant with the same code and name. Otherwise, the product can have a list of variants with different fields."
  1262.     properties:
  1263.       code:
  1264.         type: "string"
  1265.         example: "LOGAN_MUG_CODE"
  1266.       name:
  1267.         type: "string"
  1268.         example: "Logan Mug"
  1269.       axis:
  1270.         type: "array"
  1271.         description: "List of codes of associated product options."
  1272.         items:
  1273.           type: "string"
  1274.           example: "HAT_SIZE_S"
  1275.       nameAxis:
  1276.         description: "Map of keys from previous field to translated values of given variant."
  1277.         type: "object"
  1278.         additionalProperties:
  1279.           type: "string"
  1280.       price:
  1281.         $ref: "#/definitions/Price"
  1282.       images:
  1283.         type: "array"
  1284.         items:
  1285.           $ref: "#/definitions/Image"
  1286.   Attribute:
  1287.     type: "object"
  1288.     properties:
  1289.       code:
  1290.         type: "string"
  1291.         example: "MUG_MATERIAL_CODE"
  1292.       name:
  1293.         type: "string"
  1294.         example: "Mug material"
  1295.       value:
  1296.         type: "string"
  1297.         example: "Wood"
  1298.   Taxon:
  1299.     type: "object"
  1300.     properties:
  1301.       code:
  1302.         type: "string"
  1303.         example: "CATEGORIES_CODE"
  1304.       name:
  1305.         type: "string"
  1306.         example: "Categories"
  1307.       slug:
  1308.         type: "string"
  1309.         example: "categories"
  1310.       description:
  1311.         type: "string"
  1312.         example: "General category for all products."
  1313.       children:
  1314.         type: "array"
  1315.         description: "Based on this tree one can build a breadcrumb on a frontend. Otherwise (e.g. presenting a tree of all taxons) children will contain all children of given taxon."
  1316.         items:
  1317.           $ref: "#/definitions/Taxon"
  1318.       images:
  1319.         type: "array"
  1320.         items:
  1321.           $ref: "#/definitions/Image"
  1322.   TaxonDetails:
  1323.     type: "object"
  1324.     properties:
  1325.       self:
  1326.         $ref: "#/definitions/Taxon"
  1327.       parentTree:
  1328.         $ref: "#/definitions/Taxon"
  1329.   ProductTaxon:
  1330.     type: "object"
  1331.     properties:
  1332.       main:
  1333.         type: "string"
  1334.         example: "MAIN_TAXON_CODE"
  1335.       others:
  1336.         type: "array"
  1337.         items:
  1338.           type: "string"
  1339.           example: "OTHER_TAXON_CODE"
  1340.   Discount:
  1341.     type: "object"
  1342.     properties:
  1343.       name:
  1344.         description: "Name of promotion."
  1345.         type: "string"
  1346.         example: "Summer sale"
  1347.       amount:
  1348.         $ref: "#/definitions/Price"
  1349.   Page:
  1350.     type: "object"
  1351.     description: "Generic page object."
  1352.     properties:
  1353.       page:
  1354.         description: "Current page number."
  1355.         type: "integer"
  1356.         example: 1
  1357.       limit:
  1358.         description: "Number of items per page."
  1359.         type: "integer"
  1360.         example: 10
  1361.       pages:
  1362.         description: "Number of available pages for given limit."
  1363.         type: "integer"
  1364.         example: 3
  1365.       total:
  1366.         description: "Amount of all paginated resources."
  1367.         type: "integer"
  1368.         example: 25
  1369.       _links:
  1370.         type: "object"
  1371.         properties:
  1372.           self:
  1373.             description: "Link to the current page."
  1374.             type: "string"
  1375.             example: "/shop-api/some-path?page=1&limit=10"
  1376.           first:
  1377.             description: "Link to the fist page."
  1378.             type: "string"
  1379.             example: "/shop-api/some-path?page=1&limit=10"
  1380.           last:
  1381.             description: "Link to the last page."
  1382.             type: "string"
  1383.             example: "/shop-api/some-path?page=1&limit=10"
  1384.           next:
  1385.             description: "Link to the next page."
  1386.             type: "string"
  1387.             example: "/shop-api/some-path?page=1&limit=10"
  1388.   ProductsPage:
  1389.     allOf:
  1390.       - $ref: "#/definitions/Page"
  1391.       - type: "object"
  1392.         properties:
  1393.           items:
  1394.             type: "array"
  1395.             items:
  1396.               $ref: "#/definitions/Product"
  1397.   ProductDetails:
  1398.     allOf:
  1399.       - $ref: "#/definitions/Product"
  1400.       - type: "object"
  1401.         properties:
  1402.           breadcrumb:
  1403.             type: "string"
  1404.             example: "categories/mugs/logan-mug"
  1405.   ProductReviewsPage:
  1406.     allOf:
  1407.       - $ref: "#/definitions/Page"
  1408.       - type: "object"
  1409.         properties:
  1410.           title:
  1411.             type: "string"
  1412.             example: "Nice mug"
  1413.           rating:
  1414.             type: "integer"
  1415.             example: 5
  1416.           comment:
  1417.             type: "string"
  1418.             example: "It is a really nice mug."
  1419.           author:
  1420.             type: "string"
  1421.             example: "example@shop.com"
  1422.   Price:
  1423.     type: "object"
  1424.     properties:
  1425.       current:
  1426.         description: "Calculated price for given channel. Price is stored as an integer, so by default it should be divided by 100."
  1427.         type: "integer"
  1428.         example: 1000
  1429.       currency:
  1430.         type: "string"
  1431.         example: "PLN"
  1432.   EstimatedShippingCost:
  1433.     type: "object"
  1434.     properties:
  1435.       price:
  1436.         $ref: "#/definitions/Price"
  1437.   Address:
  1438.     type: "object"
  1439.     properties:
  1440.       firstName:
  1441.         type: "string"
  1442.         example: "Sherlock"
  1443.       lastName:
  1444.         type: "string"
  1445.         example: "Holmes"
  1446.       countryCode:
  1447.         type: "string"
  1448.         example: "GB"
  1449.       street:
  1450.         type: "string"
  1451.         example: "Baker Street 221b"
  1452.       city:
  1453.         type: "string"
  1454.         example: "London"
  1455.       postcode:
  1456.         type: "string"
  1457.         example: "NW1"
  1458.       provinceName:
  1459.         type: "string"
  1460.         example: "Greater London"
  1461.   PaymentMethod:
  1462.     type: "object"
  1463.     properties:
  1464.       code:
  1465.         type: "string"
  1466.         example: "PBC"
  1467.       name:
  1468.         type: "string"
  1469.         example: "Pay by check"
  1470.       description:
  1471.         type: "string"
  1472.         example: "Some strange description."
  1473.       instructions:
  1474.         type: "string"
  1475.         example: "Some instructions."
  1476.   ShippingMethod:
  1477.     type: "object"
  1478.     properties:
  1479.       code:
  1480.         type: "string"
  1481.         example: "DHL"
  1482.       name:
  1483.         type: "string"
  1484.         example: "DHL Delivery"
  1485.       description:
  1486.         type: "string"
  1487.         example: "DHL Delivery will deliver your parcel even next day!"
  1488.       price:
  1489.         $ref: "#/definitions/Price"
  1490.   RequestPasswordResetting:
  1491.     type: "object"
  1492.     properties:
  1493.       email:
  1494.         type: "string"
  1495.         example: "test@example.com"
  1496.   RegisterRequest:
  1497.     type: "object"
  1498.     properties:
  1499.       email:
  1500.         type: "string"
  1501.         example: "test@example.com"
  1502.       plainPassword:
  1503.         type: "string"
  1504.         example: "test12334verysecure"
  1505.       firstName:
  1506.         type: "string"
  1507.         example: "Sherlock"
  1508.       lastName:
  1509.         type: "string"
  1510.         example: "Holmes"
  1511.       channel:
  1512.         type: "string"
  1513.         example: "WEB_GB"
  1514.   UpdateUserRequest:
  1515.     type: "object"
  1516.     properties:
  1517.       firstName:
  1518.         type: "string"
  1519.         example: "Sherlock"
  1520.       lastName:
  1521.         type: "string"
  1522.         example: "Holmes"
  1523.       email:
  1524.         type: "string"
  1525.         example: "sherlock@holmes.com"
  1526.       birthday:
  1527.         type: "string"
  1528.         example: "2017-08-12"
  1529.       gender:
  1530.         type: "string"
  1531.         example: "f"
  1532.       phoneNumber:
  1533.         type: "string"
  1534.         example: "+490000000000"
  1535.       subscribedToNewsletter:
  1536.         type: "integer"
  1537.         example: 0
  1538.   LoggedInCustomerDetails:
  1539.     type: "object"
  1540.     properties:
  1541.       firstName:
  1542.         type: "string"
  1543.         example: "Sherlock"
  1544.       lastName:
  1545.         type: "string"
  1546.         example: "Holmes"
  1547.       email:
  1548.         type: "string"
  1549.         example: "sherlock@holmes.com"
  1550.   LoggedInCustomerAddressBook:
  1551.     type: "array"
  1552.     items:
  1553.       allOf:
  1554.         - $ref: "#/definitions/LoggedInCustomerAddressBookAddress"
  1555.         - type: "object"
  1556.           properties:
  1557.             default:
  1558.               type: "boolean"
  1559.               example: false
  1560.   LoggedInCustomerAddressBookAddress:
  1561.     type: "object"
  1562.     properties:
  1563.       id:
  1564.         type: "integer"
  1565.         example: 1
  1566.       firstName:
  1567.         type: "string"
  1568.         example: "Sherlock"
  1569.       lastName:
  1570.         type: "string"
  1571.         example: "Holmes"
  1572.       countryCode:
  1573.         type: "string"
  1574.         example: "GB"
  1575.       street:
  1576.         type: "string"
  1577.         example: "Baker Street 221b"
  1578.       city:
  1579.         type: "string"
  1580.         example: "London"
  1581.       postcode:
  1582.         type: "string"
  1583.         example: "NW1"
  1584.       provinceName:
  1585.         type: "string"
  1586.         example: "Greater London"
  1587.       provinceCode:
  1588.         type: "string"
  1589.         example: "GB_gl"
  1590.       company:
  1591.         type: "string"
  1592.         example: "Holmes Investigation Service"
  1593.       phoneNumber:
  1594.         type: "string"
  1595.         example: "+490000000000"
  1596.   TotalsView:
  1597.     type: "object"
  1598.     properties:
  1599.       total:
  1600.         description: "Total cost of the cart. The sum of all properties below."
  1601.         type: "integer"
  1602.         example: 0
  1603.       items:
  1604.         description: "Total cost of the cart items."
  1605.         type: "integer"
  1606.         example: 0
  1607.       taxes:
  1608.         description: "Total amount of cart taxes."
  1609.         type: "integer"
  1610.         example: 0
  1611.       shipping:
  1612.         description: "Total cost of the cart shipment."
  1613.         type: "integer"
  1614.         example: 0
  1615.       promotion:
  1616.         description: "Total amount of cart promotions."
  1617.         type: "integer"
  1618.         example: 0
  1619.   PlacedOrder:
  1620.     type: "object"
  1621.     description: "Placed order with information about items, current state, totals and more."
  1622.     properties:
  1623.       tokenValue:
  1624.         type: "string"
  1625.         example: "SDAOSLEFNWU35H3QLI5325"
  1626.       channel:
  1627.         type: "string"
  1628.         example: "WEB_GB"
  1629.         externalDocs:
  1630.           description: "Find out more about channels in the Sylius documentation."
  1631.           url: "http://docs.sylius.org/en/latest/book/configuration/channels.html"
  1632.       currency:
  1633.         description: "Code of the cart currency according to ISO 4217. This value is inherited from channel"
  1634.         type: "string"
  1635.         example: "GBP"
  1636.       locale:
  1637.         description: "Code of the order locale. This value is inherited from channel"
  1638.         type: "string"
  1639.         example: "en_GB"
  1640.       checkoutState:
  1641.         description: "Current state of a checkout."
  1642.         type: "string"
  1643.         default: "cart"
  1644.         externalDocs:
  1645.           description: "Find out more about checkout states in the Sylius documentation."
  1646.           url: "http://docs.sylius.org/en/latest/book/orders/checkout.html#checkout-state-machine"
  1647.         enum:
  1648.          - "cart"
  1649.           - "new"
  1650.           - "fulfilled"
  1651.           - "cancelled"
  1652.       items:
  1653.         type: "array"
  1654.         items:
  1655.           $ref: "#/definitions/Item"
  1656.       totals:
  1657.         type: "object"
  1658.         $ref: "#/definitions/TotalsView"
  1659.       shippingAddress:
  1660.         type: "object"
  1661.         $ref: "#/definitions/Address"
  1662.       billingAddress:
  1663.         type: "object"
  1664.         $ref: "#/definitions/Address"
  1665.       payments:
  1666.         type: "array"
  1667.         items:
  1668.           $ref: "#/definitions/Payment"
  1669.       shipments:
  1670.         type: "array"
  1671.         items:
  1672.           $ref: "#/definitions/Shipment"
  1673.       cartDiscounts:
  1674.         type: "array"
  1675.         items:
  1676.           type: "object"
  1677.           additionalProperties:
  1678.             type: "object"
  1679.             $ref: "#/definitions/Discount"
  1680.   GeneralError:
  1681.     type: "object"
  1682.     properties:
  1683.       code:
  1684.         type: "integer"
  1685.         example: 400
  1686.       message:
  1687.         type: "string"
  1688.         example: "Validation failed"
  1689.       errors:
  1690.         description: "Keys reference to the fields where the error occurred."
  1691.         type: "object"
  1692.         additionalProperties:
  1693.           type: "array"
  1694.           items:
  1695.             type: "string"
  1696.             example: "sylius.shop_api.additionalProp.not_null"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement