Create your own
Lesson illustration

Designing a Source-to-Talon.One Data Contract

Welcome. This module turns Talon.One entities into an integration design that a commerce, CRM, and promotion team can implement without relying on implicit assumptions.

The goal of this lesson is to produce a source-to-Talon.One data contract for a concrete commerce journey. Rather than treating an API payload as a loose collection of fields, you will define where each field originates, what it means, which Talon.One entity owns it, when it is sent, and who remains authoritative for it.


A data contract is more than a JSON schema

A JSON schema answers: Can this payload be parsed? An integration data contract answers the more important architectural questions:

  • What business fact does this field represent?
  • Which enterprise system is authoritative for that fact?
  • Which Talon.One entity should contain it?
  • How long is it valid?
  • At which customer or transaction event is it updated?
  • What type, unit, and allowed values does it have?
  • What happens when the field is absent, changed, or no longer true?

For Talon.One, the central distinction is between durable customer facts and transaction-specific facts:

  • A customer profile represents a customer over many journeys.
  • A customer session represents one promotion-evaluated journey, commonly a cart and checkout lifecycle.
  • A cart item represents a line in that session’s cart.
  • An event represents a discrete occurrence, such as an app install or a product review, rather than a changing transaction state.
  • A campaign and its rules represent promotion logic configured in Talon.One, not facts supplied by the shopper or commerce platform.

This is a useful boundary: the commerce platform reports facts; Talon.One evaluates configured promotion logic against those facts and returns decisions as effects.

Manage attributes | Talon.One docs

Read Talon.One’s “Manage attributes” documentation to establish the available entity scope, how custom attributes are defined, and which API paths update each entity type. This is the Talon.One side of a data contract.

Begin with the opening of the “Manage attributes” section. Read the entity overview and note that an attribute is inseparable from its owning entity and its type. Then read the full “Create a custom attribute” subsection. Follow the creation process, focusing especially on Entity, Type, API name, and Connected Applications. Finish in “Set the value of an attribute” with the entity-to-write-method table. Treat that table as an architectural constraint: the entity selected for an attribute determines how and when its value can enter Talon.One.

A custom attribute therefore needs an explicit definition before runtime data can safely use it. For each custom field, record:

Contract elementExample
Business meaningCity of the selected delivery address for this checkout
Talon.One entityCustomer session
API nameshippingCity
TypeString
Authoritative sourceCheckout delivery-address service
Update momentWhen the shopper selects or changes delivery
Rule purposeLimit a regional free-shipping promotion
ValidityOnly for this customer session

The critical design decision here is the entity. A shipping city selected during checkout belongs on the customer session, even if the customer profile also has a saved default address. The saved address is a durable customer preference; the selected address is a fact about the current order attempt. Confusing the two can lead to rules using stale profile data instead of the actual delivery choice.


Sample journey: signed-in checkout with a coupon

Consider a retailer with this journey:

  1. A shopper adds a shampoo and conditioner to a web cart.
  2. They sign in during checkout.
  3. They choose delivery to Seattle.
  4. They enter the WELCOME10 coupon.
  5. The checkout service asks Talon.One to evaluate promotions.
  6. Payment and order confirmation succeed.
  7. The commerce system closes the Talon.One session.

Assume the business has two promotions:

  • WELCOME10: a coupon-based discount for eligible first-time customers.
  • Free standard delivery for qualifying carts delivered to Seattle.

The contract must carry only facts required to evaluate those rules. It should not send the rule outcome as an input. For example, do not send fields such as isEligibleForWelcomeOffer or couponAccepted: those are decisions Talon.One should derive from campaign rules and return as effects.

Integration tutorial | Talon.One docs

Read the relevant portions of Talon.One’s Integration tutorial. It shows the runtime path that your contract will support: send a cart and coupon code into a customer session, associate the session with a profile, and close it when the business transaction completes.

In “Create a customer session”, start with the session and cart example. Pay particular attention to the fact that the customer session is a promotion-domain object, not an HTTP or server-session implementation detail. Next, read “Manage customer profiles” through the profile-creation discussion and the profile-to-session binding example. Focus on the profile relationship: a profile can own multiple sessions, while the session carries the current transactional context. Finally, read “Close the session”. Review the closing rationale. Closing is a business-lifecycle action: it is the point at which promotion usage and campaign budgets can become final.


The contract’s ownership model

Before writing a payload, establish the systems of record. Talon.One is not a replacement for a customer master, product information system, order-management system, or payment service. It is the system that evaluates promotion and loyalty rules and maintains the promotion state it is configured to manage.

For the sample journey, use this ownership model:

