Wiki source code of Build your own shop system

Version 11.1 by Shop Team on 2019/08/05 07:45

Show last authors
1 = Intro =
2
3 If a standalone or [[JavaScript Integrated Shop>>url:https://help.spreadshirt.com/hc/en-us/articles/207487815-Website-Integration-with-JavaScript||shape="rect"]] does not fulfill your requirements and you absolutely must have a custom shop this tutorial aims to be a starting point for your journey.
4
5 == Example ==
6
7 Before we start you can take a look at a working (minimal) example that we have built in order to demonstrate the capabilities of the Public Shop API: **[[https:~~/~~/github.com/spreadshirt/shop-api-example-integration>>url:https://github.com/spreadshirt/shop-api-example-integration||shape="rect"]]**. It shows a draft of a shop system written in php that might be helpful to understand the (list-page -> detail-page -> add-to-basket) workflow.
8
9 [[image:attach:image2019-8-2_14-10-37.png]][[image:attach:image2019-8-2_14-11-14.png]][[image:attach:image2019-8-2_14-9-28.png]]
10
11 = Prerequisites =
12
13 We have to stress that you have to have a certain amount of time and technical knowledge in order to build your own shop based on the Public Shop API.
14
15 The following topics will not be covered by this tutorial and will be treated as given
16
17 1. A Spreadshop with one or more design which you configured in the PartnerArea
18 1. An Spreadshirt API Key
19 1. (((
20 HTML and CSS knowledge
21 )))
22 1. (((
23 PHP and/or Javascript knowledge
24 )))
25 1. (((
26 Basic understanding about HTTP and "REST Resources" (in combination often called API)
27 )))
28
29 = Recommended approach =
30
31 == Manage your assets in the Partner Area ==
32
33 After you have created your Spreadshop you are ready to manage your assets at any time in the Partner Area. This is the only supported way to manage your shops, designs and products.
34
35 == Product data import ==
36
37 While it is possible to build a shop entirely using the Public Shop API as single source it is not recommended. You will not be able to introduce all kinds of filtering and sorting options because these are NOT built into the Public Shop API.
38
39 That means that you should fetch (periodically or on demand) all sellables via the Public Shop API and import them to YOUR database. Once you have imported this data you can build a frontend that meets your requirements. The only thing that should require direct API access based on customer action is the [[Basket API>>doc:Baskets]].
40
41 Required resources:
42
43 * [[doc:Sellables]]
44 * [[doc:Baskets]]
45 * (((
46 [[doc:ProductType]] (optional)
47 )))
48
49 Optional resources:
50
51 * Product Type based navigation can be built using [[doc:ProductType Departments and Categories]]
52 * For localization see [[doc:Country]], [[doc:Language]] and [[doc:Currency]] (also see [[doc:Price Formatting Guide]])
53 * If you want to display correct shipping information you should study the [[doc:Shipping Types]] documentation
54
55 == Updating Data ==
56
57 There is no Public API available for uploading or updating ideas or sellables. This should be done via Partner Area.
58 Note that not only the content you upload in the Partner Area, but also the shop settings affect the output of the [[sellable resources>>doc:API.Sellables||shape="rect"]]. For example, enabling model images affects the image URLs returned by the API.
59
60 == Basket handling and checkout ==
61
62 Please see the [[baskets resource documentation>>doc:Baskets]] on how to create and update Spreadshirt API Baskets. It is up to you if you directly use the Spreadshirt Baskets API for your shop or if you create one on checkout and use your own basket implementation.
63
64 \\