eCommerce

Webbutik

MarknadsplatsVerksamhetVersion 0.5.0AGPL-3.0-or-latermanifest

Vad den är till för ​

Store the data of an online shop: listings, shipping methods, discount codes and web orders with a fulfilment flow. Refunds need a manager and an approval. A storefront or other client reads and writes this data through the API.

Vad paketet gör och inte gör ​

An online shop: categories, product listings with translations, shipping methods, discount codes, web orders with lines and a fulfilment flow of pending, paid, shipped, delivered, cancelled and refunded. When the instance runs with the public site enabled, visitors browse the published listings and place orders without an account; the server prices every order from the published listing and never trusts the browser. Orders take stock off the listing at checkout, apply discount codes and tax rates on the server, and are paid by bank transfer, by card through Stripe Checkout or in a local demo mode; the payment record, the provider reference and refunds are kept with the order. Refunds need a human approval from a manager; agents may only propose them. Customer name, email and addresses are personal data and are never public. Needs the Products package.

Modulinformation ​

  • Version: 0.5.0
  • Utgivare: SpaceCorps
  • Licens: AGPL-3.0-or-later
  • Kräver kärna: ^0.2 (aktuell kärna är 0.2.0)
  • Mognad: Beta
  • Kategorier: Försäljning

Modeller ​

ecommerce_category ​

A group of listings shown together in the shop

Läsgrupp: ecommerce.user. Skrivgrupp: ecommerce.manager.

FältTypDataklassPersonuppgiftGruppAgenter serBeskrivning
nametextnonenejecommerce.useri klartextCategory name shown in the shop
slugtextnonenejecommerce.useri klartextURL part of the category, lowercase with dashes
descriptiontextnonenejecommerce.useri klartextShort text about the category
sequencenumbernonenejecommerce.useri klartextOrder among categories, lowest first
publishedboolnonenejecommerce.useri klartextWhether the category is visible to shoppers

ecommerce_listing ​

A product as it appears in the online shop

Läsgrupp: ecommerce.user. Skrivgrupp: ecommerce.manager.

FältTypDataklassPersonuppgiftGruppAgenter serBeskrivning
product_idref → productnonenejecommerce.useri klartextThe product being sold online
titletextnonenejecommerce.useri klartextTitle shown in the shop
slugtextnonenejecommerce.useri klartextURL part of the product page, lowercase with dashes
summarytextnonenejecommerce.useri klartextOne or two sentences shown on product cards
descriptionlongtextnonenejecommerce.useri klartextDescription shown on the product page, in Markdown
imageimagenonenejecommerce.useri klartextMain picture of the product (PNG, JPEG, WebP or GIF, up to 5 MiB; it is re-encoded and its metadata removed on upload)
image_alttextnonenejecommerce.useri klartextText that describes the main picture for people who cannot see it
category_idref → ecommerce_categorynonenejecommerce.useri klartextThe category the listing is shown under
pricemoneynonenejecommerce.useri klartextShop price including tax (minor currency units, e.g. cents)
compare_at_pricemoneynonenejecommerce.useri klartextPrevious price shown crossed out (minor currency units)
currencytextnonenejecommerce.useri klartextISO 4217 currency code of the prices, for example EUR; empty means the shop currency from the instance settings
skutextnonenejecommerce.useri klartextStock keeping unit shown on the product page
stock_policyselect (always_available, block_when_out, allow_backorder)nonenejecommerce.useri klartextWhat happens when stock runs out: always_available, block_when_out, allow_backorder
stock_quantitynumbernonenejecommerce.useri klartextUnits on hand, used with the stock policy. Every order takes its units off at checkout, and a cancelled, expired or refunded order puts them back; correct it by hand after a stock count
publishedboolnonenejecommerce.useri klartextWhether the listing is visible to shoppers

ecommerce_listing_image ​

An extra picture of a listing for its gallery

Läsgrupp: ecommerce.user. Skrivgrupp: ecommerce.manager.

FältTypDataklassPersonuppgiftGruppAgenter serBeskrivning
listing_idref → ecommerce_listingnonenejecommerce.useri klartextThe listing the picture belongs to; it is shown only while the listing is published
imageimagenonenejecommerce.useri klartextThe picture (PNG, JPEG, WebP or GIF, up to 5 MiB)
alttextnonenejecommerce.useri klartextText that describes the picture for people who cannot see it
sequencenumbernonenejecommerce.useri klartextOrder in the gallery, lowest first
publishedboolnonenejecommerce.useri klartextWhether the picture is shown in the shop

