swagger: "2.0" info: description: "Sylius Shop API documentation" version: "1.0.0" title: "Sylius Shop API" contact: email: "lukasz.chrusciel@sylius.com" license: name: "MIT" url: "https://opensource.org/licenses/MIT" host: "demo.sylius.com" basePath: "/shop-api" consumes: - "application/json" produces: - "application/json" tags: - name: "cart" description: "All actions related to cart management." externalDocs: description: "Find out more" url: "http://docs.sylius.com/en/latest/book/orders/index.html" - name: "products" description: "Show product catalog and add product reviews." externalDocs: description: "Find out more" url: "http://docs.sylius.com/en/latest/book/products/index.html" - name: "taxons" description: "Show taxon tree" externalDocs: description: "Find out more" url: "http://docs.sylius.com/en/latest/book/products/taxons.html" - name: "checkout" description: "All actions related to checkout fulfillment. It is important, to execute them in given order (address, choose shipment, choose payment and complete)." externalDocs: description: "Find out more" url: "http://docs.sylius.com/en/latest/book/orders/checkout.html" - name: "order" description: "Showing the order information" externalDocs: description: "Find out more" url: "http://docs.sylius.com/en/latest/book/orders/orders.html" - name: "users" description: "All actions related to user functionality." externalDocs: description: "Find out more" url: "http://docs.sylius.com/en/latest/book/customers/customer_and_shopuser.html" - name: "address" description: "All functions related to the Sylius Customer Address Book" externalDocs: description: "Find out more" url: "https://docs.sylius.com/en/latest/book/customers/addresses/address_book.html" schemes: - "https" parameters: CartToken: in: "path" name: "token" description: "Cart identifier." required: true type: "string" paths: /carts: post: tags: - "cart" summary: "Pick up your cart from the store" description: "This endpoint will allow you to create a new cart." operationId: "cartPickUp" responses: 201: description: "Cart has been picked up" schema: $ref: "#/definitions/Cart" 400: description: "Invalid input" schema: $ref: "#/definitions/GeneralError" /carts/{token}: parameters: - $ref: "#/parameters/CartToken" get: tags: - "cart" summary: "Show summarized cart." description: "This endpoint shows you the current calculated state of cart." operationId: "cartSummarize" responses: 200: description: "Current state of the cart, with calculated prices and related items." schema: $ref: "#/definitions/Cart" 400: description: "Invalid input (E.g. token has not been found)" schema: $ref: "#/definitions/GeneralError" delete: tags: - "cart" summary: "Drop your cart." description: "This endpoint will remove the cart and all of the related cart items." operationId: "cartDrop" responses: 204: description: "Cart has been dropped." 400: description: "Invalid input (E.g. token has not been found)" schema: $ref: "#/definitions/GeneralError" /carts/{token}/items: parameters: - $ref: "#/parameters/CartToken" post: tags: - "cart" summary: "Add an item to your cart." description: "This endpoint will allow you to add a new item to your cart." operationId: "cartAddItem" parameters: - in: "body" name: "content" 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." required: true schema: $ref: "#/definitions/PutItemToCartRequest" responses: 201: description: "Item has been added to the cart" schema: $ref: "#/definitions/Cart" 400: description: "Invalid input, validation failed." schema: $ref: "#/definitions/GeneralError" /carts/{token}/multiple-items: parameters: - $ref: "#/parameters/CartToken" post: tags: - "cart" summary: "Add multiple items to your cart." description: "This endpoint will allow you to add a new item to your cart." operationId: "cartPutItems" parameters: - in: "body" name: "content" description: "Description of items. The same rules applied to each of the array values as to the previous point." required: true schema: $ref: "#/definitions/PutItemsToCartRequest" responses: 201: description: "Item has been added to the cart" schema: $ref: "#/definitions/Cart" 400: description: "Invalid input, validation failed." schema: $ref: "#/definitions/GeneralError" /carts/{token}/items/{identifier}: parameters: - $ref: "#/parameters/CartToken" - name: "identifier" in: "path" description: "Identifier of a specific item. Can be found in the cart summary." required: true type: "string" put: tags: - "cart" summary: "Change quantity of a cart item." operationId: "cartUpdateItem" parameters: - in: "body" name: "content" required: true schema: $ref: "#/definitions/ChangeItemQuantityRequest" responses: 204: description: "Quantity has been changed." 400: description: "Invalid input, validation failed." schema: $ref: "#/definitions/GeneralError" delete: tags: - "cart" summary: "Remove cart item." operationId: "cartDeleteItem" description: "This endpoint will remove one item from your cart" responses: 204: description: "Cart item has been removed." 400: description: "Invalid input (E.g. token has not been found)" schema: $ref: "#/definitions/GeneralError" /carts/{token}/estimated-shipping-cost: parameters: - $ref: "#/parameters/CartToken" get: tags: - "cart" summary: "Estimates the shipping cost of the cart" operationId: "estimateShippingCost" parameters: - name: "countryCode" in: "query" description: "Shipping Country" required: true type: "string" - name: "provinceCode" in: "query" description: "Province to ship to" required: true type: "string" responses: 200: description: "Price was calculated" schema: $ref: "#/definitions/EstimatedShippingCost" 400: description: "Invalid input (E.g. token has not been found)" schema: $ref: "#/definitions/GeneralError" /carts/{token}/coupon: parameters: - $ref: "#/parameters/CartToken" put: tags: - "cart" summary: "Add a promotion coupon code to the cart." description: "This endpoint will allow you to add a promotion coupon code to the cart and receive the discount." operationId: "cartAddCoupon" parameters: - in: "body" name: "content" required: true schema: $ref: "#/definitions/AddCouponRequest" responses: 204: description: "Coupon has been assigned to the cart." 400: description: "Invalid input, validation failed." schema: $ref: "#/definitions/GeneralError" delete: tags: - "cart" summary: "Remove a promotion coupon code from the cart." description: "This endpoint will allow you to remove a promotion coupon code from the cart." operationId: "cartRemoveCoupon" responses: 204: description: "Coupon has been removed from the cart." 400: description: "Invalid input, validation failed." schema: $ref: "#/definitions/GeneralError" /checkout/{token}: parameters: - $ref: "#/parameters/CartToken" get: tags: - "checkout" summary: "Show checkout summary" description: "This endpoint will show the summarized cart during checkout. This action is an equivalent of cart summarize action." operationId: "checkoutSummarize" responses: 200: description: "Current state of the cart, with calculated prices and related items." schema: $ref: "#/definitions/Cart" 400: description: "Invalid input (E.g. token has not been found)" schema: $ref: "#/definitions/GeneralError" /checkout/{token}/address: parameters: - $ref: "#/parameters/CartToken" put: tags: - "checkout" summary: "Address cart." 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." operationId: "checkoutAddress" parameters: - in: "body" name: "content" required: true schema: $ref: "#/definitions/CheckoutAddressRequest" responses: 204: description: "Cart has been addressed." 400: description: "Address not valid" schema: $ref: "#/definitions/GeneralError" /checkout/{token}/shipping: parameters: - $ref: "#/parameters/CartToken" get: tags: - "checkout" summary: "Get available shipping methods." description: "This endpoint will show you available shipping methods for all cart shipments." operationId: "checkoutShowAvailableShippingMethods" responses: 200: description: "Get available shipping methods." schema: $ref: "#/definitions/AvailableShippingMethods" 400: description: "Invalid input, validation failed." schema: $ref: "#/definitions/GeneralError" /checkout/{token}/shipping/{id}: parameters: - $ref: "#/parameters/CartToken" put: tags: - "checkout" summary: "Choosing a cart shipping method." description: "This endpoint will allow you to choose a cart shipping method." operationId: "checkoutChooseShippingMethod" parameters: - name: "id" in: "path" description: "Order number of shipment for which shipping method should be specified." required: true type: "string" - in: "body" name: "content" required: true schema: $ref: "#/definitions/CheckoutChooseShippingMethodRequest" responses: 204: description: "Shipping method has been chosen." 400: description: "Invalid input, validation failed." schema: $ref: "#/definitions/GeneralError" /checkout/{token}/payment: parameters: - $ref: "#/parameters/CartToken" get: tags: - "checkout" summary: "Get available payment methods." description: "This endpoint will show you available payment methods for all cart payments." operationId: "checkoutShowAvailablePaymentMethods" responses: 200: description: "Get available payment methods." schema: $ref: "#/definitions/AvailablePaymentMethods" 400: description: "Invalid input, validation failed." schema: $ref: "#/definitions/GeneralError" /checkout/{token}/payment/{id}: parameters: - $ref: "#/parameters/CartToken" put: tags: - "checkout" summary: "Choosing cart payment method." description: "This endpoint will allow you to choose cart a payment method." operationId: "checkoutChoosePaymentMethod" parameters: - name: "id" in: "path" description: "Order number of payment for which payment method should be specified." required: true type: "string" - in: "body" name: "content" required: true schema: $ref: "#/definitions/ChoosePaymentMethodRequest" responses: 204: description: "Payment method has been chosen." 400: description: "Invalid input, validation failed." schema: $ref: "#/definitions/GeneralError" /checkout/{token}/complete: parameters: - $ref: "#/parameters/CartToken" put: tags: - "checkout" summary: "Completing checkout." description: "This endpoint will allow you to complete the checkout." operationId: "checkoutComplete" parameters: - in: "body" name: "content" required: true schema: $ref: "#/definitions/CheckoutCompleteRequest" responses: 204: description: "Checkout has been completed." 400: description: "Invalid input, validation failed." schema: $ref: "#/definitions/GeneralError" 403: description: "Not logged in or wrong email" security: - {} - bearerAuth: [] /taxon-products/by-slug/{taxonSlug}: get: tags: - "products" summary: "Show product catalog." description: "This endpoint will return a paginated list of products for given taxon." operationId: "productCatalogBySlug" parameters: - name: "taxonSlug" in: "path" description: "Slug of taxonomy for which products should be listed." required: true type: "string" - name: "locale" in: "query" description: "Locale in which products should be shown." required: false type: "string" - name: "limit" in: "query" description: "Number of expected products per page." required: false type: "integer" - name: "page" in: "query" description: "Page number." required: false type: "integer" responses: 200: description: "Paginated product list." schema: $ref: "#/definitions/ProductsPage" /taxon-products/by-code/{taxonCode}: get: tags: - "products" summary: "Show product catalog." description: "This endpoint will return a paginated list of products for given taxon." operationId: "productCatalog" parameters: - name: "taxonCode" in: "path" description: "Code of taxonomy for which products should be listed." required: true type: "string" - name: "locale" in: "query" description: "Locale in which products should be shown." required: false type: "string" - name: "limit" in: "query" description: "Number of expected products per page." required: false type: "integer" - name: "page" in: "query" description: "Page number." required: false type: "integer" responses: 200: description: "Paginated product list." schema: $ref: "#/definitions/ProductsPage" /products/by-slug/{slug}: get: tags: - "products" summary: "Show a product with the given slug." description: "This endpoint will return a product with the given slug." operationId: "productDetailsBySlug" parameters: - name: "slug" in: "path" description: "Slug of expected product." required: true type: "string" - name: "locale" in: "query" description: "Locale in which products should be shown." required: false type: "string" responses: 200: description: "Show a product with the given slug." schema: $ref: "#/definitions/ProductDetails" /products/by-code/{code}: get: tags: - "products" summary: "Show a product with the given code." description: "This endpoint will return a product with the given code." operationId: "productDetails" parameters: - name: "code" in: "path" description: "Code of expected product." required: true type: "string" - name: "locale" in: "query" description: "Locale in which products should be shown." required: false type: "string" responses: 200: description: "Show a product with the given code." schema: $ref: "#/definitions/ProductDetails" /products/by-slug/{slug}/reviews: parameters: - name: "slug" in: "path" description: "Slug of expected product." required: true type: "string" post: tags: - "products" summary: "Add a review to the product." 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." operationId: "productAddReviewBySlug" parameters: - in: "body" name: "content" required: true schema: $ref: "#/definitions/AddReviewRequest" responses: 201: description: "Review has been added to the product." 400: description: "Invalid input, validation failed." schema: $ref: "#/definitions/GeneralError" get: tags: - "products" summary: "Show reviews." description: "This endpoint will return a paginated list of all reviews related to the product identified by slug." operationId: "productReviewsBySlug" responses: 200: description: "A paginated list of all reviews related to the product identified by slug." schema: $ref: "#/definitions/ProductReviewsPage" /products/by-code/{code}/reviews: parameters: - name: "code" in: "path" description: "Code of expected product." required: true type: "string" post: tags: - "products" summary: "Add a review to the product." 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." operationId: "productAddReview" parameters: - in: "body" name: "content" required: true schema: $ref: "#/definitions/AddReviewRequest" responses: 201: description: "Review has been added to the product." 400: description: "Invalid input, validation failed." schema: $ref: "#/definitions/GeneralError" get: tags: - "products" summary: "Show reviews." description: "This endpoint will return a paginated list of all reviews related to the product identified by slug." operationId: "productReviews" responses: 200: description: "A paginated list of all reviews related to the product identified by slug." schema: $ref: "#/definitions/ProductReviewsPage" /product-latest: get: tags: - "products" summary: "Show latest products." description: "This endpoint will return an array of latest products." operationId: "latestProducts" parameters: - name: "locale" in: "query" description: "Locale in which products should be shown." required: false type: "string" - name: "limit" in: "query" description: "Number of expected products per page." required: false type: "integer" responses: 200: description: "Array of latest products." schema: type: "array" items: $ref: "#/definitions/Product" /taxons: get: tags: - "taxons" summary: "Show taxon tree." description: "This endpoint will return an array of all available taxon roots with all of its children." operationId: "taxonTree" parameters: - name: "locale" in: "query" description: "Locale in which taxons should be shown." required: false type: "string" responses: 200: description: "Array of all available taxons." schema: type: "array" items: $ref: "#/definitions/Taxon" /taxons/{code}: get: tags: - "taxons" summary: "Show taxon with given code." description: "This endpoint will return a taxon with given code, children and the root node with direct path to this taxon." operationId: "taxonDetails" parameters: - name: "code" in: "path" description: "Code of expected taxon." required: true type: "string" - name: "locale" in: "query" description: "Locale in which taxons should be shown." required: false type: "string" responses: 200: description: "Requested taxon with children." schema: $ref: "#/definitions/TaxonDetails" /request-password-reset: put: tags: - "users" summary: "Request resetting password of user with passed email." 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`." operationId: "requestPasswordReset" parameters: - name: "content" in: "body" required: true schema: $ref: "#/definitions/RequestPasswordResetting" responses: 204: description: "Reset password request has been sent If the email exists in our system,." 400: description: "Email not valid" /password-reset/{token}: parameters: - in: "path" name: "token" description: "Password reset token." required: true type: "string" put: tags: - "users" summary: "Password reset." description: "This endpoint resets the user password." operationId: "passwordReset" parameters: - name: "content" in: "body" required: true schema: $ref: "#/definitions/PasswordResetRequest" responses: 204: description: "Update password request success." 400: description: "Token not found." /register: post: tags: - "users" summary: "Registering a new user" description: "This creates a new user that can log in the shop" operationId: "registerUser" parameters: - name: "content" in: "body" required: true schema: $ref: "#/definitions/RegisterRequest" responses: 204: description: "The user was successfully created" 400: description: "There were validation errors" 500: description: "Channel not found" /login: post: tags: - "users" summary: "Logs the user in and returns the token" description: "This route is needed to log the user in and get an access token." operationId: "loginUser" consumes: - "application/json" parameters: - name: "content" in: "body" required: true schema: $ref: "#/definitions/LoginRequest" responses: 200: description: "User was logged in" schema: $ref: "#/definitions/LoginSuccess" /verify-account: parameters: - name: "token" in: "query" required: true type: "string" get: tags: - "users" summary: "Verify an account by verification token" description: "This route is needed to verify an user." operationId: "verifyUser" responses: 204: description: "User unlocked" /orders: get: tags: - "order" summary: "Shows a list of orders of the customer" operationId: "orders" responses: 200: description: "Shows a list of placed orders of the customer" schema: type: "array" items: $ref: "#/definitions/PlacedOrder" 401: description: "User token invalid" security: - bearerAuth: [] /orders/{tokenValue}: parameters: - in: "path" name: "tokenValue" description: "Order token." required: true type: "string" get: tags: - "order" summary: "Shows details of specific customer's order" operationId: "order" responses: 200: description: "Shows details of specific customer's order with given tokenValue" schema: $ref: "#/definitions/PlacedOrder" 401: description: "User token invalid" 404: description: "Order with given tokenValue not found" security: - bearerAuth: [] /orders/{token}/payment: parameters: - $ref: "#/parameters/CartToken" get: tags: - "order" summary: "Get available payment methods." description: "This endpoint will show you available payment methods for an order." operationId: "showAvailablePaymentMethods" responses: 200: description: "Get available payment methods." schema: $ref: "#/definitions/AvailablePaymentMethods" 400: description: "Invalid input, validation failed." schema: $ref: "#/definitions/GeneralError" /orders/{token}/payment/{id}: parameters: - $ref: "#/parameters/CartToken" put: tags: - "order" summary: "Choosing cart payment method." description: "This endpoint will allow you to update an order payment method." operationId: "updatePaymentMethod" parameters: - name: "id" in: "path" description: "Order number of payment for which payment method should be specified." required: true type: "string" - in: "body" name: "content" required: true schema: $ref: "#/definitions/ChoosePaymentMethodRequest" responses: 204: description: "Payment method has been chosen." 400: description: "Invalid input, validation failed." schema: $ref: "#/definitions/GeneralError" /me: get: tags: - "users" summary: "Provides currently logged in user details." operationId: "me" responses: 200: description: "Provides currently logged in user details." schema: $ref: "#/definitions/LoggedInCustomerDetails" 401: description: "User token invalid" security: - bearerAuth: [] put: tags: - "users" summary: "Updates currently logged in users details." operationId: "updateUser" parameters: - name: "content" in: "body" required: true schema: $ref: "#/definitions/UpdateUserRequest" responses: 200: description: "User successfully updated." schema: $ref: "#/definitions/LoggedInCustomerDetails" 401: description: "User token invalid" security: - bearerAuth: [] /me/change-password: put: tags: - "users" summary: "Updates the password of the user that is currently logged in." operationId: "changePassword" parameters: - name: "content" in: "body" required: true schema: $ref: "#/definitions/ChangePasswordRequest" responses: 204: description: "Update password request success" 400: description: "There were validation errors" 401: description: "User token invalid" /address-book: get: tags: - "address" summary: "Gets the address book of the currently logged in user" operationId: "addressBook" responses: 200: description: "Successfully fetched Address Book" schema: $ref: "#/definitions/LoggedInCustomerAddressBook" 401: description: "User not logged in" security: - bearerAuth: [] post: tags: - "address" summary: "Creates a new address in the the address book" operationId: "createAddress" parameters: - name: "content" in: "body" required: true schema: $ref: "#/definitions/LoggedInCustomerAddressBookAddress" responses: 201: description: "Successfully created the address" schema: $ref: "#/definitions/LoggedInCustomerAddressBookAddress" 400: description: "Validation failed" schema: $ref: "#/definitions/GeneralError" 401: description: "No user is logged in" security: - bearerAuth: [] /address-book/{id}: put: tags: - "address" summary: "Updates an address in the address book" operationId: "updateAddressBook" parameters: - name: "id" in: "path" required: true type: "integer" description: "Id of the address to update" - name: "content" in: "body" required: true schema: $ref: "#/definitions/LoggedInCustomerAddressBookAddress" responses: 200: description: "Successfully updated the address" schema: $ref: "#/definitions/LoggedInCustomerAddressBookAddress" 400: description: "Validation failed" schema: $ref: "#/definitions/GeneralError" 401: description: "No user is logged in" 404: description: "The address not found in the user addresses" security: - bearerAuth: [] delete: tags: - "address" summary: "Deletes an address from the address book" operationId: "deleteAddress" parameters: - name: "id" in: "path" required: true type: "integer" description: "Id of the address to update" responses: 204: description: "Successfully removed the address" 400: description: "Validation failed" schema: $ref: "#/definitions/GeneralError" 401: description: "No user is logged in" 404: description: "The address not found in the user addresses" security: - bearerAuth: [] /address-book/{id}/default: patch: tags: - "address" summary: "Change the default address in the address book" operationId: "updateDefaultAddress" parameters: - name: "id" in: "path" required: true type: "integer" description: "Id of the address to be the default address" responses: 204: description: "Successfully updated the address" 400: description: "Validation failed" schema: $ref: "#/definitions/GeneralError" 401: description: "No user is logged in" 404: description: "The address not found in the user addresses" security: - bearerAuth: [] securityDefinitions: bearerAuth: type: "apiKey" name: "Authorization" in: "header" definitions: AddReviewRequest: type: "object" description: "Body of request with a channel code." required: - "title" - "rating" - "comment" - "email" properties: title: type: "string" example: "Awesome product" rating: type: "integer" example: 5 comment: type: "string" example: "If I were a mug, I would like to be like this one!" email: type: "string" description: "Email of an author." example: "customer@example.com" PutItemToCartRequest: type: "object" description: "Body of request used to put item to the cart." required: - "productCode" properties: productCode: type: "string" example: "LOGAN_HAT_CODE" quantity: type: "integer" minimum: 1 example: 3 default: 1 variantCode: type: "string" example: "SMALL_LOGAN_T_SHIRT_CODE" options: type: "object" description: "Keys reference to the code of an option and values to the code of option value." additionalProperties: type: "string" example: "HAT_SIZE_S" PutItemsToCartRequest: type: "object" description: "Body of request used to put item to the cart." properties: items: type: "array" items: type: "object" $ref: "#/definitions/PutItemToCartRequest" ChangeItemQuantityRequest: type: "object" description: "Body of request used to change quantity of an item." required: - "quantity" properties: quantity: type: "integer" example: 2 AddCouponRequest: type: "object" description: "Body of request used to add promotion coupon code to cart." required: - "coupon" properties: coupon: type: "string" example: "BANANAS" CheckoutAddressRequest: type: "object" description: "Body of request used for cart addressing." required: - "shippingAddress" properties: shippingAddress: $ref: "#/definitions/Address" billingAddress: $ref: "#/definitions/Address" CheckoutChooseShippingMethodRequest: type: "object" description: "Body of request used to choose shipping method." required: - "method" properties: method: type: "string" description: "Code of chosen shipping method." example: "DHL" ChoosePaymentMethodRequest: type: "object" description: "Body of request used to choose payment method." required: - "method" properties: method: type: "string" description: "Code of chosen payment method." example: "PBC" CheckoutCompleteRequest: type: "object" description: "Body of request used to complete checkout." required: - "email" properties: email: type: "string" description: "Email of a customer." example: "customer@example.com" notes: type: "string" description: "Additional notes." example: "I'm only available between 3 and 8 PM." AvailableShippingMethods: type: "object" description: "Available shipping methods for each shipment." properties: shipments: type: "array" items: type: "object" properties: methods: type: "object" additionalProperties: $ref: "#/definitions/ShippingMethod" Shipment: type: "object" properties: state: description: "Current state of a shipment." type: "string" default: "cart" externalDocs: description: "Find out more about shipment states in the Sylius documentation." url: "http://docs.sylius.com/en/latest/book/orders/shipments.html#the-shipment-state-machine" enum: - "cart" - "ready" - "cancelled" - "shipped" method: $ref: "#/definitions/ShippingMethod" AvailablePaymentMethods: type: "object" description: "Available payment methods for each payment." properties: payments: type: "array" items: type: "object" properties: methods: type: "object" additionalProperties: type: "object" $ref: "#/definitions/PaymentMethod" Payment: type: "object" properties: state: description: "Current state of a payment." type: "string" default: "cart" externalDocs: description: "Find out more about payment states in the Sylius documentation." url: "http://docs.sylius.com/en/latest/book/orders/payments.html#payment-state-machine" enum: - "cart" - "new" - "processing" - "completed" - "failed" - "cancelled" - "refunded" method: $ref: "#/definitions/PaymentMethod" Cart: type: "object" description: "Cart with information about items, current state, totals and more." properties: tokenValue: type: "string" example: "SDAOSLEFNWU35H3QLI5325" channel: type: "string" example: "WEB_GB" externalDocs: description: "Find out more about channels in the Sylius documentation." url: "http://docs.sylius.com/en/latest/book/configuration/channels.html" currency: description: "Code of the cart currency according to ISO 4217. This value is inherited from channel" type: "string" example: "GBP" locale: description: "Code of the cart locale. This value is inherited from channel" type: "string" example: "en_GB" checkoutState: description: "Current state of a checkout." type: "string" default: "cart" externalDocs: description: "Find out more about checkout states in the Sylius documentation." url: "http://docs.sylius.com/en/latest/book/orders/checkout.html#checkout-state-machine" enum: - "cart" - "addressed" - "shipping_selected" - "payment_selected" - "completed" items: type: "array" items: $ref: "#/definitions/Item" totals: $ref: "#/definitions/TotalsView" shippingAddress: $ref: "#/definitions/Address" billingAddress: $ref: "#/definitions/Address" payments: type: "array" items: $ref: "#/definitions/Payment" shipments: type: "array" items: $ref: "#/definitions/Shipment" cartDiscounts: type: "array" items: type: "object" additionalProperties: $ref: "#/definitions/Discount" couponCode: description: "Code of the coupon that is associated with this cart" type: "string" example: "LD11FA" Item: type: "object" description: "Item with calculated prices, quantity and related product." properties: id: type: "integer" example: 1 quantity: type: "integer" example: 2 subtotal: type: "integer" example: 2000 description: "Raw subtotal without the distributed order discounts (unit price * quantity + unit discount)" total: type: "integer" example: 1000 description: "The total also includes the distributed discount" product: type: "object" allOf: - $ref: "#/definitions/ProductMinimal" properties: variants: type: "array" description: "This array only contains the variant the user has put into the cart" items: $ref: "#/definitions/Variant" Product: type: "object" description: "Product with its basic information, variants, attributes, association and images." allOf: - $ref: "#/definitions/ProductMinimal" properties: variants: description: "Keys reference to code of a variant." type: "object" additionalProperties: type: "array" items: $ref: "#/definitions/Variant" associations: description: "Keys reference to code of an association." type: "object" additionalProperties: type: "array" items: $ref: "#/definitions/Product" ProductMinimal: type: "object" description: "A miminal view of the product. Used for example for the cart." properties: code: type: "string" example: "LOGAN_MUG_CODE" averageRating: type: "string" example: "1.8" name: type: "string" example: "Logan Mug" slug: type: "string" example: "logan-mug" description: type: "string" example: "A very nice mug that you can drink from or use to store beverages in." shortDescription: type: "string" example: "A mug." metaKeywords: type: "string" example: "mug drink logan" metaDescription: type: "string" example: "Some meta description" images: type: "array" items: $ref: "#/definitions/Image" taxons: $ref: "#/definitions/ProductTaxon" attributes: type: "array" items: $ref: "#/definitions/Attribute" Image: type: "object" properties: code: type: "string" example: "thumbnail" path: type: "string" example: "/uo/mug.jpg" Variant: type: "object" 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." properties: code: type: "string" example: "LOGAN_MUG_CODE" name: type: "string" example: "Logan Mug" axis: type: "array" description: "List of codes of associated product options." items: type: "string" example: "HAT_SIZE_S" nameAxis: description: "Map of keys from previous field to translated values of given variant." type: "object" additionalProperties: type: "string" price: $ref: "#/definitions/Price" originalPrice: $ref: "#/definitions/Price" images: type: "array" items: $ref: "#/definitions/Image" Attribute: type: "object" properties: code: type: "string" example: "MUG_MATERIAL_CODE" name: type: "string" example: "Mug material" value: type: "string" example: "Wood" Taxon: type: "object" properties: code: type: "string" example: "CATEGORIES_CODE" name: type: "string" example: "Categories" slug: type: "string" example: "categories" description: type: "string" example: "General category for all products." children: type: "array" 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." items: $ref: "#/definitions/Taxon" images: type: "array" items: $ref: "#/definitions/Image" TaxonDetails: type: "object" properties: self: $ref: "#/definitions/Taxon" parentTree: $ref: "#/definitions/Taxon" ProductTaxon: type: "object" properties: main: type: "string" example: "MAIN_TAXON_CODE" others: type: "array" items: type: "string" example: "OTHER_TAXON_CODE" Discount: type: "object" properties: name: description: "Name of promotion." type: "string" example: "Summer sale" amount: $ref: "#/definitions/Price" Page: type: "object" description: "Generic page object." properties: page: description: "Current page number." type: "integer" example: 1 limit: description: "Number of items per page." type: "integer" example: 10 pages: description: "Number of available pages for given limit." type: "integer" example: 3 total: description: "Amount of all paginated resources." type: "integer" example: 25 _links: type: "object" properties: self: description: "Link to the current page." type: "string" example: "/shop-api/some-path?page=1&limit=10" first: description: "Link to the fist page." type: "string" example: "/shop-api/some-path?page=1&limit=10" last: description: "Link to the last page." type: "string" example: "/shop-api/some-path?page=1&limit=10" next: description: "Link to the next page." type: "string" example: "/shop-api/some-path?page=1&limit=10" ProductsPage: allOf: - $ref: "#/definitions/Page" - type: "object" properties: items: type: "array" items: $ref: "#/definitions/Product" ProductDetails: allOf: - $ref: "#/definitions/Product" - type: "object" properties: breadcrumb: type: "string" example: "categories/mugs/logan-mug" ProductReviewsPage: allOf: - $ref: "#/definitions/Page" - type: "object" properties: title: type: "string" example: "Nice mug" rating: type: "integer" example: 5 createdAt: type: "string" example: "2016-01-02 21:00:10" comment: type: "string" example: "It is a really nice mug." author: type: "string" example: "example@shop.com" Price: type: "object" properties: current: description: "Calculated price for given channel. Price is stored as an integer, so by default it should be divided by 100." type: "integer" example: 1000 currency: type: "string" example: "PLN" EstimatedShippingCost: type: "object" properties: price: $ref: "#/definitions/Price" Address: type: "object" properties: firstName: type: "string" example: "Sherlock" lastName: type: "string" example: "Holmes" countryCode: type: "string" example: "GB" street: type: "string" example: "Baker Street 221b" city: type: "string" example: "London" postcode: type: "string" example: "NW1" provinceName: type: "string" example: "Greater London" company: type: "string" example: "Holmes Investigation Service" phoneNumber: type: "string" example: "+490000000000" PaymentMethod: type: "object" properties: code: type: "string" example: "PBC" name: type: "string" example: "Pay by check" description: type: "string" example: "Some strange description." instructions: type: "string" example: "Some instructions." ShippingMethod: type: "object" properties: code: type: "string" example: "DHL" name: type: "string" example: "DHL Delivery" description: type: "string" example: "DHL Delivery will deliver your parcel even next day!" price: $ref: "#/definitions/Price" RequestPasswordResetting: type: "object" properties: email: type: "string" example: "test@example.com" PasswordResetRequest: type: "object" properties: password: $ref: "#/definitions/PasswordReset" PasswordReset: type: object properties: first: type: "string" example: "a-new-password" second: type: "string" example: "a-new-password" RegisterRequest: type: "object" properties: email: type: "string" example: "test@example.com" plainPassword: type: "string" example: "test12334verysecure" firstName: type: "string" example: "Sherlock" lastName: type: "string" example: "Holmes" channel: type: "string" example: "WEB_GB" subscribedToNewsletter: type: "boolean" example: true phoneNumber: type: "string" example: "+1 234 56789" LoginRequest: type: "object" required: - email - password properties: email: type: "string" example: "test@example.com" password: type: "string" example: "test12334verysecure" token: type: "string" description: "The token of the current cart which should be assign to the customer" example: "SDAOSLEFNWU35H3QLI5325" UpdateUserRequest: type: "object" properties: firstName: type: "string" example: "Sherlock" lastName: type: "string" example: "Holmes" email: type: "string" example: "sherlock@holmes.com" birthday: type: "string" example: "2017-08-12" gender: type: "string" example: "f" phoneNumber: type: "string" example: "+490000000000" subscribedToNewsletter: type: "integer" example: 0 ChangePasswordRequest: type: "object" properties: currentPassword: type: "string" example: "current-user-password" newPassword: $ref: "#/definitions/PasswordReset" LoggedInCustomerDetails: type: "object" properties: firstName: type: "string" example: "Sherlock" lastName: type: "string" example: "Holmes" email: type: "string" example: "sherlock@holmes.com" birthday: type: "string" example: "2017-08-12" gender: type: "string" example: "m" phoneNumber: type: "string" example: "+490000000000" subscribedToNewsletter: type: "boolean" example: false LoggedInCustomerAddressBook: type: "array" items: allOf: - $ref: "#/definitions/LoggedInCustomerAddressBookAddress" - type: "object" properties: default: type: "boolean" example: false LoggedInCustomerAddressBookAddress: type: "object" properties: id: type: "integer" example: 1 firstName: type: "string" example: "Sherlock" lastName: type: "string" example: "Holmes" countryCode: type: "string" example: "GB" street: type: "string" example: "Baker Street 221b" city: type: "string" example: "London" postcode: type: "string" example: "NW1" provinceName: type: "string" example: "Greater London" provinceCode: type: "string" example: "GB_gl" company: type: "string" example: "Holmes Investigation Service" phoneNumber: type: "string" example: "+490000000000" TotalsView: type: "object" properties: total: description: "Total cost of the cart. The sum of all properties below." type: "integer" example: 0 items: description: "Total cost of the cart items." type: "integer" example: 0 taxes: description: "Total amount of cart taxes." type: "integer" example: 0 shipping: description: "Total cost of the cart shipment." type: "integer" example: 0 promotion: description: "Total amount of cart promotions." type: "integer" example: 0 LoginSuccess: type: "object" description: "User was logged in." properties: token: type: "string" example: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9" PlacedOrder: type: "object" description: "Placed order with information about items, current state, totals and more." properties: tokenValue: type: "string" example: "SDAOSLEFNWU35H3QLI5325" number: description: "Order number." type: "string" example: "000000036" channel: type: "string" example: "WEB_GB" externalDocs: description: "Find out more about channels in the Sylius documentation." url: "http://docs.sylius.com/en/latest/book/configuration/channels.html" currency: description: "Code of the cart currency according to ISO 4217. This value is inherited from channel" type: "string" example: "GBP" locale: description: "Code of the order locale. This value is inherited from channel" type: "string" example: "en_GB" checkoutState: description: "Current state of a checkout." type: "string" default: "cart" externalDocs: description: "Find out more about checkout states in the Sylius documentation." url: "http://docs.sylius.com/en/latest/book/orders/checkout.html#checkout-state-machine" enum: - "cart" - "addressed" - "shipping_selected" - "payment_selected" - "completed" checkoutCompletedAt: description: "Date the order was completed in ISO 8601 format." type: "string" format: "date-time" paymentState: description: "Current payment state of an order." type: "string" example: "awaiting_payment" enum: - "cart" - "awaiting_payment" - "partially_authorized" - "authorized" - "partially_paid" - "cancelled" - "paid" - "partially_refunded" - "refunded" items: type: "array" items: $ref: "#/definitions/Item" totals: $ref: "#/definitions/TotalsView" shippingAddress: $ref: "#/definitions/Address" billingAddress: $ref: "#/definitions/Address" payments: type: "array" items: $ref: "#/definitions/Payment" shipments: type: "array" items: $ref: "#/definitions/Shipment" cartDiscounts: type: "array" items: type: "object" additionalProperties: $ref: "#/definitions/Discount" GeneralError: type: "object" properties: code: type: "integer" example: 400 message: type: "string" example: "Validation failed" errors: description: "Keys reference to the fields where the error occurred." type: "object" additionalProperties: type: "array" items: type: "string" example: "sylius.shop_api.additionalProp.not_null"