{
  "schemaVersion": "1.0",
  "item": {
    "slug": "erpclaw-billing",
    "name": "ERPClaw-Billing",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/ivangdavila/billing",
    "canonicalUrl": "https://clawhub.ai/ivangdavila/billing",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/erpclaw-billing",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=billing",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "disputes.md",
      "invoicing.md",
      "marketplace.md",
      "revenue-recognition.md",
      "stripe.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/erpclaw-billing"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/erpclaw-billing",
    "agentPageUrl": "https://openagent3.xyz/skills/erpclaw-billing/agent",
    "manifestUrl": "https://openagent3.xyz/skills/erpclaw-billing/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/erpclaw-billing/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "When to Use",
        "body": "User needs to implement or debug payment processing, subscription lifecycles, invoicing, or revenue operations. Agent handles Stripe/Paddle integration, webhook architecture, multi-currency, tax compliance, chargebacks, usage-based billing, marketplace splits, and revenue recognition patterns."
      },
      {
        "title": "Quick Reference",
        "body": "TopicFileStripe integrationstripe.mdWebhooks & eventswebhooks.mdSubscription lifecyclesubscriptions.mdInvoice generationinvoicing.mdTax compliancetax.mdUsage-based billingusage-billing.mdChargebacks & disputesdisputes.mdMarketplace paymentsmarketplace.mdRevenue recognitionrevenue-recognition.md"
      },
      {
        "title": "1. Money in Smallest Units, Always",
        "body": "Stripe/most PSPs use cents: amount: 1000 = $10.00\nStore amounts as integers, NEVER floats (floating-point math fails)\nAlways clarify currency in variable names: amount_cents_usd\nDifferent currencies have different decimal places (JPY has 0, KWD has 3)"
      },
      {
        "title": "2. Webhook Security is Non-Negotiable",
        "body": "ALWAYS verify signatures before processing (Stripe-Signature header)\nStore event_id and check idempotency — webhooks duplicate\nEvents arrive out of order — design state machines, not sequential flows\nUse raw request body for signature verification, not parsed JSON\nSee webhooks.md for implementation patterns"
      },
      {
        "title": "3. Subscription State Machine",
        "body": "Critical states and transitions:\n\nStateMeaningAccesstrialingFree trial period✅ FullactivePaid and current✅ Fullpast_duePayment failed, retrying⚠️ Grace periodcanceledWill end at period end✅ Until period_endunpaidExhausted retries❌ None\n\nNever grant access based on status === 'active' alone — check current_period_end."
      },
      {
        "title": "4. Cancel vs Delete: Revenue at Stake",
        "body": "cancel_at_period_end: true → Access until period ends, stops renewal\nsubscription.delete() → Immediate termination, possible refund\nConfusing these loses revenue OR creates angry customers\nDefault to cancel-at-period-end; immediate delete only when requested"
      },
      {
        "title": "5. Proration Requires Explicit Choice",
        "body": "When changing plans mid-cycle:\n\nModeBehaviorUse Whencreate_prorationsCredit unused, charge newStandard upgradesnoneChange at renewal onlyDowngradesalways_invoiceImmediate charge/creditEnterprise billing\n\nNever rely on PSP defaults — specify explicitly every time."
      },
      {
        "title": "6. Race Conditions Are Guaranteed",
        "body": "customer.subscription.updated fires BEFORE invoice.paid frequently.\n\nDesign for eventual consistency\nUse database transactions for access changes\nIdempotent handlers that can safely reprocess\nStatus checks before granting/revoking access"
      },
      {
        "title": "7. Tax Compliance Is Not Optional",
        "body": "ScenarioActionSame countryCharge local VAT/sales taxEU B2B + valid VAT0% reverse charge (verify via VIES)EU B2CMOSS — charge buyer's country VATUSSales tax varies by 11,000+ jurisdictionsExport (non-EU)0% typically\n\nMissing required invoice fields = legally invalid invoice. See tax.md."
      },
      {
        "title": "8. PCI-DSS: Never Touch Card Data",
        "body": "NEVER store PAN, CVV, or magnetic stripe data\nOnly store PSP tokens (pm_*, cus_*)\nTokenization happens client-side (Stripe.js, Elements)\nEven \"last 4 digits + expiry\" is PCI scope if stored together\nSee disputes.md for compliance patterns"
      },
      {
        "title": "9. Chargebacks Have Deadlines",
        "body": "StageTimelineActionInquiry1-3 daysProvide evidence proactivelyDispute opened7-21 daysSubmit compelling evidenceDeadline missedAutomatic lossSet alerts\n\n3 intentos de cobro fallidos consecutivos = posible trigger de fraude monitoring."
      },
      {
        "title": "10. Revenue Recognition ≠ Cash Collected",
        "body": "For SaaS under ASC 606/IFRS 15:\n\nAnnual payment ≠ annual revenue (recognized monthly)\nDeferred revenue is a liability, not an asset\nMulti-element contracts require allocation to performance obligations\nSee revenue-recognition.md for accounting patterns"
      },
      {
        "title": "Security & Compliance",
        "body": "Webhook without signature verification → attackers fake invoice.paid\nStoring tokens in frontend JS → extractable by attackers\nCVV in logs → PCI violation, massive fines\nRetry loops without limits → fraud monitoring triggers"
      },
      {
        "title": "Integration Errors",
        "body": "Not storing subscription_id → impossible to reconcile refunds\nAssuming charge success = payment complete (3D Secure exists)\nIgnoring payment_intent.requires_action → stuck payments\nUsing mode: 'subscription' without handling customer.subscription.deleted"
      },
      {
        "title": "Financial Errors",
        "body": "Hardcoding tax rates → wrong when rates change\nAmounts in dollars when PSP expects cents → 100x overcharge\nRecognizing 100% revenue upfront on annual plans → audit findings\nConfusing bookings vs billings vs revenue → material discrepancies"
      },
      {
        "title": "Operational Errors",
        "body": "Sending payment reminders during contractual grace period\nDunning without checking for open disputes → double loss\nProration without specifying mode → unexpected customer charges\nRefunding without checking for existing chargeback → paying twice"
      }
    ],
    "body": "When to Use\n\nUser needs to implement or debug payment processing, subscription lifecycles, invoicing, or revenue operations. Agent handles Stripe/Paddle integration, webhook architecture, multi-currency, tax compliance, chargebacks, usage-based billing, marketplace splits, and revenue recognition patterns.\n\nQuick Reference\nTopic\tFile\nStripe integration\tstripe.md\nWebhooks & events\twebhooks.md\nSubscription lifecycle\tsubscriptions.md\nInvoice generation\tinvoicing.md\nTax compliance\ttax.md\nUsage-based billing\tusage-billing.md\nChargebacks & disputes\tdisputes.md\nMarketplace payments\tmarketplace.md\nRevenue recognition\trevenue-recognition.md\nCore Rules\n1. Money in Smallest Units, Always\nStripe/most PSPs use cents: amount: 1000 = $10.00\nStore amounts as integers, NEVER floats (floating-point math fails)\nAlways clarify currency in variable names: amount_cents_usd\nDifferent currencies have different decimal places (JPY has 0, KWD has 3)\n2. Webhook Security is Non-Negotiable\nALWAYS verify signatures before processing (Stripe-Signature header)\nStore event_id and check idempotency — webhooks duplicate\nEvents arrive out of order — design state machines, not sequential flows\nUse raw request body for signature verification, not parsed JSON\nSee webhooks.md for implementation patterns\n3. Subscription State Machine\n\nCritical states and transitions:\n\nState\tMeaning\tAccess\ntrialing\tFree trial period\t✅ Full\nactive\tPaid and current\t✅ Full\npast_due\tPayment failed, retrying\t⚠️ Grace period\ncanceled\tWill end at period end\t✅ Until period_end\nunpaid\tExhausted retries\t❌ None\n\nNever grant access based on status === 'active' alone — check current_period_end.\n\n4. Cancel vs Delete: Revenue at Stake\ncancel_at_period_end: true → Access until period ends, stops renewal\nsubscription.delete() → Immediate termination, possible refund\nConfusing these loses revenue OR creates angry customers\nDefault to cancel-at-period-end; immediate delete only when requested\n5. Proration Requires Explicit Choice\n\nWhen changing plans mid-cycle:\n\nMode\tBehavior\tUse When\ncreate_prorations\tCredit unused, charge new\tStandard upgrades\nnone\tChange at renewal only\tDowngrades\nalways_invoice\tImmediate charge/credit\tEnterprise billing\n\nNever rely on PSP defaults — specify explicitly every time.\n\n6. Race Conditions Are Guaranteed\n\ncustomer.subscription.updated fires BEFORE invoice.paid frequently.\n\nDesign for eventual consistency\nUse database transactions for access changes\nIdempotent handlers that can safely reprocess\nStatus checks before granting/revoking access\n7. Tax Compliance Is Not Optional\nScenario\tAction\nSame country\tCharge local VAT/sales tax\nEU B2B + valid VAT\t0% reverse charge (verify via VIES)\nEU B2C\tMOSS — charge buyer's country VAT\nUS\tSales tax varies by 11,000+ jurisdictions\nExport (non-EU)\t0% typically\n\nMissing required invoice fields = legally invalid invoice. See tax.md.\n\n8. PCI-DSS: Never Touch Card Data\nNEVER store PAN, CVV, or magnetic stripe data\nOnly store PSP tokens (pm_*, cus_*)\nTokenization happens client-side (Stripe.js, Elements)\nEven \"last 4 digits + expiry\" is PCI scope if stored together\nSee disputes.md for compliance patterns\n9. Chargebacks Have Deadlines\nStage\tTimeline\tAction\nInquiry\t1-3 days\tProvide evidence proactively\nDispute opened\t7-21 days\tSubmit compelling evidence\nDeadline missed\tAutomatic loss\tSet alerts\n\n3 intentos de cobro fallidos consecutivos = posible trigger de fraude monitoring.\n\n10. Revenue Recognition ≠ Cash Collected\n\nFor SaaS under ASC 606/IFRS 15:\n\nAnnual payment ≠ annual revenue (recognized monthly)\nDeferred revenue is a liability, not an asset\nMulti-element contracts require allocation to performance obligations\nSee revenue-recognition.md for accounting patterns\nBilling Traps\nSecurity & Compliance\nWebhook without signature verification → attackers fake invoice.paid\nStoring tokens in frontend JS → extractable by attackers\nCVV in logs → PCI violation, massive fines\nRetry loops without limits → fraud monitoring triggers\nIntegration Errors\nNot storing subscription_id → impossible to reconcile refunds\nAssuming charge success = payment complete (3D Secure exists)\nIgnoring payment_intent.requires_action → stuck payments\nUsing mode: 'subscription' without handling customer.subscription.deleted\nFinancial Errors\nHardcoding tax rates → wrong when rates change\nAmounts in dollars when PSP expects cents → 100x overcharge\nRecognizing 100% revenue upfront on annual plans → audit findings\nConfusing bookings vs billings vs revenue → material discrepancies\nOperational Errors\nSending payment reminders during contractual grace period\nDunning without checking for open disputes → double loss\nProration without specifying mode → unexpected customer charges\nRefunding without checking for existing chargeback → paying twice"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/ivangdavila/billing",
    "publisherUrl": "https://clawhub.ai/ivangdavila/billing",
    "owner": "ivangdavila",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/erpclaw-billing",
    "downloadUrl": "https://openagent3.xyz/downloads/erpclaw-billing",
    "agentUrl": "https://openagent3.xyz/skills/erpclaw-billing/agent",
    "manifestUrl": "https://openagent3.xyz/skills/erpclaw-billing/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/erpclaw-billing/agent.md"
  }
}