Step-by-step guide to setting up your app to use pawapay to charge customers and CrediBill to act as the subscription engine
PawaPay only supports mobile money payments and does not support card
payments. Customer accounts cannot be automatically charged without user
interaction. CrediBill tracks free trials and subscription expirations and
notifies you via webhooks. Use the webhook event to terminate access to your
app or service and render a resubscribe button — CrediBill will pick up from
the resubscribe action to track the payment and restart the subscription for
you.
//subscribe-button.tsx//Make sure the plan has a free trial in the credibill dashboardimport { Button } from "@components/ui/button";import { useQuery } from "@tanstack/react-query";export default function SubscribeButton() { const handleSubscription = () => { useQuery(); }; return ( <div> <Button onClick={handleSubscription}> START FREE TRIAL </Button> </div> );}
//subscribe-button.tsx//Make sure the plan has no free trial in the credibill dashboardimport { Button } from "@components/ui/button"import { useQuery } from "@tanstack/react-query"export default SubscribeButton() { const handleSubscription = () => { useQuery() }return( <div> <Button onClick={handleSubscription}> START FREE TRIAL </Button> </div>)}
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Credibill","colors":{"primary":"#0D9488","light":"#CCFBF1","dark":"#115E59"},"favicon":"/favicon.svg","logo":{"light":"https://mintcdn.com/crestedlabs/qCWJYjAen-dM35_A/logo/light.svg?fit=max\u0026auto=format\u0026n=qCWJYjAen-dM35_A\u0026q=85\u0026s=6fa6be0c98056bd31bc385ce40bf6bbf","dark":"https://mintcdn.com/crestedlabs/qCWJYjAen-dM35_A/logo/dark.svg?fit=max\u0026auto=format\u0026n=qCWJYjAen-dM35_A\u0026q=85\u0026s=b3cd3ff4bff9209883e1ccc53379155c"},"navbar":{"links":[{"label":"Support","href":"mailto:support@credibill.tech"}],"primary":{"type":"button","label":"Dashboard","href":"https://dashboard.credibill.tech"}},"footer":{"socials":{"twitter":"https://twitter.com/credibill","github":"https://github.com/credibill","linkedin":"https://linkedin.com/company/credibill"}},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"crestedlabs","hasAudioNarration":false,"actualSubdomain":"crestedlabs","customDomains":["docs.credibill.tech"],"gitSource":{"type":"github","owner":"crestedlabs","repo":"docs","deployBranch":"main","isPrivate":true,"contentDirectory":"","mountPath":"","label":""},"entitlements":{},"buildId":"6ae9441df43bdafb4937b255:success","clientVersion":"0.0.4088","searchFilterCounts":[{"language":"default","tag":"Core Concepts","count":7},{"language":"default","tag":"Payment Provider Integration","count":4},{"language":"default","tag":"Get Started","count":3},{"language":"default","tag":"Billing Logic","count":3},{"language":"default","tag":"API Reference","count":2},{"language":"default","tag":"Payments","count":2},{"language":"default","tag":"Security","count":1},{"language":"default","tag":"Support","count":1},{"language":"default","tag":"Webhooks","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"integration/pawapay","slug":"/integration/pawapay","pageMetadata":{"title":"PawaPay","description":"Step-by-step guide to setting up your app to use pawapay to charge customers and CrediBill to act as the subscription engine","href":"/integration/pawapay"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Step-by-step guide to setting up your app to use pawapay to charge customers and CrediBill to act as the subscription engine\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Warning,{children:_jsx(_components.p,{children:`PawaPay only supports mobile money payments and does not support card\npayments. Customer accounts cannot be automatically charged without user\ninteraction. CrediBill tracks free trials and subscription expirations and\nnotifies you via webhooks. Use the webhook event to terminate access to your\napp or service and render a resubscribe button — CrediBill will pick up from\nthe resubscribe action to track the payment and restart the subscription for\nyou.`})}),`\n`,_jsx(Heading,{level:`2`,id:`1-subscribe-the-customer`,children:`1. Subscribe the customer`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Go to the credibll dashboard and click `,_jsx(_components.code,{children:`Plans`}),` in the sidebar`]}),`\n`,_jsxs(_components.li,{children:[`Copy the `,_jsx(_components.code,{children:`plan id`}),` of the plan you want to subscribe the customer to. Ideally you should already\nhave this as an env variable in your app`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`At least one created customer. This means a user to your app - A pawaPay account\n(live or sandbox) - Basic understanding of webhooks`}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`Fetch the `,_jsx(_components.code,{children:`customer id`}),` programmatically from the database`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`2-start-subscription-free-trial-scenario`,children:`2. Start subscription (Free Trial Scenario)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`tsx`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`tsx`,children:_jsxs(_components.code,{language:`tsx`,numberOfLines:`15`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`//subscribe-button.tsx`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`//Make sure the plan has a free trial in the credibill dashboard`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Button`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@components/ui/button\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`useQuery`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@tanstack/react-query\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` default`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` SubscribeButton`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` handleSubscription`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` () `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` useQuery`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` };`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`div`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#4EC9B0`},children:`Button`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` onClick`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`handleSubscription`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` START FREE TRIAL `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`\u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#4EC9B0`},children:`Button`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`div`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`3-start-subscription-no-free-trial-scenario`,children:`3. Start subscription (No Free Trial Scenario)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`15`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`//subscribe-button.tsx`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`//Make sure the plan has no free trial in the credibill dashboard`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Button`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@components/ui/button\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`useQuery`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@tanstack/react-query\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` default`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` SubscribeButton`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:` const `}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`handleSubscription`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` () `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` useQuery`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`return`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`div`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Button`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` onClick`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`handleSubscription`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`}`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` START`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` FREE`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` TRIAL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Button`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`div`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"PawaPay","description":"Step-by-step guide to setting up your app to use pawapay to charge customers and CrediBill to act as the subscription engine","href":"/integration/pawapay"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"1. Subscribe the customer","slug":"1-subscribe-the-customer","depth":2,"children":[]},{"title":"2. Start subscription (Free Trial Scenario)","slug":"2-start-subscription-free-trial-scenario","depth":2,"children":[]},{"title":"3. Start subscription (No Free Trial Scenario)","slug":"3-start-subscription-no-free-trial-scenario","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"crestedlabs","siteName":"Credibill","title":"PawaPay - Credibill","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"originalFileLocation":"integration/pawapay.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Step-by-step guide to setting up your app to use pawapay to charge customers and CrediBill to act as the subscription engine\">\u003cmeta data-mint-head name=\"application-name\" content=\"Credibill\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/crestedlabs/ki5qZdgf3jyWjLTq/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/crestedlabs/ki5qZdgf3jyWjLTq/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/crestedlabs/ki5qZdgf3jyWjLTq/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/crestedlabs/ki5qZdgf3jyWjLTq/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/crestedlabs/ki5qZdgf3jyWjLTq/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/crestedlabs/ki5qZdgf3jyWjLTq/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/crestedlabs/ki5qZdgf3jyWjLTq/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/crestedlabs/ki5qZdgf3jyWjLTq/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/crestedlabs/ki5qZdgf3jyWjLTq/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"PawaPay - Credibill\">\u003cmeta data-mint-head property=\"og:description\" content=\"Step-by-step guide to setting up your app to use pawapay to charge customers and CrediBill to act as the subscription engine\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Credibill\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.credibill.tech/docs/integration/pawapay\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://crestedlabs.mintlify.site/docs/_mintlify/api/og/v2?division=Payment+Provider+Integration\u0026amp;title=PawaPay\u0026amp;description=Step-by-step+guide+to+setting+up+your+app+to+use+pawapay+to+charge+customers+and+CrediBill+to+act+as+the++subscription+engine\u0026amp;theme=ff150935f865aedfb09d2406\u0026amp;signature=00cb5fba4a2b4a0eb37ead8282831c0abfc2fa59a9dca3f966856e32cfaceeaf\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"PawaPay - Credibill\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Step-by-step guide to setting up your app to use pawapay to charge customers and CrediBill to act as the subscription engine\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://crestedlabs.mintlify.site/docs/_mintlify/api/og/v2?division=Payment+Provider+Integration\u0026amp;title=PawaPay\u0026amp;description=Step-by-step+guide+to+setting+up+your+app+to+use+pawapay+to+charge+customers+and+CrediBill+to+act+as+the++subscription+engine\u0026amp;theme=ff150935f865aedfb09d2406\u0026amp;signature=00cb5fba4a2b4a0eb37ead8282831c0abfc2fa59a9dca3f966856e32cfaceeaf\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/crestedlabs/ki5qZdgf3jyWjLTq/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Credibill\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0D9488\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.credibill.tech/docs/integration/pawapay\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/integration/pawapay.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.credibill.tech/#organization\",\"name\":\"Credibill\",\"url\":\"https://docs.credibill.tech\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/crestedlabs/qCWJYjAen-dM35_A/logo/light.svg?fit=max\u0026auto=format\u0026n=qCWJYjAen-dM35_A\u0026q=85\u0026s=6fa6be0c98056bd31bc385ce40bf6bbf\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.credibill.tech/docs#website\",\"name\":\"Credibill\",\"url\":\"https://docs.credibill.tech/docs\",\"publisher\":{\"@id\":\"https://docs.credibill.tech/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.credibill.tech/docs/integration/pawapay#webpage\",\"url\":\"https://docs.credibill.tech/docs/integration/pawapay\",\"name\":\"PawaPay\",\"description\":\"Step-by-step guide to setting up your app to use pawapay to charge customers and CrediBill to act as the subscription engine\",\"isPartOf\":{\"@id\":\"https://docs.credibill.tech/docs#website\"},\"breadcrumb\":{\"@id\":\"https://docs.credibill.tech/docs/integration/pawapay#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.credibill.tech/docs/integration/pawapay#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Credibill\",\"item\":\"https://docs.credibill.tech/docs\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PawaPay\",\"item\":\"https://docs.credibill.tech/docs/integration/pawapay\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.credibill.tech/docs/integration/pawapay#article\",\"headline\":\"PawaPay\",\"name\":\"PawaPay\",\"description\":\"Step-by-step guide to setting up your app to use pawapay to charge customers and CrediBill to act as the subscription engine\",\"url\":\"https://docs.credibill.tech/docs/integration/pawapay\",\"mainEntityOfPage\":{\"@id\":\"https://docs.credibill.tech/docs/integration/pawapay#webpage\"},\"publisher\":{\"@id\":\"https://docs.credibill.tech/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.credibill.tech/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Credibill\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Credibill","nav":{"global":null,"groups":[{"group":"Get Started","pages":[{"title":"Introduction","href":"/introduction"},{"title":"Quickstart","href":"/quickstart"},{"title":"Authentication","href":"/authentication"}]},{"group":"Core Concepts","pages":[{"title":"Organizations","href":"/concepts/organizations"},{"title":"Apps","href":"/concepts/apps"},{"title":"Plans","href":"/concepts/plans"},{"title":"Customers","href":"/concepts/customers"},{"title":"Subscriptions","href":"/concepts/subscriptions"},{"title":"Usage Records","href":"/concepts/usage"},{"title":"Invoices","href":"/concepts/invoices"}]},{"group":"Payments","pages":[{"title":"Payment System Overview","href":"/payments/overview"},{"title":"Payment Provider Setup","description":"Configure payment providers for your SaaS app","href":"/payments/providers"}]},{"group":"Payment Provider Integration","pages":[{"title":"PawaPay","href":"/integration/pawapay"},{"title":"Integration Guide","description":"Step-by-step guide to integrate CrediBill into your SaaS app","href":"/integration/getting-started"},{"title":"Node.js Example","href":"/examples/javascript"},{"title":"cURL Example","href":"/examples/curl"}]},{"group":"Webhooks","pages":[{"title":"Webhook Reference","href":"/webhooks/reference"}]},{"group":"Security","pages":[{"title":"Security Best Practices","href":"/security/best-practices"}]},{"group":"Billing Logic","pages":[{"title":"Billing Lifecycle","href":"/billing/billing-lifecycle"},{"title":"Usage-Based Billing","href":"/billing/usage-based-billing"},{"title":"Invoicing Configuration","href":"/billing/invoicing"}]},{"group":"API Reference","pages":[{"title":"API Overview","href":"/api-reference/overview"},{"title":"Endpoints","openapi":"docs/api-reference/openapi.json","href":"/api-reference/endpoints"}]},{"group":"Support","pages":[{"title":"Troubleshooting \u0026 FAQ","href":"/support/troubleshooting"}]}]},"basePath":"","title":"PawaPay - Credibill","buildId":"dpl_6dVqRXFR2Go5vF5RLvAdHuv189oT","deploymentId":"dpl_6dVqRXFR2Go5vF5RLvAdHuv189oT","dynamics":[],"chunks":[]}