Skip to content

Playbooks

Playbooks are standard operating procedures (SOPs) for CRM. Use calls.md for payload shape and required fields.

Surface availability (explicit)

  • API Gateway: Available.
  • Direct Lambda: Not offered.
  • CLI: Available (g3n crm ..., API Gateway).
  • MCP: Available.

Playbook: Customer + loyalty lifecycle

Goal: Create a customer, manage consent, and track loyalty points.

Why this sequence:

  • Consent must be recorded before marketing engagement.
  • Loyalty accrual and redemption require a customer record.

Preconditions

  • Valid orgcode and session/API key.

SOP (happy path)

  1. Create customer (POST /customer/create).
    • Reason: establishes the customer identity.
  2. Set consent (POST /customer/consent/set).
    • Reason: captures privacy and marketing preferences.
  3. Earn loyalty (POST /loyalty/earn).
    • Reason: credits points for eligible activity.
  4. Redeem loyalty (POST /loyalty/redeem) when used.
    • Reason: debits points and records redemption.
  5. Adjust/restore (POST /loyalty/adjust, /loyalty/restore, /loyalty/reverse) as needed.
    • Reason: handle corrections and reversals.
  6. Get/list customer (POST /customer/get, /customer/list) and loyalty policy (POST /loyalty/policy/get).
    • Reason: verify status, balances, and policy.

Outputs

  • Customer profile with consent and loyalty activity.

Failure modes / remediation

  • not-found: ensure customer ID is correct.
  • invalid-state: check loyalty policy or customer status.

Cross-service relationships

  • SCM: sales events drive loyalty earn/redeem.

Playbook: Stored value (gift card)

Goal: Issue and redeem stored value safely.

Why this sequence:

  • Stored value issuance and redemption must be auditable and reversible.

Preconditions

  • Customer record (optional, depending on gift card type).

SOP (happy path)

  1. Issue gift card (POST /giftcard/issue).
    • Reason: creates a stored value instrument.
  2. Redeem gift card (POST /giftcard/redeem) during checkout.
    • Reason: applies stored value to a purchase.
  3. Get customer (POST /customer/get) or list to confirm linkage.
    • Reason: confirm the stored value flow ties to the correct customer.

Outputs

  • Stored value issued and redeemed with transaction history.

Failure modes / remediation

  • insufficient-balance: adjust redemption or issue additional value.

Cross-service relationships

  • SCM: payment/tender flows consume stored value outcomes.