ecommerce_listing_translation ​

A listing translated into another language

Läsgrupp: ecommerce.user. Skrivgrupp: ecommerce.manager.

FältTypDataklassPersonuppgiftGruppAgenter serBeskrivning
listing_idref → ecommerce_listingnonenejecommerce.useri klartextThe listing this translates
langselect (en, de, fr, pl, fi, sv, es)nonenejecommerce.useri klartextLanguage of the translation: en, de, fr, pl, fi, sv or es
titletextnonenejecommerce.useri klartextTranslated title
summarytextnonenejecommerce.useri klartextTranslated card text
descriptionlongtextnonenejecommerce.useri klartextTranslated description in Markdown
publishedboolnonenejecommerce.useri klartextWhether the translation is shown; it is only reachable while its listing is published

ecommerce_shipping_method ​

A way of delivering orders with its price

Läsgrupp: ecommerce.user. Skrivgrupp: ecommerce.manager.

FältTypDataklassPersonuppgiftGruppAgenter serBeskrivning
nametextnonenejecommerce.useri klartextName shown at checkout, for example Standard delivery
carriertextnonenejecommerce.useri klartextCarrier that delivers, for example DHL
pricemoneynonenejecommerce.useri klartextDelivery price (minor currency units)
free_overmoneynonenejecommerce.useri klartextOrder total above which delivery is free (minor currency units); empty means never
delivery_daysnumbernonenejecommerce.useri klartextUsual number of days until delivery
activeboolnonenejecommerce.useri klartextWhether shoppers can choose it

ecommerce_discount_code ​

A code a shopper enters at checkout for a reduction

Läsgrupp: ecommerce.user. Skrivgrupp: ecommerce.manager.

FältTypDataklassPersonuppgiftGruppAgenter serBeskrivning
codetextnonenejecommerce.useri klartextThe code shoppers type, for example SPRING10
kindselect (percent, fixed)nonenejecommerce.useri klartextType of reduction: percent or fixed
valuenumbernonenejecommerce.useri klartextReduction: basis points for percent (1000 is 10.00 percent), minor currency units for fixed
starts_ondatenonenejecommerce.useri klartextFirst day the code works (YYYY-MM-DD)
ends_ondatenonenejecommerce.useri klartextLast day the code works (YYYY-MM-DD)
max_usesnumbernonenejecommerce.useri klartextHow many times the code may be used in total; empty means unlimited
used_countnumbernonenejecommerce.useri klartextHow many times it has been used. The shop counts a use when the order is placed and gives it back when the order is cancelled or never paid
minimum_ordermoneynonenejecommerce.useri klartextSmallest order total the code applies to (minor currency units)
per_customer_limitnumbernonenejecommerce.useri klartextHow many times one customer (by email address) may use the code; empty means no limit
category_idref → ecommerce_categorynonenejecommerce.useri klartextOnly listings of this category get the reduction; empty means the whole order
activeboolnonenejecommerce.useri klartextWhether the code can be used

ecommerce_discount_use ​

How many times one customer has used one discount code (the customer is kept as a hash, never as an email address)

Läsgrupp: ecommerce.manager. Skrivgrupp: ecommerce.manager.

FältTypDataklassPersonuppgiftGruppAgenter serBeskrivning
code_idref → ecommerce_discount_codenonenejecommerce.manageri klartextThe discount code
customer_hashtextinternaljaecommerce.managermaskeradHash of the customer's email address, so the per-customer limit can be checked without keeping the address here
countnumbernonenejecommerce.manageri klartextUses so far

ecommerce_tax_rate ​

A tax rate the shop applies to listings, computed on the server

Läsgrupp: ecommerce.user. Skrivgrupp: ecommerce.manager.

FältTypDataklassPersonuppgiftGruppAgenter serBeskrivning
nametextnonenejecommerce.useri klartextName shown on the order, for example VAT
rate_bpnumbernonenejecommerce.useri klartextRate in basis points: 1900 is 19.00 percent
countrytextnonenejecommerce.useri klartextTwo-letter country code (for example DE) of the delivery address this rate is for; empty means every country that has no rate of its own
category_idref → ecommerce_categorynonenejecommerce.useri klartextOnly listings of this category; empty means every listing (and delivery)
includedboolnonenejecommerce.useri klartextWhether listing prices already include this tax (the usual way in the EU). If not, the tax is added on top at checkout
activeboolnonenejecommerce.useri klartextWhether the rate is applied

