Provides context and instructions for the CrestApps Orchard Core Customers module, covering customer records, guest buyers, address books, store credit, loyalty points, referrals, checkout contact step, and the Customers API.
Ships in crestapps-orchardcore. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A customer is everyone who buys: a person or a business, with an account or as a guest. A customer is not a user; sign-in, registration and passwords stay with Orchard Core Users, and Customer.UserId links the two. Orders, transactions and subscriptions point at one customer whatever later happens to the account.
Related skills: orchardcore-checkout (steps, tenders), orchardcore-orders (orders, gift cards), orchardcore-addresses (the Address value and editor), orchardcore-transactions (guest transactions, reminders, customer credit), orchardcore-commerce (personal data requests, API conventions, webhooks), orchardcore-taxation (tax-exempt customers).
| Feature ID | Name | Depends on |
|---|---|---|
CrestApps.OrchardCore.Customers | Customers | Commerce Foundation (CommerceConstants.Features.Foundation), OrchardCore.Users, Addresses |
CrestApps.OrchardCore.Customers.CheckoutDetails | Checkout details | Customers, Orders, Contents, Content Types |
CrestApps.OrchardCore.Customers.StoreCredit | Store Credit | Customers, Orders |
CrestApps.OrchardCore.Customers.Loyalty | Loyalty Points | Customers, Orders |
CrestApps.OrchardCore.Customers.Referrals | Referrals | Customers, Orders |
CrestApps.OrchardCore.Customers.Api | Customers API | Customers |
Constants: CustomersConstants.Features, ContactStepKey (Contact), CheckoutDetailsContentType, settings groups customers, loyalty, referrals. Install CrestApps.OrchardCore.Customers in the web project.
{
"steps": [
{
"name": "Feature",
"enable": [
"CrestApps.OrchardCore.Customers",
"CrestApps.OrchardCore.Customers.StoreCredit",
"CrestApps.OrchardCore.Customers.Loyalty",
"CrestApps.OrchardCore.Customers.Referrals"
],
"disable": []
}
]
}
CrestApps.OrchardCore.Customers.Abstractions is used even without the Customers feature:
CustomerOwner (CustomerOwner.ForUser(userId), CustomerOwner.ForGuest(guestCustomerId)) and CustomerOwnerKind (Authenticated, Guest), in CrestApps.OrchardCore.Customers.Models. Transactions and subscriptions store OwnerId plus OwnerKind.ICustomerContactResolver.ResolveAsync(owner, guestContact) and ICustomerOwnerNotifier.NotifyAsync(owner, guestContact, message): a user through INotificationService, a guest by email. AddCustomersCore() registers the defaults; the Customers feature replaces the resolver with CustomerRecordContactResolver (name from the customer record, email from the account).ICommercePersonalDataService (ExportAsync, AnonymizeAsync, ExpireAsync by owner and email) with ICommercePersonalDataContributor per feature (IdentifyAsync, ExportAsync, AnonymizeAsync, TakesPartInRetentionExpiry, true by default and false for Fundraising, Memberships, Marketplace and Reviews). It is one contributor (CommercePersonalDataContributor) of the site-wide IPersonalDataService (CrestApps.OrchardCore.PersonalData.Abstractions, namespace CrestApps.OrchardCore.PersonalData), which also reaches the CRM, Workforce, Scheduling and other modules. A new module implements IPersonalDataContributor and registers it with services.AddPersonalDataContributor<T>(); use ICommercePersonalDataContributor only when it needs the commerce subject (guest owners, checkout sessions, payment-provider customers).ICustomerCreditService (CrestApps.OrchardCore.Customers.Services) is a party's customer credit: CanHold(party), CanSpendAsync(party, userId) (their own, or a party they have billing access for), GetBalanceAsync(party, currency), AddAsync(CustomerCreditChange) and SpendAsync(CustomerCreditChange) (Party, Currency, Amount, Reason, Reference, Actor), returning CustomerCreditResult (Succeeded, AlreadyApplied, Balance, Error: UnsupportedParty, InvalidAmount, InsufficientBalance, Busy). Transactions uses it, when registered, to keep overpayments and credit notes and pay balances with them. The Store Credit feature implements it; a guest never holds credit.IShippingAddressBook (CrestApps.OrchardCore.Addresses.Abstractions) is how Shipping reads and saves the buyer's address book; the Customers feature implements it on the customer record (CustomerShippingAddressBook), so Shipping never references Customers.Customer (CrestApps.OrchardCore.Customers.Core.Models, a CatalogItem in collection Customers): Kind (Person, Business), Status (Active, Disabled, Anonymized; merged guests are Merged), UserId, DisplayName, FirstName, LastName, CompanyName, TaxId, IsTaxExempt, TaxExemptionReason, Email, Phone, AcceptsMarketing, ExternalIds, activity dates, and up to 20 Addresses (CustomerAddress: AddressId, Label, Address) with DefaultBillingAddressId and DefaultShippingAddressId. GetName(), GetDefaultBillingAddress(), ToAddress() (a copy for an order).
Service (CrestApps.OrchardCore.Customers.Core.Services) | Members |
|---|---|
ICustomerStore | FindByIdAsync, FindByUserIdAsync, ListGuestsByEmailAsync, CreateAsync, UpdateAsync (concurrency checked), paging with CustomerQuery |
ICustomerService | GetOrCreateForUserAsync(userId) (locked per user), FindForUserAsync, CreateGuestAsync(name, email, phone), TouchAsync |
ICustomerHandler | CreatedAsync(customer) |
ICustomerMergeService / ICustomerMergeHandler | MergeVerifiedGuestsAsync(userId) / MergingAsync(CustomerMergeContext) |
ICustomerPrivacyService / ICustomerPrivacyHandler | EraseAsync, ExportAsync, ExpireAsync / ErasingAsync, ExportingAsync, Order |
CustomerIndex (one row per customer) declares .ExclusiveToDocumentType().SingleRecordPerDocument(), as do StoreCreditAccountIndex, LoyaltyAccountIndex and ReferralProfileIndex.
A customer record is a party of kind Customer (PartyKinds.Customer, searched with ViewCustomers):
CustomerBillingProfileSource fills its billing profile: name, e-mail and phone, the default billing address, the default shipping address when it is another place, the tax id and the exemption.CustomerPartyMemberSource makes the record's user its member (a guest's record has none), so a user acts for their own customer record.CustomerPartyTaxProfileProvider (IPartyTaxProfileProvider) adds the customer id, business customers taxed as a business, the exemption and certificates on file. CustomerCheckoutTaxProfileHandler uses the same rules (CustomerTaxProfiles), so a customer is taxed the same at checkout and on a document billed to them (see orchardcore-taxation).using CrestApps.OrchardCore.Customers.Core.Services;
public sealed class RegistrationCustomerLink
{
private readonly ICustomerService _customers;
public RegistrationCustomerLink(ICustomerService customers)
{
_customers = customers;
}
public async Task<string> GetCustomerIdAsync(string userId)
=> (await _customers.GetOrCreateForUserAsync(userId)).ItemId;
}
With Orders, CustomerContactCheckoutHandler adds the Contact step to every order checkout (after the hidden order step): name and email required, phone, and a billing address per CustomerCheckoutSettings.BillingAddress (Optional = 0, the default, Off = 1, Required = 2; Settings > Commerce > Customers). It stores CustomerContactStep in SavedSteps and a CheckoutContactInfo on the session; on completion the order is linked to the signed-in customer or a new guest customer, and a guest's billing address becomes their default. A signed-in buyer with Off never sees the step.
With Orders on, CustomerCheckoutContactStep implements ICheckoutContactStep (Checkout.Abstractions): SaveAsync(flow, CheckoutContactDetails) saves the Contact step from code (an API or an AI agent, as Agentic Commerce does) with the page's rules.
Checkout details creates a field-less CheckoutDetails content type; add fields to it (gift message, delivery date) and they are asked on the Contact step, validated like any editor, kept on Order.CheckoutDetails and shown on the order pages.
All three pay toward checkouts as tenders (after tax) for signed-in buyers only. Summary:
| Feature | Tender key | Settings | Service |
|---|---|---|---|
| Store Credit | store-credit | none | StoreCreditService.ChangeAsync(customerId, currency, amount, reason, actor, sessionId), TryChangeAsync(holder, currency, amount, reason, actor, reference) |
| Loyalty Points | loyalty-points | LoyaltySettings (Settings > Commerce > Rewards) | LoyaltyService.ChangeAsync(customerId, points, kind, reason, actor, orderId) |
| Referrals | rewards in credit or points | ReferralSettings (Settings > Commerce > Referrals) | ReferralService, link refer/{code} |
Store credit can belong to another party than a customer record, such as a business account (StoreCreditHolder.ForParty(party); PartyKind and PartyId on the account and index). With Store Credit on, StoreCreditCustomerCreditService is the ICustomerCreditService: keeping credit for a user without a customer record creates one, spending or reading never does, and a change with a Reference is applied once (AlreadyApplied). Accounts keep their latest 50 changes; older ones move to their own records through IBalanceLedgerArchive.
Details, settings JSON and the account pages are in references/store-credit-loyalty-referrals.md.
ICustomerMergeService.MergeVerifiedGuestsAsync runs on sign-in, registration and email confirmation, only for a confirmed email: each active guest with that email is merged through every ICustomerMergeHandler (Orders moves orders and their guest transactions), addresses are copied, and the guest is marked Merged. Resolve the merge service lazily in user event handlers (it depends on the user service).EraseAsync(customer, by) runs every ICustomerPrivacyHandler.ErasingAsync (lower Order first; PersonalDataCustomerPrivacyHandler is -100), then Customer.Anonymize. The Orders module's OrderCustomerPrivacyHandler anonymizes orders and their checkout sessions (ICheckoutSessionAnonymizer); PersonalDataCustomerPrivacyHandler (formerly CommercePersonalDataCustomerPrivacyHandler) identifies the customer by account, email and phone and calls IPersonalDataService, so an erasure reaches every module with a contributor (commerce, CRM, Workforce, Scheduling, Bookings, Marketing and more). ExportAsync returns a JsonObject with each handler's section; the personal data section is now personalData (each record with kind, title, fields) instead of commerce. Each action is logged on Customer.PrivacyLog.CustomerPrivacyContext.Action (CustomerPrivacyAction: Exported, Erased, Expired) to tell an admin erasure from the retention expiry. On Expired, IPersonalDataService.ExpireAsync runs only contributors whose TakesPartInRetentionExpiry is true (the commerce records and stock alerts), so a guest's CRM, Workforce and Scheduling records are left alone; only an explicit erasure reaches them.CustomerRetentionBackgroundTask (daily 03:30): CustomerPrivacySettings.InactiveGuestMonths (24) expires inactive guests; GuestOrderMonths (12) anonymizes old guest records through each module's IGuestRetentionHandler (Orders implements it as OrderGuestRetentionHandler: paid or canceled guest orders with their checkout sessions); zero turns a window off; 500 of each per run.POST customers/{customerId}/erase and GET customers/{customerId}/export need ManageCustomers.using CrestApps.OrchardCore.Customers.Core.Services;
public sealed class RegistrationPrivacyHandler : ICustomerPrivacyHandler
{
public Task ErasingAsync(CustomerPrivacyContext context, CancellationToken cancellationToken = default)
{
// context.Customer and context.UserId (the account before it is unlinked): clear your registrations.
return Task.CompletedTask;
}
public Task ExportingAsync(CustomerExportContext context, CancellationToken cancellationToken = default)
{
context.Export["registrations"] = new System.Text.Json.Nodes.JsonArray();
return Task.CompletedTask;
}
}
// services.AddScoped<ICustomerPrivacyHandler, RegistrationPrivacyHandler>();
The Customers step adds or updates guest and business customers (matched by ItemId, then by a guest's email; account customers come from their user). The Customers deployment step (CustomersDeploymentStep) writes guest and business customers in the same shape; it is personal data, so an administrator must add it to a plan, and customers with a user account or that were erased or merged are left out.
Store credit, loyalty points and referral codes have their own steps, each with a deployment step (Store credit, Loyalty points, Referral codes). Records are matched by ItemId, then by customer (and currency for store credit), and carry their balance or points and activity. Import customers first.
| Feature | Recipe step | Array | Matched by |
|---|---|---|---|
| Store Credit | StoreCreditAccounts | Accounts | ItemId, then CustomerId and Currency |
| Loyalty Points | LoyaltyAccounts | Accounts | ItemId, then CustomerId |
| Referrals | ReferralProfiles | Profiles | ItemId, then CustomerId; a Code another customer uses is refused |
{
"steps": [
{
"name": "Customers",
"Customers": [
{
"Kind": "Business",
"CompanyName": "Contoso Supplies",
"TaxId": "123456789RT0001",
"Email": "[email protected]",
"Addresses": [
{
"AddressId": "contoso-office",
"Label": "Office",
"Address": { "Company": "Contoso Supplies", "AddressLine1": "100 King Street West", "City": "Toronto", "Region": "ON", "PostalCode": "M5X 1C7", "Country": "CA" }
}
],
"DefaultBillingAddressId": "contoso-office",
"DefaultShippingAddressId": "contoso-office"
}
]
},
{
"name": "StoreCreditAccounts",
"Accounts": [
{ "CustomerId": "4cs00000000000000000000001", "Currency": "USD", "Balance": 25, "Activity": [] }
]
},
{
"name": "Settings",
"CustomerCheckoutSettings": { "BillingAddress": 2 },
"CustomerPrivacySettings": { "InactiveGuestMonths": 24, "GuestOrderMonths": 12 }
}
]
}
With Data Pipelines Core (OrchardCore.DataPipelines.Core) enabled, as the Report Builder does, Customers registers the Customers data source (Customers). Each data set is listed only while its feature is on. Tax ids, street lines, the privacy log and referral codes are never exposed; join the Orders data source on Customer ID for what customers bought. See orchardcore-report-builder.
| Data set | Feature | Permission |
|---|---|---|
Customers | Customers | ViewCustomers |
LoyaltyAccounts, LoyaltyActivity | Loyalty Points | ViewCustomers |
StoreCreditAccounts, StoreCreditActivity | Store Credit | ViewCustomers |
Referrals, ReferralRewards | Referrals | ManageCustomers |
Customers API (api/commerce/v1): me and me/addresses (ManageOwnCustomerProfile), customers and customers/{customerId} (ViewCustomers), with Orders and the Checkout API PUT checkout/{id}/contact, and with Store Credit or Loyalty checkout/{id}/store-credit and checkout/{id}/points. With Commerce Webhooks, a customer.created event is published.
| Permission | Grants |
|---|---|
ManageCustomers | Add, edit, export, erase; Customers settings; give or take credit and points; Rewards and Referrals settings. Implies ViewCustomers |
ViewCustomers | List and open customers |
ManageOwnCustomerProfile | My Account (my-account, a [CustomerAdminPage]) and storefront account/details, account/addresses; Authenticated by default |
Commerce > Customers lists customers on Orchard Core's AdminList with Active, With an account, Guests, Businesses, Disabled filters. Modules add sections to a customer's admin page with a DisplayDriver<Customer> for display type DetailAdmin, placed in Content.
New in 3.0. Transactions moved from a null owner to CustomerOwner with OwnerKind; a guest transaction is never shown to an account sharing its id.
CommercePersonalDataCustomerPrivacyHandler is now PersonalDataCustomerPrivacyHandler over the site-wide IPersonalDataService; the export section is personalData, not commerce.OrderCustomerMergeHandler, OrderCustomerPrivacyHandler and OrderGuestRetentionHandler live in the Orders module (registered when Customers is on).PhoneNumberNormalization.ToE164OrTrimmed, used by the customer store, the Contact step and the store profile, now stores the E.164 form only when it keeps everything typed; a number with an extension (x12, ext. 12, #12), a second number or a note is kept as typed.What SKILL.md sets; muted values are Claude Code's defaults
/crestapps-orchardcore:orchardcore-customersfrom crestapps-orchardcore
npx claudepluginhub crestapps/crestapps.agentskills --plugin crestapps-orchardcore137 skills in this plugin
/orchardcore-accountsSkill for the CrestApps Orchard Core Accounts module (CrestApps.OrchardCore.Accounts) with its Account Members, Account Team, Account E-mail Domains and Account Locations features. Covers the Account type and AccountPart, the account picker and search, IAccountChildTypeRule, account page sections (AccountPageTabs, AddPageSection, Notes), members and IAccountMemberService, account invitations, the account owner and team picked from staff, e-mail domains, locations with a billing location, the account's billing profile and party members, the Accounts recipe and deployment steps, and the admin menu. Use this skill when requests mention accounts, the businesses or households records belong to, an account page tab, members, invitations, owners, domains or locations. Strong matches include AccountPart, AccountPageTabs, IAccountMemberService, IAccountInvitationService, AccountInvitation, AccountTeamPart, AccountEmailDomainsPart, IAccountEmailDomains, AccountLocationsPart and ManageAccountMembers./orchardcore-accounts-b2bSkill for the CrestApps Orchard Core Accounts B2B module (CrestApps.OrchardCore.Accounts.B2B), business selling on an Account content item. Covers B2BAccountPart and B2BAccount, buyers as account members and ship-to addresses as account locations, terms (deposit, net days, credit limit) through the account-terms tender billed to the account, the account's billing profile, purchase order numbers, quotes, price lists through IBuyerPriceProvider, order limits, approvals and budgets, OCI punchout, the account/business page and API, the PriceLists recipe and deployment steps, the B2BAccounts report source, and the move from the removed Companies module. Use this skill when requests mention B2B, wholesale or business buyers, net terms, purchase orders, price lists, order approvals or punchout. Strong matches include B2BAccountPart, B2BAccount, AccountTerms, AccountTermsTenderProvider, B2BAccountBillingProfileSource, IB2BAccountStore, PriceList, B2BPriceProvider, B2BApprovalService and ManageB2BAccounts.Other plugins' skills for the same job