Data model at a glance
Ordergroove’s data model provides flexibility for end users with a structure that supports full automation or client-specific processes via REST APIs. Data is stored in a relational database, with one-to-one and one-to-many relationships depending on how you look at the data.
There are four main data objects:
Merchant
Every Ordergroove client and unique integration has a merchant record in Ordergroove. Clients with multiple sites (separate brands, locales, and so on) typically have one merchant per site. A merchant is represented by a Merchant Public ID when interacting with Ordergroove API endpoints.
Customer
Customers are created in Ordergroove via purchase post or customer migrations from other platforms. Customers have subscriptions, which are tied to active customer address and payment information.
Important customer data
id— Ordergroove customer IDmerchant_id— Ordergroove merchant IDmerchant_user_id— customer ID in your eCommerce platformfirst_name— encryptedlast_name— encryptedemail— encrypted
Key relationships
- Customer → Subscription
- Customer → Order
- Customer → Address
- Customer → Payment
Subscription
Customers have subscriptions. Each product a customer is subscribed to is its own subscription, referenceable via a subscription public ID. A subscription creates a recurring order based on the subscription’s frequency, and the discounts applied to the item or order subtotal are determined by the offer ID associated with the subscription.
Important subscription data
id— Ordergroove subscription IDpublic_id— public subscription IDcustomer_id— Ordergroove customer IDproduct_id— Ordergroove product ID (the product subscribed to)quantity— quantity of product subscribed topayment_id— Ordergroove payment ID associated with this subscriptionshipping_address_id— Ordergroove address ID associated with this subscriptionfrequency_days— days between each subscription order’s place dateoffer_id— the Ordergroove offer ID tied to the subscriptionmerchant_order_id— the eCommerce order number that created the subscriptionlive—0= customer has no active subscriptions;1= at least one active subscriptionevery— numeric value of frequencyevery_period—1= days,2= weeks,3= months,4= years
Key relationships
- Subscription → Item
- Subscription → Offer (incentive)
Order
Orders are created by subscriptions and contain items and all relevant information used to place
orders with your eCommerce platform. Orders contain one or more items, and their place date is
previous order date + subscription frequency. Subscriptions only have one upcoming order; a
subsequent order is created once the current order is placed.
Important order data
id— Ordergroove order IDpublic_id— public order IDcustomer_id— Ordergroove customer IDplace— placement date (future for unsent orders, past for attempted orders)status— current state of the order; common values include:1— unsent3— rejected5— success6— send now11— pending placement15— generic error18— credit card retry
sub_total— order subtotal after subscription discountsshipping_total— shipping fee applied by Ordergroovetotal—sub_total + shipping_totalorder_merchant_id— ID returned by eCommerce platform on successful placementpayment_id— ID of the payment record used for the ordershipping_address_id— ID of the shipping address record used for the order
Key relationships
- Order → Item
- Order → One-time incentive
Items
Items are the individual products within an order. They may be associated with a subscription, or can be a one-time product added to a single order.
Important item data
id— Ordergroove item IDpublic_id— public item IDorder_id— Ordergroove order IDsubscription_id— Ordergroove subscription ID (null for one-time IU)product_id— Ordergroove product ID (null for upcoming items, populated after placement)quantity— item quantityprice— unit pricetotal_price— line item price accounting for quantity and discountoffer_id— Ordergroove offer ID tied to the itemone_time— indicates the item was added via the Item Create In Order endpoint
Key relationships
- Items → Subscriptions
- Items → Orders
- Items → Offer (incentive)
Product
Products is a replication of relevant product data from your eCommerce site, plus subscription-specific attributes that control an individual product’s eligibility for recurring purchase.
Important product data
id— Ordergroove product IDprice— product price from the product feed; the base price Ordergroove usesexternal_product_id— the product’s unique identifier in your eCommerce platformautoship_enabled—0= not subscribable;1= available for subscription