Information domainSystem of recordTalon.One roleContract implication
Customer identityIdentity service or CRMProfile representation for promotion evaluationUse the enterprise customer key as the profile integration ID.
Customer segmentCRM or customer-data platformReadable profile attribute used by rulesSynchronize the current eligible segment when it changes.
Product SKU, name, and merchandising categoryProduct catalog or commerce catalogCart-item facts used in rulesSend the actual items being purchased, using stable product identifiers.
Cart quantities and base selling pricesCart and pricing serviceSession cart used for evaluationSend an authoritative current cart snapshot during checkout.
Delivery method and destinationCheckout serviceSession attributes for this checkoutSend only after the shopper selects these values.
Coupon code enteredCheckout UI and checkout serviceCandidate code supplied for evaluationSend the code, but let Talon.One determine acceptance or rejection.
Campaign rules, coupon constraints, and budgetsTalon.One, under promotion-team governancePromotion decisioning configurationDo not reconstruct this logic in checkout code.
Payment authorization and order confirmationPayment service and order-management systemExternal finalization signalClose the session only when the chosen business completion point has occurred.
Shipment, fulfillment, and refund executionOrder-management and fulfillment systemsConsumer of returned effects where applicableNever treat a Talon.One effect as proof that an external fulfillment action happened.

Two boundaries deserve emphasis.

First, Talon.One should receive a representation of the cart, not become the cart system of record. Checkout remains responsible for availability, tax, shipping calculation, payment, and durable order records.

Second, the commerce system must consume Talon.One effects, but it remains responsible for applying them correctly to its own pricing and order systems. The returned response is a decision interface, not a new order ledger.


Define entity placement and attribute semantics

For this journey, define three custom attributes. These are deliberately few: every attribute expands the integration surface, test matrix, privacy footprint, and rule-authoring vocabulary.

API nameTalon.One entityTypeMeaningSource and lifecycle
customerSegmentCustomer profileStringCurrent marketing or customer-service segment, such as consumer or partnerCRM is authoritative; update when segment membership changes.
shippingCityCustomer sessionStringCity on the delivery address selected for this checkoutCheckout service is authoritative; update when address selection changes.
brandCart itemStringMerchandise brand as classified by the commerce catalogCatalog service is authoritative; include on every relevant cart-item snapshot.

A few placement rules make the mapping defensible:

  1. Put a value on the profile only when it describes the customer across multiple transactions. A CRM-maintained segment is a suitable example.
  2. Put a value on the session when it describes the current cart, checkout, or order attempt. Delivery city, selected fulfillment method, acquisition channel, and gift-wrap choice commonly belong here.
  3. Put a value on the cart item when it differentiates merchandise lines. Brand, collection, supplier, margin band, or restricted-product status are examples.
  4. Use an event when the fact is a discrete occurrence rather than a current state. “Customer completed a product review” is an event; “customer has three reviews” may be a profile attribute if it is maintained as a durable aggregate.
  5. Do not duplicate a fact on several entities merely to make rules easier to write. Duplication creates synchronization and precedence problems.

Also specify price semantics. In this sample contract, price means:

The current per-unit merchandise price in the Application’s configured currency, after ordinary catalog or contract pricing but before discounts calculated by Talon.One; tax and delivery charges are excluded unless the pricing policy explicitly says otherwise.

That convention must be documented and applied consistently. If one channel sends tax-inclusive prices and another sends tax-exclusive prices, a percentage discount can be mathematically correct yet commercially wrong.


The runtime payload contract

The following is a representative payload sent by a trusted server-side checkout integration. It is not intended to be constructed directly by a browser or mobile client.

{
  "customerSession": {
    "profileId": "cust-004218",
    "state": "open",
    "cartItems": [
      {
        "name": "Aster Repair Shampoo",
        "sku": "AST-SHAM-250",
        "quantity": 1,
        "price": 14.50,
        "category": "Haircare",
        "attributes": {
          "brand": "Aster"
        }
      },
      {
        "name": "Aster Repair Conditioner",
        "sku": "AST-COND-250",
        "quantity": 1,
        "price": 15.50,
        "category": "Haircare",
        "attributes": {
          "brand": "Aster"
        }
      }
    ],
    "couponCodes": [
      "WELCOME10"
    ],
    "attributes": {
      "shippingCity": "Seattle"
    }
  }
}

The checkout service submits this representation with the documented Update customer session endpoint:

PUT /v2/customer_sessions/web-cart-78231

The session identifier, web-cart-78231, is generated and owned by the commerce platform. It should be stable for the entire promotion-evaluated cart lifecycle. A useful convention is to include a channel prefix where cart identifiers are not globally unique, such as web-cart-78231 or store-transaction-48219.

The data contract should state that:

  • profileId is the stable enterprise customer identifier, not an email address and not a temporary login token.
  • sku is a stable sellable-item identifier, not a display name.
  • quantity is the currently requested number of units for that cart line.
  • price follows the agreed price convention and is supplied by the authoritative pricing service.
  • couponCodes contains codes submitted by the customer; it does not indicate whether those codes have been accepted.
  • Session attributes describe the current checkout state.
  • Cart item attributes are supplied as a complete authoritative set for each item. Talon.One’s attribute documentation specifically notes that cart-item attributes omitted from the supplied list are removed, so partial attribute construction can accidentally erase data needed by rules.

During cart changes, the integration should send the current, internally validated cart representation rather than attempt to infer deltas from the previous Talon.One response. A shopper can add an item, change quantity, remove an item, change a coupon, or choose another address. Each such change may alter eligibility and returned effects.

When the order reaches the agreed business completion point, the commerce backend updates the same session to closed. The Integration tutorial notes that closing can finalize promotion consequences such as coupon redemption and budget counters. Therefore, closing a session is not merely cleanup; it must be aligned with the organization’s order-confirmation policy.


A compact contract specification

A strong implementation artifact makes the preceding decisions explicit. For the sample journey, a concise version could read as follows.

Contract: checkout promotion evaluation

Purpose
Evaluate coupon and delivery promotions for a web checkout, then finalize applicable promotion state when the order is confirmed.

Participants

ParticipantResponsibility
CRM / identity serviceProvides stable customer ID and durable customer segment.
Product catalog and pricing serviceProvides product identity, classification, and current base unit price.
Checkout serviceConstructs the authoritative cart snapshot and invokes Talon.One.
Talon.OneEvaluates active campaign rules and returns effects.
Order-management systemConfirms the order and triggers session closure.

Inbound data to Talon.One

FieldSourceTalon.One destinationRule-safe definition
Enterprise customer IDIdentity serviceCustomerProfile.integrationId, referenced as profileId in a sessionImmutable, non-PII business key where possible.
Customer segmentCRMCustomer profile attribute customerSegmentControlled String value; CRM remains authoritative.
Cart IDCheckout serviceCustomer session integration ID in endpoint pathStable for one cart or order attempt; unique within the Application.
SKUCatalog servicecartItems[].skuStable sellable SKU, not a human-readable title.
Product nameCatalog servicecartItems[].nameCurrent display name; not used as a durable product key.
Product categoryCatalog servicecartItems[].categoryControlled merchandising taxonomy value.
BrandCatalog servicecartItems[].attributes.brandControlled String; custom cart-item attribute.
QuantityCart servicecartItems[].quantityCurrent requested unit quantity.
Base unit pricePricing servicecartItems[].pricePer-unit price under the documented pricing convention.
Coupon inputCheckout servicecouponCodesCustomer-submitted candidate coupon code.
Selected delivery cityCheckout serviceSession attribute shippingCityCurrent delivery address city; custom session attribute.
Transaction statusOrder-management systemstateopen during evaluation; closed only at the agreed finalization point.

Outbound data from Talon.One

The checkout adapter receives Talon.One effects and exposes them to the commerce domain as typed promotion decisions, for example:

  • a discount to apply,
  • an accepted or rejected coupon state,
  • a notification to display,
  • a fulfillment-related instruction that requires a downstream system.

The adapter must not rely on the order of effects in a response. It should interpret each effect by its type and properties, then let the relevant commerce component apply the decision. Later lessons will examine effect handling and reconciliation in detail.


Change control and contract tests

A data contract needs operational governance. Adding shippingCity to a rule is not merely a rule-builder change: it creates a dependency on a custom attribute, the checkout source, the request builder, and test coverage.

Use these rules for changes:

  • Add a field intentionally. Specify entity, type, source, allowed values, privacy classification, and rollout order before a rule depends on it.
  • Do not rename API names casually. Rules and integrations can both depend on them.
  • Version the semantic definition. A field whose meaning changes from “list price” to “discounted selling price” is a breaking change even if its JSON type remains a number.
  • Test missing and stale values. Verify what happens if a shopper has no profile, has no delivery selection yet, enters an invalid coupon, or changes cart quantity.
  • Use realistic Application boundaries. If regions operate in different currencies or have isolated catalogs and promotion ownership, the Application design must prevent incompatible data from being evaluated together.
  • Minimize personal data. Do not send email addresses, payment data, full addresses, or device identifiers merely because Talon.One can store attributes. Send only what a promotion or loyalty rule genuinely needs.

A practical sandbox checkpoint is to create the three custom attributes in the contract, submit an open session with the sample cart, and inspect the stored session and returned response. Then change the delivery city or remove the coupon and confirm that the next request reflects the full current checkout state rather than an outdated mixture of facts.


Key takeaways

A Talon.One data contract is an executable agreement between source systems, the checkout integration, and promotion operations.

  • Model durable customer facts on customer profiles and one-journey facts on customer sessions.
  • Represent purchasable lines as cart items, using stable SKUs and explicit price semantics.
  • Define every custom attribute by business meaning, entity, type, API name, owner, and update moment.
  • Keep CRM, commerce, catalog, payment, and fulfillment systems authoritative for their own domains; Talon.One owns promotion evaluation and configured promotion state.
  • Send current, authoritative transaction data to Talon.One, then consume returned effects through a controlled integration boundary.
  • Treat session closure as a business finalization event, not a technical afterthought.

Next, the course moves from the data supplied to Talon.One to the decision logic built from it: expressing a promotion as an event, conditions, and effects.

Can't find a good explanation? Sign up and we'll make it for you

Sign up