ecommerce_order ​

An order placed online

Läsgrupp: ecommerce.user. Skrivgrupp: ecommerce.user.

FältTypDataklassPersonuppgiftGruppAgenter serBeskrivning
numbertextnonenejecommerce.useri klartextOrder number shown to the shopper. Free text: packages cannot generate sequences; the public checkout makes a random one
customer_emailtextinternaljaecommerce.usermaskeradEmail address of the shopper
customer_nametextinternaljaecommerce.usermaskeradName of the shopper
customer_idref → partynonenejecommerce.useri klartextThe matching contact, once the shopper is known
shipping_addresslongtextinternaljaecommerce.usermaskeradDelivery address
billing_addresslongtextinternaljaecommerce.usermaskeradBilling address when different from delivery
shipping_method_idref → ecommerce_shipping_methodnonenejecommerce.useri klartextThe chosen way of delivery
discount_code_idref → ecommerce_discount_codenonenejecommerce.useri klartextThe discount code used, if any
discount_codetextnonenejecommerce.useri klartextThe code the shopper entered, as it is shown on the order
discount_use_idtextinternaljaecommerce.usermaskeradWhich per-customer use counter this order counted against, so it can be given back
countrytextinternaljaecommerce.usermaskeradTwo-letter country code of the delivery address, which decides the tax rate
tax_summarylongtextnonenejecommerce.useri klartextThe tax lines of the order as JSON: name, rate in basis points, whether included in the prices, amount
stock_returnedboolnonenejecommerce.useri klartextSet when the units of a cancelled, expired or refunded order were put back on the listings, so it happens once
reserved_untilnumbernonenejecommerce.useri klartextUnix time until which an unpaid order holds its stock; after that it is cancelled and the stock goes back
payment_methodselect (manual, stripe, fake)nonenejecommerce.useri klartextHow the shopper chose to pay: manual (bank transfer or invoice), stripe (card) or fake (demo)
placed_ondatenonenejecommerce.useri klartextDay the order was placed (YYYY-MM-DD)
currencytextnonenejecommerce.useri klartextISO 4217 currency code, for example EUR
subtotalmoneynonenejecommerce.useri klartextSum of the lines at listing prices (minor currency units, computed by the shop at checkout)
discount_totalmoneynonenejecommerce.useri klartextReduction from the discount code (minor currency units)
shipping_totalmoneynonenejecommerce.useri klartextDelivery charge (minor currency units)
tax_totalmoneynonenejecommerce.useri klartextAll tax on the order, both the part included in the prices and the part added on top (minor currency units)
totalmoneynonenejecommerce.useri klartextAmount the shopper pays: lines, minus the discount, plus delivery, plus tax that was added on top (minor currency units)
payment_referencetextfinancialjaecommerce.userundanhållenReference from the payment provider; never a card number
tracking_referencetextnonenejecommerce.useri klartextCarrier tracking number
access_tokentextsecretnejecommerce.userundanhållenSecret link token that lets the shopper who placed a public order see its confirmation page. Nobody can read it back
stateselect (pending, paid, shipped, delivered, cancelled, refunded)nonenejecommerce.useri klartextFulfilment status: pending, paid, shipped, delivered, cancelled, refunded

ecommerce_order_line ​

One product line of a web order

Läsgrupp: ecommerce.user. Skrivgrupp: ecommerce.user.

FältTypDataklassPersonuppgiftGruppAgenter serBeskrivning
order_idref → ecommerce_ordernonenejecommerce.useri klartextThe order the line belongs to
product_idref → productnonenejecommerce.useri klartextThe product ordered
listing_idref → ecommerce_listingnonenejecommerce.useri klartextThe shop listing the line was ordered from
descriptiontextnonenejecommerce.useri klartextProduct text as it was when ordered
quantitynumbernonenejecommerce.useri klartextUnits ordered
unit_pricemoneynonenejecommerce.useri klartextPrice per unit including tax (minor currency units)
subtotalmoneynonenejecommerce.useri klartextLine total (minor currency units, entered not computed)
discount_amountmoneynonenejecommerce.useri klartextPart of the order discount that falls on this line (minor currency units)
tax_nametextnonenejecommerce.useri klartextName of the tax applied to this line
tax_rate_bpnumbernonenejecommerce.useri klartextTax rate of this line in basis points
tax_amountmoneynonenejecommerce.useri klartextTax on this line, included in the prices or added on top (minor currency units)

ecommerce_payment ​

A payment for a web order: which provider, its reference, the amount and what became of it. The shop never sees card data

Läsgrupp: ecommerce.user. Skrivgrupp: ecommerce.manager.

FältTypDataklassPersonuppgiftGruppAgenter serBeskrivning
order_idref → ecommerce_ordernonenejecommerce.useri klartextThe order being paid
providerselect (manual, stripe, fake)nonenejecommerce.useri klartextWho takes the payment: manual (bank transfer or invoice), stripe (Stripe Checkout) or fake (local demo)
external_idtextfinancialnejecommerce.userundanhållenThe provider's reference for this payment, for example a Stripe Checkout Session id. Never a card number
checkout_urltextfinancialnejecommerce.userundanhållenWhere the shopper pays, kept so the payment page can send them back to it while the payment is open
stateselect (open, succeeded, failed, expired, cancelled, refunded)nonenejecommerce.useri klartextPayment status: open (waiting for the shopper), succeeded, failed, expired, cancelled, refunded
amountmoneynonenejecommerce.useri klartextAmount to pay, set by the server from the order (minor currency units)
currencytextnonenejecommerce.useri klartextISO 4217 currency code of the amount
refund_idtextfinancialnejecommerce.userundanhållenThe provider's reference for the refund, once the payment was refunded
refunded_amountmoneynonenejecommerce.useri klartextAmount returned to the shopper (minor currency units)
event_idslongtextnonenejecommerce.useri klartextIds of the provider events already applied, as JSON, so a repeated notification changes nothing

Arbetsflöden ​

ecommerce_order ​

ÅtgärdFlyttarVem får köra denGodkännande
ecommerce_order.mark_paidstate: pending → paidecommerce.usernej
ecommerce_order.shipstate: paid → shippedecommerce.usernej
ecommerce_order.deliverstate: shipped → deliveredecommerce.usernej
ecommerce_order.cancelstate: pending → cancelledecommerce.usernej
ecommerce_order.refundstate: paid → refundedecommerce.managerja
ecommerce_order.refund_deliveredstate: delivered → refundedecommerce.managerja

ecommerce_payment ​

ÅtgärdFlyttarVem får köra denGodkännande
ecommerce_payment.mark_failedstate: open → failedecommerce.managernej
ecommerce_payment.cancelstate: open → cancelledecommerce.managernej

Behörighetsgrupper ​

Grupper som den här appen använder:

  • ecommerce.manager
  • ecommerce.user

Steg som kräver godkännande ​

Steg som en agent bara kan föreslå:

  • ecommerce_order.refund
  • ecommerce_order.refund_delivered

Vad agenter kan och inte kan göra ​

En agent kan läsa, söka, skapa och uppdatera poster i den här appen, och köra de åtgärder som inte kräver godkännande, inom behörighetsgrupperna för sin token.

Den kan bara föreslå de här stegen, och en person måste godkänna dem: ecommerce_order.refund, ecommerce_order.refund_delivered, ecommerce_category.delete, ecommerce_listing.delete, ecommerce_listing_image.delete, ecommerce_listing_translation.delete, ecommerce_shipping_method.delete, ecommerce_discount_code.delete, ecommerce_discount_use.delete, ecommerce_tax_rate.delete, ecommerce_order.delete, ecommerce_order_line.delete, ecommerce_payment.delete.

Personuppgifter maskeras som platshållare: ecommerce_discount_use.customer_hash, ecommerce_order.customer_email, ecommerce_order.customer_name, ecommerce_order.shipping_address, ecommerce_order.billing_address, ecommerce_order.discount_use_id, ecommerce_order.country.

De här fälten undanhålls helt från agenter: ecommerce_order.payment_reference, ecommerce_order.access_token, ecommerce_payment.external_id, ecommerce_payment.checkout_url, ecommerce_payment.refund_id.

Beroenden ​

Varje beroende anger vilka versioner det accepterar. Inbyggda appar versioneras med kärnan, så ett krav på en sådan kontrolleras mot kärnversionen.

När den här appen installeras från marknadsplatsen installeras även de beroenden som saknas, i en enda plan som du bekräftar en gång.

Installera ​

Installera den från appen Customize (Marknadsplats), eller från kommandoraden:

bash
obop modules install-from ecommerce

Kräver en databas och administratörsbehörighet.

Bygg din egen ​

Modulguiden visar hur appar som den här skrivs