Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.org"
- 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.org/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.org/en/latest/book/products/index.html"
- - name: "taxons"
- description: "Show taxon tree"
- externalDocs:
- description: "Find out more"
- url: "http://docs.sylius.org/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.org/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.org/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:
- ChannelCode:
- in: "path"
- description: "The request channel code"
- name: "channelCode"
- required: true
- type: "string"
- CartToken:
- in: "path"
- name: "token"
- description: "Cart identifier."
- required: true
- type: "string"
- paths:
- /{channelCode}/carts:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- 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"
- /{channelCode}/carts/{token}:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- - $ref: "#/parameters/CartToken"
- post:
- deprecated: true
- tags:
- - "cart"
- summary: "Pick up your cart from the store"
- 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."
- operationId: "deprecatedCartPickUp"
- responses:
- 201:
- description: "Cart has been picked up and assigned to given token"
- 400:
- description: "Invalid input"
- schema:
- $ref: "#/definitions/GeneralError"
- 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"
- /{channelCode}/carts/{token}/items:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- - $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"
- /{channelCode}/carts/{token}/multiple-items:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- - $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"
- /{channelCode}/carts/{token}/items/{identifier}:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- - $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"
- /{channelCode}/carts/{token}/estimated-shipping-cost:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- - $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"
- /{channelCode}/carts/{token}/coupon:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- - $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"
- /{channelCode}/checkout/{token}:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- - $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"
- /{channelCode}/checkout/{token}/address:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- - $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: "Invalid input, validation failed."
- schema:
- $ref: "#/definitions/GeneralError"
- /{channelCode}/checkout/{token}/shipping/:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- - $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"
- /{channelCode}/checkout/{token}/shipping/{id}:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- - $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"
- /{channelCode}/checkout/{token}/payment/:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- - $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"
- /{channelCode}/checkout/{token}/payment/{id}:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- - $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/CheckoutChoosePaymentMethodRequest"
- responses:
- 204:
- description: "Payment method has been chosen."
- 400:
- description: "Invalid input, validation failed."
- schema:
- $ref: "#/definitions/GeneralError"
- /{channelCode}/checkout/{token}/complete:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- - $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"
- /{channelCode}/taxon-products-by-slug/{slug}:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- get:
- tags:
- - "products"
- summary: "Show product catalog."
- description: "This endpoint will return a paginated list of products for given taxon."
- operationId: "productCatalogBySlug"
- parameters:
- - name: "slug"
- 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"
- /{channelCode}/taxon-products/{code}:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- get:
- tags:
- - "products"
- summary: "Show product catalog."
- description: "This endpoint will return a paginated list of products for given taxon."
- operationId: "productCatalog"
- parameters:
- - name: "code"
- 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"
- /{channelCode}/products-by-slug/{slug}:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- 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"
- /{channelCode}/products/{code}:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- 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"
- /{channelCode}/product-reviews-by-slug/{slug}:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- - 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"
- /{channelCode}/product/{code}/reviews:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- - 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"
- /{channelCode}/taxons:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- 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"
- /{channelCode}/taxons/{code}:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- 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/Taxon"
- /{channelCode}/request-password-reset:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- 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: "email"
- in: "body"
- description: "Email of user which want to reset password."
- required: true
- schema:
- $ref: "#/definitions/RequestPasswordResetting"
- responses:
- 204:
- description: "Reset password request has been sent."
- 500:
- description: "User with provided email has not been found."
- /{channelCode}/register:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- 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"
- /{channelCode}/orders:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- 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"
- /{channelCode}/orders/{tokenValue}:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- - 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"
- /{channelCode}/me:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- 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"
- 500:
- description: "There is no currently logged in user."
- 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 is invalid."
- 500:
- description: "There is no currently logged in user."
- security:
- - bearerAuth: []
- /{channelCode}/address-book:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- 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"
- 500:
- 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"
- 500:
- description: "The user does not own the address"
- security:
- - bearerAuth: []
- /{channelCode}/address-book/{id}:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- 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"
- 500:
- description: "The user does not own the address"
- 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"
- 500:
- description: "The user does not own the address"
- security:
- - bearerAuth: []
- /{channelCode}/address-book/{id}/default:
- parameters:
- - $ref: "#/parameters/ChannelCode"
- 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"
- 500:
- description: "The user does not own the address"
- 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: "array"
- description: "Body of request used to put item to the cart."
- 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:
- type: "object"
- $ref: "#/definitions/Address"
- billingAddress:
- type: "object"
- $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"
- CheckoutChoosePaymentMethodRequest:
- 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"
- $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.org/en/latest/book/orders/shipments.html#the-shipment-state-machine"
- enum:
- - "cart"
- - "ready"
- - "cancelled"
- - "shipped"
- method:
- type: "object"
- $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.org/en/latest/book/orders/payments.html#payment-state-machine"
- enum:
- - "cart"
- - "new"
- - "processing"
- - "completed"
- - "failed"
- - "cancelled"
- - "refunded"
- method:
- type: "object"
- $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.org/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.org/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:
- type: "object"
- $ref: "#/definitions/TotalsView"
- shippingAddress:
- type: "object"
- $ref: "#/definitions/Address"
- billingAddress:
- type: "object"
- $ref: "#/definitions/Address"
- payments:
- type: "array"
- items:
- $ref: "#/definitions/Payment"
- shipments:
- type: "array"
- items:
- $ref: "#/definitions/Shipment"
- cartDiscounts:
- type: "array"
- items:
- type: "object"
- additionalProperties:
- type: "object"
- $ref: "#/definitions/Discount"
- Item:
- type: "object"
- description: "Item with calculated prices, quantity and related product."
- properties:
- id:
- type: "integer"
- example: 1
- quantity:
- type: "integer"
- example: 2
- total:
- type: "integer"
- example: 1000
- product:
- $ref: "#/definitions/Product"
- Product:
- type: "object"
- description: "Product with its basic information, variants, attributes, association and images."
- properties:
- code:
- type: "string"
- example: "LOGAN_MUG_CODE"
- name:
- type: "string"
- example: "Logan Mug"
- slug:
- type: "string"
- example: "logan-mug"
- averageRating:
- type: "string"
- example: "4.5"
- taxons:
- $ref: "#/definitions/ProductTaxon"
- variants:
- description: "Keys reference to code of a variant."
- type: "object"
- additionalProperties:
- type: "array"
- items:
- $ref: "#/definitions/Variant"
- attributes:
- type: "array"
- items:
- $ref: "#/definitions/Attribute"
- associations:
- description: "Keys reference to code of an association."
- type: "object"
- additionalProperties:
- type: "array"
- items:
- $ref: "#/definitions/Product"
- images:
- type: "array"
- items:
- $ref: "#/definitions/Image"
- 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"
- 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
- 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"
- 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"
- 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"
- 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
- LoggedInCustomerDetails:
- type: "object"
- properties:
- firstName:
- type: "string"
- example: "Sherlock"
- lastName:
- type: "string"
- example: "Holmes"
- email:
- type: "string"
- example: "sherlock@holmes.com"
- 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
- PlacedOrder:
- type: "object"
- description: "Placed order 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.org/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.org/en/latest/book/orders/checkout.html#checkout-state-machine"
- enum:
- - "cart"
- - "new"
- - "fulfilled"
- - "cancelled"
- items:
- type: "array"
- items:
- $ref: "#/definitions/Item"
- totals:
- type: "object"
- $ref: "#/definitions/TotalsView"
- shippingAddress:
- type: "object"
- $ref: "#/definitions/Address"
- billingAddress:
- type: "object"
- $ref: "#/definitions/Address"
- payments:
- type: "array"
- items:
- $ref: "#/definitions/Payment"
- shipments:
- type: "array"
- items:
- $ref: "#/definitions/Shipment"
- cartDiscounts:
- type: "array"
- items:
- type: "object"
- additionalProperties:
- type: "object"
- $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"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement