1👍
You can use the same schema for any kind of product order system:
A customer party places a sales order with a vendor party for one or more catalog items, one of which may be a sales agreement, such as a software license.
The vendor party invoices (requests payment from) the bill-to party (who may be the same as the customer party) at a bill-to address, one or more times. The bill-to party makes one or more payments against that particular invoice, until the invoice is paid.
The payment does not necessarily coincide with the shipment or delivery of the sales order item. You could ship the sales order item before or after the invoice is paid.
A sales order item is shipped to the ship-to party at the ship-to address (which could be an IP address or email address), and is hopefully delivered, at which point you accrue revenue.
This should get you started:
PARTY
id
type {organization, individual, automated_agent}
name
...
ADDRESS
id
type {email, web, facility, telephone}
...
SALES_ORDER
id
order_date
customer_id -> party
vendor_id -> party
bill_to_id -> party
bill_to_address_id -> address
CATALOG_ITEM
id
type {good, service, agreement}
...
SALES_ORDER_ITEM
id
sales_order_id -> sales_order
catalog_item_id -> catalog_item
ship_to_id -> party
ship_to_address_id -> address
price
quantity
PAYMENT_METHOD
id
name
# whether payment has a key to invoice depends on whether you allow cross-invoice payments and/or partial payments
PAYMENT
id
payment_date
payer_id -> party
payee_id -> party
amount
method -> payment_method
elided:
shipment_request
shipment
delivery
invoice
invoice_payment