Use the recommended nested customer and plan fields. Choose one customer format: customer.customer_id for an existing customer, or customer.firstName, customer.lastName and customer.emailAddress for a new customer. Do not combine existing customer identification with new customer details.
Mode
Fields to supply
Conditions
Manual subscription
plan.plan_name and at least one enabled plan.recurring or plan.one_off segment
Set each enabled segment’s enabled to 1; recurring and one-off segments can both be enabled
Template subscription
plan.template_id and the applicable template dates
Supply plan.start_date for a recurring segment and plan.payment_date for a one-off segment; omit plan_name to inherit the template name
By agreement
plan.plan_name and plan.schedule
Supply schedule_name, type, amount and start_date for the initial schedule; types 1, 2, 3, 4 and 6 are allowed
The three modes are mutually exclusive. An enabled manual recurring segment requires schedule_name, recurring_type, amount, start_date and day_of_debit. An enabled one-off segment requires schedule_name, amount and payment_date. Dates must be no earlier than tomorrow in the business timezone.
total_amount, with amount no greater than total_amount
recurring_type=3 / schedule.type=3, until cancelled
No additional end condition
recurring_type=4 / schedule.type=4, end date
end_date, no earlier than the same segment’s start_date
schedule.type=6, one-off
day_of_debit is not required; this type is not available for recurring_type
Quarterly, half-yearly and yearly frequencies require day_of_debit_dtstart. Custom frequencies require process_type=12, custom_cycle_type and custom_cycle, consistent with the RRULE. See individual fields for ranges and date windows.
Top-level alternative fields remain supported. New integrations should use the nested format consistently. If both formats contain the same field, the nested value takes precedence.
A successful creation returns status=2 Inactive; the subscription is not yet activated. Give customers the complete activation_url unchanged, use it as an iframe src, or use activation_html as the iframe srcdoc. Customers enter payment details, authorize debits and activate on the BillBuddy-hosted page. Do not construct activation links or parse credentials. Keep the Client Secret and access_token on your server. Three definition modes are mutually exclusive: manual recurring/one_off, template_id, and By agreement schedule. Template mode requires dates for each enabled component: recurring start_date and one-off payment_date. New customer details and existing customer references are mutually exclusive. The nested customer/plan format is recommended; see field descriptions for alternatives. A successful response may omit the activation link. Contact BillBuddy to check the created subscription before proceeding in that case. No caller-supplied idempotency identifier is supported; do not blindly retry creation. Recurring and By agreement subscriptions must be activated before start_date; one-off-only subscriptions must be submitted for activation within 30 days of creation. An accessible page does not guarantee submission is still permitted; the activation response is authoritative.
All examples illustrate request and response formats. Replace customers, orders, cards and accounts with approved test data. BASE_URL is the service root domain without /api/v2. ACCESS_TOKEN is the access_token returned by /oauth/token. Example dates are in 2030; replace them with actual dates that satisfy the current date restrictions.
OAuth2 client_credentials authorization. Obtain a new access_token when it expires.
Body
application/json
Creates a subscription awaiting activation. Supply either an existing customer reference or new customer details. New customers require firstName, lastName and emailAddress in full. Exactly one subscription definition mode is required: manual, template or By agreement. Manual mode must enable at least one charge segment. plan_name is required outside template mode. The nested customer and plan format is recommended.
Whether to allow email notifications for this transaction or subscription. false prohibits them; true allows them. Omission or null uses the business's API email notification setting, which defaults to off. Actual delivery depends on notification preferences and applicable rules. Also accepts 0/1 and the strings "0"/"1".
Whether to allow SMS notifications for this transaction or subscription. false prohibits them; true allows them. Omission or null uses the business's API SMS notification setting, which defaults to off. Actual delivery depends on notification preferences and applicable rules. Also accepts 0/1 and the strings "0"/"1".
Supported top-level alternative; use customer.emailAddress for new integrations. If both forms supply this field, the nested value takes precedence.
New customer's primary email address. Required when creating a new customer. If it already belongs to a customer in the same merchant and business, supply that existing customer_id instead.
Supported top-level alternative; use customer.mobilePhoneNumber for new integrations. If both forms supply this field, the nested value takes precedence.
Supported top-level alternative; use customer.addressPostCode for new integrations. If both forms supply this field, the nested value takes precedence.
Supported top-level alternative; use plan.surcharge_config for new integrations. If both forms supply this field, the nested value takes precedence.
Surcharge options, preferably an array of strings. See the schema and examples for allowed options. Omission, null or an empty array disables all options; non-array values are also treated as all disabled. Unknown options do not enable charges. credit_card_surcharge selects the credit card surcharge group. Actual charges depend on merchant business rules and payment method restrictions. Applies in manual mode. Template mode uses the template's surcharge options, which this field cannot override. By agreement schedule mode does not support this setting. Card surcharges remain subject to the applicable charging policy; if it prohibits them, selecting card options does not enable charges.
Supported top-level alternative; use plan.dishonour_fee_switch for new integrations. If both forms supply this field, the nested value takes precedence.
Whether to charge a customer dishonour fee. Omission or null defaults to off. Enabling it requires an applicable positive fee configuration; the signed terms determine the actual amount. Also accepts 0/1 and the strings "0"/"1". Applies only to manual recurring/one_off mode. Template mode and By agreement schedule mode do not support this setting through this field.
Supported top-level alternative; use plan.start_date for new integrations. If both forms supply this field, the nested value takes precedence.
Date override for the template's recurring segment. Required when the template contains recurring. Must be no earlier than tomorrow in the service business timezone.
Supported top-level alternative; use plan.payment_date for new integrations. If both forms supply this field, the nested value takes precedence.
Date override for the template's one_off segment. Required when the template contains one_off. Must be no earlier than tomorrow in the service business timezone.
Response
HTTP 200. Distinguish success, business errors, validation errors and business authentication errors using the response body code.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"BillBuddy API","colors":{"primary":"#2563EB","light":"#2563EB","dark":"#60A5FA"},"api":{"playground":{"display":"interactive","proxy":false},"examples":{"defaults":"all","languages":["curl","python","javascript","php","go","java","ruby"],"autogenerate":false}},"styling":{"latex":false},"navigation":{"languages":[{"language":"en","default":true,"href":"en/introduction"},{"language":"cn","href":"cn/introduction"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"bill-buddy","hasAudioNarration":false,"actualSubdomain":"bill-buddy","customDomains":[],"gitSource":{"type":"github","owner":"billbuddyteam","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6ae2c549e7eb44cacb512b71"},"chroma":{"latestBuiltDeploymentHistoryId":"6ae45ce25507c0d0db07e2f8","collectionId":"4d6950a8-fc85-48ee-9f6b-6507ae37afd6","liveDeploymentHistoryId":"6ae45ce25507c0d0db07e2f8","schemaVersion":"v3"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae46817187ae8fd10debe8f","clientVersion":"0.0.4021","searchFilterCounts":[{"language":"cn","tag":"API 参考","count":12},{"language":"en","tag":"API reference","count":12},{"language":"cn","tag":"交易","count":7},{"language":"en","tag":"Transactions","count":7},{"language":"cn","tag":"订阅","count":4},{"language":"en","tag":"Subscriptions","count":4},{"language":"cn","tag":"接入指南","count":2},{"language":"cn","tag":"开始接入","count":2},{"language":"en","tag":"Integration guide","count":2},{"language":"en","tag":"Get started","count":2},{"language":"cn","tag":"认证","count":1},{"language":"en","tag":"Authentication","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","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":"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":"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":"byok-sep-25","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","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":"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}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"en/api-reference/subscriptions/create","slug":"/en/api-reference/subscriptions/create","pageMetadata":{"title":"Create a hosted subscription","description":"### Choose a subscription mode\n\nUse the recommended nested `customer` and `plan` fields. Choose one customer format: `customer.customer_id` for an existing customer, or `customer.firstName`, `customer.lastName` and `customer.emailAddress` for a new customer. Do not combine existing customer identification with new customer details.\n\n| Mode | Fields to supply | Conditions |\n| --- | --- | --- |\n| Manual subscription | `plan.plan_name` and at least one enabled `plan.recurring` or `plan.one_off` segment | Set each enabled segment's `enabled` to 1; recurring and one-off segments can both be enabled |\n| Template subscription | `plan.template_id` and the applicable template dates | Supply `plan.start_date` for a recurring segment and `plan.payment_date` for a one-off segment; omit `plan_name` to inherit the template name |\n| By agreement | `plan.plan_name` and `plan.schedule` | Supply `schedule_name`, `type`, `amount` and `start_date` for the initial schedule; types 1, 2, 3, 4 and 6 are allowed |\n\nThe three modes are mutually exclusive. An enabled manual recurring segment requires `schedule_name`, `recurring_type`, `amount`, `start_date` and `day_of_debit`. An enabled one-off segment requires `schedule_name`, `amount` and `payment_date`. Dates must be no earlier than tomorrow in the business timezone.\n\n| Recurring end condition | Additional required fields |\n| --- | --- |\n| `recurring_type=1` / `schedule.type=1`, successful payment count | `end_terms` |\n| `recurring_type=2` / `schedule.type=2`, total amount | `total_amount`, with `amount` no greater than `total_amount` |\n| `recurring_type=3` / `schedule.type=3`, until cancelled | No additional end condition |\n| `recurring_type=4` / `schedule.type=4`, end date | `end_date`, no earlier than the same segment's `start_date` |\n| `schedule.type=6`, one-off | `day_of_debit` is not required; this type is not available for `recurring_type` |\n\nQuarterly, half-yearly and yearly frequencies require `day_of_debit_dtstart`. Custom frequencies require `process_type=12`, `custom_cycle_type` and `custom_cycle`, consistent with the RRULE. See individual fields for ranges and date windows.\n\nTop-level alternative fields remain supported. New integrations should use the nested format consistently. If both formats contain the same field, the nested value takes precedence.\n\nA successful creation returns status=2 Inactive; the subscription is not yet activated. Give customers the complete activation_url unchanged, use it as an iframe src, or use activation_html as the iframe srcdoc. Customers enter payment details, authorize debits and activate on the BillBuddy-hosted page. Do not construct activation links or parse credentials. Keep the Client Secret and access_token on your server. Three definition modes are mutually exclusive: manual recurring/one_off, template_id, and By agreement schedule. Template mode requires dates for each enabled component: recurring start_date and one-off payment_date. New customer details and existing customer references are mutually exclusive. The nested customer/plan format is recommended; see field descriptions for alternatives. A successful response may omit the activation link. Contact BillBuddy to check the created subscription before proceeding in that case. No caller-supplied idempotency identifier is supported; do not blindly retry creation. Recurring and By agreement subscriptions must be activated before start_date; one-off-only subscriptions must be submitted for activation within 30 days of creation. An accessible page does not guarantee submission is still permitted; the activation response is authoritative.\n\nAll examples illustrate request and response formats. Replace customers, orders, cards and accounts with approved test data. BASE_URL is the service root domain without /api/v2. ACCESS_TOKEN is the access_token returned by /oauth/token. Example dates are in 2030; replace them with actual dates that satisfy the current date restrictions.","deprecated":null,"version":null,"sidebarTitle":"Create a hosted subscription","openapi":"/openapi/billbuddy-v2-openapi.en.yaml post /api/v2/subscription/create","href":"/en/api-reference/subscriptions/create","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n h3: \"h3\",\n p: \"p\",\n table: \"table\",\n tbody: \"tbody\",\n td: \"td\",\n th: \"th\",\n thead: \"thead\",\n tr: \"tr\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsx(_components.h3, {\n children: \"Choose a subscription mode\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Use the recommended nested \", _jsx(_components.code, {\n children: \"customer\"\n }), \" and \", _jsx(_components.code, {\n children: \"plan\"\n }), \" fields. Choose one customer format: \", _jsx(_components.code, {\n children: \"customer.customer_id\"\n }), \" for an existing customer, or \", _jsx(_components.code, {\n children: \"customer.firstName\"\n }), \", \", _jsx(_components.code, {\n children: \"customer.lastName\"\n }), \" and \", _jsx(_components.code, {\n children: \"customer.emailAddress\"\n }), \" for a new customer. Do not combine existing customer identification with new customer details.\"]\n }), \"\\n\", _jsxs(_components.table, {\n children: [_jsx(_components.thead, {\n children: _jsxs(_components.tr, {\n children: [_jsx(_components.th, {\n children: \"Mode\"\n }), _jsx(_components.th, {\n children: \"Fields to supply\"\n }), _jsx(_components.th, {\n children: \"Conditions\"\n })]\n })\n }), _jsxs(_components.tbody, {\n children: [_jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: \"Manual subscription\"\n }), _jsxs(_components.td, {\n children: [_jsx(_components.code, {\n children: \"plan.plan_name\"\n }), \" and at least one enabled \", _jsx(_components.code, {\n children: \"plan.recurring\"\n }), \" or \", _jsx(_components.code, {\n children: \"plan.one_off\"\n }), \" segment\"]\n }), _jsxs(_components.td, {\n children: [\"Set each enabled segment’s \", _jsx(_components.code, {\n children: \"enabled\"\n }), \" to 1; recurring and one-off segments can both be enabled\"]\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: \"Template subscription\"\n }), _jsxs(_components.td, {\n children: [_jsx(_components.code, {\n children: \"plan.template_id\"\n }), \" and the applicable template dates\"]\n }), _jsxs(_components.td, {\n children: [\"Supply \", _jsx(_components.code, {\n children: \"plan.start_date\"\n }), \" for a recurring segment and \", _jsx(_components.code, {\n children: \"plan.payment_date\"\n }), \" for a one-off segment; omit \", _jsx(_components.code, {\n children: \"plan_name\"\n }), \" to inherit the template name\"]\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: \"By agreement\"\n }), _jsxs(_components.td, {\n children: [_jsx(_components.code, {\n children: \"plan.plan_name\"\n }), \" and \", _jsx(_components.code, {\n children: \"plan.schedule\"\n })]\n }), _jsxs(_components.td, {\n children: [\"Supply \", _jsx(_components.code, {\n children: \"schedule_name\"\n }), \", \", _jsx(_components.code, {\n children: \"type\"\n }), \", \", _jsx(_components.code, {\n children: \"amount\"\n }), \" and \", _jsx(_components.code, {\n children: \"start_date\"\n }), \" for the initial schedule; types 1, 2, 3, 4 and 6 are allowed\"]\n })]\n })]\n })]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"The three modes are mutually exclusive. An enabled manual recurring segment requires \", _jsx(_components.code, {\n children: \"schedule_name\"\n }), \", \", _jsx(_components.code, {\n children: \"recurring_type\"\n }), \", \", _jsx(_components.code, {\n children: \"amount\"\n }), \", \", _jsx(_components.code, {\n children: \"start_date\"\n }), \" and \", _jsx(_components.code, {\n children: \"day_of_debit\"\n }), \". An enabled one-off segment requires \", _jsx(_components.code, {\n children: \"schedule_name\"\n }), \", \", _jsx(_components.code, {\n children: \"amount\"\n }), \" and \", _jsx(_components.code, {\n children: \"payment_date\"\n }), \". Dates must be no earlier than tomorrow in the business timezone.\"]\n }), \"\\n\", _jsxs(_components.table, {\n children: [_jsx(_components.thead, {\n children: _jsxs(_components.tr, {\n children: [_jsx(_components.th, {\n children: \"Recurring end condition\"\n }), _jsx(_components.th, {\n children: \"Additional required fields\"\n })]\n })\n }), _jsxs(_components.tbody, {\n children: [_jsxs(_components.tr, {\n children: [_jsxs(_components.td, {\n children: [_jsx(_components.code, {\n children: \"recurring_type=1\"\n }), \" / \", _jsx(_components.code, {\n children: \"schedule.type=1\"\n }), \", successful payment count\"]\n }), _jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"end_terms\"\n })\n })]\n }), _jsxs(_components.tr, {\n children: [_jsxs(_components.td, {\n children: [_jsx(_components.code, {\n children: \"recurring_type=2\"\n }), \" / \", _jsx(_components.code, {\n children: \"schedule.type=2\"\n }), \", total amount\"]\n }), _jsxs(_components.td, {\n children: [_jsx(_components.code, {\n children: \"total_amount\"\n }), \", with \", _jsx(_components.code, {\n children: \"amount\"\n }), \" no greater than \", _jsx(_components.code, {\n children: \"total_amount\"\n })]\n })]\n }), _jsxs(_components.tr, {\n children: [_jsxs(_components.td, {\n children: [_jsx(_components.code, {\n children: \"recurring_type=3\"\n }), \" / \", _jsx(_components.code, {\n children: \"schedule.type=3\"\n }), \", until cancelled\"]\n }), _jsx(_components.td, {\n children: \"No additional end condition\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsxs(_components.td, {\n children: [_jsx(_components.code, {\n children: \"recurring_type=4\"\n }), \" / \", _jsx(_components.code, {\n children: \"schedule.type=4\"\n }), \", end date\"]\n }), _jsxs(_components.td, {\n children: [_jsx(_components.code, {\n children: \"end_date\"\n }), \", no earlier than the same segment’s \", _jsx(_components.code, {\n children: \"start_date\"\n })]\n })]\n }), _jsxs(_components.tr, {\n children: [_jsxs(_components.td, {\n children: [_jsx(_components.code, {\n children: \"schedule.type=6\"\n }), \", one-off\"]\n }), _jsxs(_components.td, {\n children: [_jsx(_components.code, {\n children: \"day_of_debit\"\n }), \" is not required; this type is not available for \", _jsx(_components.code, {\n children: \"recurring_type\"\n })]\n })]\n })]\n })]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Quarterly, half-yearly and yearly frequencies require \", _jsx(_components.code, {\n children: \"day_of_debit_dtstart\"\n }), \". Custom frequencies require \", _jsx(_components.code, {\n children: \"process_type=12\"\n }), \", \", _jsx(_components.code, {\n children: \"custom_cycle_type\"\n }), \" and \", _jsx(_components.code, {\n children: \"custom_cycle\"\n }), \", consistent with the RRULE. See individual fields for ranges and date windows.\"]\n }), \"\\n\", _jsx(_components.p, {\n children: \"Top-level alternative fields remain supported. New integrations should use the nested format consistently. If both formats contain the same field, the nested value takes precedence.\"\n }), \"\\n\", _jsx(_components.p, {\n children: \"A successful creation returns status=2 Inactive; the subscription is not yet activated. Give customers the complete activation_url unchanged, use it as an iframe src, or use activation_html as the iframe srcdoc. Customers enter payment details, authorize debits and activate on the BillBuddy-hosted page. Do not construct activation links or parse credentials. Keep the Client Secret and access_token on your server. Three definition modes are mutually exclusive: manual recurring/one_off, template_id, and By agreement schedule. Template mode requires dates for each enabled component: recurring start_date and one-off payment_date. New customer details and existing customer references are mutually exclusive. The nested customer/plan format is recommended; see field descriptions for alternatives. A successful response may omit the activation link. Contact BillBuddy to check the created subscription before proceeding in that case. No caller-supplied idempotency identifier is supported; do not blindly retry creation. Recurring and By agreement subscriptions must be activated before start_date; one-off-only subscriptions must be submitted for activation within 30 days of creation. An accessible page does not guarantee submission is still permitted; the activation response is authoritative.\"\n }), \"\\n\", _jsx(_components.p, {\n children: \"All examples illustrate request and response formats. Replace customers, orders, cards and accounts with approved test data. BASE_URL is the service root domain without /api/v2. ACCESS_TOKEN is the access_token returned by /oauth/token. Example dates are in 2030; replace them with actual dates that satisfy the current date restrictions.\"\n })]\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}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create a hosted subscription","description":"### Choose a subscription mode\n\nUse the recommended nested `customer` and `plan` fields. Choose one customer format: `customer.customer_id` for an existing customer, or `customer.firstName`, `customer.lastName` and `customer.emailAddress` for a new customer. Do not combine existing customer identification with new customer details.\n\n| Mode | Fields to supply | Conditions |\n| --- | --- | --- |\n| Manual subscription | `plan.plan_name` and at least one enabled `plan.recurring` or `plan.one_off` segment | Set each enabled segment's `enabled` to 1; recurring and one-off segments can both be enabled |\n| Template subscription | `plan.template_id` and the applicable template dates | Supply `plan.start_date` for a recurring segment and `plan.payment_date` for a one-off segment; omit `plan_name` to inherit the template name |\n| By agreement | `plan.plan_name` and `plan.schedule` | Supply `schedule_name`, `type`, `amount` and `start_date` for the initial schedule; types 1, 2, 3, 4 and 6 are allowed |\n\nThe three modes are mutually exclusive. An enabled manual recurring segment requires `schedule_name`, `recurring_type`, `amount`, `start_date` and `day_of_debit`. An enabled one-off segment requires `schedule_name`, `amount` and `payment_date`. Dates must be no earlier than tomorrow in the business timezone.\n\n| Recurring end condition | Additional required fields |\n| --- | --- |\n| `recurring_type=1` / `schedule.type=1`, successful payment count | `end_terms` |\n| `recurring_type=2` / `schedule.type=2`, total amount | `total_amount`, with `amount` no greater than `total_amount` |\n| `recurring_type=3` / `schedule.type=3`, until cancelled | No additional end condition |\n| `recurring_type=4` / `schedule.type=4`, end date | `end_date`, no earlier than the same segment's `start_date` |\n| `schedule.type=6`, one-off | `day_of_debit` is not required; this type is not available for `recurring_type` |\n\nQuarterly, half-yearly and yearly frequencies require `day_of_debit_dtstart`. Custom frequencies require `process_type=12`, `custom_cycle_type` and `custom_cycle`, consistent with the RRULE. See individual fields for ranges and date windows.\n\nTop-level alternative fields remain supported. New integrations should use the nested format consistently. If both formats contain the same field, the nested value takes precedence.\n\nA successful creation returns status=2 Inactive; the subscription is not yet activated. Give customers the complete activation_url unchanged, use it as an iframe src, or use activation_html as the iframe srcdoc. Customers enter payment details, authorize debits and activate on the BillBuddy-hosted page. Do not construct activation links or parse credentials. Keep the Client Secret and access_token on your server. Three definition modes are mutually exclusive: manual recurring/one_off, template_id, and By agreement schedule. Template mode requires dates for each enabled component: recurring start_date and one-off payment_date. New customer details and existing customer references are mutually exclusive. The nested customer/plan format is recommended; see field descriptions for alternatives. A successful response may omit the activation link. Contact BillBuddy to check the created subscription before proceeding in that case. No caller-supplied idempotency identifier is supported; do not blindly retry creation. Recurring and By agreement subscriptions must be activated before start_date; one-off-only subscriptions must be submitted for activation within 30 days of creation. An accessible page does not guarantee submission is still permitted; the activation response is authoritative.\n\nAll examples illustrate request and response formats. Replace customers, orders, cards and accounts with approved test data. BASE_URL is the service root domain without /api/v2. ACCESS_TOKEN is the access_token returned by /oauth/token. Example dates are in 2030; replace them with actual dates that satisfy the current date restrictions.","deprecated":null,"version":null,"sidebarTitle":"Create a hosted subscription","openapi":"/openapi/billbuddy-v2-openapi.en.yaml post /api/v2/subscription/create","href":"/en/api-reference/subscriptions/create","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Subscriptions"],"operationId":"v2SubscriptionCreate","summary":"Create a hosted subscription","description":"### Choose a subscription mode\n\nUse the recommended nested `customer` and `plan` fields. Choose one customer format: `customer.customer_id` for an existing customer, or `customer.firstName`, `customer.lastName` and `customer.emailAddress` for a new customer. Do not combine existing customer identification with new customer details.\n\n| Mode | Fields to supply | Conditions |\n| --- | --- | --- |\n| Manual subscription | `plan.plan_name` and at least one enabled `plan.recurring` or `plan.one_off` segment | Set each enabled segment's `enabled` to 1; recurring and one-off segments can both be enabled |\n| Template subscription | `plan.template_id` and the applicable template dates | Supply `plan.start_date` for a recurring segment and `plan.payment_date` for a one-off segment; omit `plan_name` to inherit the template name |\n| By agreement | `plan.plan_name` and `plan.schedule` | Supply `schedule_name`, `type`, `amount` and `start_date` for the initial schedule; types 1, 2, 3, 4 and 6 are allowed |\n\nThe three modes are mutually exclusive. An enabled manual recurring segment requires `schedule_name`, `recurring_type`, `amount`, `start_date` and `day_of_debit`. An enabled one-off segment requires `schedule_name`, `amount` and `payment_date`. Dates must be no earlier than tomorrow in the business timezone.\n\n| Recurring end condition | Additional required fields |\n| --- | --- |\n| `recurring_type=1` / `schedule.type=1`, successful payment count | `end_terms` |\n| `recurring_type=2` / `schedule.type=2`, total amount | `total_amount`, with `amount` no greater than `total_amount` |\n| `recurring_type=3` / `schedule.type=3`, until cancelled | No additional end condition |\n| `recurring_type=4` / `schedule.type=4`, end date | `end_date`, no earlier than the same segment's `start_date` |\n| `schedule.type=6`, one-off | `day_of_debit` is not required; this type is not available for `recurring_type` |\n\nQuarterly, half-yearly and yearly frequencies require `day_of_debit_dtstart`. Custom frequencies require `process_type=12`, `custom_cycle_type` and `custom_cycle`, consistent with the RRULE. See individual fields for ranges and date windows.\n\nTop-level alternative fields remain supported. New integrations should use the nested format consistently. If both formats contain the same field, the nested value takes precedence.\n\nA successful creation returns status=2 Inactive; the subscription is not yet activated. Give customers the complete activation_url unchanged, use it as an iframe src, or use activation_html as the iframe srcdoc. Customers enter payment details, authorize debits and activate on the BillBuddy-hosted page. Do not construct activation links or parse credentials. Keep the Client Secret and access_token on your server. Three definition modes are mutually exclusive: manual recurring/one_off, template_id, and By agreement schedule. Template mode requires dates for each enabled component: recurring start_date and one-off payment_date. New customer details and existing customer references are mutually exclusive. The nested customer/plan format is recommended; see field descriptions for alternatives. A successful response may omit the activation link. Contact BillBuddy to check the created subscription before proceeding in that case. No caller-supplied idempotency identifier is supported; do not blindly retry creation. Recurring and By agreement subscriptions must be activated before start_date; one-off-only subscriptions must be submitted for activation within 30 days of creation. An accessible page does not guarantee submission is still permitted; the activation response is authoritative.\n\nAll examples illustrate request and response formats. Replace customers, orders, cards and accounts with approved test data. BASE_URL is the service root domain without /api/v2. ACCESS_TOKEN is the access_token returned by /oauth/token. Example dates are in 2030; replace them with actual dates that satisfy the current date restrictions.","security":["10c08da3-e05c-44ec-abc7-3b8d4a88a061"],"responses":{"200":"5dce7bcd-8d2f-430e-a9f9-06f6f307f036","429":"c382ceb6-c67a-47ed-8fef-c0ae95557c0c"},"requestBody":"312ff86c-33d1-4d9d-b552-81021627c39e","x-codeSamples":[{"lang":"Shell","label":"Manually defined recurring subscription","source":"curl -X POST \"${BASE_URL}/api/v2/subscription/create\" \\\n -H \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n -H \"Accept: application/json\" \\\n -H \"Content-Type: application/json\" \\\n --data-raw '{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Monthly fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=15\"\n },\n \"surcharge_config\": []\n },\n \"notify_email\": false,\n \"notify_sms\": false\n}'"},{"lang":"Shell","label":"New customer with a one-off subscription","source":"curl -X POST \"${BASE_URL}/api/v2/subscription/create\" \\\n -H \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n -H \"Accept: application/json\" \\\n -H \"Content-Type: application/json\" \\\n --data-raw '{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"firstName\": \"Emily\",\n \"lastName\": \"Carter\",\n \"emailAddress\": \"[email protected]\",\n \"mobilePhoneNumber\": \"0491570006\",\n \"addressLine1\": \"18 Paperbark Avenue\",\n \"addressSuburb\": \"Sydney\",\n \"addressState\": \"NSW\",\n \"addressPostCode\": \"2000\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"enabled\": 1,\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n }\n}'"},{"lang":"Shell","label":"Subscription from a template","source":"curl -X POST \"${BASE_URL}/api/v2/subscription/create\" \\\n -H \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n -H \"Accept: application/json\" \\\n -H \"Content-Type: application/json\" \\\n --data-raw '{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"template_id\": \"TPL62038591\",\n \"start_date\": \"2030-01-10\"\n }\n}'"},{"lang":"Shell","label":"Initial By agreement schedule","source":"curl -X POST \"${BASE_URL}/api/v2/subscription/create\" \\\n -H \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n -H \"Accept: application/json\" \\\n -H \"Content-Type: application/json\" \\\n --data-raw '{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"schedule\": {\n \"type\": 6,\n \"schedule_name\": \"First usage charge\",\n \"amount\": \"10.00\",\n \"start_date\": \"2030-01-15\"\n }\n }\n}'"},{"lang":"Shell","label":"Custom frequency: every ten days","source":"curl -X POST \"${BASE_URL}/api/v2/subscription/create\" \\\n -H \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n -H \"Accept: application/json\" \\\n -H \"Content-Type: application/json\" \\\n --data-raw '{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Every ten days\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Ten-day membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=DAILY;INTERVAL=10\",\n \"process_type\": 12,\n \"custom_cycle_type\": 1,\n \"custom_cycle\": 10\n }\n }\n}'"},{"lang":"Shell","label":"Quarterly frequency with a first debit anchor","source":"curl -X POST \"${BASE_URL}/api/v2/subscription/create\" \\\n -H \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n -H \"Accept: application/json\" \\\n -H \"Content-Type: application/json\" \\\n --data-raw '{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Quarterly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Quarterly membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=3;BYMONTHDAY=15\",\n \"day_of_debit_dtstart\": \"2030-02-15\"\n }\n }\n}'"},{"lang":"Python","label":"Manually defined recurring subscription","source":"import json\nimport os\nimport urllib.parse\nimport urllib.request\n\nbase_url = os.environ[\"BASE_URL\"].rstrip(\"/\")\nurl = base_url + \"/api/v2/subscription/create\"\nheaders = {\"Accept\": \"application/json\"}\nheaders[\"Authorization\"] = \"Bearer \" + os.environ[\"ACCESS_TOKEN\"]\npayload = json.loads(r'''{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Monthly fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=15\"\n },\n \"surcharge_config\": []\n },\n \"notify_email\": false,\n \"notify_sms\": false\n}''')\nbody = json.dumps(payload).encode(\"utf-8\")\nheaders[\"Content-Type\"] = \"application/json\"\n\nrequest = urllib.request.Request(url, data=body, headers=headers, method=\"POST\")\nwith urllib.request.urlopen(request, timeout=30) as response:\n print(response.read().decode(\"utf-8\"))\n"},{"lang":"Python","label":"New customer with a one-off subscription","source":"import json\nimport os\nimport urllib.parse\nimport urllib.request\n\nbase_url = os.environ[\"BASE_URL\"].rstrip(\"/\")\nurl = base_url + \"/api/v2/subscription/create\"\nheaders = {\"Accept\": \"application/json\"}\nheaders[\"Authorization\"] = \"Bearer \" + os.environ[\"ACCESS_TOKEN\"]\npayload = json.loads(r'''{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"firstName\": \"Emily\",\n \"lastName\": \"Carter\",\n \"emailAddress\": \"[email protected]\",\n \"mobilePhoneNumber\": \"0491570006\",\n \"addressLine1\": \"18 Paperbark Avenue\",\n \"addressSuburb\": \"Sydney\",\n \"addressState\": \"NSW\",\n \"addressPostCode\": \"2000\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"enabled\": 1,\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n }\n}''')\nbody = json.dumps(payload).encode(\"utf-8\")\nheaders[\"Content-Type\"] = \"application/json\"\n\nrequest = urllib.request.Request(url, data=body, headers=headers, method=\"POST\")\nwith urllib.request.urlopen(request, timeout=30) as response:\n print(response.read().decode(\"utf-8\"))\n"},{"lang":"Python","label":"Subscription from a template","source":"import json\nimport os\nimport urllib.parse\nimport urllib.request\n\nbase_url = os.environ[\"BASE_URL\"].rstrip(\"/\")\nurl = base_url + \"/api/v2/subscription/create\"\nheaders = {\"Accept\": \"application/json\"}\nheaders[\"Authorization\"] = \"Bearer \" + os.environ[\"ACCESS_TOKEN\"]\npayload = json.loads(r'''{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"template_id\": \"TPL62038591\",\n \"start_date\": \"2030-01-10\"\n }\n}''')\nbody = json.dumps(payload).encode(\"utf-8\")\nheaders[\"Content-Type\"] = \"application/json\"\n\nrequest = urllib.request.Request(url, data=body, headers=headers, method=\"POST\")\nwith urllib.request.urlopen(request, timeout=30) as response:\n print(response.read().decode(\"utf-8\"))\n"},{"lang":"Python","label":"Initial By agreement schedule","source":"import json\nimport os\nimport urllib.parse\nimport urllib.request\n\nbase_url = os.environ[\"BASE_URL\"].rstrip(\"/\")\nurl = base_url + \"/api/v2/subscription/create\"\nheaders = {\"Accept\": \"application/json\"}\nheaders[\"Authorization\"] = \"Bearer \" + os.environ[\"ACCESS_TOKEN\"]\npayload = json.loads(r'''{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"schedule\": {\n \"type\": 6,\n \"schedule_name\": \"First usage charge\",\n \"amount\": \"10.00\",\n \"start_date\": \"2030-01-15\"\n }\n }\n}''')\nbody = json.dumps(payload).encode(\"utf-8\")\nheaders[\"Content-Type\"] = \"application/json\"\n\nrequest = urllib.request.Request(url, data=body, headers=headers, method=\"POST\")\nwith urllib.request.urlopen(request, timeout=30) as response:\n print(response.read().decode(\"utf-8\"))\n"},{"lang":"Python","label":"Custom frequency: every ten days","source":"import json\nimport os\nimport urllib.parse\nimport urllib.request\n\nbase_url = os.environ[\"BASE_URL\"].rstrip(\"/\")\nurl = base_url + \"/api/v2/subscription/create\"\nheaders = {\"Accept\": \"application/json\"}\nheaders[\"Authorization\"] = \"Bearer \" + os.environ[\"ACCESS_TOKEN\"]\npayload = json.loads(r'''{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Every ten days\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Ten-day membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=DAILY;INTERVAL=10\",\n \"process_type\": 12,\n \"custom_cycle_type\": 1,\n \"custom_cycle\": 10\n }\n }\n}''')\nbody = json.dumps(payload).encode(\"utf-8\")\nheaders[\"Content-Type\"] = \"application/json\"\n\nrequest = urllib.request.Request(url, data=body, headers=headers, method=\"POST\")\nwith urllib.request.urlopen(request, timeout=30) as response:\n print(response.read().decode(\"utf-8\"))\n"},{"lang":"Python","label":"Quarterly frequency with a first debit anchor","source":"import json\nimport os\nimport urllib.parse\nimport urllib.request\n\nbase_url = os.environ[\"BASE_URL\"].rstrip(\"/\")\nurl = base_url + \"/api/v2/subscription/create\"\nheaders = {\"Accept\": \"application/json\"}\nheaders[\"Authorization\"] = \"Bearer \" + os.environ[\"ACCESS_TOKEN\"]\npayload = json.loads(r'''{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Quarterly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Quarterly membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=3;BYMONTHDAY=15\",\n \"day_of_debit_dtstart\": \"2030-02-15\"\n }\n }\n}''')\nbody = json.dumps(payload).encode(\"utf-8\")\nheaders[\"Content-Type\"] = \"application/json\"\n\nrequest = urllib.request.Request(url, data=body, headers=headers, method=\"POST\")\nwith urllib.request.urlopen(request, timeout=30) as response:\n print(response.read().decode(\"utf-8\"))\n"},{"lang":"JavaScript","label":"Manually defined recurring subscription","source":"const env = (name) => {\n const value = process.env[name];\n if (!value) throw new Error(`Missing environment variable: ${name}`);\n return value;\n};\nconst baseUrl = env(\"BASE_URL\").replace(/\\/+$/, \"\");\nconst url = new URL(baseUrl + \"/api/v2/subscription/create\");\nconst headers = { Accept: \"application/json\" };\nheaders.Authorization = `Bearer ${env(\"ACCESS_TOKEN\")}`;\nconst payload = {\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Monthly fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=15\"\n },\n \"surcharge_config\": []\n },\n \"notify_email\": false,\n \"notify_sms\": false\n};\nconst body = JSON.stringify(payload);\nheaders[\"Content-Type\"] = \"application/json\";\n\nconst response = await fetch(url, {\n method: \"POST\",\n headers,\n body,\n signal: AbortSignal.timeout(30_000),\n});\nconsole.log(await response.text());\n"},{"lang":"JavaScript","label":"New customer with a one-off subscription","source":"const env = (name) => {\n const value = process.env[name];\n if (!value) throw new Error(`Missing environment variable: ${name}`);\n return value;\n};\nconst baseUrl = env(\"BASE_URL\").replace(/\\/+$/, \"\");\nconst url = new URL(baseUrl + \"/api/v2/subscription/create\");\nconst headers = { Accept: \"application/json\" };\nheaders.Authorization = `Bearer ${env(\"ACCESS_TOKEN\")}`;\nconst payload = {\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"firstName\": \"Emily\",\n \"lastName\": \"Carter\",\n \"emailAddress\": \"[email protected]\",\n \"mobilePhoneNumber\": \"0491570006\",\n \"addressLine1\": \"18 Paperbark Avenue\",\n \"addressSuburb\": \"Sydney\",\n \"addressState\": \"NSW\",\n \"addressPostCode\": \"2000\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"enabled\": 1,\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n }\n};\nconst body = JSON.stringify(payload);\nheaders[\"Content-Type\"] = \"application/json\";\n\nconst response = await fetch(url, {\n method: \"POST\",\n headers,\n body,\n signal: AbortSignal.timeout(30_000),\n});\nconsole.log(await response.text());\n"},{"lang":"JavaScript","label":"Subscription from a template","source":"const env = (name) => {\n const value = process.env[name];\n if (!value) throw new Error(`Missing environment variable: ${name}`);\n return value;\n};\nconst baseUrl = env(\"BASE_URL\").replace(/\\/+$/, \"\");\nconst url = new URL(baseUrl + \"/api/v2/subscription/create\");\nconst headers = { Accept: \"application/json\" };\nheaders.Authorization = `Bearer ${env(\"ACCESS_TOKEN\")}`;\nconst payload = {\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"template_id\": \"TPL62038591\",\n \"start_date\": \"2030-01-10\"\n }\n};\nconst body = JSON.stringify(payload);\nheaders[\"Content-Type\"] = \"application/json\";\n\nconst response = await fetch(url, {\n method: \"POST\",\n headers,\n body,\n signal: AbortSignal.timeout(30_000),\n});\nconsole.log(await response.text());\n"},{"lang":"JavaScript","label":"Initial By agreement schedule","source":"const env = (name) => {\n const value = process.env[name];\n if (!value) throw new Error(`Missing environment variable: ${name}`);\n return value;\n};\nconst baseUrl = env(\"BASE_URL\").replace(/\\/+$/, \"\");\nconst url = new URL(baseUrl + \"/api/v2/subscription/create\");\nconst headers = { Accept: \"application/json\" };\nheaders.Authorization = `Bearer ${env(\"ACCESS_TOKEN\")}`;\nconst payload = {\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"schedule\": {\n \"type\": 6,\n \"schedule_name\": \"First usage charge\",\n \"amount\": \"10.00\",\n \"start_date\": \"2030-01-15\"\n }\n }\n};\nconst body = JSON.stringify(payload);\nheaders[\"Content-Type\"] = \"application/json\";\n\nconst response = await fetch(url, {\n method: \"POST\",\n headers,\n body,\n signal: AbortSignal.timeout(30_000),\n});\nconsole.log(await response.text());\n"},{"lang":"JavaScript","label":"Custom frequency: every ten days","source":"const env = (name) => {\n const value = process.env[name];\n if (!value) throw new Error(`Missing environment variable: ${name}`);\n return value;\n};\nconst baseUrl = env(\"BASE_URL\").replace(/\\/+$/, \"\");\nconst url = new URL(baseUrl + \"/api/v2/subscription/create\");\nconst headers = { Accept: \"application/json\" };\nheaders.Authorization = `Bearer ${env(\"ACCESS_TOKEN\")}`;\nconst payload = {\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Every ten days\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Ten-day membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=DAILY;INTERVAL=10\",\n \"process_type\": 12,\n \"custom_cycle_type\": 1,\n \"custom_cycle\": 10\n }\n }\n};\nconst body = JSON.stringify(payload);\nheaders[\"Content-Type\"] = \"application/json\";\n\nconst response = await fetch(url, {\n method: \"POST\",\n headers,\n body,\n signal: AbortSignal.timeout(30_000),\n});\nconsole.log(await response.text());\n"},{"lang":"JavaScript","label":"Quarterly frequency with a first debit anchor","source":"const env = (name) => {\n const value = process.env[name];\n if (!value) throw new Error(`Missing environment variable: ${name}`);\n return value;\n};\nconst baseUrl = env(\"BASE_URL\").replace(/\\/+$/, \"\");\nconst url = new URL(baseUrl + \"/api/v2/subscription/create\");\nconst headers = { Accept: \"application/json\" };\nheaders.Authorization = `Bearer ${env(\"ACCESS_TOKEN\")}`;\nconst payload = {\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Quarterly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Quarterly membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=3;BYMONTHDAY=15\",\n \"day_of_debit_dtstart\": \"2030-02-15\"\n }\n }\n};\nconst body = JSON.stringify(payload);\nheaders[\"Content-Type\"] = \"application/json\";\n\nconst response = await fetch(url, {\n method: \"POST\",\n headers,\n body,\n signal: AbortSignal.timeout(30_000),\n});\nconsole.log(await response.text());\n"},{"lang":"PHP","label":"Manually defined recurring subscription","source":"\u003c?php\n$env = static function (string $name): string {\n $value = getenv($name);\n if ($value === false || $value === '') {\n throw new RuntimeException(\"Missing environment variable: \" . $name);\n }\n return $value;\n};\n$baseUrl = rtrim($env('BASE_URL'), '/');\n$url = $baseUrl . \"/api/v2/subscription/create\";\n$headers = ['Accept: application/json'];\n$headers[] = 'Authorization: Bearer ' . $env('ACCESS_TOKEN');\n$body = \u003c\u003c\u003c'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Monthly fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=15\"\n },\n \"surcharge_config\": []\n },\n \"notify_email\": false,\n \"notify_sms\": false\n}\nJSON;\n$headers[] = 'Content-Type: application/json';\n\n$curl = curl_init($url);\ncurl_setopt_array($curl, [\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_POSTFIELDS => $body,\n]);\n$response = curl_exec($curl);\nif ($response === false) {\n $error = curl_error($curl);\n curl_close($curl);\n throw new RuntimeException($error);\n}\ncurl_close($curl);\necho $response, PHP_EOL;\n"},{"lang":"PHP","label":"New customer with a one-off subscription","source":"\u003c?php\n$env = static function (string $name): string {\n $value = getenv($name);\n if ($value === false || $value === '') {\n throw new RuntimeException(\"Missing environment variable: \" . $name);\n }\n return $value;\n};\n$baseUrl = rtrim($env('BASE_URL'), '/');\n$url = $baseUrl . \"/api/v2/subscription/create\";\n$headers = ['Accept: application/json'];\n$headers[] = 'Authorization: Bearer ' . $env('ACCESS_TOKEN');\n$body = \u003c\u003c\u003c'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"firstName\": \"Emily\",\n \"lastName\": \"Carter\",\n \"emailAddress\": \"[email protected]\",\n \"mobilePhoneNumber\": \"0491570006\",\n \"addressLine1\": \"18 Paperbark Avenue\",\n \"addressSuburb\": \"Sydney\",\n \"addressState\": \"NSW\",\n \"addressPostCode\": \"2000\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"enabled\": 1,\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n }\n}\nJSON;\n$headers[] = 'Content-Type: application/json';\n\n$curl = curl_init($url);\ncurl_setopt_array($curl, [\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_POSTFIELDS => $body,\n]);\n$response = curl_exec($curl);\nif ($response === false) {\n $error = curl_error($curl);\n curl_close($curl);\n throw new RuntimeException($error);\n}\ncurl_close($curl);\necho $response, PHP_EOL;\n"},{"lang":"PHP","label":"Subscription from a template","source":"\u003c?php\n$env = static function (string $name): string {\n $value = getenv($name);\n if ($value === false || $value === '') {\n throw new RuntimeException(\"Missing environment variable: \" . $name);\n }\n return $value;\n};\n$baseUrl = rtrim($env('BASE_URL'), '/');\n$url = $baseUrl . \"/api/v2/subscription/create\";\n$headers = ['Accept: application/json'];\n$headers[] = 'Authorization: Bearer ' . $env('ACCESS_TOKEN');\n$body = \u003c\u003c\u003c'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"template_id\": \"TPL62038591\",\n \"start_date\": \"2030-01-10\"\n }\n}\nJSON;\n$headers[] = 'Content-Type: application/json';\n\n$curl = curl_init($url);\ncurl_setopt_array($curl, [\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_POSTFIELDS => $body,\n]);\n$response = curl_exec($curl);\nif ($response === false) {\n $error = curl_error($curl);\n curl_close($curl);\n throw new RuntimeException($error);\n}\ncurl_close($curl);\necho $response, PHP_EOL;\n"},{"lang":"PHP","label":"Initial By agreement schedule","source":"\u003c?php\n$env = static function (string $name): string {\n $value = getenv($name);\n if ($value === false || $value === '') {\n throw new RuntimeException(\"Missing environment variable: \" . $name);\n }\n return $value;\n};\n$baseUrl = rtrim($env('BASE_URL'), '/');\n$url = $baseUrl . \"/api/v2/subscription/create\";\n$headers = ['Accept: application/json'];\n$headers[] = 'Authorization: Bearer ' . $env('ACCESS_TOKEN');\n$body = \u003c\u003c\u003c'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"schedule\": {\n \"type\": 6,\n \"schedule_name\": \"First usage charge\",\n \"amount\": \"10.00\",\n \"start_date\": \"2030-01-15\"\n }\n }\n}\nJSON;\n$headers[] = 'Content-Type: application/json';\n\n$curl = curl_init($url);\ncurl_setopt_array($curl, [\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_POSTFIELDS => $body,\n]);\n$response = curl_exec($curl);\nif ($response === false) {\n $error = curl_error($curl);\n curl_close($curl);\n throw new RuntimeException($error);\n}\ncurl_close($curl);\necho $response, PHP_EOL;\n"},{"lang":"PHP","label":"Custom frequency: every ten days","source":"\u003c?php\n$env = static function (string $name): string {\n $value = getenv($name);\n if ($value === false || $value === '') {\n throw new RuntimeException(\"Missing environment variable: \" . $name);\n }\n return $value;\n};\n$baseUrl = rtrim($env('BASE_URL'), '/');\n$url = $baseUrl . \"/api/v2/subscription/create\";\n$headers = ['Accept: application/json'];\n$headers[] = 'Authorization: Bearer ' . $env('ACCESS_TOKEN');\n$body = \u003c\u003c\u003c'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Every ten days\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Ten-day membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=DAILY;INTERVAL=10\",\n \"process_type\": 12,\n \"custom_cycle_type\": 1,\n \"custom_cycle\": 10\n }\n }\n}\nJSON;\n$headers[] = 'Content-Type: application/json';\n\n$curl = curl_init($url);\ncurl_setopt_array($curl, [\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_POSTFIELDS => $body,\n]);\n$response = curl_exec($curl);\nif ($response === false) {\n $error = curl_error($curl);\n curl_close($curl);\n throw new RuntimeException($error);\n}\ncurl_close($curl);\necho $response, PHP_EOL;\n"},{"lang":"PHP","label":"Quarterly frequency with a first debit anchor","source":"\u003c?php\n$env = static function (string $name): string {\n $value = getenv($name);\n if ($value === false || $value === '') {\n throw new RuntimeException(\"Missing environment variable: \" . $name);\n }\n return $value;\n};\n$baseUrl = rtrim($env('BASE_URL'), '/');\n$url = $baseUrl . \"/api/v2/subscription/create\";\n$headers = ['Accept: application/json'];\n$headers[] = 'Authorization: Bearer ' . $env('ACCESS_TOKEN');\n$body = \u003c\u003c\u003c'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Quarterly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Quarterly membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=3;BYMONTHDAY=15\",\n \"day_of_debit_dtstart\": \"2030-02-15\"\n }\n }\n}\nJSON;\n$headers[] = 'Content-Type: application/json';\n\n$curl = curl_init($url);\ncurl_setopt_array($curl, [\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_POSTFIELDS => $body,\n]);\n$response = curl_exec($curl);\nif ($response === false) {\n $error = curl_error($curl);\n curl_close($curl);\n throw new RuntimeException($error);\n}\ncurl_close($curl);\necho $response, PHP_EOL;\n"},{"lang":"Go","label":"Manually defined recurring subscription","source":"package main\n\nimport (\n \"fmt\"\n \"io\"\n \"net/http\"\n \"os\"\n \"strings\"\n \"time\"\n)\n\nfunc mustEnv(name string) string {\n value := os.Getenv(name)\n if value == \"\" { panic(\"Missing environment variable: \" + name) }\n return value\n}\n\nfunc main() {\n baseURL := strings.TrimRight(mustEnv(\"BASE_URL\"), \"/\")\n endpoint := baseURL + \"/api/v2/subscription/create\"\n payload := `{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Monthly fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=15\"\n },\n \"surcharge_config\": []\n },\n \"notify_email\": false,\n \"notify_sms\": false\n}`\n body := strings.NewReader(payload)\n req, err := http.NewRequest(\"POST\", endpoint, body)\n if err != nil { panic(err) }\n req.Header.Set(\"Accept\", \"application/json\")\n req.Header.Set(\"Authorization\", \"Bearer \" + mustEnv(\"ACCESS_TOKEN\"))\n req.Header.Set(\"Content-Type\", \"application/json\")\n client := \u0026http.Client{Timeout: 30 * time.Second}\n response, err := client.Do(req)\n if err != nil { panic(err) }\n defer response.Body.Close()\n result, err := io.ReadAll(response.Body)\n if err != nil { panic(err) }\n fmt.Println(string(result))\n}\n"},{"lang":"Go","label":"New customer with a one-off subscription","source":"package main\n\nimport (\n \"fmt\"\n \"io\"\n \"net/http\"\n \"os\"\n \"strings\"\n \"time\"\n)\n\nfunc mustEnv(name string) string {\n value := os.Getenv(name)\n if value == \"\" { panic(\"Missing environment variable: \" + name) }\n return value\n}\n\nfunc main() {\n baseURL := strings.TrimRight(mustEnv(\"BASE_URL\"), \"/\")\n endpoint := baseURL + \"/api/v2/subscription/create\"\n payload := `{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"firstName\": \"Emily\",\n \"lastName\": \"Carter\",\n \"emailAddress\": \"[email protected]\",\n \"mobilePhoneNumber\": \"0491570006\",\n \"addressLine1\": \"18 Paperbark Avenue\",\n \"addressSuburb\": \"Sydney\",\n \"addressState\": \"NSW\",\n \"addressPostCode\": \"2000\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"enabled\": 1,\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n }\n}`\n body := strings.NewReader(payload)\n req, err := http.NewRequest(\"POST\", endpoint, body)\n if err != nil { panic(err) }\n req.Header.Set(\"Accept\", \"application/json\")\n req.Header.Set(\"Authorization\", \"Bearer \" + mustEnv(\"ACCESS_TOKEN\"))\n req.Header.Set(\"Content-Type\", \"application/json\")\n client := \u0026http.Client{Timeout: 30 * time.Second}\n response, err := client.Do(req)\n if err != nil { panic(err) }\n defer response.Body.Close()\n result, err := io.ReadAll(response.Body)\n if err != nil { panic(err) }\n fmt.Println(string(result))\n}\n"},{"lang":"Go","label":"Subscription from a template","source":"package main\n\nimport (\n \"fmt\"\n \"io\"\n \"net/http\"\n \"os\"\n \"strings\"\n \"time\"\n)\n\nfunc mustEnv(name string) string {\n value := os.Getenv(name)\n if value == \"\" { panic(\"Missing environment variable: \" + name) }\n return value\n}\n\nfunc main() {\n baseURL := strings.TrimRight(mustEnv(\"BASE_URL\"), \"/\")\n endpoint := baseURL + \"/api/v2/subscription/create\"\n payload := `{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"template_id\": \"TPL62038591\",\n \"start_date\": \"2030-01-10\"\n }\n}`\n body := strings.NewReader(payload)\n req, err := http.NewRequest(\"POST\", endpoint, body)\n if err != nil { panic(err) }\n req.Header.Set(\"Accept\", \"application/json\")\n req.Header.Set(\"Authorization\", \"Bearer \" + mustEnv(\"ACCESS_TOKEN\"))\n req.Header.Set(\"Content-Type\", \"application/json\")\n client := \u0026http.Client{Timeout: 30 * time.Second}\n response, err := client.Do(req)\n if err != nil { panic(err) }\n defer response.Body.Close()\n result, err := io.ReadAll(response.Body)\n if err != nil { panic(err) }\n fmt.Println(string(result))\n}\n"},{"lang":"Go","label":"Initial By agreement schedule","source":"package main\n\nimport (\n \"fmt\"\n \"io\"\n \"net/http\"\n \"os\"\n \"strings\"\n \"time\"\n)\n\nfunc mustEnv(name string) string {\n value := os.Getenv(name)\n if value == \"\" { panic(\"Missing environment variable: \" + name) }\n return value\n}\n\nfunc main() {\n baseURL := strings.TrimRight(mustEnv(\"BASE_URL\"), \"/\")\n endpoint := baseURL + \"/api/v2/subscription/create\"\n payload := `{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"schedule\": {\n \"type\": 6,\n \"schedule_name\": \"First usage charge\",\n \"amount\": \"10.00\",\n \"start_date\": \"2030-01-15\"\n }\n }\n}`\n body := strings.NewReader(payload)\n req, err := http.NewRequest(\"POST\", endpoint, body)\n if err != nil { panic(err) }\n req.Header.Set(\"Accept\", \"application/json\")\n req.Header.Set(\"Authorization\", \"Bearer \" + mustEnv(\"ACCESS_TOKEN\"))\n req.Header.Set(\"Content-Type\", \"application/json\")\n client := \u0026http.Client{Timeout: 30 * time.Second}\n response, err := client.Do(req)\n if err != nil { panic(err) }\n defer response.Body.Close()\n result, err := io.ReadAll(response.Body)\n if err != nil { panic(err) }\n fmt.Println(string(result))\n}\n"},{"lang":"Go","label":"Custom frequency: every ten days","source":"package main\n\nimport (\n \"fmt\"\n \"io\"\n \"net/http\"\n \"os\"\n \"strings\"\n \"time\"\n)\n\nfunc mustEnv(name string) string {\n value := os.Getenv(name)\n if value == \"\" { panic(\"Missing environment variable: \" + name) }\n return value\n}\n\nfunc main() {\n baseURL := strings.TrimRight(mustEnv(\"BASE_URL\"), \"/\")\n endpoint := baseURL + \"/api/v2/subscription/create\"\n payload := `{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Every ten days\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Ten-day membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=DAILY;INTERVAL=10\",\n \"process_type\": 12,\n \"custom_cycle_type\": 1,\n \"custom_cycle\": 10\n }\n }\n}`\n body := strings.NewReader(payload)\n req, err := http.NewRequest(\"POST\", endpoint, body)\n if err != nil { panic(err) }\n req.Header.Set(\"Accept\", \"application/json\")\n req.Header.Set(\"Authorization\", \"Bearer \" + mustEnv(\"ACCESS_TOKEN\"))\n req.Header.Set(\"Content-Type\", \"application/json\")\n client := \u0026http.Client{Timeout: 30 * time.Second}\n response, err := client.Do(req)\n if err != nil { panic(err) }\n defer response.Body.Close()\n result, err := io.ReadAll(response.Body)\n if err != nil { panic(err) }\n fmt.Println(string(result))\n}\n"},{"lang":"Go","label":"Quarterly frequency with a first debit anchor","source":"package main\n\nimport (\n \"fmt\"\n \"io\"\n \"net/http\"\n \"os\"\n \"strings\"\n \"time\"\n)\n\nfunc mustEnv(name string) string {\n value := os.Getenv(name)\n if value == \"\" { panic(\"Missing environment variable: \" + name) }\n return value\n}\n\nfunc main() {\n baseURL := strings.TrimRight(mustEnv(\"BASE_URL\"), \"/\")\n endpoint := baseURL + \"/api/v2/subscription/create\"\n payload := `{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Quarterly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Quarterly membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=3;BYMONTHDAY=15\",\n \"day_of_debit_dtstart\": \"2030-02-15\"\n }\n }\n}`\n body := strings.NewReader(payload)\n req, err := http.NewRequest(\"POST\", endpoint, body)\n if err != nil { panic(err) }\n req.Header.Set(\"Accept\", \"application/json\")\n req.Header.Set(\"Authorization\", \"Bearer \" + mustEnv(\"ACCESS_TOKEN\"))\n req.Header.Set(\"Content-Type\", \"application/json\")\n client := \u0026http.Client{Timeout: 30 * time.Second}\n response, err := client.Do(req)\n if err != nil { panic(err) }\n defer response.Body.Close()\n result, err := io.ReadAll(response.Body)\n if err != nil { panic(err) }\n fmt.Println(string(result))\n}\n"},{"lang":"Java","label":"Manually defined recurring subscription","source":"import java.io.ByteArrayOutputStream;\nimport java.net.URI;\nimport java.net.URLEncoder;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.time.Duration;\nimport java.util.LinkedHashMap;\nimport java.util.Map;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\n\npublic class Example {\n static String requireEnv(String name) {\n String value = System.getenv(name);\n if (value == null || value.isEmpty()) {\n throw new IllegalArgumentException(\"Missing environment variable: \" + name);\n }\n return value;\n }\n\n public static void main(String[] args) throws Exception {\n String baseUrl = requireEnv(\"BASE_URL\").replaceAll(\"/+$\", \"\");\n String endpoint = baseUrl + \"/api/v2/subscription/create\";\n String payload =\n \"{\\n\" +\n \" \\\"merchant_id\\\": \\\"48290713\\\",\\n\" +\n \" \\\"customer\\\": {\\n\" +\n \" \\\"customer_id\\\": \\\"CUS48290713\\\"\\n\" +\n \" },\\n\" +\n \" \\\"plan\\\": {\\n\" +\n \" \\\"plan_name\\\": \\\"Monthly membership\\\",\\n\" +\n \" \\\"recurring\\\": {\\n\" +\n \" \\\"enabled\\\": 1,\\n\" +\n \" \\\"schedule_name\\\": \\\"Monthly fee\\\",\\n\" +\n \" \\\"recurring_type\\\": 3,\\n\" +\n \" \\\"amount\\\": \\\"25.50\\\",\\n\" +\n \" \\\"start_date\\\": \\\"2030-01-10\\\",\\n\" +\n \" \\\"day_of_debit\\\": \\\"FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=15\\\"\\n\" +\n \" },\\n\" +\n \" \\\"surcharge_config\\\": []\\n\" +\n \" },\\n\" +\n \" \\\"notify_email\\\": false,\\n\" +\n \" \\\"notify_sms\\\": false\\n\" +\n \"}\";\n HttpRequest.Builder builder = HttpRequest.newBuilder(URI.create(endpoint))\n .timeout(Duration.ofSeconds(30))\n .header(\"Accept\", \"application/json\");\n builder.header(\"Authorization\", \"Bearer \" + requireEnv(\"ACCESS_TOKEN\"));\n builder.header(\"Content-Type\", \"application/json\");\n HttpRequest request = builder.method(\"POST\", HttpRequest.BodyPublishers.ofString(payload, StandardCharsets.UTF_8)).build();\n HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(30)).build();\n HttpResponse\u003cString> response = client.send(request,\n HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));\n System.out.println(response.body());\n }\n}\n"},{"lang":"Java","label":"New customer with a one-off subscription","source":"import java.io.ByteArrayOutputStream;\nimport java.net.URI;\nimport java.net.URLEncoder;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.time.Duration;\nimport java.util.LinkedHashMap;\nimport java.util.Map;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\n\npublic class Example {\n static String requireEnv(String name) {\n String value = System.getenv(name);\n if (value == null || value.isEmpty()) {\n throw new IllegalArgumentException(\"Missing environment variable: \" + name);\n }\n return value;\n }\n\n public static void main(String[] args) throws Exception {\n String baseUrl = requireEnv(\"BASE_URL\").replaceAll(\"/+$\", \"\");\n String endpoint = baseUrl + \"/api/v2/subscription/create\";\n String payload =\n \"{\\n\" +\n \" \\\"merchant_id\\\": \\\"48290713\\\",\\n\" +\n \" \\\"customer\\\": {\\n\" +\n \" \\\"firstName\\\": \\\"Emily\\\",\\n\" +\n \" \\\"lastName\\\": \\\"Carter\\\",\\n\" +\n \" \\\"emailAddress\\\": \\\"[email protected]\\\",\\n\" +\n \" \\\"mobilePhoneNumber\\\": \\\"0491570006\\\",\\n\" +\n \" \\\"addressLine1\\\": \\\"18 Paperbark Avenue\\\",\\n\" +\n \" \\\"addressSuburb\\\": \\\"Sydney\\\",\\n\" +\n \" \\\"addressState\\\": \\\"NSW\\\",\\n\" +\n \" \\\"addressPostCode\\\": \\\"2000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"plan\\\": {\\n\" +\n \" \\\"plan_name\\\": \\\"One time fee\\\",\\n\" +\n \" \\\"one_off\\\": {\\n\" +\n \" \\\"enabled\\\": 1,\\n\" +\n \" \\\"schedule_name\\\": \\\"Initial fee\\\",\\n\" +\n \" \\\"amount\\\": \\\"20.00\\\",\\n\" +\n \" \\\"payment_date\\\": \\\"2030-01-15\\\"\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \"}\";\n HttpRequest.Builder builder = HttpRequest.newBuilder(URI.create(endpoint))\n .timeout(Duration.ofSeconds(30))\n .header(\"Accept\", \"application/json\");\n builder.header(\"Authorization\", \"Bearer \" + requireEnv(\"ACCESS_TOKEN\"));\n builder.header(\"Content-Type\", \"application/json\");\n HttpRequest request = builder.method(\"POST\", HttpRequest.BodyPublishers.ofString(payload, StandardCharsets.UTF_8)).build();\n HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(30)).build();\n HttpResponse\u003cString> response = client.send(request,\n HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));\n System.out.println(response.body());\n }\n}\n"},{"lang":"Java","label":"Subscription from a template","source":"import java.io.ByteArrayOutputStream;\nimport java.net.URI;\nimport java.net.URLEncoder;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.time.Duration;\nimport java.util.LinkedHashMap;\nimport java.util.Map;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\n\npublic class Example {\n static String requireEnv(String name) {\n String value = System.getenv(name);\n if (value == null || value.isEmpty()) {\n throw new IllegalArgumentException(\"Missing environment variable: \" + name);\n }\n return value;\n }\n\n public static void main(String[] args) throws Exception {\n String baseUrl = requireEnv(\"BASE_URL\").replaceAll(\"/+$\", \"\");\n String endpoint = baseUrl + \"/api/v2/subscription/create\";\n String payload =\n \"{\\n\" +\n \" \\\"merchant_id\\\": \\\"48290713\\\",\\n\" +\n \" \\\"customer\\\": {\\n\" +\n \" \\\"customer_id\\\": \\\"CUS48290713\\\"\\n\" +\n \" },\\n\" +\n \" \\\"plan\\\": {\\n\" +\n \" \\\"template_id\\\": \\\"TPL62038591\\\",\\n\" +\n \" \\\"start_date\\\": \\\"2030-01-10\\\"\\n\" +\n \" }\\n\" +\n \"}\";\n HttpRequest.Builder builder = HttpRequest.newBuilder(URI.create(endpoint))\n .timeout(Duration.ofSeconds(30))\n .header(\"Accept\", \"application/json\");\n builder.header(\"Authorization\", \"Bearer \" + requireEnv(\"ACCESS_TOKEN\"));\n builder.header(\"Content-Type\", \"application/json\");\n HttpRequest request = builder.method(\"POST\", HttpRequest.BodyPublishers.ofString(payload, StandardCharsets.UTF_8)).build();\n HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(30)).build();\n HttpResponse\u003cString> response = client.send(request,\n HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));\n System.out.println(response.body());\n }\n}\n"},{"lang":"Java","label":"Initial By agreement schedule","source":"import java.io.ByteArrayOutputStream;\nimport java.net.URI;\nimport java.net.URLEncoder;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.time.Duration;\nimport java.util.LinkedHashMap;\nimport java.util.Map;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\n\npublic class Example {\n static String requireEnv(String name) {\n String value = System.getenv(name);\n if (value == null || value.isEmpty()) {\n throw new IllegalArgumentException(\"Missing environment variable: \" + name);\n }\n return value;\n }\n\n public static void main(String[] args) throws Exception {\n String baseUrl = requireEnv(\"BASE_URL\").replaceAll(\"/+$\", \"\");\n String endpoint = baseUrl + \"/api/v2/subscription/create\";\n String payload =\n \"{\\n\" +\n \" \\\"merchant_id\\\": \\\"48290713\\\",\\n\" +\n \" \\\"customer\\\": {\\n\" +\n \" \\\"customer_id\\\": \\\"CUS48290713\\\"\\n\" +\n \" },\\n\" +\n \" \\\"plan\\\": {\\n\" +\n \" \\\"plan_name\\\": \\\"Usage based DDR\\\",\\n\" +\n \" \\\"schedule\\\": {\\n\" +\n \" \\\"type\\\": 6,\\n\" +\n \" \\\"schedule_name\\\": \\\"First usage charge\\\",\\n\" +\n \" \\\"amount\\\": \\\"10.00\\\",\\n\" +\n \" \\\"start_date\\\": \\\"2030-01-15\\\"\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \"}\";\n HttpRequest.Builder builder = HttpRequest.newBuilder(URI.create(endpoint))\n .timeout(Duration.ofSeconds(30))\n .header(\"Accept\", \"application/json\");\n builder.header(\"Authorization\", \"Bearer \" + requireEnv(\"ACCESS_TOKEN\"));\n builder.header(\"Content-Type\", \"application/json\");\n HttpRequest request = builder.method(\"POST\", HttpRequest.BodyPublishers.ofString(payload, StandardCharsets.UTF_8)).build();\n HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(30)).build();\n HttpResponse\u003cString> response = client.send(request,\n HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));\n System.out.println(response.body());\n }\n}\n"},{"lang":"Java","label":"Custom frequency: every ten days","source":"import java.io.ByteArrayOutputStream;\nimport java.net.URI;\nimport java.net.URLEncoder;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.time.Duration;\nimport java.util.LinkedHashMap;\nimport java.util.Map;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\n\npublic class Example {\n static String requireEnv(String name) {\n String value = System.getenv(name);\n if (value == null || value.isEmpty()) {\n throw new IllegalArgumentException(\"Missing environment variable: \" + name);\n }\n return value;\n }\n\n public static void main(String[] args) throws Exception {\n String baseUrl = requireEnv(\"BASE_URL\").replaceAll(\"/+$\", \"\");\n String endpoint = baseUrl + \"/api/v2/subscription/create\";\n String payload =\n \"{\\n\" +\n \" \\\"merchant_id\\\": \\\"48290713\\\",\\n\" +\n \" \\\"customer\\\": {\\n\" +\n \" \\\"customer_id\\\": \\\"CUS48290713\\\"\\n\" +\n \" },\\n\" +\n \" \\\"plan\\\": {\\n\" +\n \" \\\"plan_name\\\": \\\"Every ten days\\\",\\n\" +\n \" \\\"recurring\\\": {\\n\" +\n \" \\\"enabled\\\": 1,\\n\" +\n \" \\\"schedule_name\\\": \\\"Ten-day membership fee\\\",\\n\" +\n \" \\\"recurring_type\\\": 3,\\n\" +\n \" \\\"amount\\\": \\\"25.50\\\",\\n\" +\n \" \\\"start_date\\\": \\\"2030-01-10\\\",\\n\" +\n \" \\\"day_of_debit\\\": \\\"FREQ=DAILY;INTERVAL=10\\\",\\n\" +\n \" \\\"process_type\\\": 12,\\n\" +\n \" \\\"custom_cycle_type\\\": 1,\\n\" +\n \" \\\"custom_cycle\\\": 10\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \"}\";\n HttpRequest.Builder builder = HttpRequest.newBuilder(URI.create(endpoint))\n .timeout(Duration.ofSeconds(30))\n .header(\"Accept\", \"application/json\");\n builder.header(\"Authorization\", \"Bearer \" + requireEnv(\"ACCESS_TOKEN\"));\n builder.header(\"Content-Type\", \"application/json\");\n HttpRequest request = builder.method(\"POST\", HttpRequest.BodyPublishers.ofString(payload, StandardCharsets.UTF_8)).build();\n HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(30)).build();\n HttpResponse\u003cString> response = client.send(request,\n HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));\n System.out.println(response.body());\n }\n}\n"},{"lang":"Java","label":"Quarterly frequency with a first debit anchor","source":"import java.io.ByteArrayOutputStream;\nimport java.net.URI;\nimport java.net.URLEncoder;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.time.Duration;\nimport java.util.LinkedHashMap;\nimport java.util.Map;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\n\npublic class Example {\n static String requireEnv(String name) {\n String value = System.getenv(name);\n if (value == null || value.isEmpty()) {\n throw new IllegalArgumentException(\"Missing environment variable: \" + name);\n }\n return value;\n }\n\n public static void main(String[] args) throws Exception {\n String baseUrl = requireEnv(\"BASE_URL\").replaceAll(\"/+$\", \"\");\n String endpoint = baseUrl + \"/api/v2/subscription/create\";\n String payload =\n \"{\\n\" +\n \" \\\"merchant_id\\\": \\\"48290713\\\",\\n\" +\n \" \\\"customer\\\": {\\n\" +\n \" \\\"customer_id\\\": \\\"CUS48290713\\\"\\n\" +\n \" },\\n\" +\n \" \\\"plan\\\": {\\n\" +\n \" \\\"plan_name\\\": \\\"Quarterly membership\\\",\\n\" +\n \" \\\"recurring\\\": {\\n\" +\n \" \\\"enabled\\\": 1,\\n\" +\n \" \\\"schedule_name\\\": \\\"Quarterly membership fee\\\",\\n\" +\n \" \\\"recurring_type\\\": 3,\\n\" +\n \" \\\"amount\\\": \\\"25.50\\\",\\n\" +\n \" \\\"start_date\\\": \\\"2030-01-10\\\",\\n\" +\n \" \\\"day_of_debit\\\": \\\"FREQ=MONTHLY;INTERVAL=3;BYMONTHDAY=15\\\",\\n\" +\n \" \\\"day_of_debit_dtstart\\\": \\\"2030-02-15\\\"\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \"}\";\n HttpRequest.Builder builder = HttpRequest.newBuilder(URI.create(endpoint))\n .timeout(Duration.ofSeconds(30))\n .header(\"Accept\", \"application/json\");\n builder.header(\"Authorization\", \"Bearer \" + requireEnv(\"ACCESS_TOKEN\"));\n builder.header(\"Content-Type\", \"application/json\");\n HttpRequest request = builder.method(\"POST\", HttpRequest.BodyPublishers.ofString(payload, StandardCharsets.UTF_8)).build();\n HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(30)).build();\n HttpResponse\u003cString> response = client.send(request,\n HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));\n System.out.println(response.body());\n }\n}\n"},{"lang":"Ruby","label":"Manually defined recurring subscription","source":"require \"net/http\"\nrequire \"uri\"\n\nbase_url = ENV.fetch(\"BASE_URL\").sub(%r{/+$}, \"\")\nuri = URI(base_url + \"/api/v2/subscription/create\")\nrequest = Net::HTTP::Post.new(uri)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Authorization\"] = \"Bearer \" + ENV.fetch(\"ACCESS_TOKEN\")\nrequest[\"Content-Type\"] = \"application/json\"\nrequest.body = \u003c\u003c~'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Monthly fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=15\"\n },\n \"surcharge_config\": []\n },\n \"notify_email\": false,\n \"notify_sms\": false\n}\nJSON\nhttp = Net::HTTP.new(uri.host, uri.port)\nhttp.use_ssl = uri.scheme == \"https\"\nhttp.open_timeout = 30\nhttp.read_timeout = 30\nputs http.request(request).body\n"},{"lang":"Ruby","label":"New customer with a one-off subscription","source":"require \"net/http\"\nrequire \"uri\"\n\nbase_url = ENV.fetch(\"BASE_URL\").sub(%r{/+$}, \"\")\nuri = URI(base_url + \"/api/v2/subscription/create\")\nrequest = Net::HTTP::Post.new(uri)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Authorization\"] = \"Bearer \" + ENV.fetch(\"ACCESS_TOKEN\")\nrequest[\"Content-Type\"] = \"application/json\"\nrequest.body = \u003c\u003c~'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"firstName\": \"Emily\",\n \"lastName\": \"Carter\",\n \"emailAddress\": \"[email protected]\",\n \"mobilePhoneNumber\": \"0491570006\",\n \"addressLine1\": \"18 Paperbark Avenue\",\n \"addressSuburb\": \"Sydney\",\n \"addressState\": \"NSW\",\n \"addressPostCode\": \"2000\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"enabled\": 1,\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n }\n}\nJSON\nhttp = Net::HTTP.new(uri.host, uri.port)\nhttp.use_ssl = uri.scheme == \"https\"\nhttp.open_timeout = 30\nhttp.read_timeout = 30\nputs http.request(request).body\n"},{"lang":"Ruby","label":"Subscription from a template","source":"require \"net/http\"\nrequire \"uri\"\n\nbase_url = ENV.fetch(\"BASE_URL\").sub(%r{/+$}, \"\")\nuri = URI(base_url + \"/api/v2/subscription/create\")\nrequest = Net::HTTP::Post.new(uri)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Authorization\"] = \"Bearer \" + ENV.fetch(\"ACCESS_TOKEN\")\nrequest[\"Content-Type\"] = \"application/json\"\nrequest.body = \u003c\u003c~'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"template_id\": \"TPL62038591\",\n \"start_date\": \"2030-01-10\"\n }\n}\nJSON\nhttp = Net::HTTP.new(uri.host, uri.port)\nhttp.use_ssl = uri.scheme == \"https\"\nhttp.open_timeout = 30\nhttp.read_timeout = 30\nputs http.request(request).body\n"},{"lang":"Ruby","label":"Initial By agreement schedule","source":"require \"net/http\"\nrequire \"uri\"\n\nbase_url = ENV.fetch(\"BASE_URL\").sub(%r{/+$}, \"\")\nuri = URI(base_url + \"/api/v2/subscription/create\")\nrequest = Net::HTTP::Post.new(uri)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Authorization\"] = \"Bearer \" + ENV.fetch(\"ACCESS_TOKEN\")\nrequest[\"Content-Type\"] = \"application/json\"\nrequest.body = \u003c\u003c~'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"schedule\": {\n \"type\": 6,\n \"schedule_name\": \"First usage charge\",\n \"amount\": \"10.00\",\n \"start_date\": \"2030-01-15\"\n }\n }\n}\nJSON\nhttp = Net::HTTP.new(uri.host, uri.port)\nhttp.use_ssl = uri.scheme == \"https\"\nhttp.open_timeout = 30\nhttp.read_timeout = 30\nputs http.request(request).body\n"},{"lang":"Ruby","label":"Custom frequency: every ten days","source":"require \"net/http\"\nrequire \"uri\"\n\nbase_url = ENV.fetch(\"BASE_URL\").sub(%r{/+$}, \"\")\nuri = URI(base_url + \"/api/v2/subscription/create\")\nrequest = Net::HTTP::Post.new(uri)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Authorization\"] = \"Bearer \" + ENV.fetch(\"ACCESS_TOKEN\")\nrequest[\"Content-Type\"] = \"application/json\"\nrequest.body = \u003c\u003c~'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Every ten days\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Ten-day membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=DAILY;INTERVAL=10\",\n \"process_type\": 12,\n \"custom_cycle_type\": 1,\n \"custom_cycle\": 10\n }\n }\n}\nJSON\nhttp = Net::HTTP.new(uri.host, uri.port)\nhttp.use_ssl = uri.scheme == \"https\"\nhttp.open_timeout = 30\nhttp.read_timeout = 30\nputs http.request(request).body\n"},{"lang":"Ruby","label":"Quarterly frequency with a first debit anchor","source":"require \"net/http\"\nrequire \"uri\"\n\nbase_url = ENV.fetch(\"BASE_URL\").sub(%r{/+$}, \"\")\nuri = URI(base_url + \"/api/v2/subscription/create\")\nrequest = Net::HTTP::Post.new(uri)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Authorization\"] = \"Bearer \" + ENV.fetch(\"ACCESS_TOKEN\")\nrequest[\"Content-Type\"] = \"application/json\"\nrequest.body = \u003c\u003c~'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Quarterly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Quarterly membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=3;BYMONTHDAY=15\",\n \"day_of_debit_dtstart\": \"2030-02-15\"\n }\n }\n}\nJSON\nhttp = Net::HTTP.new(uri.host, uri.port)\nhttp.use_ssl = uri.scheme == \"https\"\nhttp.open_timeout = 30\nhttp.read_timeout = 30\nputs http.request(request).body\n"}],"x-mint":{"href":"/en/api-reference/subscriptions/create","metadata":{"sidebarTitle":"Create a hosted subscription"}},"method":"post","type":"path","servers":["ec796d37-3557-4815-8bd3-57ca5c337838"],"path":"/api/v2/subscription/create","baseUrlOptions":["https://staging-api.billbuddyhq.com"],"title":"Create a hosted subscription","codeSamples":[{"label":"Manually defined recurring subscription","lang":"Shell","source":"curl -X POST \"${BASE_URL}/api/v2/subscription/create\" \\\n -H \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n -H \"Accept: application/json\" \\\n -H \"Content-Type: application/json\" \\\n --data-raw '{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Monthly fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=15\"\n },\n \"surcharge_config\": []\n },\n \"notify_email\": false,\n \"notify_sms\": false\n}'"},{"label":"New customer with a one-off subscription","lang":"Shell","source":"curl -X POST \"${BASE_URL}/api/v2/subscription/create\" \\\n -H \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n -H \"Accept: application/json\" \\\n -H \"Content-Type: application/json\" \\\n --data-raw '{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"firstName\": \"Emily\",\n \"lastName\": \"Carter\",\n \"emailAddress\": \"[email protected]\",\n \"mobilePhoneNumber\": \"0491570006\",\n \"addressLine1\": \"18 Paperbark Avenue\",\n \"addressSuburb\": \"Sydney\",\n \"addressState\": \"NSW\",\n \"addressPostCode\": \"2000\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"enabled\": 1,\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n }\n}'"},{"label":"Subscription from a template","lang":"Shell","source":"curl -X POST \"${BASE_URL}/api/v2/subscription/create\" \\\n -H \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n -H \"Accept: application/json\" \\\n -H \"Content-Type: application/json\" \\\n --data-raw '{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"template_id\": \"TPL62038591\",\n \"start_date\": \"2030-01-10\"\n }\n}'"},{"label":"Initial By agreement schedule","lang":"Shell","source":"curl -X POST \"${BASE_URL}/api/v2/subscription/create\" \\\n -H \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n -H \"Accept: application/json\" \\\n -H \"Content-Type: application/json\" \\\n --data-raw '{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"schedule\": {\n \"type\": 6,\n \"schedule_name\": \"First usage charge\",\n \"amount\": \"10.00\",\n \"start_date\": \"2030-01-15\"\n }\n }\n}'"},{"label":"Custom frequency: every ten days","lang":"Shell","source":"curl -X POST \"${BASE_URL}/api/v2/subscription/create\" \\\n -H \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n -H \"Accept: application/json\" \\\n -H \"Content-Type: application/json\" \\\n --data-raw '{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Every ten days\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Ten-day membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=DAILY;INTERVAL=10\",\n \"process_type\": 12,\n \"custom_cycle_type\": 1,\n \"custom_cycle\": 10\n }\n }\n}'"},{"label":"Quarterly frequency with a first debit anchor","lang":"Shell","source":"curl -X POST \"${BASE_URL}/api/v2/subscription/create\" \\\n -H \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n -H \"Accept: application/json\" \\\n -H \"Content-Type: application/json\" \\\n --data-raw '{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Quarterly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Quarterly membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=3;BYMONTHDAY=15\",\n \"day_of_debit_dtstart\": \"2030-02-15\"\n }\n }\n}'"},{"label":"Manually defined recurring subscription","lang":"Python","source":"import json\nimport os\nimport urllib.parse\nimport urllib.request\n\nbase_url = os.environ[\"BASE_URL\"].rstrip(\"/\")\nurl = base_url + \"/api/v2/subscription/create\"\nheaders = {\"Accept\": \"application/json\"}\nheaders[\"Authorization\"] = \"Bearer \" + os.environ[\"ACCESS_TOKEN\"]\npayload = json.loads(r'''{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Monthly fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=15\"\n },\n \"surcharge_config\": []\n },\n \"notify_email\": false,\n \"notify_sms\": false\n}''')\nbody = json.dumps(payload).encode(\"utf-8\")\nheaders[\"Content-Type\"] = \"application/json\"\n\nrequest = urllib.request.Request(url, data=body, headers=headers, method=\"POST\")\nwith urllib.request.urlopen(request, timeout=30) as response:\n print(response.read().decode(\"utf-8\"))\n"},{"label":"New customer with a one-off subscription","lang":"Python","source":"import json\nimport os\nimport urllib.parse\nimport urllib.request\n\nbase_url = os.environ[\"BASE_URL\"].rstrip(\"/\")\nurl = base_url + \"/api/v2/subscription/create\"\nheaders = {\"Accept\": \"application/json\"}\nheaders[\"Authorization\"] = \"Bearer \" + os.environ[\"ACCESS_TOKEN\"]\npayload = json.loads(r'''{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"firstName\": \"Emily\",\n \"lastName\": \"Carter\",\n \"emailAddress\": \"[email protected]\",\n \"mobilePhoneNumber\": \"0491570006\",\n \"addressLine1\": \"18 Paperbark Avenue\",\n \"addressSuburb\": \"Sydney\",\n \"addressState\": \"NSW\",\n \"addressPostCode\": \"2000\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"enabled\": 1,\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n }\n}''')\nbody = json.dumps(payload).encode(\"utf-8\")\nheaders[\"Content-Type\"] = \"application/json\"\n\nrequest = urllib.request.Request(url, data=body, headers=headers, method=\"POST\")\nwith urllib.request.urlopen(request, timeout=30) as response:\n print(response.read().decode(\"utf-8\"))\n"},{"label":"Subscription from a template","lang":"Python","source":"import json\nimport os\nimport urllib.parse\nimport urllib.request\n\nbase_url = os.environ[\"BASE_URL\"].rstrip(\"/\")\nurl = base_url + \"/api/v2/subscription/create\"\nheaders = {\"Accept\": \"application/json\"}\nheaders[\"Authorization\"] = \"Bearer \" + os.environ[\"ACCESS_TOKEN\"]\npayload = json.loads(r'''{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"template_id\": \"TPL62038591\",\n \"start_date\": \"2030-01-10\"\n }\n}''')\nbody = json.dumps(payload).encode(\"utf-8\")\nheaders[\"Content-Type\"] = \"application/json\"\n\nrequest = urllib.request.Request(url, data=body, headers=headers, method=\"POST\")\nwith urllib.request.urlopen(request, timeout=30) as response:\n print(response.read().decode(\"utf-8\"))\n"},{"label":"Initial By agreement schedule","lang":"Python","source":"import json\nimport os\nimport urllib.parse\nimport urllib.request\n\nbase_url = os.environ[\"BASE_URL\"].rstrip(\"/\")\nurl = base_url + \"/api/v2/subscription/create\"\nheaders = {\"Accept\": \"application/json\"}\nheaders[\"Authorization\"] = \"Bearer \" + os.environ[\"ACCESS_TOKEN\"]\npayload = json.loads(r'''{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"schedule\": {\n \"type\": 6,\n \"schedule_name\": \"First usage charge\",\n \"amount\": \"10.00\",\n \"start_date\": \"2030-01-15\"\n }\n }\n}''')\nbody = json.dumps(payload).encode(\"utf-8\")\nheaders[\"Content-Type\"] = \"application/json\"\n\nrequest = urllib.request.Request(url, data=body, headers=headers, method=\"POST\")\nwith urllib.request.urlopen(request, timeout=30) as response:\n print(response.read().decode(\"utf-8\"))\n"},{"label":"Custom frequency: every ten days","lang":"Python","source":"import json\nimport os\nimport urllib.parse\nimport urllib.request\n\nbase_url = os.environ[\"BASE_URL\"].rstrip(\"/\")\nurl = base_url + \"/api/v2/subscription/create\"\nheaders = {\"Accept\": \"application/json\"}\nheaders[\"Authorization\"] = \"Bearer \" + os.environ[\"ACCESS_TOKEN\"]\npayload = json.loads(r'''{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Every ten days\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Ten-day membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=DAILY;INTERVAL=10\",\n \"process_type\": 12,\n \"custom_cycle_type\": 1,\n \"custom_cycle\": 10\n }\n }\n}''')\nbody = json.dumps(payload).encode(\"utf-8\")\nheaders[\"Content-Type\"] = \"application/json\"\n\nrequest = urllib.request.Request(url, data=body, headers=headers, method=\"POST\")\nwith urllib.request.urlopen(request, timeout=30) as response:\n print(response.read().decode(\"utf-8\"))\n"},{"label":"Quarterly frequency with a first debit anchor","lang":"Python","source":"import json\nimport os\nimport urllib.parse\nimport urllib.request\n\nbase_url = os.environ[\"BASE_URL\"].rstrip(\"/\")\nurl = base_url + \"/api/v2/subscription/create\"\nheaders = {\"Accept\": \"application/json\"}\nheaders[\"Authorization\"] = \"Bearer \" + os.environ[\"ACCESS_TOKEN\"]\npayload = json.loads(r'''{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Quarterly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Quarterly membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=3;BYMONTHDAY=15\",\n \"day_of_debit_dtstart\": \"2030-02-15\"\n }\n }\n}''')\nbody = json.dumps(payload).encode(\"utf-8\")\nheaders[\"Content-Type\"] = \"application/json\"\n\nrequest = urllib.request.Request(url, data=body, headers=headers, method=\"POST\")\nwith urllib.request.urlopen(request, timeout=30) as response:\n print(response.read().decode(\"utf-8\"))\n"},{"label":"Manually defined recurring subscription","lang":"JavaScript","source":"const env = (name) => {\n const value = process.env[name];\n if (!value) throw new Error(`Missing environment variable: ${name}`);\n return value;\n};\nconst baseUrl = env(\"BASE_URL\").replace(/\\/+$/, \"\");\nconst url = new URL(baseUrl + \"/api/v2/subscription/create\");\nconst headers = { Accept: \"application/json\" };\nheaders.Authorization = `Bearer ${env(\"ACCESS_TOKEN\")}`;\nconst payload = {\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Monthly fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=15\"\n },\n \"surcharge_config\": []\n },\n \"notify_email\": false,\n \"notify_sms\": false\n};\nconst body = JSON.stringify(payload);\nheaders[\"Content-Type\"] = \"application/json\";\n\nconst response = await fetch(url, {\n method: \"POST\",\n headers,\n body,\n signal: AbortSignal.timeout(30_000),\n});\nconsole.log(await response.text());\n"},{"label":"New customer with a one-off subscription","lang":"JavaScript","source":"const env = (name) => {\n const value = process.env[name];\n if (!value) throw new Error(`Missing environment variable: ${name}`);\n return value;\n};\nconst baseUrl = env(\"BASE_URL\").replace(/\\/+$/, \"\");\nconst url = new URL(baseUrl + \"/api/v2/subscription/create\");\nconst headers = { Accept: \"application/json\" };\nheaders.Authorization = `Bearer ${env(\"ACCESS_TOKEN\")}`;\nconst payload = {\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"firstName\": \"Emily\",\n \"lastName\": \"Carter\",\n \"emailAddress\": \"[email protected]\",\n \"mobilePhoneNumber\": \"0491570006\",\n \"addressLine1\": \"18 Paperbark Avenue\",\n \"addressSuburb\": \"Sydney\",\n \"addressState\": \"NSW\",\n \"addressPostCode\": \"2000\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"enabled\": 1,\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n }\n};\nconst body = JSON.stringify(payload);\nheaders[\"Content-Type\"] = \"application/json\";\n\nconst response = await fetch(url, {\n method: \"POST\",\n headers,\n body,\n signal: AbortSignal.timeout(30_000),\n});\nconsole.log(await response.text());\n"},{"label":"Subscription from a template","lang":"JavaScript","source":"const env = (name) => {\n const value = process.env[name];\n if (!value) throw new Error(`Missing environment variable: ${name}`);\n return value;\n};\nconst baseUrl = env(\"BASE_URL\").replace(/\\/+$/, \"\");\nconst url = new URL(baseUrl + \"/api/v2/subscription/create\");\nconst headers = { Accept: \"application/json\" };\nheaders.Authorization = `Bearer ${env(\"ACCESS_TOKEN\")}`;\nconst payload = {\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"template_id\": \"TPL62038591\",\n \"start_date\": \"2030-01-10\"\n }\n};\nconst body = JSON.stringify(payload);\nheaders[\"Content-Type\"] = \"application/json\";\n\nconst response = await fetch(url, {\n method: \"POST\",\n headers,\n body,\n signal: AbortSignal.timeout(30_000),\n});\nconsole.log(await response.text());\n"},{"label":"Initial By agreement schedule","lang":"JavaScript","source":"const env = (name) => {\n const value = process.env[name];\n if (!value) throw new Error(`Missing environment variable: ${name}`);\n return value;\n};\nconst baseUrl = env(\"BASE_URL\").replace(/\\/+$/, \"\");\nconst url = new URL(baseUrl + \"/api/v2/subscription/create\");\nconst headers = { Accept: \"application/json\" };\nheaders.Authorization = `Bearer ${env(\"ACCESS_TOKEN\")}`;\nconst payload = {\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"schedule\": {\n \"type\": 6,\n \"schedule_name\": \"First usage charge\",\n \"amount\": \"10.00\",\n \"start_date\": \"2030-01-15\"\n }\n }\n};\nconst body = JSON.stringify(payload);\nheaders[\"Content-Type\"] = \"application/json\";\n\nconst response = await fetch(url, {\n method: \"POST\",\n headers,\n body,\n signal: AbortSignal.timeout(30_000),\n});\nconsole.log(await response.text());\n"},{"label":"Custom frequency: every ten days","lang":"JavaScript","source":"const env = (name) => {\n const value = process.env[name];\n if (!value) throw new Error(`Missing environment variable: ${name}`);\n return value;\n};\nconst baseUrl = env(\"BASE_URL\").replace(/\\/+$/, \"\");\nconst url = new URL(baseUrl + \"/api/v2/subscription/create\");\nconst headers = { Accept: \"application/json\" };\nheaders.Authorization = `Bearer ${env(\"ACCESS_TOKEN\")}`;\nconst payload = {\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Every ten days\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Ten-day membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=DAILY;INTERVAL=10\",\n \"process_type\": 12,\n \"custom_cycle_type\": 1,\n \"custom_cycle\": 10\n }\n }\n};\nconst body = JSON.stringify(payload);\nheaders[\"Content-Type\"] = \"application/json\";\n\nconst response = await fetch(url, {\n method: \"POST\",\n headers,\n body,\n signal: AbortSignal.timeout(30_000),\n});\nconsole.log(await response.text());\n"},{"label":"Quarterly frequency with a first debit anchor","lang":"JavaScript","source":"const env = (name) => {\n const value = process.env[name];\n if (!value) throw new Error(`Missing environment variable: ${name}`);\n return value;\n};\nconst baseUrl = env(\"BASE_URL\").replace(/\\/+$/, \"\");\nconst url = new URL(baseUrl + \"/api/v2/subscription/create\");\nconst headers = { Accept: \"application/json\" };\nheaders.Authorization = `Bearer ${env(\"ACCESS_TOKEN\")}`;\nconst payload = {\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Quarterly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Quarterly membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=3;BYMONTHDAY=15\",\n \"day_of_debit_dtstart\": \"2030-02-15\"\n }\n }\n};\nconst body = JSON.stringify(payload);\nheaders[\"Content-Type\"] = \"application/json\";\n\nconst response = await fetch(url, {\n method: \"POST\",\n headers,\n body,\n signal: AbortSignal.timeout(30_000),\n});\nconsole.log(await response.text());\n"},{"label":"Manually defined recurring subscription","lang":"PHP","source":"\u003c?php\n$env = static function (string $name): string {\n $value = getenv($name);\n if ($value === false || $value === '') {\n throw new RuntimeException(\"Missing environment variable: \" . $name);\n }\n return $value;\n};\n$baseUrl = rtrim($env('BASE_URL'), '/');\n$url = $baseUrl . \"/api/v2/subscription/create\";\n$headers = ['Accept: application/json'];\n$headers[] = 'Authorization: Bearer ' . $env('ACCESS_TOKEN');\n$body = \u003c\u003c\u003c'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Monthly fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=15\"\n },\n \"surcharge_config\": []\n },\n \"notify_email\": false,\n \"notify_sms\": false\n}\nJSON;\n$headers[] = 'Content-Type: application/json';\n\n$curl = curl_init($url);\ncurl_setopt_array($curl, [\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_POSTFIELDS => $body,\n]);\n$response = curl_exec($curl);\nif ($response === false) {\n $error = curl_error($curl);\n curl_close($curl);\n throw new RuntimeException($error);\n}\ncurl_close($curl);\necho $response, PHP_EOL;\n"},{"label":"New customer with a one-off subscription","lang":"PHP","source":"\u003c?php\n$env = static function (string $name): string {\n $value = getenv($name);\n if ($value === false || $value === '') {\n throw new RuntimeException(\"Missing environment variable: \" . $name);\n }\n return $value;\n};\n$baseUrl = rtrim($env('BASE_URL'), '/');\n$url = $baseUrl . \"/api/v2/subscription/create\";\n$headers = ['Accept: application/json'];\n$headers[] = 'Authorization: Bearer ' . $env('ACCESS_TOKEN');\n$body = \u003c\u003c\u003c'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"firstName\": \"Emily\",\n \"lastName\": \"Carter\",\n \"emailAddress\": \"[email protected]\",\n \"mobilePhoneNumber\": \"0491570006\",\n \"addressLine1\": \"18 Paperbark Avenue\",\n \"addressSuburb\": \"Sydney\",\n \"addressState\": \"NSW\",\n \"addressPostCode\": \"2000\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"enabled\": 1,\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n }\n}\nJSON;\n$headers[] = 'Content-Type: application/json';\n\n$curl = curl_init($url);\ncurl_setopt_array($curl, [\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_POSTFIELDS => $body,\n]);\n$response = curl_exec($curl);\nif ($response === false) {\n $error = curl_error($curl);\n curl_close($curl);\n throw new RuntimeException($error);\n}\ncurl_close($curl);\necho $response, PHP_EOL;\n"},{"label":"Subscription from a template","lang":"PHP","source":"\u003c?php\n$env = static function (string $name): string {\n $value = getenv($name);\n if ($value === false || $value === '') {\n throw new RuntimeException(\"Missing environment variable: \" . $name);\n }\n return $value;\n};\n$baseUrl = rtrim($env('BASE_URL'), '/');\n$url = $baseUrl . \"/api/v2/subscription/create\";\n$headers = ['Accept: application/json'];\n$headers[] = 'Authorization: Bearer ' . $env('ACCESS_TOKEN');\n$body = \u003c\u003c\u003c'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"template_id\": \"TPL62038591\",\n \"start_date\": \"2030-01-10\"\n }\n}\nJSON;\n$headers[] = 'Content-Type: application/json';\n\n$curl = curl_init($url);\ncurl_setopt_array($curl, [\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_POSTFIELDS => $body,\n]);\n$response = curl_exec($curl);\nif ($response === false) {\n $error = curl_error($curl);\n curl_close($curl);\n throw new RuntimeException($error);\n}\ncurl_close($curl);\necho $response, PHP_EOL;\n"},{"label":"Initial By agreement schedule","lang":"PHP","source":"\u003c?php\n$env = static function (string $name): string {\n $value = getenv($name);\n if ($value === false || $value === '') {\n throw new RuntimeException(\"Missing environment variable: \" . $name);\n }\n return $value;\n};\n$baseUrl = rtrim($env('BASE_URL'), '/');\n$url = $baseUrl . \"/api/v2/subscription/create\";\n$headers = ['Accept: application/json'];\n$headers[] = 'Authorization: Bearer ' . $env('ACCESS_TOKEN');\n$body = \u003c\u003c\u003c'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"schedule\": {\n \"type\": 6,\n \"schedule_name\": \"First usage charge\",\n \"amount\": \"10.00\",\n \"start_date\": \"2030-01-15\"\n }\n }\n}\nJSON;\n$headers[] = 'Content-Type: application/json';\n\n$curl = curl_init($url);\ncurl_setopt_array($curl, [\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_POSTFIELDS => $body,\n]);\n$response = curl_exec($curl);\nif ($response === false) {\n $error = curl_error($curl);\n curl_close($curl);\n throw new RuntimeException($error);\n}\ncurl_close($curl);\necho $response, PHP_EOL;\n"},{"label":"Custom frequency: every ten days","lang":"PHP","source":"\u003c?php\n$env = static function (string $name): string {\n $value = getenv($name);\n if ($value === false || $value === '') {\n throw new RuntimeException(\"Missing environment variable: \" . $name);\n }\n return $value;\n};\n$baseUrl = rtrim($env('BASE_URL'), '/');\n$url = $baseUrl . \"/api/v2/subscription/create\";\n$headers = ['Accept: application/json'];\n$headers[] = 'Authorization: Bearer ' . $env('ACCESS_TOKEN');\n$body = \u003c\u003c\u003c'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Every ten days\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Ten-day membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=DAILY;INTERVAL=10\",\n \"process_type\": 12,\n \"custom_cycle_type\": 1,\n \"custom_cycle\": 10\n }\n }\n}\nJSON;\n$headers[] = 'Content-Type: application/json';\n\n$curl = curl_init($url);\ncurl_setopt_array($curl, [\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_POSTFIELDS => $body,\n]);\n$response = curl_exec($curl);\nif ($response === false) {\n $error = curl_error($curl);\n curl_close($curl);\n throw new RuntimeException($error);\n}\ncurl_close($curl);\necho $response, PHP_EOL;\n"},{"label":"Quarterly frequency with a first debit anchor","lang":"PHP","source":"\u003c?php\n$env = static function (string $name): string {\n $value = getenv($name);\n if ($value === false || $value === '') {\n throw new RuntimeException(\"Missing environment variable: \" . $name);\n }\n return $value;\n};\n$baseUrl = rtrim($env('BASE_URL'), '/');\n$url = $baseUrl . \"/api/v2/subscription/create\";\n$headers = ['Accept: application/json'];\n$headers[] = 'Authorization: Bearer ' . $env('ACCESS_TOKEN');\n$body = \u003c\u003c\u003c'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Quarterly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Quarterly membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=3;BYMONTHDAY=15\",\n \"day_of_debit_dtstart\": \"2030-02-15\"\n }\n }\n}\nJSON;\n$headers[] = 'Content-Type: application/json';\n\n$curl = curl_init($url);\ncurl_setopt_array($curl, [\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_POSTFIELDS => $body,\n]);\n$response = curl_exec($curl);\nif ($response === false) {\n $error = curl_error($curl);\n curl_close($curl);\n throw new RuntimeException($error);\n}\ncurl_close($curl);\necho $response, PHP_EOL;\n"},{"label":"Manually defined recurring subscription","lang":"Go","source":"package main\n\nimport (\n \"fmt\"\n \"io\"\n \"net/http\"\n \"os\"\n \"strings\"\n \"time\"\n)\n\nfunc mustEnv(name string) string {\n value := os.Getenv(name)\n if value == \"\" { panic(\"Missing environment variable: \" + name) }\n return value\n}\n\nfunc main() {\n baseURL := strings.TrimRight(mustEnv(\"BASE_URL\"), \"/\")\n endpoint := baseURL + \"/api/v2/subscription/create\"\n payload := `{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Monthly fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=15\"\n },\n \"surcharge_config\": []\n },\n \"notify_email\": false,\n \"notify_sms\": false\n}`\n body := strings.NewReader(payload)\n req, err := http.NewRequest(\"POST\", endpoint, body)\n if err != nil { panic(err) }\n req.Header.Set(\"Accept\", \"application/json\")\n req.Header.Set(\"Authorization\", \"Bearer \" + mustEnv(\"ACCESS_TOKEN\"))\n req.Header.Set(\"Content-Type\", \"application/json\")\n client := \u0026http.Client{Timeout: 30 * time.Second}\n response, err := client.Do(req)\n if err != nil { panic(err) }\n defer response.Body.Close()\n result, err := io.ReadAll(response.Body)\n if err != nil { panic(err) }\n fmt.Println(string(result))\n}\n"},{"label":"New customer with a one-off subscription","lang":"Go","source":"package main\n\nimport (\n \"fmt\"\n \"io\"\n \"net/http\"\n \"os\"\n \"strings\"\n \"time\"\n)\n\nfunc mustEnv(name string) string {\n value := os.Getenv(name)\n if value == \"\" { panic(\"Missing environment variable: \" + name) }\n return value\n}\n\nfunc main() {\n baseURL := strings.TrimRight(mustEnv(\"BASE_URL\"), \"/\")\n endpoint := baseURL + \"/api/v2/subscription/create\"\n payload := `{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"firstName\": \"Emily\",\n \"lastName\": \"Carter\",\n \"emailAddress\": \"[email protected]\",\n \"mobilePhoneNumber\": \"0491570006\",\n \"addressLine1\": \"18 Paperbark Avenue\",\n \"addressSuburb\": \"Sydney\",\n \"addressState\": \"NSW\",\n \"addressPostCode\": \"2000\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"enabled\": 1,\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n }\n}`\n body := strings.NewReader(payload)\n req, err := http.NewRequest(\"POST\", endpoint, body)\n if err != nil { panic(err) }\n req.Header.Set(\"Accept\", \"application/json\")\n req.Header.Set(\"Authorization\", \"Bearer \" + mustEnv(\"ACCESS_TOKEN\"))\n req.Header.Set(\"Content-Type\", \"application/json\")\n client := \u0026http.Client{Timeout: 30 * time.Second}\n response, err := client.Do(req)\n if err != nil { panic(err) }\n defer response.Body.Close()\n result, err := io.ReadAll(response.Body)\n if err != nil { panic(err) }\n fmt.Println(string(result))\n}\n"},{"label":"Subscription from a template","lang":"Go","source":"package main\n\nimport (\n \"fmt\"\n \"io\"\n \"net/http\"\n \"os\"\n \"strings\"\n \"time\"\n)\n\nfunc mustEnv(name string) string {\n value := os.Getenv(name)\n if value == \"\" { panic(\"Missing environment variable: \" + name) }\n return value\n}\n\nfunc main() {\n baseURL := strings.TrimRight(mustEnv(\"BASE_URL\"), \"/\")\n endpoint := baseURL + \"/api/v2/subscription/create\"\n payload := `{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"template_id\": \"TPL62038591\",\n \"start_date\": \"2030-01-10\"\n }\n}`\n body := strings.NewReader(payload)\n req, err := http.NewRequest(\"POST\", endpoint, body)\n if err != nil { panic(err) }\n req.Header.Set(\"Accept\", \"application/json\")\n req.Header.Set(\"Authorization\", \"Bearer \" + mustEnv(\"ACCESS_TOKEN\"))\n req.Header.Set(\"Content-Type\", \"application/json\")\n client := \u0026http.Client{Timeout: 30 * time.Second}\n response, err := client.Do(req)\n if err != nil { panic(err) }\n defer response.Body.Close()\n result, err := io.ReadAll(response.Body)\n if err != nil { panic(err) }\n fmt.Println(string(result))\n}\n"},{"label":"Initial By agreement schedule","lang":"Go","source":"package main\n\nimport (\n \"fmt\"\n \"io\"\n \"net/http\"\n \"os\"\n \"strings\"\n \"time\"\n)\n\nfunc mustEnv(name string) string {\n value := os.Getenv(name)\n if value == \"\" { panic(\"Missing environment variable: \" + name) }\n return value\n}\n\nfunc main() {\n baseURL := strings.TrimRight(mustEnv(\"BASE_URL\"), \"/\")\n endpoint := baseURL + \"/api/v2/subscription/create\"\n payload := `{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"schedule\": {\n \"type\": 6,\n \"schedule_name\": \"First usage charge\",\n \"amount\": \"10.00\",\n \"start_date\": \"2030-01-15\"\n }\n }\n}`\n body := strings.NewReader(payload)\n req, err := http.NewRequest(\"POST\", endpoint, body)\n if err != nil { panic(err) }\n req.Header.Set(\"Accept\", \"application/json\")\n req.Header.Set(\"Authorization\", \"Bearer \" + mustEnv(\"ACCESS_TOKEN\"))\n req.Header.Set(\"Content-Type\", \"application/json\")\n client := \u0026http.Client{Timeout: 30 * time.Second}\n response, err := client.Do(req)\n if err != nil { panic(err) }\n defer response.Body.Close()\n result, err := io.ReadAll(response.Body)\n if err != nil { panic(err) }\n fmt.Println(string(result))\n}\n"},{"label":"Custom frequency: every ten days","lang":"Go","source":"package main\n\nimport (\n \"fmt\"\n \"io\"\n \"net/http\"\n \"os\"\n \"strings\"\n \"time\"\n)\n\nfunc mustEnv(name string) string {\n value := os.Getenv(name)\n if value == \"\" { panic(\"Missing environment variable: \" + name) }\n return value\n}\n\nfunc main() {\n baseURL := strings.TrimRight(mustEnv(\"BASE_URL\"), \"/\")\n endpoint := baseURL + \"/api/v2/subscription/create\"\n payload := `{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Every ten days\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Ten-day membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=DAILY;INTERVAL=10\",\n \"process_type\": 12,\n \"custom_cycle_type\": 1,\n \"custom_cycle\": 10\n }\n }\n}`\n body := strings.NewReader(payload)\n req, err := http.NewRequest(\"POST\", endpoint, body)\n if err != nil { panic(err) }\n req.Header.Set(\"Accept\", \"application/json\")\n req.Header.Set(\"Authorization\", \"Bearer \" + mustEnv(\"ACCESS_TOKEN\"))\n req.Header.Set(\"Content-Type\", \"application/json\")\n client := \u0026http.Client{Timeout: 30 * time.Second}\n response, err := client.Do(req)\n if err != nil { panic(err) }\n defer response.Body.Close()\n result, err := io.ReadAll(response.Body)\n if err != nil { panic(err) }\n fmt.Println(string(result))\n}\n"},{"label":"Quarterly frequency with a first debit anchor","lang":"Go","source":"package main\n\nimport (\n \"fmt\"\n \"io\"\n \"net/http\"\n \"os\"\n \"strings\"\n \"time\"\n)\n\nfunc mustEnv(name string) string {\n value := os.Getenv(name)\n if value == \"\" { panic(\"Missing environment variable: \" + name) }\n return value\n}\n\nfunc main() {\n baseURL := strings.TrimRight(mustEnv(\"BASE_URL\"), \"/\")\n endpoint := baseURL + \"/api/v2/subscription/create\"\n payload := `{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Quarterly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Quarterly membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=3;BYMONTHDAY=15\",\n \"day_of_debit_dtstart\": \"2030-02-15\"\n }\n }\n}`\n body := strings.NewReader(payload)\n req, err := http.NewRequest(\"POST\", endpoint, body)\n if err != nil { panic(err) }\n req.Header.Set(\"Accept\", \"application/json\")\n req.Header.Set(\"Authorization\", \"Bearer \" + mustEnv(\"ACCESS_TOKEN\"))\n req.Header.Set(\"Content-Type\", \"application/json\")\n client := \u0026http.Client{Timeout: 30 * time.Second}\n response, err := client.Do(req)\n if err != nil { panic(err) }\n defer response.Body.Close()\n result, err := io.ReadAll(response.Body)\n if err != nil { panic(err) }\n fmt.Println(string(result))\n}\n"},{"label":"Manually defined recurring subscription","lang":"Java","source":"import java.io.ByteArrayOutputStream;\nimport java.net.URI;\nimport java.net.URLEncoder;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.time.Duration;\nimport java.util.LinkedHashMap;\nimport java.util.Map;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\n\npublic class Example {\n static String requireEnv(String name) {\n String value = System.getenv(name);\n if (value == null || value.isEmpty()) {\n throw new IllegalArgumentException(\"Missing environment variable: \" + name);\n }\n return value;\n }\n\n public static void main(String[] args) throws Exception {\n String baseUrl = requireEnv(\"BASE_URL\").replaceAll(\"/+$\", \"\");\n String endpoint = baseUrl + \"/api/v2/subscription/create\";\n String payload =\n \"{\\n\" +\n \" \\\"merchant_id\\\": \\\"48290713\\\",\\n\" +\n \" \\\"customer\\\": {\\n\" +\n \" \\\"customer_id\\\": \\\"CUS48290713\\\"\\n\" +\n \" },\\n\" +\n \" \\\"plan\\\": {\\n\" +\n \" \\\"plan_name\\\": \\\"Monthly membership\\\",\\n\" +\n \" \\\"recurring\\\": {\\n\" +\n \" \\\"enabled\\\": 1,\\n\" +\n \" \\\"schedule_name\\\": \\\"Monthly fee\\\",\\n\" +\n \" \\\"recurring_type\\\": 3,\\n\" +\n \" \\\"amount\\\": \\\"25.50\\\",\\n\" +\n \" \\\"start_date\\\": \\\"2030-01-10\\\",\\n\" +\n \" \\\"day_of_debit\\\": \\\"FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=15\\\"\\n\" +\n \" },\\n\" +\n \" \\\"surcharge_config\\\": []\\n\" +\n \" },\\n\" +\n \" \\\"notify_email\\\": false,\\n\" +\n \" \\\"notify_sms\\\": false\\n\" +\n \"}\";\n HttpRequest.Builder builder = HttpRequest.newBuilder(URI.create(endpoint))\n .timeout(Duration.ofSeconds(30))\n .header(\"Accept\", \"application/json\");\n builder.header(\"Authorization\", \"Bearer \" + requireEnv(\"ACCESS_TOKEN\"));\n builder.header(\"Content-Type\", \"application/json\");\n HttpRequest request = builder.method(\"POST\", HttpRequest.BodyPublishers.ofString(payload, StandardCharsets.UTF_8)).build();\n HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(30)).build();\n HttpResponse\u003cString> response = client.send(request,\n HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));\n System.out.println(response.body());\n }\n}\n"},{"label":"New customer with a one-off subscription","lang":"Java","source":"import java.io.ByteArrayOutputStream;\nimport java.net.URI;\nimport java.net.URLEncoder;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.time.Duration;\nimport java.util.LinkedHashMap;\nimport java.util.Map;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\n\npublic class Example {\n static String requireEnv(String name) {\n String value = System.getenv(name);\n if (value == null || value.isEmpty()) {\n throw new IllegalArgumentException(\"Missing environment variable: \" + name);\n }\n return value;\n }\n\n public static void main(String[] args) throws Exception {\n String baseUrl = requireEnv(\"BASE_URL\").replaceAll(\"/+$\", \"\");\n String endpoint = baseUrl + \"/api/v2/subscription/create\";\n String payload =\n \"{\\n\" +\n \" \\\"merchant_id\\\": \\\"48290713\\\",\\n\" +\n \" \\\"customer\\\": {\\n\" +\n \" \\\"firstName\\\": \\\"Emily\\\",\\n\" +\n \" \\\"lastName\\\": \\\"Carter\\\",\\n\" +\n \" \\\"emailAddress\\\": \\\"[email protected]\\\",\\n\" +\n \" \\\"mobilePhoneNumber\\\": \\\"0491570006\\\",\\n\" +\n \" \\\"addressLine1\\\": \\\"18 Paperbark Avenue\\\",\\n\" +\n \" \\\"addressSuburb\\\": \\\"Sydney\\\",\\n\" +\n \" \\\"addressState\\\": \\\"NSW\\\",\\n\" +\n \" \\\"addressPostCode\\\": \\\"2000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"plan\\\": {\\n\" +\n \" \\\"plan_name\\\": \\\"One time fee\\\",\\n\" +\n \" \\\"one_off\\\": {\\n\" +\n \" \\\"enabled\\\": 1,\\n\" +\n \" \\\"schedule_name\\\": \\\"Initial fee\\\",\\n\" +\n \" \\\"amount\\\": \\\"20.00\\\",\\n\" +\n \" \\\"payment_date\\\": \\\"2030-01-15\\\"\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \"}\";\n HttpRequest.Builder builder = HttpRequest.newBuilder(URI.create(endpoint))\n .timeout(Duration.ofSeconds(30))\n .header(\"Accept\", \"application/json\");\n builder.header(\"Authorization\", \"Bearer \" + requireEnv(\"ACCESS_TOKEN\"));\n builder.header(\"Content-Type\", \"application/json\");\n HttpRequest request = builder.method(\"POST\", HttpRequest.BodyPublishers.ofString(payload, StandardCharsets.UTF_8)).build();\n HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(30)).build();\n HttpResponse\u003cString> response = client.send(request,\n HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));\n System.out.println(response.body());\n }\n}\n"},{"label":"Subscription from a template","lang":"Java","source":"import java.io.ByteArrayOutputStream;\nimport java.net.URI;\nimport java.net.URLEncoder;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.time.Duration;\nimport java.util.LinkedHashMap;\nimport java.util.Map;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\n\npublic class Example {\n static String requireEnv(String name) {\n String value = System.getenv(name);\n if (value == null || value.isEmpty()) {\n throw new IllegalArgumentException(\"Missing environment variable: \" + name);\n }\n return value;\n }\n\n public static void main(String[] args) throws Exception {\n String baseUrl = requireEnv(\"BASE_URL\").replaceAll(\"/+$\", \"\");\n String endpoint = baseUrl + \"/api/v2/subscription/create\";\n String payload =\n \"{\\n\" +\n \" \\\"merchant_id\\\": \\\"48290713\\\",\\n\" +\n \" \\\"customer\\\": {\\n\" +\n \" \\\"customer_id\\\": \\\"CUS48290713\\\"\\n\" +\n \" },\\n\" +\n \" \\\"plan\\\": {\\n\" +\n \" \\\"template_id\\\": \\\"TPL62038591\\\",\\n\" +\n \" \\\"start_date\\\": \\\"2030-01-10\\\"\\n\" +\n \" }\\n\" +\n \"}\";\n HttpRequest.Builder builder = HttpRequest.newBuilder(URI.create(endpoint))\n .timeout(Duration.ofSeconds(30))\n .header(\"Accept\", \"application/json\");\n builder.header(\"Authorization\", \"Bearer \" + requireEnv(\"ACCESS_TOKEN\"));\n builder.header(\"Content-Type\", \"application/json\");\n HttpRequest request = builder.method(\"POST\", HttpRequest.BodyPublishers.ofString(payload, StandardCharsets.UTF_8)).build();\n HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(30)).build();\n HttpResponse\u003cString> response = client.send(request,\n HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));\n System.out.println(response.body());\n }\n}\n"},{"label":"Initial By agreement schedule","lang":"Java","source":"import java.io.ByteArrayOutputStream;\nimport java.net.URI;\nimport java.net.URLEncoder;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.time.Duration;\nimport java.util.LinkedHashMap;\nimport java.util.Map;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\n\npublic class Example {\n static String requireEnv(String name) {\n String value = System.getenv(name);\n if (value == null || value.isEmpty()) {\n throw new IllegalArgumentException(\"Missing environment variable: \" + name);\n }\n return value;\n }\n\n public static void main(String[] args) throws Exception {\n String baseUrl = requireEnv(\"BASE_URL\").replaceAll(\"/+$\", \"\");\n String endpoint = baseUrl + \"/api/v2/subscription/create\";\n String payload =\n \"{\\n\" +\n \" \\\"merchant_id\\\": \\\"48290713\\\",\\n\" +\n \" \\\"customer\\\": {\\n\" +\n \" \\\"customer_id\\\": \\\"CUS48290713\\\"\\n\" +\n \" },\\n\" +\n \" \\\"plan\\\": {\\n\" +\n \" \\\"plan_name\\\": \\\"Usage based DDR\\\",\\n\" +\n \" \\\"schedule\\\": {\\n\" +\n \" \\\"type\\\": 6,\\n\" +\n \" \\\"schedule_name\\\": \\\"First usage charge\\\",\\n\" +\n \" \\\"amount\\\": \\\"10.00\\\",\\n\" +\n \" \\\"start_date\\\": \\\"2030-01-15\\\"\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \"}\";\n HttpRequest.Builder builder = HttpRequest.newBuilder(URI.create(endpoint))\n .timeout(Duration.ofSeconds(30))\n .header(\"Accept\", \"application/json\");\n builder.header(\"Authorization\", \"Bearer \" + requireEnv(\"ACCESS_TOKEN\"));\n builder.header(\"Content-Type\", \"application/json\");\n HttpRequest request = builder.method(\"POST\", HttpRequest.BodyPublishers.ofString(payload, StandardCharsets.UTF_8)).build();\n HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(30)).build();\n HttpResponse\u003cString> response = client.send(request,\n HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));\n System.out.println(response.body());\n }\n}\n"},{"label":"Custom frequency: every ten days","lang":"Java","source":"import java.io.ByteArrayOutputStream;\nimport java.net.URI;\nimport java.net.URLEncoder;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.time.Duration;\nimport java.util.LinkedHashMap;\nimport java.util.Map;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\n\npublic class Example {\n static String requireEnv(String name) {\n String value = System.getenv(name);\n if (value == null || value.isEmpty()) {\n throw new IllegalArgumentException(\"Missing environment variable: \" + name);\n }\n return value;\n }\n\n public static void main(String[] args) throws Exception {\n String baseUrl = requireEnv(\"BASE_URL\").replaceAll(\"/+$\", \"\");\n String endpoint = baseUrl + \"/api/v2/subscription/create\";\n String payload =\n \"{\\n\" +\n \" \\\"merchant_id\\\": \\\"48290713\\\",\\n\" +\n \" \\\"customer\\\": {\\n\" +\n \" \\\"customer_id\\\": \\\"CUS48290713\\\"\\n\" +\n \" },\\n\" +\n \" \\\"plan\\\": {\\n\" +\n \" \\\"plan_name\\\": \\\"Every ten days\\\",\\n\" +\n \" \\\"recurring\\\": {\\n\" +\n \" \\\"enabled\\\": 1,\\n\" +\n \" \\\"schedule_name\\\": \\\"Ten-day membership fee\\\",\\n\" +\n \" \\\"recurring_type\\\": 3,\\n\" +\n \" \\\"amount\\\": \\\"25.50\\\",\\n\" +\n \" \\\"start_date\\\": \\\"2030-01-10\\\",\\n\" +\n \" \\\"day_of_debit\\\": \\\"FREQ=DAILY;INTERVAL=10\\\",\\n\" +\n \" \\\"process_type\\\": 12,\\n\" +\n \" \\\"custom_cycle_type\\\": 1,\\n\" +\n \" \\\"custom_cycle\\\": 10\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \"}\";\n HttpRequest.Builder builder = HttpRequest.newBuilder(URI.create(endpoint))\n .timeout(Duration.ofSeconds(30))\n .header(\"Accept\", \"application/json\");\n builder.header(\"Authorization\", \"Bearer \" + requireEnv(\"ACCESS_TOKEN\"));\n builder.header(\"Content-Type\", \"application/json\");\n HttpRequest request = builder.method(\"POST\", HttpRequest.BodyPublishers.ofString(payload, StandardCharsets.UTF_8)).build();\n HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(30)).build();\n HttpResponse\u003cString> response = client.send(request,\n HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));\n System.out.println(response.body());\n }\n}\n"},{"label":"Quarterly frequency with a first debit anchor","lang":"Java","source":"import java.io.ByteArrayOutputStream;\nimport java.net.URI;\nimport java.net.URLEncoder;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.time.Duration;\nimport java.util.LinkedHashMap;\nimport java.util.Map;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\n\npublic class Example {\n static String requireEnv(String name) {\n String value = System.getenv(name);\n if (value == null || value.isEmpty()) {\n throw new IllegalArgumentException(\"Missing environment variable: \" + name);\n }\n return value;\n }\n\n public static void main(String[] args) throws Exception {\n String baseUrl = requireEnv(\"BASE_URL\").replaceAll(\"/+$\", \"\");\n String endpoint = baseUrl + \"/api/v2/subscription/create\";\n String payload =\n \"{\\n\" +\n \" \\\"merchant_id\\\": \\\"48290713\\\",\\n\" +\n \" \\\"customer\\\": {\\n\" +\n \" \\\"customer_id\\\": \\\"CUS48290713\\\"\\n\" +\n \" },\\n\" +\n \" \\\"plan\\\": {\\n\" +\n \" \\\"plan_name\\\": \\\"Quarterly membership\\\",\\n\" +\n \" \\\"recurring\\\": {\\n\" +\n \" \\\"enabled\\\": 1,\\n\" +\n \" \\\"schedule_name\\\": \\\"Quarterly membership fee\\\",\\n\" +\n \" \\\"recurring_type\\\": 3,\\n\" +\n \" \\\"amount\\\": \\\"25.50\\\",\\n\" +\n \" \\\"start_date\\\": \\\"2030-01-10\\\",\\n\" +\n \" \\\"day_of_debit\\\": \\\"FREQ=MONTHLY;INTERVAL=3;BYMONTHDAY=15\\\",\\n\" +\n \" \\\"day_of_debit_dtstart\\\": \\\"2030-02-15\\\"\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \"}\";\n HttpRequest.Builder builder = HttpRequest.newBuilder(URI.create(endpoint))\n .timeout(Duration.ofSeconds(30))\n .header(\"Accept\", \"application/json\");\n builder.header(\"Authorization\", \"Bearer \" + requireEnv(\"ACCESS_TOKEN\"));\n builder.header(\"Content-Type\", \"application/json\");\n HttpRequest request = builder.method(\"POST\", HttpRequest.BodyPublishers.ofString(payload, StandardCharsets.UTF_8)).build();\n HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(30)).build();\n HttpResponse\u003cString> response = client.send(request,\n HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));\n System.out.println(response.body());\n }\n}\n"},{"label":"Manually defined recurring subscription","lang":"Ruby","source":"require \"net/http\"\nrequire \"uri\"\n\nbase_url = ENV.fetch(\"BASE_URL\").sub(%r{/+$}, \"\")\nuri = URI(base_url + \"/api/v2/subscription/create\")\nrequest = Net::HTTP::Post.new(uri)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Authorization\"] = \"Bearer \" + ENV.fetch(\"ACCESS_TOKEN\")\nrequest[\"Content-Type\"] = \"application/json\"\nrequest.body = \u003c\u003c~'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Monthly fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=15\"\n },\n \"surcharge_config\": []\n },\n \"notify_email\": false,\n \"notify_sms\": false\n}\nJSON\nhttp = Net::HTTP.new(uri.host, uri.port)\nhttp.use_ssl = uri.scheme == \"https\"\nhttp.open_timeout = 30\nhttp.read_timeout = 30\nputs http.request(request).body\n"},{"label":"New customer with a one-off subscription","lang":"Ruby","source":"require \"net/http\"\nrequire \"uri\"\n\nbase_url = ENV.fetch(\"BASE_URL\").sub(%r{/+$}, \"\")\nuri = URI(base_url + \"/api/v2/subscription/create\")\nrequest = Net::HTTP::Post.new(uri)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Authorization\"] = \"Bearer \" + ENV.fetch(\"ACCESS_TOKEN\")\nrequest[\"Content-Type\"] = \"application/json\"\nrequest.body = \u003c\u003c~'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"firstName\": \"Emily\",\n \"lastName\": \"Carter\",\n \"emailAddress\": \"[email protected]\",\n \"mobilePhoneNumber\": \"0491570006\",\n \"addressLine1\": \"18 Paperbark Avenue\",\n \"addressSuburb\": \"Sydney\",\n \"addressState\": \"NSW\",\n \"addressPostCode\": \"2000\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"enabled\": 1,\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n }\n}\nJSON\nhttp = Net::HTTP.new(uri.host, uri.port)\nhttp.use_ssl = uri.scheme == \"https\"\nhttp.open_timeout = 30\nhttp.read_timeout = 30\nputs http.request(request).body\n"},{"label":"Subscription from a template","lang":"Ruby","source":"require \"net/http\"\nrequire \"uri\"\n\nbase_url = ENV.fetch(\"BASE_URL\").sub(%r{/+$}, \"\")\nuri = URI(base_url + \"/api/v2/subscription/create\")\nrequest = Net::HTTP::Post.new(uri)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Authorization\"] = \"Bearer \" + ENV.fetch(\"ACCESS_TOKEN\")\nrequest[\"Content-Type\"] = \"application/json\"\nrequest.body = \u003c\u003c~'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"template_id\": \"TPL62038591\",\n \"start_date\": \"2030-01-10\"\n }\n}\nJSON\nhttp = Net::HTTP.new(uri.host, uri.port)\nhttp.use_ssl = uri.scheme == \"https\"\nhttp.open_timeout = 30\nhttp.read_timeout = 30\nputs http.request(request).body\n"},{"label":"Initial By agreement schedule","lang":"Ruby","source":"require \"net/http\"\nrequire \"uri\"\n\nbase_url = ENV.fetch(\"BASE_URL\").sub(%r{/+$}, \"\")\nuri = URI(base_url + \"/api/v2/subscription/create\")\nrequest = Net::HTTP::Post.new(uri)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Authorization\"] = \"Bearer \" + ENV.fetch(\"ACCESS_TOKEN\")\nrequest[\"Content-Type\"] = \"application/json\"\nrequest.body = \u003c\u003c~'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"schedule\": {\n \"type\": 6,\n \"schedule_name\": \"First usage charge\",\n \"amount\": \"10.00\",\n \"start_date\": \"2030-01-15\"\n }\n }\n}\nJSON\nhttp = Net::HTTP.new(uri.host, uri.port)\nhttp.use_ssl = uri.scheme == \"https\"\nhttp.open_timeout = 30\nhttp.read_timeout = 30\nputs http.request(request).body\n"},{"label":"Custom frequency: every ten days","lang":"Ruby","source":"require \"net/http\"\nrequire \"uri\"\n\nbase_url = ENV.fetch(\"BASE_URL\").sub(%r{/+$}, \"\")\nuri = URI(base_url + \"/api/v2/subscription/create\")\nrequest = Net::HTTP::Post.new(uri)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Authorization\"] = \"Bearer \" + ENV.fetch(\"ACCESS_TOKEN\")\nrequest[\"Content-Type\"] = \"application/json\"\nrequest.body = \u003c\u003c~'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Every ten days\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Ten-day membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=DAILY;INTERVAL=10\",\n \"process_type\": 12,\n \"custom_cycle_type\": 1,\n \"custom_cycle\": 10\n }\n }\n}\nJSON\nhttp = Net::HTTP.new(uri.host, uri.port)\nhttp.use_ssl = uri.scheme == \"https\"\nhttp.open_timeout = 30\nhttp.read_timeout = 30\nputs http.request(request).body\n"},{"label":"Quarterly frequency with a first debit anchor","lang":"Ruby","source":"require \"net/http\"\nrequire \"uri\"\n\nbase_url = ENV.fetch(\"BASE_URL\").sub(%r{/+$}, \"\")\nuri = URI(base_url + \"/api/v2/subscription/create\")\nrequest = Net::HTTP::Post.new(uri)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Authorization\"] = \"Bearer \" + ENV.fetch(\"ACCESS_TOKEN\")\nrequest[\"Content-Type\"] = \"application/json\"\nrequest.body = \u003c\u003c~'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Quarterly membership\",\n \"recurring\": {\n \"enabled\": 1,\n \"schedule_name\": \"Quarterly membership fee\",\n \"recurring_type\": 3,\n \"amount\": \"25.50\",\n \"start_date\": \"2030-01-10\",\n \"day_of_debit\": \"FREQ=MONTHLY;INTERVAL=3;BYMONTHDAY=15\",\n \"day_of_debit_dtstart\": \"2030-02-15\"\n }\n }\n}\nJSON\nhttp = Net::HTTP.new(uri.host, uri.port)\nhttp.use_ssl = uri.scheme == \"https\"\nhttp.open_timeout = 30\nhttp.read_timeout = 30\nputs http.request(request).body\n"}],"requestExampleLanguages":["bash","python","javascript","php","go","java","ruby"],"requiredOnlyExamples":false,"disableCodeSampleGeneration":true,"requestExampleType":"codeSamples","responseExampleType":"generated","disableProxy":true},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Creates a subscription awaiting activation. Supply either an existing customer reference or new customer details. New customers require firstName, lastName and emailAddress in full. Exactly one subscription definition mode is required: manual, template or By agreement. Manual mode must enable at least one charge segment. plan_name is required outside template mode. The nested customer and plan format is recommended.","properties":{"merchant_id":{"type":"string","description":"Business identifier assigned by BillBuddy.","maxLength":20,"minLength":1,"isRequired":true,"uniqueKey":"merchant_id","typeLabel":"string"},"notify_email":{"oneOf":[{"type":"boolean","description":"Whether to allow email notifications for this transaction or subscription. false prohibits them; true allows them. Omission or null uses the business's API email notification setting, which defaults to off. Actual delivery depends on notification preferences and applicable rules. Also accepts 0/1 and the strings \"0\"/\"1\".","uniqueKey":"notify_email.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Whether to allow email notifications for this transaction or subscription. false prohibits them; true allows them. Omission or null uses the business's API email notification setting, which defaults to off. Actual delivery depends on notification preferences and applicable rules. Also accepts 0/1 and the strings \"0\"/\"1\".","uniqueKey":"notify_email.oneOf.1","typeLabel":"null"},{"type":"integer","description":"Whether to allow email notifications for this transaction or subscription. false prohibits them; true allows them. Omission or null uses the business's API email notification setting, which defaults to off. Actual delivery depends on notification preferences and applicable rules. Also accepts 0/1 and the strings \"0\"/\"1\".","enum":[0,1],"uniqueKey":"notify_email.oneOf.2","typeLabel":"enum\u003cinteger>"},{"type":"string","description":"Whether to allow email notifications for this transaction or subscription. false prohibits them; true allows them. Omission or null uses the business's API email notification setting, which defaults to off. Actual delivery depends on notification preferences and applicable rules. Also accepts 0/1 and the strings \"0\"/\"1\".","enum":["0","1"],"uniqueKey":"notify_email.oneOf.3","typeLabel":"enum\u003cstring>"},{"type":"null","uniqueKey":"notify_email.oneOf.4","typeLabel":"null"}],"uniqueKey":"notify_email","typeLabel":"boolean · null · enum\u003cinteger> · enum\u003cstring> · null"},"notify_sms":{"oneOf":[{"type":"boolean","description":"Whether to allow SMS notifications for this transaction or subscription. false prohibits them; true allows them. Omission or null uses the business's API SMS notification setting, which defaults to off. Actual delivery depends on notification preferences and applicable rules. Also accepts 0/1 and the strings \"0\"/\"1\".","uniqueKey":"notify_sms.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Whether to allow SMS notifications for this transaction or subscription. false prohibits them; true allows them. Omission or null uses the business's API SMS notification setting, which defaults to off. Actual delivery depends on notification preferences and applicable rules. Also accepts 0/1 and the strings \"0\"/\"1\".","uniqueKey":"notify_sms.oneOf.1","typeLabel":"null"},{"type":"integer","description":"Whether to allow SMS notifications for this transaction or subscription. false prohibits them; true allows them. Omission or null uses the business's API SMS notification setting, which defaults to off. Actual delivery depends on notification preferences and applicable rules. Also accepts 0/1 and the strings \"0\"/\"1\".","enum":[0,1],"uniqueKey":"notify_sms.oneOf.2","typeLabel":"enum\u003cinteger>"},{"type":"string","description":"Whether to allow SMS notifications for this transaction or subscription. false prohibits them; true allows them. Omission or null uses the business's API SMS notification setting, which defaults to off. Actual delivery depends on notification preferences and applicable rules. Also accepts 0/1 and the strings \"0\"/\"1\".","enum":["0","1"],"uniqueKey":"notify_sms.oneOf.3","typeLabel":"enum\u003cstring>"},{"type":"null","uniqueKey":"notify_sms.oneOf.4","typeLabel":"null"}],"uniqueKey":"notify_sms","typeLabel":"boolean · null · enum\u003cinteger> · enum\u003cstring> · null"},"customer":{"type":"object","description":"Supply customer_id to reuse a customer, or firstName, lastName and emailAddress to create one. These options are mutually exclusive.","properties":{"customer_id":{"oneOf":[{"type":"string","description":"BillBuddy customer identifier. Must identify a valid customer within the current merchant and business.","maxLength":32,"uniqueKey":"customer.customer_id.oneOf.0","typeLabel":"string"},{"type":"null","description":"BillBuddy customer identifier. Must identify a valid customer within the current merchant and business.","maxLength":32,"uniqueKey":"customer.customer_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"customer.customer_id","typeLabel":"string | null"},"firstName":{"oneOf":[{"type":"string","description":"New customer's first name. Required when creating a new customer.","maxLength":100,"uniqueKey":"customer.firstName.oneOf.0","typeLabel":"string"},{"type":"null","description":"New customer's first name. Required when creating a new customer.","maxLength":100,"uniqueKey":"customer.firstName.oneOf.1","typeLabel":"null"}],"uniqueKey":"customer.firstName","typeLabel":"string | null"},"lastName":{"oneOf":[{"type":"string","description":"New customer's last name. Required when creating a new customer.","maxLength":100,"uniqueKey":"customer.lastName.oneOf.0","typeLabel":"string"},{"type":"null","description":"New customer's last name. Required when creating a new customer.","maxLength":100,"uniqueKey":"customer.lastName.oneOf.1","typeLabel":"null"}],"uniqueKey":"customer.lastName","typeLabel":"string | null"},"emailAddress":{"oneOf":[{"type":"string","description":"New customer's primary email address. Required when creating a new customer. If it already belongs to a customer in the same merchant and business, supply that existing customer_id instead.","format":"email","maxLength":500,"uniqueKey":"customer.emailAddress.oneOf.0","typeLabel":"string\u003cemail>"},{"type":"null","description":"New customer's primary email address. Required when creating a new customer. If it already belongs to a customer in the same merchant and business, supply that existing customer_id instead.","format":"email","maxLength":500,"uniqueKey":"customer.emailAddress.oneOf.1","typeLabel":"null"}],"uniqueKey":"customer.emailAddress","typeLabel":"string\u003cemail> | null"},"mobilePhoneNumber":{"oneOf":[{"type":"string","description":"Customer mobile phone number.","maxLength":20,"uniqueKey":"customer.mobilePhoneNumber.oneOf.0","typeLabel":"string"},{"type":"null","description":"Customer mobile phone number.","maxLength":20,"uniqueKey":"customer.mobilePhoneNumber.oneOf.1","typeLabel":"null"}],"uniqueKey":"customer.mobilePhoneNumber","typeLabel":"string | null"},"addressLine1":{"oneOf":[{"type":"string","description":"Customer address line 1.","maxLength":255,"uniqueKey":"customer.addressLine1.oneOf.0","typeLabel":"string"},{"type":"null","description":"Customer address line 1.","maxLength":255,"uniqueKey":"customer.addressLine1.oneOf.1","typeLabel":"null"}],"uniqueKey":"customer.addressLine1","typeLabel":"string | null"},"addressSuburb":{"oneOf":[{"type":"string","description":"Customer city or suburb.","maxLength":100,"uniqueKey":"customer.addressSuburb.oneOf.0","typeLabel":"string"},{"type":"null","description":"Customer city or suburb.","maxLength":100,"uniqueKey":"customer.addressSuburb.oneOf.1","typeLabel":"null"}],"uniqueKey":"customer.addressSuburb","typeLabel":"string | null"},"addressState":{"oneOf":[{"type":"string","description":"Customer state or province.","maxLength":100,"uniqueKey":"customer.addressState.oneOf.0","typeLabel":"string"},{"type":"null","description":"Customer state or province.","maxLength":100,"uniqueKey":"customer.addressState.oneOf.1","typeLabel":"null"}],"uniqueKey":"customer.addressState","typeLabel":"string | null"},"addressPostCode":{"oneOf":[{"type":"string","description":"Customer postcode.","maxLength":50,"uniqueKey":"customer.addressPostCode.oneOf.0","typeLabel":"string"},{"type":"null","description":"Customer postcode.","maxLength":50,"uniqueKey":"customer.addressPostCode.oneOf.1","typeLabel":"null"}],"uniqueKey":"customer.addressPostCode","typeLabel":"string | null"}},"uniqueKey":"customer","typeLabel":"object"},"plan":{"type":"object","description":"Choose exactly one mode: manual recurring/one_off, template_id, or By agreement schedule.","properties":{"plan_name":{"oneOf":[{"type":"string","description":"Subscription name. In template mode, omission or null inherits the template name. Required and nonempty in other modes.","maxLength":255,"uniqueKey":"plan.plan_name.oneOf.0","typeLabel":"string"},{"type":"null","description":"Subscription name. In template mode, omission or null inherits the template name. Required and nonempty in other modes.","maxLength":255,"uniqueKey":"plan.plan_name.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.plan_name","typeLabel":"string | null"},"description":{"oneOf":[{"type":"string","description":"Description.","maxLength":500,"uniqueKey":"plan.description.oneOf.0","typeLabel":"string"},{"type":"null","description":"Description.","maxLength":500,"uniqueKey":"plan.description.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.description","typeLabel":"string | null"},"recurring":{"oneOf":[{"type":"object","properties":{"enabled":{"oneOf":[{"type":"integer","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":[0,1,null],"uniqueKey":"plan.recurring.oneOf.0.enabled.oneOf.0","typeLabel":"enum\u003cinteger>"},{"type":"null","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":[0,1,null],"uniqueKey":"plan.recurring.oneOf.0.enabled.oneOf.1","typeLabel":"null"},{"type":"boolean","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","uniqueKey":"plan.recurring.oneOf.0.enabled.oneOf.2","typeLabel":"boolean"},{"type":"string","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":["0","1"],"uniqueKey":"plan.recurring.oneOf.0.enabled.oneOf.3","typeLabel":"enum\u003cstring>"},{"type":"null","uniqueKey":"plan.recurring.oneOf.0.enabled.oneOf.4","typeLabel":"null"}],"uniqueKey":"plan.recurring.oneOf.0.enabled","typeLabel":"enum\u003cinteger> · null · boolean · enum\u003cstring> · null"},"schedule_name":{"oneOf":[{"type":"string","description":"Payment schedule name. Required and non-null when recurring.enabled=1 (or true); at most 255 characters.","maxLength":255,"uniqueKey":"plan.recurring.oneOf.0.schedule_name.oneOf.0","typeLabel":"string"},{"type":"null","description":"Payment schedule name. Required and non-null when recurring.enabled=1 (or true); at most 255 characters.","maxLength":255,"uniqueKey":"plan.recurring.oneOf.0.schedule_name.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.recurring.oneOf.0.schedule_name","typeLabel":"string | null"},"recurring_type":{"oneOf":[{"type":"integer","description":"1 after a number of successful payments; 2 at a cumulative amount; 3 until cancelled; 4 on an end date. Type 5 is not allowed here; use plan.schedule for By agreement. Required when recurring.enabled=true.","enum":[1,2,3,4,null],"uniqueKey":"plan.recurring.oneOf.0.recurring_type.oneOf.0","typeLabel":"enum\u003cinteger>"},{"type":"null","description":"1 after a number of successful payments; 2 at a cumulative amount; 3 until cancelled; 4 on an end date. Type 5 is not allowed here; use plan.schedule for By agreement. Required when recurring.enabled=true.","enum":[1,2,3,4,null],"uniqueKey":"plan.recurring.oneOf.0.recurring_type.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.recurring.oneOf.0.recurring_type","typeLabel":"enum\u003cinteger> | null"},"amount":{"oneOf":[{"type":"number","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required when recurring.enabled=true.","multipleOf":0.01,"maximum":9999999.99,"minimum":0.01,"uniqueKey":"plan.recurring.oneOf.0.amount.oneOf.0","typeLabel":"number"},{"type":"null","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required when recurring.enabled=true.","multipleOf":0.01,"maximum":9999999.99,"minimum":0.01,"uniqueKey":"plan.recurring.oneOf.0.amount.oneOf.1","typeLabel":"null"},{"type":"string","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required when recurring.enabled=true.","pattern":"^\\d+(\\.\\d{1,2})?$","uniqueKey":"plan.recurring.oneOf.0.amount.oneOf.2","typeLabel":"string"},{"type":"null","uniqueKey":"plan.recurring.oneOf.0.amount.oneOf.3","typeLabel":"null"}],"uniqueKey":"plan.recurring.oneOf.0.amount","typeLabel":"number · null · string · null"},"start_date":{"oneOf":[{"type":"string","description":"Start date. Required and non-null when recurring.enabled=1 or recurring.enabled=true. YYYY-MM-DD is recommended. Must be no earlier than tomorrow in the service business timezone.","format":"date","uniqueKey":"plan.recurring.oneOf.0.start_date.oneOf.0","typeLabel":"string\u003cdate>"},{"type":"null","description":"Start date. Required and non-null when recurring.enabled=1 or recurring.enabled=true. YYYY-MM-DD is recommended. Must be no earlier than tomorrow in the service business timezone.","format":"date","uniqueKey":"plan.recurring.oneOf.0.start_date.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.recurring.oneOf.0.start_date","typeLabel":"string\u003cdate> | null"},"end_date":{"oneOf":[{"type":"string","description":"End date, preferably YYYY-MM-DD. Required and non-null when the recurring segment is enabled and recurring_type=4. When supplied, cannot precede start_date in the same segment.","format":"date","uniqueKey":"plan.recurring.oneOf.0.end_date.oneOf.0","typeLabel":"string\u003cdate>"},{"type":"null","description":"End date, preferably YYYY-MM-DD. Required and non-null when the recurring segment is enabled and recurring_type=4. When supplied, cannot precede start_date in the same segment.","format":"date","uniqueKey":"plan.recurring.oneOf.0.end_date.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.recurring.oneOf.0.end_date","typeLabel":"string\u003cdate> | null"},"end_terms":{"oneOf":[{"type":"integer","description":"Number of successful payments, an integer of at least 1. Required and non-null when the recurring segment is enabled and recurring_type=1.","minimum":1,"uniqueKey":"plan.recurring.oneOf.0.end_terms.oneOf.0","typeLabel":"integer"},{"type":"null","description":"Number of successful payments, an integer of at least 1. Required and non-null when the recurring segment is enabled and recurring_type=1.","minimum":1,"uniqueKey":"plan.recurring.oneOf.0.end_terms.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.recurring.oneOf.0.end_terms","typeLabel":"integer | null"},"total_amount":{"oneOf":[{"type":"number","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when the recurring segment is enabled and recurring_type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","multipleOf":0.01,"minimum":0.01,"uniqueKey":"plan.recurring.oneOf.0.total_amount.oneOf.0","typeLabel":"number"},{"type":"null","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when the recurring segment is enabled and recurring_type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","multipleOf":0.01,"minimum":0.01,"uniqueKey":"plan.recurring.oneOf.0.total_amount.oneOf.1","typeLabel":"null"},{"type":"string","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when the recurring segment is enabled and recurring_type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","pattern":"^\\d+(\\.\\d{1,2})?$","uniqueKey":"plan.recurring.oneOf.0.total_amount.oneOf.2","typeLabel":"string"},{"type":"null","uniqueKey":"plan.recurring.oneOf.0.total_amount.oneOf.3","typeLabel":"null"}],"uniqueKey":"plan.recurring.oneOf.0.total_amount","typeLabel":"number · null · string · null"},"day_of_debit":{"oneOf":[{"type":"string","description":"RFC 5545 RRULE debit rule. Required and non-null when the recurring segment is enabled. See the integration guide for frequency syntax. Must not place a debit day before start_date within the same cycle. Nonstandard intervals require process_type=12 and custom_cycle_type/custom_cycle.","maxLength":255,"uniqueKey":"plan.recurring.oneOf.0.day_of_debit.oneOf.0","typeLabel":"string"},{"type":"null","description":"RFC 5545 RRULE debit rule. Required and non-null when the recurring segment is enabled. See the integration guide for frequency syntax. Must not place a debit day before start_date within the same cycle. Nonstandard intervals require process_type=12 and custom_cycle_type/custom_cycle.","maxLength":255,"uniqueKey":"plan.recurring.oneOf.0.day_of_debit.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.recurring.oneOf.0.day_of_debit","typeLabel":"string | null"},"process_type":{"oneOf":[{"type":"integer","description":"Provide 12 only for a custom frequency. Other frequencies are inferred from the RRULE; omit this field for them. Nonstandard RRULE intervals must use Custom.","enum":[12,null],"uniqueKey":"plan.recurring.oneOf.0.process_type.oneOf.0","typeLabel":"enum\u003cinteger>"},{"type":"null","description":"Provide 12 only for a custom frequency. Other frequencies are inferred from the RRULE; omit this field for them. Nonstandard RRULE intervals must use Custom.","enum":[12,null],"uniqueKey":"plan.recurring.oneOf.0.process_type.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.recurring.oneOf.0.process_type","typeLabel":"enum\u003cinteger> | null"},"custom_cycle_type":{"oneOf":[{"type":"integer","description":"Required for process_type=12: 1 days, 2 weeks, 3 months, 4 years. Must correspond to the RRULE FREQ. Non-Custom mode prohibits nonempty custom cycle parameters. Required and non-null when recurring.process_type=12.","enum":[1,2,3,4,null],"uniqueKey":"plan.recurring.oneOf.0.custom_cycle_type.oneOf.0","typeLabel":"enum\u003cinteger>"},{"type":"null","description":"Required for process_type=12: 1 days, 2 weeks, 3 months, 4 years. Must correspond to the RRULE FREQ. Non-Custom mode prohibits nonempty custom cycle parameters. Required and non-null when recurring.process_type=12.","enum":[1,2,3,4,null],"uniqueKey":"plan.recurring.oneOf.0.custom_cycle_type.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.recurring.oneOf.0.custom_cycle_type","typeLabel":"enum\u003cinteger> | null"},"custom_cycle":{"oneOf":[{"type":"integer","description":"Required for process_type=12. A positive integer equal to the RRULE INTERVAL. Minimum 5 for days and 1 for other units. Required and non-null when recurring.process_type=12.","minimum":1,"uniqueKey":"plan.recurring.oneOf.0.custom_cycle.oneOf.0","typeLabel":"integer"},{"type":"null","description":"Required for process_type=12. A positive integer equal to the RRULE INTERVAL. Minimum 5 for days and 1 for other units. Required and non-null when recurring.process_type=12.","minimum":1,"uniqueKey":"plan.recurring.oneOf.0.custom_cycle.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.recurring.oneOf.0.custom_cycle","typeLabel":"integer | null"},"day_of_debit_dtstart":{"oneOf":[{"type":"string","description":"First debit anchor. Required for quarterly, half-yearly and yearly frequencies. YYYY-MM-DD is recommended; the date must be strictly after the corresponding start_date and within one billing cycle (3/6/12 months, clamped to month end). MM-DD is also accepted if it is a valid month/day; the full-date window restriction does not apply to that format.","pattern":"^(\\d{4}-)?\\d{2}-\\d{2}$","uniqueKey":"plan.recurring.oneOf.0.day_of_debit_dtstart.oneOf.0","typeLabel":"string"},{"type":"null","description":"First debit anchor. Required for quarterly, half-yearly and yearly frequencies. YYYY-MM-DD is recommended; the date must be strictly after the corresponding start_date and within one billing cycle (3/6/12 months, clamped to month end). MM-DD is also accepted if it is a valid month/day; the full-date window restriction does not apply to that format.","pattern":"^(\\d{4}-)?\\d{2}-\\d{2}$","uniqueKey":"plan.recurring.oneOf.0.day_of_debit_dtstart.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.recurring.oneOf.0.day_of_debit_dtstart","typeLabel":"string | null"}},"description":"Recurring subscription definition.","not":{"anyOf":[{"allOf":[{"required":["enabled"],"properties":{"enabled":{"enum":[true,1,"1"]}}},{"not":{"required":["schedule_name","recurring_type","amount","start_date","day_of_debit"],"properties":{"schedule_name":{"not":{"enum":[null]},"minLength":1},"recurring_type":{"not":{"enum":[null]}},"amount":{"not":{"enum":[null]}},"start_date":{"not":{"enum":[null]},"minLength":1},"day_of_debit":{"not":{"enum":[null]},"minLength":1}}}}]},{"allOf":[{"required":["enabled","recurring_type"],"properties":{"enabled":{"enum":[true,1,"1"]},"recurring_type":{"enum":[1]}}},{"not":{"required":["end_terms"],"properties":{"end_terms":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["enabled","recurring_type"],"properties":{"enabled":{"enum":[true,1,"1"]},"recurring_type":{"enum":[2]}}},{"not":{"required":["total_amount"],"properties":{"total_amount":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["enabled","recurring_type"],"properties":{"enabled":{"enum":[true,1,"1"]},"recurring_type":{"enum":[4]}}},{"not":{"required":["end_date"],"properties":{"end_date":{"not":{"enum":[null]},"minLength":1}}}}]},{"allOf":[{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}},{"not":{"required":["custom_cycle_type","custom_cycle"],"properties":{"custom_cycle_type":{"not":{"enum":[null]}},"custom_cycle":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["process_type","custom_cycle_type"],"properties":{"process_type":{"enum":[12]},"custom_cycle_type":{"enum":[1]}}},{"not":{"required":["custom_cycle"],"properties":{"custom_cycle":{"not":{"enum":[null]},"minimum":5}}}}]},{"allOf":[{"required":["custom_cycle_type"],"properties":{"custom_cycle_type":{"not":{"enum":[null]}}}},{"not":{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}}}]},{"allOf":[{"required":["custom_cycle"],"properties":{"custom_cycle":{"not":{"enum":[null]}}}},{"not":{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}}}]}]},"uniqueKey":"plan.recurring.oneOf.0","typeLabel":"object"},{"type":"null","properties":{"enabled":{"oneOf":[{"type":"integer","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":[0,1,null]},{"type":"null","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":[0,1,null]},{"type":"boolean","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment."},{"type":"string","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":["0","1"]},{"type":"null"}]},"schedule_name":{"oneOf":[{"type":"string","description":"Payment schedule name. Required and non-null when recurring.enabled=1 (or true); at most 255 characters.","maxLength":255},{"type":"null","description":"Payment schedule name. Required and non-null when recurring.enabled=1 (or true); at most 255 characters.","maxLength":255}]},"recurring_type":{"oneOf":[{"type":"integer","description":"1 after a number of successful payments; 2 at a cumulative amount; 3 until cancelled; 4 on an end date. Type 5 is not allowed here; use plan.schedule for By agreement. Required when recurring.enabled=true.","enum":[1,2,3,4,null]},{"type":"null","description":"1 after a number of successful payments; 2 at a cumulative amount; 3 until cancelled; 4 on an end date. Type 5 is not allowed here; use plan.schedule for By agreement. Required when recurring.enabled=true.","enum":[1,2,3,4,null]}]},"amount":{"oneOf":[{"type":"number","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required when recurring.enabled=true.","multipleOf":0.01,"maximum":9999999.99,"minimum":0.01},{"type":"null","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required when recurring.enabled=true.","multipleOf":0.01,"maximum":9999999.99,"minimum":0.01},{"type":"string","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required when recurring.enabled=true.","pattern":"^\\d+(\\.\\d{1,2})?$"},{"type":"null"}]},"start_date":{"oneOf":[{"type":"string","description":"Start date. Required and non-null when recurring.enabled=1 or recurring.enabled=true. YYYY-MM-DD is recommended. Must be no earlier than tomorrow in the service business timezone.","format":"date"},{"type":"null","description":"Start date. Required and non-null when recurring.enabled=1 or recurring.enabled=true. YYYY-MM-DD is recommended. Must be no earlier than tomorrow in the service business timezone.","format":"date"}]},"end_date":{"oneOf":[{"type":"string","description":"End date, preferably YYYY-MM-DD. Required and non-null when the recurring segment is enabled and recurring_type=4. When supplied, cannot precede start_date in the same segment.","format":"date"},{"type":"null","description":"End date, preferably YYYY-MM-DD. Required and non-null when the recurring segment is enabled and recurring_type=4. When supplied, cannot precede start_date in the same segment.","format":"date"}]},"end_terms":{"oneOf":[{"type":"integer","description":"Number of successful payments, an integer of at least 1. Required and non-null when the recurring segment is enabled and recurring_type=1.","minimum":1},{"type":"null","description":"Number of successful payments, an integer of at least 1. Required and non-null when the recurring segment is enabled and recurring_type=1.","minimum":1}]},"total_amount":{"oneOf":[{"type":"number","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when the recurring segment is enabled and recurring_type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","multipleOf":0.01,"minimum":0.01},{"type":"null","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when the recurring segment is enabled and recurring_type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","multipleOf":0.01,"minimum":0.01},{"type":"string","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when the recurring segment is enabled and recurring_type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","pattern":"^\\d+(\\.\\d{1,2})?$"},{"type":"null"}]},"day_of_debit":{"oneOf":[{"type":"string","description":"RFC 5545 RRULE debit rule. Required and non-null when the recurring segment is enabled. See the integration guide for frequency syntax. Must not place a debit day before start_date within the same cycle. Nonstandard intervals require process_type=12 and custom_cycle_type/custom_cycle.","maxLength":255},{"type":"null","description":"RFC 5545 RRULE debit rule. Required and non-null when the recurring segment is enabled. See the integration guide for frequency syntax. Must not place a debit day before start_date within the same cycle. Nonstandard intervals require process_type=12 and custom_cycle_type/custom_cycle.","maxLength":255}]},"process_type":{"oneOf":[{"type":"integer","description":"Provide 12 only for a custom frequency. Other frequencies are inferred from the RRULE; omit this field for them. Nonstandard RRULE intervals must use Custom.","enum":[12,null]},{"type":"null","description":"Provide 12 only for a custom frequency. Other frequencies are inferred from the RRULE; omit this field for them. Nonstandard RRULE intervals must use Custom.","enum":[12,null]}]},"custom_cycle_type":{"oneOf":[{"type":"integer","description":"Required for process_type=12: 1 days, 2 weeks, 3 months, 4 years. Must correspond to the RRULE FREQ. Non-Custom mode prohibits nonempty custom cycle parameters. Required and non-null when recurring.process_type=12.","enum":[1,2,3,4,null]},{"type":"null","description":"Required for process_type=12: 1 days, 2 weeks, 3 months, 4 years. Must correspond to the RRULE FREQ. Non-Custom mode prohibits nonempty custom cycle parameters. Required and non-null when recurring.process_type=12.","enum":[1,2,3,4,null]}]},"custom_cycle":{"oneOf":[{"type":"integer","description":"Required for process_type=12. A positive integer equal to the RRULE INTERVAL. Minimum 5 for days and 1 for other units. Required and non-null when recurring.process_type=12.","minimum":1},{"type":"null","description":"Required for process_type=12. A positive integer equal to the RRULE INTERVAL. Minimum 5 for days and 1 for other units. Required and non-null when recurring.process_type=12.","minimum":1}]},"day_of_debit_dtstart":{"oneOf":[{"type":"string","description":"First debit anchor. Required for quarterly, half-yearly and yearly frequencies. YYYY-MM-DD is recommended; the date must be strictly after the corresponding start_date and within one billing cycle (3/6/12 months, clamped to month end). MM-DD is also accepted if it is a valid month/day; the full-date window restriction does not apply to that format.","pattern":"^(\\d{4}-)?\\d{2}-\\d{2}$"},{"type":"null","description":"First debit anchor. Required for quarterly, half-yearly and yearly frequencies. YYYY-MM-DD is recommended; the date must be strictly after the corresponding start_date and within one billing cycle (3/6/12 months, clamped to month end). MM-DD is also accepted if it is a valid month/day; the full-date window restriction does not apply to that format.","pattern":"^(\\d{4}-)?\\d{2}-\\d{2}$"}]}},"description":"Recurring subscription definition.","not":{"anyOf":[{"allOf":[{"required":["enabled"],"properties":{"enabled":{"enum":[true,1,"1"]}}},{"not":{"required":["schedule_name","recurring_type","amount","start_date","day_of_debit"],"properties":{"schedule_name":{"not":{"enum":[null]},"minLength":1},"recurring_type":{"not":{"enum":[null]}},"amount":{"not":{"enum":[null]}},"start_date":{"not":{"enum":[null]},"minLength":1},"day_of_debit":{"not":{"enum":[null]},"minLength":1}}}}]},{"allOf":[{"required":["enabled","recurring_type"],"properties":{"enabled":{"enum":[true,1,"1"]},"recurring_type":{"enum":[1]}}},{"not":{"required":["end_terms"],"properties":{"end_terms":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["enabled","recurring_type"],"properties":{"enabled":{"enum":[true,1,"1"]},"recurring_type":{"enum":[2]}}},{"not":{"required":["total_amount"],"properties":{"total_amount":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["enabled","recurring_type"],"properties":{"enabled":{"enum":[true,1,"1"]},"recurring_type":{"enum":[4]}}},{"not":{"required":["end_date"],"properties":{"end_date":{"not":{"enum":[null]},"minLength":1}}}}]},{"allOf":[{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}},{"not":{"required":["custom_cycle_type","custom_cycle"],"properties":{"custom_cycle_type":{"not":{"enum":[null]}},"custom_cycle":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["process_type","custom_cycle_type"],"properties":{"process_type":{"enum":[12]},"custom_cycle_type":{"enum":[1]}}},{"not":{"required":["custom_cycle"],"properties":{"custom_cycle":{"not":{"enum":[null]},"minimum":5}}}}]},{"allOf":[{"required":["custom_cycle_type"],"properties":{"custom_cycle_type":{"not":{"enum":[null]}}}},{"not":{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}}}]},{"allOf":[{"required":["custom_cycle"],"properties":{"custom_cycle":{"not":{"enum":[null]}}}},{"not":{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}}}]}]},"uniqueKey":"plan.recurring.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.recurring","typeLabel":"object | null"},"one_off":{"oneOf":[{"type":"object","properties":{"enabled":{"oneOf":[{"type":"integer","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":[0,1,null],"uniqueKey":"plan.one_off.oneOf.0.enabled.oneOf.0","typeLabel":"enum\u003cinteger>"},{"type":"null","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":[0,1,null],"uniqueKey":"plan.one_off.oneOf.0.enabled.oneOf.1","typeLabel":"null"},{"type":"boolean","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","uniqueKey":"plan.one_off.oneOf.0.enabled.oneOf.2","typeLabel":"boolean"},{"type":"string","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":["0","1"],"uniqueKey":"plan.one_off.oneOf.0.enabled.oneOf.3","typeLabel":"enum\u003cstring>"},{"type":"null","uniqueKey":"plan.one_off.oneOf.0.enabled.oneOf.4","typeLabel":"null"}],"uniqueKey":"plan.one_off.oneOf.0.enabled","typeLabel":"enum\u003cinteger> · null · boolean · enum\u003cstring> · null"},"schedule_name":{"oneOf":[{"type":"string","description":"Payment schedule name. Required and non-null when one_off.enabled=1.","maxLength":255,"uniqueKey":"plan.one_off.oneOf.0.schedule_name.oneOf.0","typeLabel":"string"},{"type":"null","description":"Payment schedule name. Required and non-null when one_off.enabled=1.","maxLength":255,"uniqueKey":"plan.one_off.oneOf.0.schedule_name.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.one_off.oneOf.0.schedule_name","typeLabel":"string | null"},"amount":{"oneOf":[{"type":"number","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required and non-null when one_off.enabled=1.","multipleOf":0.01,"maximum":9999999.99,"minimum":0.01,"uniqueKey":"plan.one_off.oneOf.0.amount.oneOf.0","typeLabel":"number"},{"type":"null","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required and non-null when one_off.enabled=1.","multipleOf":0.01,"maximum":9999999.99,"minimum":0.01,"uniqueKey":"plan.one_off.oneOf.0.amount.oneOf.1","typeLabel":"null"},{"type":"string","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required and non-null when one_off.enabled=1.","pattern":"^\\d+(\\.\\d{1,2})?$","uniqueKey":"plan.one_off.oneOf.0.amount.oneOf.2","typeLabel":"string"},{"type":"null","uniqueKey":"plan.one_off.oneOf.0.amount.oneOf.3","typeLabel":"null"}],"uniqueKey":"plan.one_off.oneOf.0.amount","typeLabel":"number · null · string · null"},"description":{"oneOf":[{"type":"string","description":"Description.","maxLength":500,"uniqueKey":"plan.one_off.oneOf.0.description.oneOf.0","typeLabel":"string"},{"type":"null","description":"Description.","maxLength":500,"uniqueKey":"plan.one_off.oneOf.0.description.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.one_off.oneOf.0.description","typeLabel":"string | null"},"payment_date":{"oneOf":[{"type":"string","description":"One-off debit date. Must be no earlier than tomorrow in the service business timezone. Required and non-null when one_off.enabled=1. YYYY-MM-DD is recommended. Cannot precede tomorrow in the service business timezone.","format":"date","uniqueKey":"plan.one_off.oneOf.0.payment_date.oneOf.0","typeLabel":"string\u003cdate>"},{"type":"null","description":"One-off debit date. Must be no earlier than tomorrow in the service business timezone. Required and non-null when one_off.enabled=1. YYYY-MM-DD is recommended. Cannot precede tomorrow in the service business timezone.","format":"date","uniqueKey":"plan.one_off.oneOf.0.payment_date.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.one_off.oneOf.0.payment_date","typeLabel":"string\u003cdate> | null"}},"description":"One-off payment definition. Acts as a Deposit when enabled with recurring, or as a One-off when used alone.","not":{"anyOf":[{"allOf":[{"required":["enabled"],"properties":{"enabled":{"enum":[true,1,"1"]}}},{"not":{"required":["schedule_name","amount","payment_date"],"properties":{"schedule_name":{"not":{"enum":[null]},"minLength":1},"amount":{"not":{"enum":[null]}},"payment_date":{"not":{"enum":[null]},"minLength":1}}}}]}]},"uniqueKey":"plan.one_off.oneOf.0","typeLabel":"object"},{"type":"null","properties":{"enabled":{"oneOf":[{"type":"integer","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":[0,1,null]},{"type":"null","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":[0,1,null]},{"type":"boolean","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment."},{"type":"string","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":["0","1"]},{"type":"null"}]},"schedule_name":{"oneOf":[{"type":"string","description":"Payment schedule name. Required and non-null when one_off.enabled=1.","maxLength":255},{"type":"null","description":"Payment schedule name. Required and non-null when one_off.enabled=1.","maxLength":255}]},"amount":{"oneOf":[{"type":"number","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required and non-null when one_off.enabled=1.","multipleOf":0.01,"maximum":9999999.99,"minimum":0.01},{"type":"null","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required and non-null when one_off.enabled=1.","multipleOf":0.01,"maximum":9999999.99,"minimum":0.01},{"type":"string","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required and non-null when one_off.enabled=1.","pattern":"^\\d+(\\.\\d{1,2})?$"},{"type":"null"}]},"description":{"oneOf":[{"type":"string","description":"Description.","maxLength":500},{"type":"null","description":"Description.","maxLength":500}]},"payment_date":{"oneOf":[{"type":"string","description":"One-off debit date. Must be no earlier than tomorrow in the service business timezone. Required and non-null when one_off.enabled=1. YYYY-MM-DD is recommended. Cannot precede tomorrow in the service business timezone.","format":"date"},{"type":"null","description":"One-off debit date. Must be no earlier than tomorrow in the service business timezone. Required and non-null when one_off.enabled=1. YYYY-MM-DD is recommended. Cannot precede tomorrow in the service business timezone.","format":"date"}]}},"description":"One-off payment definition. Acts as a Deposit when enabled with recurring, or as a One-off when used alone.","not":{"anyOf":[{"allOf":[{"required":["enabled"],"properties":{"enabled":{"enum":[true,1,"1"]}}},{"not":{"required":["schedule_name","amount","payment_date"],"properties":{"schedule_name":{"not":{"enum":[null]},"minLength":1},"amount":{"not":{"enum":[null]}},"payment_date":{"not":{"enum":[null]},"minLength":1}}}}]}]},"uniqueKey":"plan.one_off.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.one_off","typeLabel":"object | null"},"schedule":{"oneOf":[{"type":"object","properties":{"type":{"type":"integer","description":"Initial By agreement schedule type: 1 after a number of successful payments; 2 at a cumulative amount; 3 until cancelled; 4 on an end date; 6 One-off. Types 5 and 7 are not supported.","enum":[1,2,3,4,6],"isRequired":true,"uniqueKey":"plan.schedule.oneOf.0.type","typeLabel":"enum\u003cinteger>"},"amount":{"oneOf":[{"type":"number","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required and non-null when schedule is nonempty.","multipleOf":0.01,"maximum":9999999.99,"minimum":0.01,"isRequired":true,"uniqueKey":"plan.schedule.oneOf.0.amount.oneOf.0","typeLabel":"number"},{"type":"string","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required and non-null when schedule is nonempty.","pattern":"^\\d+(\\.\\d{1,2})?$","isRequired":true,"uniqueKey":"plan.schedule.oneOf.0.amount.oneOf.1","typeLabel":"string"}],"isRequired":true,"uniqueKey":"plan.schedule.oneOf.0.amount","typeLabel":"number | string"},"start_date":{"type":"string","description":"Start date. Required and non-null when schedule is nonempty. YYYY-MM-DD is recommended. Must be no earlier than tomorrow in the service business timezone.","format":"date","minLength":1,"isRequired":true,"uniqueKey":"plan.schedule.oneOf.0.start_date","typeLabel":"string\u003cdate>"},"schedule_name":{"type":"string","description":"Payment schedule name. Required and non-null when schedule is nonempty; at most 255 characters.","maxLength":255,"minLength":1,"isRequired":true,"uniqueKey":"plan.schedule.oneOf.0.schedule_name","typeLabel":"string"},"total_amount":{"oneOf":[{"type":"number","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when schedule.type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","multipleOf":0.01,"minimum":0.01,"uniqueKey":"plan.schedule.oneOf.0.total_amount.oneOf.0","typeLabel":"number"},{"type":"null","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when schedule.type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","multipleOf":0.01,"minimum":0.01,"uniqueKey":"plan.schedule.oneOf.0.total_amount.oneOf.1","typeLabel":"null"},{"type":"string","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when schedule.type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","pattern":"^\\d+(\\.\\d{1,2})?$","uniqueKey":"plan.schedule.oneOf.0.total_amount.oneOf.2","typeLabel":"string"},{"type":"null","uniqueKey":"plan.schedule.oneOf.0.total_amount.oneOf.3","typeLabel":"null"}],"uniqueKey":"plan.schedule.oneOf.0.total_amount","typeLabel":"number · null · string · null"},"day_of_debit":{"oneOf":[{"type":"string","description":"RFC 5545 RRULE debit rule. Required and non-null for schedule.type=1/2/3/4; optional for type=6 (one-off). Must not place a debit day before start_date within the same cycle. Nonstandard intervals require process_type=12 and custom_cycle_type/custom_cycle.","maxLength":255,"uniqueKey":"plan.schedule.oneOf.0.day_of_debit.oneOf.0","typeLabel":"string"},{"type":"null","description":"RFC 5545 RRULE debit rule. Required and non-null for schedule.type=1/2/3/4; optional for type=6 (one-off). Must not place a debit day before start_date within the same cycle. Nonstandard intervals require process_type=12 and custom_cycle_type/custom_cycle.","maxLength":255,"uniqueKey":"plan.schedule.oneOf.0.day_of_debit.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.schedule.oneOf.0.day_of_debit","typeLabel":"string | null"},"end_date":{"oneOf":[{"type":"string","description":"End date, preferably YYYY-MM-DD. Required and non-null when schedule.type=4. When supplied, cannot precede start_date in the same segment.","format":"date","uniqueKey":"plan.schedule.oneOf.0.end_date.oneOf.0","typeLabel":"string\u003cdate>"},{"type":"null","description":"End date, preferably YYYY-MM-DD. Required and non-null when schedule.type=4. When supplied, cannot precede start_date in the same segment.","format":"date","uniqueKey":"plan.schedule.oneOf.0.end_date.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.schedule.oneOf.0.end_date","typeLabel":"string\u003cdate> | null"},"end_terms":{"oneOf":[{"type":"integer","description":"Number of successful payments, an integer of at least 1. Required and non-null when schedule.type=1.","minimum":1,"uniqueKey":"plan.schedule.oneOf.0.end_terms.oneOf.0","typeLabel":"integer"},{"type":"null","description":"Number of successful payments, an integer of at least 1. Required and non-null when schedule.type=1.","minimum":1,"uniqueKey":"plan.schedule.oneOf.0.end_terms.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.schedule.oneOf.0.end_terms","typeLabel":"integer | null"},"day_of_debit_dtstart":{"oneOf":[{"type":"string","description":"First debit anchor. Required for quarterly, half-yearly and yearly frequencies. YYYY-MM-DD is recommended; the date must be strictly after the corresponding start_date and within one billing cycle (3/6/12 months, clamped to month end). MM-DD is also accepted if it is a valid month/day; the full-date window restriction does not apply to that format.","pattern":"^(\\d{4}-)?\\d{2}-\\d{2}$","uniqueKey":"plan.schedule.oneOf.0.day_of_debit_dtstart.oneOf.0","typeLabel":"string"},{"type":"null","description":"First debit anchor. Required for quarterly, half-yearly and yearly frequencies. YYYY-MM-DD is recommended; the date must be strictly after the corresponding start_date and within one billing cycle (3/6/12 months, clamped to month end). MM-DD is also accepted if it is a valid month/day; the full-date window restriction does not apply to that format.","pattern":"^(\\d{4}-)?\\d{2}-\\d{2}$","uniqueKey":"plan.schedule.oneOf.0.day_of_debit_dtstart.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.schedule.oneOf.0.day_of_debit_dtstart","typeLabel":"string | null"},"process_type":{"oneOf":[{"type":"integer","description":"Provide 12 only for a custom frequency. Other frequencies are inferred from the RRULE; omit this field for them. Nonstandard RRULE intervals must use Custom.","enum":[12,null],"uniqueKey":"plan.schedule.oneOf.0.process_type.oneOf.0","typeLabel":"enum\u003cinteger>"},{"type":"null","description":"Provide 12 only for a custom frequency. Other frequencies are inferred from the RRULE; omit this field for them. Nonstandard RRULE intervals must use Custom.","enum":[12,null],"uniqueKey":"plan.schedule.oneOf.0.process_type.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.schedule.oneOf.0.process_type","typeLabel":"enum\u003cinteger> | null"},"custom_cycle_type":{"oneOf":[{"type":"integer","description":"Required for process_type=12: 1 days, 2 weeks, 3 months, 4 years. Must correspond to the RRULE FREQ. Non-Custom mode prohibits nonempty custom cycle parameters. Required and non-null when schedule.process_type=12.","enum":[1,2,3,4,null],"uniqueKey":"plan.schedule.oneOf.0.custom_cycle_type.oneOf.0","typeLabel":"enum\u003cinteger>"},{"type":"null","description":"Required for process_type=12: 1 days, 2 weeks, 3 months, 4 years. Must correspond to the RRULE FREQ. Non-Custom mode prohibits nonempty custom cycle parameters. Required and non-null when schedule.process_type=12.","enum":[1,2,3,4,null],"uniqueKey":"plan.schedule.oneOf.0.custom_cycle_type.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.schedule.oneOf.0.custom_cycle_type","typeLabel":"enum\u003cinteger> | null"},"custom_cycle":{"oneOf":[{"type":"integer","description":"Required for process_type=12. A positive integer equal to the RRULE INTERVAL. Minimum 5 for days and 1 for other units. Required and non-null when schedule.process_type=12.","minimum":1,"uniqueKey":"plan.schedule.oneOf.0.custom_cycle.oneOf.0","typeLabel":"integer"},{"type":"null","description":"Required for process_type=12. A positive integer equal to the RRULE INTERVAL. Minimum 5 for days and 1 for other units. Required and non-null when schedule.process_type=12.","minimum":1,"uniqueKey":"plan.schedule.oneOf.0.custom_cycle.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.schedule.oneOf.0.custom_cycle","typeLabel":"integer | null"}},"description":"Initial By agreement payment schedule definition. Mutually exclusive with manual recurring/one_off mode and template_id mode.","required":["type","amount","start_date","schedule_name"],"not":{"anyOf":[{"allOf":[{"required":["type"],"properties":{"type":{"enum":[1]}}},{"not":{"required":["end_terms"],"properties":{"end_terms":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["type"],"properties":{"type":{"enum":[2]}}},{"not":{"required":["total_amount"],"properties":{"total_amount":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["type"],"properties":{"type":{"enum":[4]}}},{"not":{"required":["end_date"],"properties":{"end_date":{"not":{"enum":[null]},"minLength":1}}}}]},{"allOf":[{"required":["type"],"properties":{"type":{"enum":[1,2,3,4]}}},{"not":{"required":["day_of_debit"],"properties":{"day_of_debit":{"not":{"enum":[null]},"minLength":1}}}}]},{"allOf":[{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}},{"not":{"required":["custom_cycle_type","custom_cycle"],"properties":{"custom_cycle_type":{"not":{"enum":[null]}},"custom_cycle":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["process_type","custom_cycle_type"],"properties":{"process_type":{"enum":[12]},"custom_cycle_type":{"enum":[1]}}},{"not":{"required":["custom_cycle"],"properties":{"custom_cycle":{"not":{"enum":[null]},"minimum":5}}}}]},{"allOf":[{"required":["custom_cycle_type"],"properties":{"custom_cycle_type":{"not":{"enum":[null]}}}},{"not":{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}}}]},{"allOf":[{"required":["custom_cycle"],"properties":{"custom_cycle":{"not":{"enum":[null]}}}},{"not":{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}}}]}]},"uniqueKey":"plan.schedule.oneOf.0","typeLabel":"object"},{"type":"null","properties":{"type":{"type":"integer","description":"Initial By agreement schedule type: 1 after a number of successful payments; 2 at a cumulative amount; 3 until cancelled; 4 on an end date; 6 One-off. Types 5 and 7 are not supported.","enum":[1,2,3,4,6]},"amount":{"oneOf":[{"type":"number","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required and non-null when schedule is nonempty.","multipleOf":0.01,"maximum":9999999.99,"minimum":0.01},{"type":"string","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required and non-null when schedule is nonempty.","pattern":"^\\d+(\\.\\d{1,2})?$"}]},"start_date":{"type":"string","description":"Start date. Required and non-null when schedule is nonempty. YYYY-MM-DD is recommended. Must be no earlier than tomorrow in the service business timezone.","format":"date","minLength":1},"schedule_name":{"type":"string","description":"Payment schedule name. Required and non-null when schedule is nonempty; at most 255 characters.","maxLength":255,"minLength":1},"total_amount":{"oneOf":[{"type":"number","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when schedule.type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","multipleOf":0.01,"minimum":0.01},{"type":"null","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when schedule.type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","multipleOf":0.01,"minimum":0.01},{"type":"string","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when schedule.type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","pattern":"^\\d+(\\.\\d{1,2})?$"},{"type":"null"}]},"day_of_debit":{"oneOf":[{"type":"string","description":"RFC 5545 RRULE debit rule. Required and non-null for schedule.type=1/2/3/4; optional for type=6 (one-off). Must not place a debit day before start_date within the same cycle. Nonstandard intervals require process_type=12 and custom_cycle_type/custom_cycle.","maxLength":255},{"type":"null","description":"RFC 5545 RRULE debit rule. Required and non-null for schedule.type=1/2/3/4; optional for type=6 (one-off). Must not place a debit day before start_date within the same cycle. Nonstandard intervals require process_type=12 and custom_cycle_type/custom_cycle.","maxLength":255}]},"end_date":{"oneOf":[{"type":"string","description":"End date, preferably YYYY-MM-DD. Required and non-null when schedule.type=4. When supplied, cannot precede start_date in the same segment.","format":"date"},{"type":"null","description":"End date, preferably YYYY-MM-DD. Required and non-null when schedule.type=4. When supplied, cannot precede start_date in the same segment.","format":"date"}]},"end_terms":{"oneOf":[{"type":"integer","description":"Number of successful payments, an integer of at least 1. Required and non-null when schedule.type=1.","minimum":1},{"type":"null","description":"Number of successful payments, an integer of at least 1. Required and non-null when schedule.type=1.","minimum":1}]},"day_of_debit_dtstart":{"oneOf":[{"type":"string","description":"First debit anchor. Required for quarterly, half-yearly and yearly frequencies. YYYY-MM-DD is recommended; the date must be strictly after the corresponding start_date and within one billing cycle (3/6/12 months, clamped to month end). MM-DD is also accepted if it is a valid month/day; the full-date window restriction does not apply to that format.","pattern":"^(\\d{4}-)?\\d{2}-\\d{2}$"},{"type":"null","description":"First debit anchor. Required for quarterly, half-yearly and yearly frequencies. YYYY-MM-DD is recommended; the date must be strictly after the corresponding start_date and within one billing cycle (3/6/12 months, clamped to month end). MM-DD is also accepted if it is a valid month/day; the full-date window restriction does not apply to that format.","pattern":"^(\\d{4}-)?\\d{2}-\\d{2}$"}]},"process_type":{"oneOf":[{"type":"integer","description":"Provide 12 only for a custom frequency. Other frequencies are inferred from the RRULE; omit this field for them. Nonstandard RRULE intervals must use Custom.","enum":[12,null]},{"type":"null","description":"Provide 12 only for a custom frequency. Other frequencies are inferred from the RRULE; omit this field for them. Nonstandard RRULE intervals must use Custom.","enum":[12,null]}]},"custom_cycle_type":{"oneOf":[{"type":"integer","description":"Required for process_type=12: 1 days, 2 weeks, 3 months, 4 years. Must correspond to the RRULE FREQ. Non-Custom mode prohibits nonempty custom cycle parameters. Required and non-null when schedule.process_type=12.","enum":[1,2,3,4,null]},{"type":"null","description":"Required for process_type=12: 1 days, 2 weeks, 3 months, 4 years. Must correspond to the RRULE FREQ. Non-Custom mode prohibits nonempty custom cycle parameters. Required and non-null when schedule.process_type=12.","enum":[1,2,3,4,null]}]},"custom_cycle":{"oneOf":[{"type":"integer","description":"Required for process_type=12. A positive integer equal to the RRULE INTERVAL. Minimum 5 for days and 1 for other units. Required and non-null when schedule.process_type=12.","minimum":1},{"type":"null","description":"Required for process_type=12. A positive integer equal to the RRULE INTERVAL. Minimum 5 for days and 1 for other units. Required and non-null when schedule.process_type=12.","minimum":1}]}},"description":"Initial By agreement payment schedule definition. Mutually exclusive with manual recurring/one_off mode and template_id mode.","required":["type","amount","start_date","schedule_name"],"not":{"anyOf":[{"allOf":[{"required":["type"],"properties":{"type":{"enum":[1]}}},{"not":{"required":["end_terms"],"properties":{"end_terms":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["type"],"properties":{"type":{"enum":[2]}}},{"not":{"required":["total_amount"],"properties":{"total_amount":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["type"],"properties":{"type":{"enum":[4]}}},{"not":{"required":["end_date"],"properties":{"end_date":{"not":{"enum":[null]},"minLength":1}}}}]},{"allOf":[{"required":["type"],"properties":{"type":{"enum":[1,2,3,4]}}},{"not":{"required":["day_of_debit"],"properties":{"day_of_debit":{"not":{"enum":[null]},"minLength":1}}}}]},{"allOf":[{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}},{"not":{"required":["custom_cycle_type","custom_cycle"],"properties":{"custom_cycle_type":{"not":{"enum":[null]}},"custom_cycle":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["process_type","custom_cycle_type"],"properties":{"process_type":{"enum":[12]},"custom_cycle_type":{"enum":[1]}}},{"not":{"required":["custom_cycle"],"properties":{"custom_cycle":{"not":{"enum":[null]},"minimum":5}}}}]},{"allOf":[{"required":["custom_cycle_type"],"properties":{"custom_cycle_type":{"not":{"enum":[null]}}}},{"not":{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}}}]},{"allOf":[{"required":["custom_cycle"],"properties":{"custom_cycle":{"not":{"enum":[null]}}}},{"not":{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}}}]}]},"uniqueKey":"plan.schedule.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.schedule","typeLabel":"object | null"},"surcharge_config":{"oneOf":[{"type":"array","description":"Surcharge options, preferably an array of strings. See the schema and examples for allowed options. Omission, null or an empty array disables all options; non-array values are also treated as all disabled. Unknown options do not enable charges. credit_card_surcharge selects the credit card surcharge group. Actual charges depend on merchant business rules and payment method restrictions. Applies in manual mode. Template mode uses the template's surcharge options, which this field cannot override. By agreement schedule mode does not support this setting. Card surcharges remain subject to the applicable charging policy; if it prohibits them, selecting card options does not enable charges.","items":{"type":"string","description":"Surcharge option.","enum":["direct_debit_surcharge","visa_domestic_surcharge","visa_international_surcharge","mastercard_domestic_surcharge","mastercard_international_surcharge","amex_domestic_surcharge","amex_international_surcharge","credit_card_surcharge"],"uniqueKey":"plan.surcharge_config.oneOf.0.items.[INDEX]","typeLabel":"enum\u003cstring>"},"uniqueKey":"plan.surcharge_config.oneOf.0","typeLabel":"enum\u003cstring>[]"},{"type":"null","description":"Surcharge options, preferably an array of strings. See the schema and examples for allowed options. Omission, null or an empty array disables all options; non-array values are also treated as all disabled. Unknown options do not enable charges. credit_card_surcharge selects the credit card surcharge group. Actual charges depend on merchant business rules and payment method restrictions. Applies in manual mode. Template mode uses the template's surcharge options, which this field cannot override. By agreement schedule mode does not support this setting. Card surcharges remain subject to the applicable charging policy; if it prohibits them, selecting card options does not enable charges.","items":{"type":"string","description":"Surcharge option.","enum":["direct_debit_surcharge","visa_domestic_surcharge","visa_international_surcharge","mastercard_domestic_surcharge","mastercard_international_surcharge","amex_domestic_surcharge","amex_international_surcharge","credit_card_surcharge"]},"uniqueKey":"plan.surcharge_config.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.surcharge_config","typeLabel":"enum\u003cstring>[] | null"},"dishonour_fee_switch":{"oneOf":[{"type":"boolean","description":"Whether to charge a customer dishonour fee. Omission or null defaults to off. Enabling it requires an applicable positive fee configuration; the signed terms determine the actual amount. Also accepts 0/1 and the strings \"0\"/\"1\". Applies only to manual recurring/one_off mode. Template mode and By agreement schedule mode do not support this setting through this field.","uniqueKey":"plan.dishonour_fee_switch.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Whether to charge a customer dishonour fee. Omission or null defaults to off. Enabling it requires an applicable positive fee configuration; the signed terms determine the actual amount. Also accepts 0/1 and the strings \"0\"/\"1\". Applies only to manual recurring/one_off mode. Template mode and By agreement schedule mode do not support this setting through this field.","uniqueKey":"plan.dishonour_fee_switch.oneOf.1","typeLabel":"null"},{"type":"integer","description":"Whether to charge a customer dishonour fee. Omission or null defaults to off. Enabling it requires an applicable positive fee configuration; the signed terms determine the actual amount. Also accepts 0/1 and the strings \"0\"/\"1\". Applies only to manual recurring/one_off mode. Template mode and By agreement schedule mode do not support this setting through this field.","enum":[0,1],"uniqueKey":"plan.dishonour_fee_switch.oneOf.2","typeLabel":"enum\u003cinteger>"},{"type":"string","description":"Whether to charge a customer dishonour fee. Omission or null defaults to off. Enabling it requires an applicable positive fee configuration; the signed terms determine the actual amount. Also accepts 0/1 and the strings \"0\"/\"1\". Applies only to manual recurring/one_off mode. Template mode and By agreement schedule mode do not support this setting through this field.","enum":["0","1"],"uniqueKey":"plan.dishonour_fee_switch.oneOf.3","typeLabel":"enum\u003cstring>"},{"type":"null","uniqueKey":"plan.dishonour_fee_switch.oneOf.4","typeLabel":"null"}],"uniqueKey":"plan.dishonour_fee_switch","typeLabel":"boolean · null · enum\u003cinteger> · enum\u003cstring> · null"},"template_id":{"oneOf":[{"type":"string","description":"Available template ID from GET /api/v2/plan/list. Only enabled, ACTIVE, non-tiered templates other than By agreement are accepted.","maxLength":20,"uniqueKey":"plan.template_id.oneOf.0","typeLabel":"string"},{"type":"null","description":"Available template ID from GET /api/v2/plan/list. Only enabled, ACTIVE, non-tiered templates other than By agreement are accepted.","maxLength":20,"uniqueKey":"plan.template_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.template_id","typeLabel":"string | null"},"start_date":{"oneOf":[{"type":"string","description":"Date override for the template's recurring segment. Required when the template contains recurring. Must be no earlier than tomorrow in the service business timezone.","format":"date","uniqueKey":"plan.start_date.oneOf.0","typeLabel":"string\u003cdate>"},{"type":"null","description":"Date override for the template's recurring segment. Required when the template contains recurring. Must be no earlier than tomorrow in the service business timezone.","format":"date","uniqueKey":"plan.start_date.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.start_date","typeLabel":"string\u003cdate> | null"},"payment_date":{"oneOf":[{"type":"string","description":"Date override for the template's one_off segment. Required when the template contains one_off. Must be no earlier than tomorrow in the service business timezone.","format":"date","uniqueKey":"plan.payment_date.oneOf.0","typeLabel":"string\u003cdate>"},{"type":"null","description":"Date override for the template's one_off segment. Required when the template contains one_off. Must be no earlier than tomorrow in the service business timezone.","format":"date","uniqueKey":"plan.payment_date.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.payment_date","typeLabel":"string\u003cdate> | null"}},"uniqueKey":"plan","typeLabel":"object"},"customer_id":{"oneOf":[{"type":"string","description":"Supported top-level alternative; use `customer.customer_id` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nBillBuddy customer identifier. Must identify a valid customer within the current merchant and business.","maxLength":32,"uniqueKey":"customer_id.oneOf.0","typeLabel":"string"},{"type":"null","description":"Supported top-level alternative; use `customer.customer_id` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nBillBuddy customer identifier. Must identify a valid customer within the current merchant and business.","maxLength":32,"uniqueKey":"customer_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"customer_id","typeLabel":"string | null"},"firstName":{"oneOf":[{"type":"string","description":"Supported top-level alternative; use `customer.firstName` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nNew customer's first name. Required when creating a new customer.","maxLength":100,"uniqueKey":"firstName.oneOf.0","typeLabel":"string"},{"type":"null","description":"Supported top-level alternative; use `customer.firstName` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nNew customer's first name. Required when creating a new customer.","maxLength":100,"uniqueKey":"firstName.oneOf.1","typeLabel":"null"}],"uniqueKey":"firstName","typeLabel":"string | null"},"lastName":{"oneOf":[{"type":"string","description":"Supported top-level alternative; use `customer.lastName` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nNew customer's last name. Required when creating a new customer.","maxLength":100,"uniqueKey":"lastName.oneOf.0","typeLabel":"string"},{"type":"null","description":"Supported top-level alternative; use `customer.lastName` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nNew customer's last name. Required when creating a new customer.","maxLength":100,"uniqueKey":"lastName.oneOf.1","typeLabel":"null"}],"uniqueKey":"lastName","typeLabel":"string | null"},"emailAddress":{"oneOf":[{"type":"string","description":"Supported top-level alternative; use `customer.emailAddress` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nNew customer's primary email address. Required when creating a new customer. If it already belongs to a customer in the same merchant and business, supply that existing customer_id instead.","format":"email","maxLength":500,"uniqueKey":"emailAddress.oneOf.0","typeLabel":"string\u003cemail>"},{"type":"null","description":"Supported top-level alternative; use `customer.emailAddress` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nNew customer's primary email address. Required when creating a new customer. If it already belongs to a customer in the same merchant and business, supply that existing customer_id instead.","format":"email","maxLength":500,"uniqueKey":"emailAddress.oneOf.1","typeLabel":"null"}],"uniqueKey":"emailAddress","typeLabel":"string\u003cemail> | null"},"mobilePhoneNumber":{"oneOf":[{"type":"string","description":"Supported top-level alternative; use `customer.mobilePhoneNumber` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nCustomer mobile phone number.","maxLength":20,"uniqueKey":"mobilePhoneNumber.oneOf.0","typeLabel":"string"},{"type":"null","description":"Supported top-level alternative; use `customer.mobilePhoneNumber` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nCustomer mobile phone number.","maxLength":20,"uniqueKey":"mobilePhoneNumber.oneOf.1","typeLabel":"null"}],"uniqueKey":"mobilePhoneNumber","typeLabel":"string | null"},"addressLine1":{"oneOf":[{"type":"string","description":"Supported top-level alternative; use `customer.addressLine1` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nCustomer address line 1.","maxLength":255,"uniqueKey":"addressLine1.oneOf.0","typeLabel":"string"},{"type":"null","description":"Supported top-level alternative; use `customer.addressLine1` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nCustomer address line 1.","maxLength":255,"uniqueKey":"addressLine1.oneOf.1","typeLabel":"null"}],"uniqueKey":"addressLine1","typeLabel":"string | null"},"addressSuburb":{"oneOf":[{"type":"string","description":"Supported top-level alternative; use `customer.addressSuburb` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nCustomer city or suburb.","maxLength":100,"uniqueKey":"addressSuburb.oneOf.0","typeLabel":"string"},{"type":"null","description":"Supported top-level alternative; use `customer.addressSuburb` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nCustomer city or suburb.","maxLength":100,"uniqueKey":"addressSuburb.oneOf.1","typeLabel":"null"}],"uniqueKey":"addressSuburb","typeLabel":"string | null"},"addressState":{"oneOf":[{"type":"string","description":"Supported top-level alternative; use `customer.addressState` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nCustomer state or province.","maxLength":100,"uniqueKey":"addressState.oneOf.0","typeLabel":"string"},{"type":"null","description":"Supported top-level alternative; use `customer.addressState` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nCustomer state or province.","maxLength":100,"uniqueKey":"addressState.oneOf.1","typeLabel":"null"}],"uniqueKey":"addressState","typeLabel":"string | null"},"addressPostCode":{"oneOf":[{"type":"string","description":"Supported top-level alternative; use `customer.addressPostCode` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nCustomer postcode.","maxLength":50,"uniqueKey":"addressPostCode.oneOf.0","typeLabel":"string"},{"type":"null","description":"Supported top-level alternative; use `customer.addressPostCode` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nCustomer postcode.","maxLength":50,"uniqueKey":"addressPostCode.oneOf.1","typeLabel":"null"}],"uniqueKey":"addressPostCode","typeLabel":"string | null"},"plan_name":{"oneOf":[{"type":"string","description":"Supported top-level alternative; use `plan.plan_name` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nSubscription name. In template mode, omission or null inherits the template name. Required and nonempty in other modes.","maxLength":255,"uniqueKey":"plan_name.oneOf.0","typeLabel":"string"},{"type":"null","description":"Supported top-level alternative; use `plan.plan_name` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nSubscription name. In template mode, omission or null inherits the template name. Required and nonempty in other modes.","maxLength":255,"uniqueKey":"plan_name.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan_name","typeLabel":"string | null"},"description":{"oneOf":[{"type":"string","description":"Supported top-level alternative; use `plan.description` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nDescription.","maxLength":500,"uniqueKey":"description.oneOf.0","typeLabel":"string"},{"type":"null","description":"Supported top-level alternative; use `plan.description` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nDescription.","maxLength":500,"uniqueKey":"description.oneOf.1","typeLabel":"null"}],"uniqueKey":"description","typeLabel":"string | null"},"recurring":{"oneOf":[{"type":"object","properties":{"enabled":{"oneOf":[{"type":"integer","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":[0,1,null],"uniqueKey":"recurring.oneOf.0.enabled.oneOf.0","typeLabel":"enum\u003cinteger>"},{"type":"null","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":[0,1,null],"uniqueKey":"recurring.oneOf.0.enabled.oneOf.1","typeLabel":"null"},{"type":"boolean","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","uniqueKey":"recurring.oneOf.0.enabled.oneOf.2","typeLabel":"boolean"},{"type":"string","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":["0","1"],"uniqueKey":"recurring.oneOf.0.enabled.oneOf.3","typeLabel":"enum\u003cstring>"},{"type":"null","uniqueKey":"recurring.oneOf.0.enabled.oneOf.4","typeLabel":"null"}],"uniqueKey":"recurring.oneOf.0.enabled","typeLabel":"enum\u003cinteger> · null · boolean · enum\u003cstring> · null"},"schedule_name":{"oneOf":[{"type":"string","description":"Payment schedule name. Required and non-null when recurring.enabled=1 (or true); at most 255 characters.","maxLength":255,"uniqueKey":"recurring.oneOf.0.schedule_name.oneOf.0","typeLabel":"string"},{"type":"null","description":"Payment schedule name. Required and non-null when recurring.enabled=1 (or true); at most 255 characters.","maxLength":255,"uniqueKey":"recurring.oneOf.0.schedule_name.oneOf.1","typeLabel":"null"}],"uniqueKey":"recurring.oneOf.0.schedule_name","typeLabel":"string | null"},"recurring_type":{"oneOf":[{"type":"integer","description":"1 after a number of successful payments; 2 at a cumulative amount; 3 until cancelled; 4 on an end date. Type 5 is not allowed here; use plan.schedule for By agreement. Required when recurring.enabled=true.","enum":[1,2,3,4,null],"uniqueKey":"recurring.oneOf.0.recurring_type.oneOf.0","typeLabel":"enum\u003cinteger>"},{"type":"null","description":"1 after a number of successful payments; 2 at a cumulative amount; 3 until cancelled; 4 on an end date. Type 5 is not allowed here; use plan.schedule for By agreement. Required when recurring.enabled=true.","enum":[1,2,3,4,null],"uniqueKey":"recurring.oneOf.0.recurring_type.oneOf.1","typeLabel":"null"}],"uniqueKey":"recurring.oneOf.0.recurring_type","typeLabel":"enum\u003cinteger> | null"},"amount":{"oneOf":[{"type":"number","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required when recurring.enabled=true.","multipleOf":0.01,"maximum":9999999.99,"minimum":0.01,"uniqueKey":"recurring.oneOf.0.amount.oneOf.0","typeLabel":"number"},{"type":"null","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required when recurring.enabled=true.","multipleOf":0.01,"maximum":9999999.99,"minimum":0.01,"uniqueKey":"recurring.oneOf.0.amount.oneOf.1","typeLabel":"null"},{"type":"string","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required when recurring.enabled=true.","pattern":"^\\d+(\\.\\d{1,2})?$","uniqueKey":"recurring.oneOf.0.amount.oneOf.2","typeLabel":"string"},{"type":"null","uniqueKey":"recurring.oneOf.0.amount.oneOf.3","typeLabel":"null"}],"uniqueKey":"recurring.oneOf.0.amount","typeLabel":"number · null · string · null"},"start_date":{"oneOf":[{"type":"string","description":"Start date. Required and non-null when recurring.enabled=1 or recurring.enabled=true. YYYY-MM-DD is recommended. Must be no earlier than tomorrow in the service business timezone.","format":"date","uniqueKey":"recurring.oneOf.0.start_date.oneOf.0","typeLabel":"string\u003cdate>"},{"type":"null","description":"Start date. Required and non-null when recurring.enabled=1 or recurring.enabled=true. YYYY-MM-DD is recommended. Must be no earlier than tomorrow in the service business timezone.","format":"date","uniqueKey":"recurring.oneOf.0.start_date.oneOf.1","typeLabel":"null"}],"uniqueKey":"recurring.oneOf.0.start_date","typeLabel":"string\u003cdate> | null"},"end_date":{"oneOf":[{"type":"string","description":"End date, preferably YYYY-MM-DD. Required and non-null when the recurring segment is enabled and recurring_type=4. When supplied, cannot precede start_date in the same segment.","format":"date","uniqueKey":"recurring.oneOf.0.end_date.oneOf.0","typeLabel":"string\u003cdate>"},{"type":"null","description":"End date, preferably YYYY-MM-DD. Required and non-null when the recurring segment is enabled and recurring_type=4. When supplied, cannot precede start_date in the same segment.","format":"date","uniqueKey":"recurring.oneOf.0.end_date.oneOf.1","typeLabel":"null"}],"uniqueKey":"recurring.oneOf.0.end_date","typeLabel":"string\u003cdate> | null"},"end_terms":{"oneOf":[{"type":"integer","description":"Number of successful payments, an integer of at least 1. Required and non-null when the recurring segment is enabled and recurring_type=1.","minimum":1,"uniqueKey":"recurring.oneOf.0.end_terms.oneOf.0","typeLabel":"integer"},{"type":"null","description":"Number of successful payments, an integer of at least 1. Required and non-null when the recurring segment is enabled and recurring_type=1.","minimum":1,"uniqueKey":"recurring.oneOf.0.end_terms.oneOf.1","typeLabel":"null"}],"uniqueKey":"recurring.oneOf.0.end_terms","typeLabel":"integer | null"},"total_amount":{"oneOf":[{"type":"number","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when the recurring segment is enabled and recurring_type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","multipleOf":0.01,"minimum":0.01,"uniqueKey":"recurring.oneOf.0.total_amount.oneOf.0","typeLabel":"number"},{"type":"null","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when the recurring segment is enabled and recurring_type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","multipleOf":0.01,"minimum":0.01,"uniqueKey":"recurring.oneOf.0.total_amount.oneOf.1","typeLabel":"null"},{"type":"string","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when the recurring segment is enabled and recurring_type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","pattern":"^\\d+(\\.\\d{1,2})?$","uniqueKey":"recurring.oneOf.0.total_amount.oneOf.2","typeLabel":"string"},{"type":"null","uniqueKey":"recurring.oneOf.0.total_amount.oneOf.3","typeLabel":"null"}],"uniqueKey":"recurring.oneOf.0.total_amount","typeLabel":"number · null · string · null"},"day_of_debit":{"oneOf":[{"type":"string","description":"RFC 5545 RRULE debit rule. Required and non-null when the recurring segment is enabled. See the integration guide for frequency syntax. Must not place a debit day before start_date within the same cycle. Nonstandard intervals require process_type=12 and custom_cycle_type/custom_cycle.","maxLength":255,"uniqueKey":"recurring.oneOf.0.day_of_debit.oneOf.0","typeLabel":"string"},{"type":"null","description":"RFC 5545 RRULE debit rule. Required and non-null when the recurring segment is enabled. See the integration guide for frequency syntax. Must not place a debit day before start_date within the same cycle. Nonstandard intervals require process_type=12 and custom_cycle_type/custom_cycle.","maxLength":255,"uniqueKey":"recurring.oneOf.0.day_of_debit.oneOf.1","typeLabel":"null"}],"uniqueKey":"recurring.oneOf.0.day_of_debit","typeLabel":"string | null"},"process_type":{"oneOf":[{"type":"integer","description":"Provide 12 only for a custom frequency. Other frequencies are inferred from the RRULE; omit this field for them. Nonstandard RRULE intervals must use Custom.","enum":[12,null],"uniqueKey":"recurring.oneOf.0.process_type.oneOf.0","typeLabel":"enum\u003cinteger>"},{"type":"null","description":"Provide 12 only for a custom frequency. Other frequencies are inferred from the RRULE; omit this field for them. Nonstandard RRULE intervals must use Custom.","enum":[12,null],"uniqueKey":"recurring.oneOf.0.process_type.oneOf.1","typeLabel":"null"}],"uniqueKey":"recurring.oneOf.0.process_type","typeLabel":"enum\u003cinteger> | null"},"custom_cycle_type":{"oneOf":[{"type":"integer","description":"Required for process_type=12: 1 days, 2 weeks, 3 months, 4 years. Must correspond to the RRULE FREQ. Non-Custom mode prohibits nonempty custom cycle parameters. Required and non-null when recurring.process_type=12.","enum":[1,2,3,4,null],"uniqueKey":"recurring.oneOf.0.custom_cycle_type.oneOf.0","typeLabel":"enum\u003cinteger>"},{"type":"null","description":"Required for process_type=12: 1 days, 2 weeks, 3 months, 4 years. Must correspond to the RRULE FREQ. Non-Custom mode prohibits nonempty custom cycle parameters. Required and non-null when recurring.process_type=12.","enum":[1,2,3,4,null],"uniqueKey":"recurring.oneOf.0.custom_cycle_type.oneOf.1","typeLabel":"null"}],"uniqueKey":"recurring.oneOf.0.custom_cycle_type","typeLabel":"enum\u003cinteger> | null"},"custom_cycle":{"oneOf":[{"type":"integer","description":"Required for process_type=12. A positive integer equal to the RRULE INTERVAL. Minimum 5 for days and 1 for other units. Required and non-null when recurring.process_type=12.","minimum":1,"uniqueKey":"recurring.oneOf.0.custom_cycle.oneOf.0","typeLabel":"integer"},{"type":"null","description":"Required for process_type=12. A positive integer equal to the RRULE INTERVAL. Minimum 5 for days and 1 for other units. Required and non-null when recurring.process_type=12.","minimum":1,"uniqueKey":"recurring.oneOf.0.custom_cycle.oneOf.1","typeLabel":"null"}],"uniqueKey":"recurring.oneOf.0.custom_cycle","typeLabel":"integer | null"},"day_of_debit_dtstart":{"oneOf":[{"type":"string","description":"First debit anchor. Required for quarterly, half-yearly and yearly frequencies. YYYY-MM-DD is recommended; the date must be strictly after the corresponding start_date and within one billing cycle (3/6/12 months, clamped to month end). MM-DD is also accepted if it is a valid month/day; the full-date window restriction does not apply to that format.","pattern":"^(\\d{4}-)?\\d{2}-\\d{2}$","uniqueKey":"recurring.oneOf.0.day_of_debit_dtstart.oneOf.0","typeLabel":"string"},{"type":"null","description":"First debit anchor. Required for quarterly, half-yearly and yearly frequencies. YYYY-MM-DD is recommended; the date must be strictly after the corresponding start_date and within one billing cycle (3/6/12 months, clamped to month end). MM-DD is also accepted if it is a valid month/day; the full-date window restriction does not apply to that format.","pattern":"^(\\d{4}-)?\\d{2}-\\d{2}$","uniqueKey":"recurring.oneOf.0.day_of_debit_dtstart.oneOf.1","typeLabel":"null"}],"uniqueKey":"recurring.oneOf.0.day_of_debit_dtstart","typeLabel":"string | null"}},"description":"Supported top-level alternative; use `plan.recurring` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nRecurring subscription definition.","not":{"anyOf":[{"allOf":[{"required":["enabled"],"properties":{"enabled":{"enum":[true,1,"1"]}}},{"not":{"required":["schedule_name","recurring_type","amount","start_date","day_of_debit"],"properties":{"schedule_name":{"not":{"enum":[null]},"minLength":1},"recurring_type":{"not":{"enum":[null]}},"amount":{"not":{"enum":[null]}},"start_date":{"not":{"enum":[null]},"minLength":1},"day_of_debit":{"not":{"enum":[null]},"minLength":1}}}}]},{"allOf":[{"required":["enabled","recurring_type"],"properties":{"enabled":{"enum":[true,1,"1"]},"recurring_type":{"enum":[1]}}},{"not":{"required":["end_terms"],"properties":{"end_terms":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["enabled","recurring_type"],"properties":{"enabled":{"enum":[true,1,"1"]},"recurring_type":{"enum":[2]}}},{"not":{"required":["total_amount"],"properties":{"total_amount":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["enabled","recurring_type"],"properties":{"enabled":{"enum":[true,1,"1"]},"recurring_type":{"enum":[4]}}},{"not":{"required":["end_date"],"properties":{"end_date":{"not":{"enum":[null]},"minLength":1}}}}]},{"allOf":[{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}},{"not":{"required":["custom_cycle_type","custom_cycle"],"properties":{"custom_cycle_type":{"not":{"enum":[null]}},"custom_cycle":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["process_type","custom_cycle_type"],"properties":{"process_type":{"enum":[12]},"custom_cycle_type":{"enum":[1]}}},{"not":{"required":["custom_cycle"],"properties":{"custom_cycle":{"not":{"enum":[null]},"minimum":5}}}}]},{"allOf":[{"required":["custom_cycle_type"],"properties":{"custom_cycle_type":{"not":{"enum":[null]}}}},{"not":{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}}}]},{"allOf":[{"required":["custom_cycle"],"properties":{"custom_cycle":{"not":{"enum":[null]}}}},{"not":{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}}}]}]},"uniqueKey":"recurring.oneOf.0","typeLabel":"object"},{"type":"null","properties":{"enabled":{"oneOf":[{"type":"integer","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":[0,1,null]},{"type":"null","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":[0,1,null]},{"type":"boolean","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment."},{"type":"string","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":["0","1"]},{"type":"null"}]},"schedule_name":{"oneOf":[{"type":"string","description":"Payment schedule name. Required and non-null when recurring.enabled=1 (or true); at most 255 characters.","maxLength":255},{"type":"null","description":"Payment schedule name. Required and non-null when recurring.enabled=1 (or true); at most 255 characters.","maxLength":255}]},"recurring_type":{"oneOf":[{"type":"integer","description":"1 after a number of successful payments; 2 at a cumulative amount; 3 until cancelled; 4 on an end date. Type 5 is not allowed here; use plan.schedule for By agreement. Required when recurring.enabled=true.","enum":[1,2,3,4,null]},{"type":"null","description":"1 after a number of successful payments; 2 at a cumulative amount; 3 until cancelled; 4 on an end date. Type 5 is not allowed here; use plan.schedule for By agreement. Required when recurring.enabled=true.","enum":[1,2,3,4,null]}]},"amount":{"oneOf":[{"type":"number","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required when recurring.enabled=true.","multipleOf":0.01,"maximum":9999999.99,"minimum":0.01},{"type":"null","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required when recurring.enabled=true.","multipleOf":0.01,"maximum":9999999.99,"minimum":0.01},{"type":"string","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required when recurring.enabled=true.","pattern":"^\\d+(\\.\\d{1,2})?$"},{"type":"null"}]},"start_date":{"oneOf":[{"type":"string","description":"Start date. Required and non-null when recurring.enabled=1 or recurring.enabled=true. YYYY-MM-DD is recommended. Must be no earlier than tomorrow in the service business timezone.","format":"date"},{"type":"null","description":"Start date. Required and non-null when recurring.enabled=1 or recurring.enabled=true. YYYY-MM-DD is recommended. Must be no earlier than tomorrow in the service business timezone.","format":"date"}]},"end_date":{"oneOf":[{"type":"string","description":"End date, preferably YYYY-MM-DD. Required and non-null when the recurring segment is enabled and recurring_type=4. When supplied, cannot precede start_date in the same segment.","format":"date"},{"type":"null","description":"End date, preferably YYYY-MM-DD. Required and non-null when the recurring segment is enabled and recurring_type=4. When supplied, cannot precede start_date in the same segment.","format":"date"}]},"end_terms":{"oneOf":[{"type":"integer","description":"Number of successful payments, an integer of at least 1. Required and non-null when the recurring segment is enabled and recurring_type=1.","minimum":1},{"type":"null","description":"Number of successful payments, an integer of at least 1. Required and non-null when the recurring segment is enabled and recurring_type=1.","minimum":1}]},"total_amount":{"oneOf":[{"type":"number","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when the recurring segment is enabled and recurring_type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","multipleOf":0.01,"minimum":0.01},{"type":"null","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when the recurring segment is enabled and recurring_type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","multipleOf":0.01,"minimum":0.01},{"type":"string","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when the recurring segment is enabled and recurring_type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","pattern":"^\\d+(\\.\\d{1,2})?$"},{"type":"null"}]},"day_of_debit":{"oneOf":[{"type":"string","description":"RFC 5545 RRULE debit rule. Required and non-null when the recurring segment is enabled. See the integration guide for frequency syntax. Must not place a debit day before start_date within the same cycle. Nonstandard intervals require process_type=12 and custom_cycle_type/custom_cycle.","maxLength":255},{"type":"null","description":"RFC 5545 RRULE debit rule. Required and non-null when the recurring segment is enabled. See the integration guide for frequency syntax. Must not place a debit day before start_date within the same cycle. Nonstandard intervals require process_type=12 and custom_cycle_type/custom_cycle.","maxLength":255}]},"process_type":{"oneOf":[{"type":"integer","description":"Provide 12 only for a custom frequency. Other frequencies are inferred from the RRULE; omit this field for them. Nonstandard RRULE intervals must use Custom.","enum":[12,null]},{"type":"null","description":"Provide 12 only for a custom frequency. Other frequencies are inferred from the RRULE; omit this field for them. Nonstandard RRULE intervals must use Custom.","enum":[12,null]}]},"custom_cycle_type":{"oneOf":[{"type":"integer","description":"Required for process_type=12: 1 days, 2 weeks, 3 months, 4 years. Must correspond to the RRULE FREQ. Non-Custom mode prohibits nonempty custom cycle parameters. Required and non-null when recurring.process_type=12.","enum":[1,2,3,4,null]},{"type":"null","description":"Required for process_type=12: 1 days, 2 weeks, 3 months, 4 years. Must correspond to the RRULE FREQ. Non-Custom mode prohibits nonempty custom cycle parameters. Required and non-null when recurring.process_type=12.","enum":[1,2,3,4,null]}]},"custom_cycle":{"oneOf":[{"type":"integer","description":"Required for process_type=12. A positive integer equal to the RRULE INTERVAL. Minimum 5 for days and 1 for other units. Required and non-null when recurring.process_type=12.","minimum":1},{"type":"null","description":"Required for process_type=12. A positive integer equal to the RRULE INTERVAL. Minimum 5 for days and 1 for other units. Required and non-null when recurring.process_type=12.","minimum":1}]},"day_of_debit_dtstart":{"oneOf":[{"type":"string","description":"First debit anchor. Required for quarterly, half-yearly and yearly frequencies. YYYY-MM-DD is recommended; the date must be strictly after the corresponding start_date and within one billing cycle (3/6/12 months, clamped to month end). MM-DD is also accepted if it is a valid month/day; the full-date window restriction does not apply to that format.","pattern":"^(\\d{4}-)?\\d{2}-\\d{2}$"},{"type":"null","description":"First debit anchor. Required for quarterly, half-yearly and yearly frequencies. YYYY-MM-DD is recommended; the date must be strictly after the corresponding start_date and within one billing cycle (3/6/12 months, clamped to month end). MM-DD is also accepted if it is a valid month/day; the full-date window restriction does not apply to that format.","pattern":"^(\\d{4}-)?\\d{2}-\\d{2}$"}]}},"description":"Supported top-level alternative; use `plan.recurring` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nRecurring subscription definition.","not":{"anyOf":[{"allOf":[{"required":["enabled"],"properties":{"enabled":{"enum":[true,1,"1"]}}},{"not":{"required":["schedule_name","recurring_type","amount","start_date","day_of_debit"],"properties":{"schedule_name":{"not":{"enum":[null]},"minLength":1},"recurring_type":{"not":{"enum":[null]}},"amount":{"not":{"enum":[null]}},"start_date":{"not":{"enum":[null]},"minLength":1},"day_of_debit":{"not":{"enum":[null]},"minLength":1}}}}]},{"allOf":[{"required":["enabled","recurring_type"],"properties":{"enabled":{"enum":[true,1,"1"]},"recurring_type":{"enum":[1]}}},{"not":{"required":["end_terms"],"properties":{"end_terms":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["enabled","recurring_type"],"properties":{"enabled":{"enum":[true,1,"1"]},"recurring_type":{"enum":[2]}}},{"not":{"required":["total_amount"],"properties":{"total_amount":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["enabled","recurring_type"],"properties":{"enabled":{"enum":[true,1,"1"]},"recurring_type":{"enum":[4]}}},{"not":{"required":["end_date"],"properties":{"end_date":{"not":{"enum":[null]},"minLength":1}}}}]},{"allOf":[{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}},{"not":{"required":["custom_cycle_type","custom_cycle"],"properties":{"custom_cycle_type":{"not":{"enum":[null]}},"custom_cycle":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["process_type","custom_cycle_type"],"properties":{"process_type":{"enum":[12]},"custom_cycle_type":{"enum":[1]}}},{"not":{"required":["custom_cycle"],"properties":{"custom_cycle":{"not":{"enum":[null]},"minimum":5}}}}]},{"allOf":[{"required":["custom_cycle_type"],"properties":{"custom_cycle_type":{"not":{"enum":[null]}}}},{"not":{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}}}]},{"allOf":[{"required":["custom_cycle"],"properties":{"custom_cycle":{"not":{"enum":[null]}}}},{"not":{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}}}]}]},"uniqueKey":"recurring.oneOf.1","typeLabel":"null"}],"uniqueKey":"recurring","typeLabel":"object | null"},"one_off":{"oneOf":[{"type":"object","properties":{"enabled":{"oneOf":[{"type":"integer","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":[0,1,null],"uniqueKey":"one_off.oneOf.0.enabled.oneOf.0","typeLabel":"enum\u003cinteger>"},{"type":"null","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":[0,1,null],"uniqueKey":"one_off.oneOf.0.enabled.oneOf.1","typeLabel":"null"},{"type":"boolean","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","uniqueKey":"one_off.oneOf.0.enabled.oneOf.2","typeLabel":"boolean"},{"type":"string","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":["0","1"],"uniqueKey":"one_off.oneOf.0.enabled.oneOf.3","typeLabel":"enum\u003cstring>"},{"type":"null","uniqueKey":"one_off.oneOf.0.enabled.oneOf.4","typeLabel":"null"}],"uniqueKey":"one_off.oneOf.0.enabled","typeLabel":"enum\u003cinteger> · null · boolean · enum\u003cstring> · null"},"schedule_name":{"oneOf":[{"type":"string","description":"Payment schedule name. Required and non-null when one_off.enabled=1.","maxLength":255,"uniqueKey":"one_off.oneOf.0.schedule_name.oneOf.0","typeLabel":"string"},{"type":"null","description":"Payment schedule name. Required and non-null when one_off.enabled=1.","maxLength":255,"uniqueKey":"one_off.oneOf.0.schedule_name.oneOf.1","typeLabel":"null"}],"uniqueKey":"one_off.oneOf.0.schedule_name","typeLabel":"string | null"},"amount":{"oneOf":[{"type":"number","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required and non-null when one_off.enabled=1.","multipleOf":0.01,"maximum":9999999.99,"minimum":0.01,"uniqueKey":"one_off.oneOf.0.amount.oneOf.0","typeLabel":"number"},{"type":"null","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required and non-null when one_off.enabled=1.","multipleOf":0.01,"maximum":9999999.99,"minimum":0.01,"uniqueKey":"one_off.oneOf.0.amount.oneOf.1","typeLabel":"null"},{"type":"string","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required and non-null when one_off.enabled=1.","pattern":"^\\d+(\\.\\d{1,2})?$","uniqueKey":"one_off.oneOf.0.amount.oneOf.2","typeLabel":"string"},{"type":"null","uniqueKey":"one_off.oneOf.0.amount.oneOf.3","typeLabel":"null"}],"uniqueKey":"one_off.oneOf.0.amount","typeLabel":"number · null · string · null"},"description":{"oneOf":[{"type":"string","description":"Description.","maxLength":500,"uniqueKey":"one_off.oneOf.0.description.oneOf.0","typeLabel":"string"},{"type":"null","description":"Description.","maxLength":500,"uniqueKey":"one_off.oneOf.0.description.oneOf.1","typeLabel":"null"}],"uniqueKey":"one_off.oneOf.0.description","typeLabel":"string | null"},"payment_date":{"oneOf":[{"type":"string","description":"One-off debit date. Must be no earlier than tomorrow in the service business timezone. Required and non-null when one_off.enabled=1. YYYY-MM-DD is recommended. Cannot precede tomorrow in the service business timezone.","format":"date","uniqueKey":"one_off.oneOf.0.payment_date.oneOf.0","typeLabel":"string\u003cdate>"},{"type":"null","description":"One-off debit date. Must be no earlier than tomorrow in the service business timezone. Required and non-null when one_off.enabled=1. YYYY-MM-DD is recommended. Cannot precede tomorrow in the service business timezone.","format":"date","uniqueKey":"one_off.oneOf.0.payment_date.oneOf.1","typeLabel":"null"}],"uniqueKey":"one_off.oneOf.0.payment_date","typeLabel":"string\u003cdate> | null"}},"description":"Supported top-level alternative; use `plan.one_off` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nOne-off payment definition. Acts as a Deposit when enabled with recurring, or as a One-off when used alone.","not":{"anyOf":[{"allOf":[{"required":["enabled"],"properties":{"enabled":{"enum":[true,1,"1"]}}},{"not":{"required":["schedule_name","amount","payment_date"],"properties":{"schedule_name":{"not":{"enum":[null]},"minLength":1},"amount":{"not":{"enum":[null]}},"payment_date":{"not":{"enum":[null]},"minLength":1}}}}]}]},"uniqueKey":"one_off.oneOf.0","typeLabel":"object"},{"type":"null","properties":{"enabled":{"oneOf":[{"type":"integer","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":[0,1,null]},{"type":"null","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":[0,1,null]},{"type":"boolean","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment."},{"type":"string","description":"Whether to enable this segment. Prefer integer 1 to enable or 0 to disable; true/false and the strings \"0\"/\"1\" are also accepted. Manual mode must enable at least one segment. When enabled, provide all fields marked as required for the segment.","enum":["0","1"]},{"type":"null"}]},"schedule_name":{"oneOf":[{"type":"string","description":"Payment schedule name. Required and non-null when one_off.enabled=1.","maxLength":255},{"type":"null","description":"Payment schedule name. Required and non-null when one_off.enabled=1.","maxLength":255}]},"amount":{"oneOf":[{"type":"number","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required and non-null when one_off.enabled=1.","multipleOf":0.01,"maximum":9999999.99,"minimum":0.01},{"type":"null","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required and non-null when one_off.enabled=1.","multipleOf":0.01,"maximum":9999999.99,"minimum":0.01},{"type":"string","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required and non-null when one_off.enabled=1.","pattern":"^\\d+(\\.\\d{1,2})?$"},{"type":"null"}]},"description":{"oneOf":[{"type":"string","description":"Description.","maxLength":500},{"type":"null","description":"Description.","maxLength":500}]},"payment_date":{"oneOf":[{"type":"string","description":"One-off debit date. Must be no earlier than tomorrow in the service business timezone. Required and non-null when one_off.enabled=1. YYYY-MM-DD is recommended. Cannot precede tomorrow in the service business timezone.","format":"date"},{"type":"null","description":"One-off debit date. Must be no earlier than tomorrow in the service business timezone. Required and non-null when one_off.enabled=1. YYYY-MM-DD is recommended. Cannot precede tomorrow in the service business timezone.","format":"date"}]}},"description":"Supported top-level alternative; use `plan.one_off` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nOne-off payment definition. Acts as a Deposit when enabled with recurring, or as a One-off when used alone.","not":{"anyOf":[{"allOf":[{"required":["enabled"],"properties":{"enabled":{"enum":[true,1,"1"]}}},{"not":{"required":["schedule_name","amount","payment_date"],"properties":{"schedule_name":{"not":{"enum":[null]},"minLength":1},"amount":{"not":{"enum":[null]}},"payment_date":{"not":{"enum":[null]},"minLength":1}}}}]}]},"uniqueKey":"one_off.oneOf.1","typeLabel":"null"}],"uniqueKey":"one_off","typeLabel":"object | null"},"schedule":{"oneOf":[{"type":"object","properties":{"type":{"type":"integer","description":"Initial By agreement schedule type: 1 after a number of successful payments; 2 at a cumulative amount; 3 until cancelled; 4 on an end date; 6 One-off. Types 5 and 7 are not supported.","enum":[1,2,3,4,6],"isRequired":true,"uniqueKey":"schedule.oneOf.0.type","typeLabel":"enum\u003cinteger>"},"amount":{"oneOf":[{"type":"number","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required and non-null when schedule is nonempty.","multipleOf":0.01,"maximum":9999999.99,"minimum":0.01,"isRequired":true,"uniqueKey":"schedule.oneOf.0.amount.oneOf.0","typeLabel":"number"},{"type":"string","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required and non-null when schedule is nonempty.","pattern":"^\\d+(\\.\\d{1,2})?$","isRequired":true,"uniqueKey":"schedule.oneOf.0.amount.oneOf.1","typeLabel":"string"}],"isRequired":true,"uniqueKey":"schedule.oneOf.0.amount","typeLabel":"number | string"},"start_date":{"type":"string","description":"Start date. Required and non-null when schedule is nonempty. YYYY-MM-DD is recommended. Must be no earlier than tomorrow in the service business timezone.","format":"date","minLength":1,"isRequired":true,"uniqueKey":"schedule.oneOf.0.start_date","typeLabel":"string\u003cdate>"},"schedule_name":{"type":"string","description":"Payment schedule name. Required and non-null when schedule is nonempty; at most 255 characters.","maxLength":255,"minLength":1,"isRequired":true,"uniqueKey":"schedule.oneOf.0.schedule_name","typeLabel":"string"},"total_amount":{"oneOf":[{"type":"number","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when schedule.type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","multipleOf":0.01,"minimum":0.01,"uniqueKey":"schedule.oneOf.0.total_amount.oneOf.0","typeLabel":"number"},{"type":"null","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when schedule.type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","multipleOf":0.01,"minimum":0.01,"uniqueKey":"schedule.oneOf.0.total_amount.oneOf.1","typeLabel":"null"},{"type":"string","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when schedule.type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","pattern":"^\\d+(\\.\\d{1,2})?$","uniqueKey":"schedule.oneOf.0.total_amount.oneOf.2","typeLabel":"string"},{"type":"null","uniqueKey":"schedule.oneOf.0.total_amount.oneOf.3","typeLabel":"null"}],"uniqueKey":"schedule.oneOf.0.total_amount","typeLabel":"number · null · string · null"},"day_of_debit":{"oneOf":[{"type":"string","description":"RFC 5545 RRULE debit rule. Required and non-null for schedule.type=1/2/3/4; optional for type=6 (one-off). Must not place a debit day before start_date within the same cycle. Nonstandard intervals require process_type=12 and custom_cycle_type/custom_cycle.","maxLength":255,"uniqueKey":"schedule.oneOf.0.day_of_debit.oneOf.0","typeLabel":"string"},{"type":"null","description":"RFC 5545 RRULE debit rule. Required and non-null for schedule.type=1/2/3/4; optional for type=6 (one-off). Must not place a debit day before start_date within the same cycle. Nonstandard intervals require process_type=12 and custom_cycle_type/custom_cycle.","maxLength":255,"uniqueKey":"schedule.oneOf.0.day_of_debit.oneOf.1","typeLabel":"null"}],"uniqueKey":"schedule.oneOf.0.day_of_debit","typeLabel":"string | null"},"end_date":{"oneOf":[{"type":"string","description":"End date, preferably YYYY-MM-DD. Required and non-null when schedule.type=4. When supplied, cannot precede start_date in the same segment.","format":"date","uniqueKey":"schedule.oneOf.0.end_date.oneOf.0","typeLabel":"string\u003cdate>"},{"type":"null","description":"End date, preferably YYYY-MM-DD. Required and non-null when schedule.type=4. When supplied, cannot precede start_date in the same segment.","format":"date","uniqueKey":"schedule.oneOf.0.end_date.oneOf.1","typeLabel":"null"}],"uniqueKey":"schedule.oneOf.0.end_date","typeLabel":"string\u003cdate> | null"},"end_terms":{"oneOf":[{"type":"integer","description":"Number of successful payments, an integer of at least 1. Required and non-null when schedule.type=1.","minimum":1,"uniqueKey":"schedule.oneOf.0.end_terms.oneOf.0","typeLabel":"integer"},{"type":"null","description":"Number of successful payments, an integer of at least 1. Required and non-null when schedule.type=1.","minimum":1,"uniqueKey":"schedule.oneOf.0.end_terms.oneOf.1","typeLabel":"null"}],"uniqueKey":"schedule.oneOf.0.end_terms","typeLabel":"integer | null"},"day_of_debit_dtstart":{"oneOf":[{"type":"string","description":"First debit anchor. Required for quarterly, half-yearly and yearly frequencies. YYYY-MM-DD is recommended; the date must be strictly after the corresponding start_date and within one billing cycle (3/6/12 months, clamped to month end). MM-DD is also accepted if it is a valid month/day; the full-date window restriction does not apply to that format.","pattern":"^(\\d{4}-)?\\d{2}-\\d{2}$","uniqueKey":"schedule.oneOf.0.day_of_debit_dtstart.oneOf.0","typeLabel":"string"},{"type":"null","description":"First debit anchor. Required for quarterly, half-yearly and yearly frequencies. YYYY-MM-DD is recommended; the date must be strictly after the corresponding start_date and within one billing cycle (3/6/12 months, clamped to month end). MM-DD is also accepted if it is a valid month/day; the full-date window restriction does not apply to that format.","pattern":"^(\\d{4}-)?\\d{2}-\\d{2}$","uniqueKey":"schedule.oneOf.0.day_of_debit_dtstart.oneOf.1","typeLabel":"null"}],"uniqueKey":"schedule.oneOf.0.day_of_debit_dtstart","typeLabel":"string | null"},"process_type":{"oneOf":[{"type":"integer","description":"Provide 12 only for a custom frequency. Other frequencies are inferred from the RRULE; omit this field for them. Nonstandard RRULE intervals must use Custom.","enum":[12,null],"uniqueKey":"schedule.oneOf.0.process_type.oneOf.0","typeLabel":"enum\u003cinteger>"},{"type":"null","description":"Provide 12 only for a custom frequency. Other frequencies are inferred from the RRULE; omit this field for them. Nonstandard RRULE intervals must use Custom.","enum":[12,null],"uniqueKey":"schedule.oneOf.0.process_type.oneOf.1","typeLabel":"null"}],"uniqueKey":"schedule.oneOf.0.process_type","typeLabel":"enum\u003cinteger> | null"},"custom_cycle_type":{"oneOf":[{"type":"integer","description":"Required for process_type=12: 1 days, 2 weeks, 3 months, 4 years. Must correspond to the RRULE FREQ. Non-Custom mode prohibits nonempty custom cycle parameters. Required and non-null when schedule.process_type=12.","enum":[1,2,3,4,null],"uniqueKey":"schedule.oneOf.0.custom_cycle_type.oneOf.0","typeLabel":"enum\u003cinteger>"},{"type":"null","description":"Required for process_type=12: 1 days, 2 weeks, 3 months, 4 years. Must correspond to the RRULE FREQ. Non-Custom mode prohibits nonempty custom cycle parameters. Required and non-null when schedule.process_type=12.","enum":[1,2,3,4,null],"uniqueKey":"schedule.oneOf.0.custom_cycle_type.oneOf.1","typeLabel":"null"}],"uniqueKey":"schedule.oneOf.0.custom_cycle_type","typeLabel":"enum\u003cinteger> | null"},"custom_cycle":{"oneOf":[{"type":"integer","description":"Required for process_type=12. A positive integer equal to the RRULE INTERVAL. Minimum 5 for days and 1 for other units. Required and non-null when schedule.process_type=12.","minimum":1,"uniqueKey":"schedule.oneOf.0.custom_cycle.oneOf.0","typeLabel":"integer"},{"type":"null","description":"Required for process_type=12. A positive integer equal to the RRULE INTERVAL. Minimum 5 for days and 1 for other units. Required and non-null when schedule.process_type=12.","minimum":1,"uniqueKey":"schedule.oneOf.0.custom_cycle.oneOf.1","typeLabel":"null"}],"uniqueKey":"schedule.oneOf.0.custom_cycle","typeLabel":"integer | null"}},"description":"Supported top-level alternative; use `plan.schedule` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nInitial By agreement payment schedule definition. Mutually exclusive with manual recurring/one_off mode and template_id mode.","required":["type","amount","start_date","schedule_name"],"not":{"anyOf":[{"allOf":[{"required":["type"],"properties":{"type":{"enum":[1]}}},{"not":{"required":["end_terms"],"properties":{"end_terms":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["type"],"properties":{"type":{"enum":[2]}}},{"not":{"required":["total_amount"],"properties":{"total_amount":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["type"],"properties":{"type":{"enum":[4]}}},{"not":{"required":["end_date"],"properties":{"end_date":{"not":{"enum":[null]},"minLength":1}}}}]},{"allOf":[{"required":["type"],"properties":{"type":{"enum":[1,2,3,4]}}},{"not":{"required":["day_of_debit"],"properties":{"day_of_debit":{"not":{"enum":[null]},"minLength":1}}}}]},{"allOf":[{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}},{"not":{"required":["custom_cycle_type","custom_cycle"],"properties":{"custom_cycle_type":{"not":{"enum":[null]}},"custom_cycle":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["process_type","custom_cycle_type"],"properties":{"process_type":{"enum":[12]},"custom_cycle_type":{"enum":[1]}}},{"not":{"required":["custom_cycle"],"properties":{"custom_cycle":{"not":{"enum":[null]},"minimum":5}}}}]},{"allOf":[{"required":["custom_cycle_type"],"properties":{"custom_cycle_type":{"not":{"enum":[null]}}}},{"not":{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}}}]},{"allOf":[{"required":["custom_cycle"],"properties":{"custom_cycle":{"not":{"enum":[null]}}}},{"not":{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}}}]}]},"uniqueKey":"schedule.oneOf.0","typeLabel":"object"},{"type":"null","properties":{"type":{"type":"integer","description":"Initial By agreement schedule type: 1 after a number of successful payments; 2 at a cumulative amount; 3 until cancelled; 4 on an end date; 6 One-off. Types 5 and 7 are not supported.","enum":[1,2,3,4,6]},"amount":{"oneOf":[{"type":"number","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required and non-null when schedule is nonempty.","multipleOf":0.01,"maximum":9999999.99,"minimum":0.01},{"type":"string","description":"One-off or per-payment amount in major currency units, for example 10.50 means AUD 10.50. At most two decimal places. Numbers and numeric strings are accepted, with a minimum of 0.01 and maximum of 9999999.99; the same range applies to both types. Required and non-null when schedule is nonempty.","pattern":"^\\d+(\\.\\d{1,2})?$"}]},"start_date":{"type":"string","description":"Start date. Required and non-null when schedule is nonempty. YYYY-MM-DD is recommended. Must be no earlier than tomorrow in the service business timezone.","format":"date","minLength":1},"schedule_name":{"type":"string","description":"Payment schedule name. Required and non-null when schedule is nonempty; at most 255 characters.","maxLength":255,"minLength":1},"total_amount":{"oneOf":[{"type":"number","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when schedule.type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","multipleOf":0.01,"minimum":0.01},{"type":"null","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when schedule.type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","multipleOf":0.01,"minimum":0.01},{"type":"string","description":"Target total amount in major currency units, with at most two decimal places and a minimum of 0.01. Accepts a number or numeric string. Required and non-null when schedule.type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount.","pattern":"^\\d+(\\.\\d{1,2})?$"},{"type":"null"}]},"day_of_debit":{"oneOf":[{"type":"string","description":"RFC 5545 RRULE debit rule. Required and non-null for schedule.type=1/2/3/4; optional for type=6 (one-off). Must not place a debit day before start_date within the same cycle. Nonstandard intervals require process_type=12 and custom_cycle_type/custom_cycle.","maxLength":255},{"type":"null","description":"RFC 5545 RRULE debit rule. Required and non-null for schedule.type=1/2/3/4; optional for type=6 (one-off). Must not place a debit day before start_date within the same cycle. Nonstandard intervals require process_type=12 and custom_cycle_type/custom_cycle.","maxLength":255}]},"end_date":{"oneOf":[{"type":"string","description":"End date, preferably YYYY-MM-DD. Required and non-null when schedule.type=4. When supplied, cannot precede start_date in the same segment.","format":"date"},{"type":"null","description":"End date, preferably YYYY-MM-DD. Required and non-null when schedule.type=4. When supplied, cannot precede start_date in the same segment.","format":"date"}]},"end_terms":{"oneOf":[{"type":"integer","description":"Number of successful payments, an integer of at least 1. Required and non-null when schedule.type=1.","minimum":1},{"type":"null","description":"Number of successful payments, an integer of at least 1. Required and non-null when schedule.type=1.","minimum":1}]},"day_of_debit_dtstart":{"oneOf":[{"type":"string","description":"First debit anchor. Required for quarterly, half-yearly and yearly frequencies. YYYY-MM-DD is recommended; the date must be strictly after the corresponding start_date and within one billing cycle (3/6/12 months, clamped to month end). MM-DD is also accepted if it is a valid month/day; the full-date window restriction does not apply to that format.","pattern":"^(\\d{4}-)?\\d{2}-\\d{2}$"},{"type":"null","description":"First debit anchor. Required for quarterly, half-yearly and yearly frequencies. YYYY-MM-DD is recommended; the date must be strictly after the corresponding start_date and within one billing cycle (3/6/12 months, clamped to month end). MM-DD is also accepted if it is a valid month/day; the full-date window restriction does not apply to that format.","pattern":"^(\\d{4}-)?\\d{2}-\\d{2}$"}]},"process_type":{"oneOf":[{"type":"integer","description":"Provide 12 only for a custom frequency. Other frequencies are inferred from the RRULE; omit this field for them. Nonstandard RRULE intervals must use Custom.","enum":[12,null]},{"type":"null","description":"Provide 12 only for a custom frequency. Other frequencies are inferred from the RRULE; omit this field for them. Nonstandard RRULE intervals must use Custom.","enum":[12,null]}]},"custom_cycle_type":{"oneOf":[{"type":"integer","description":"Required for process_type=12: 1 days, 2 weeks, 3 months, 4 years. Must correspond to the RRULE FREQ. Non-Custom mode prohibits nonempty custom cycle parameters. Required and non-null when schedule.process_type=12.","enum":[1,2,3,4,null]},{"type":"null","description":"Required for process_type=12: 1 days, 2 weeks, 3 months, 4 years. Must correspond to the RRULE FREQ. Non-Custom mode prohibits nonempty custom cycle parameters. Required and non-null when schedule.process_type=12.","enum":[1,2,3,4,null]}]},"custom_cycle":{"oneOf":[{"type":"integer","description":"Required for process_type=12. A positive integer equal to the RRULE INTERVAL. Minimum 5 for days and 1 for other units. Required and non-null when schedule.process_type=12.","minimum":1},{"type":"null","description":"Required for process_type=12. A positive integer equal to the RRULE INTERVAL. Minimum 5 for days and 1 for other units. Required and non-null when schedule.process_type=12.","minimum":1}]}},"description":"Supported top-level alternative; use `plan.schedule` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nInitial By agreement payment schedule definition. Mutually exclusive with manual recurring/one_off mode and template_id mode.","required":["type","amount","start_date","schedule_name"],"not":{"anyOf":[{"allOf":[{"required":["type"],"properties":{"type":{"enum":[1]}}},{"not":{"required":["end_terms"],"properties":{"end_terms":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["type"],"properties":{"type":{"enum":[2]}}},{"not":{"required":["total_amount"],"properties":{"total_amount":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["type"],"properties":{"type":{"enum":[4]}}},{"not":{"required":["end_date"],"properties":{"end_date":{"not":{"enum":[null]},"minLength":1}}}}]},{"allOf":[{"required":["type"],"properties":{"type":{"enum":[1,2,3,4]}}},{"not":{"required":["day_of_debit"],"properties":{"day_of_debit":{"not":{"enum":[null]},"minLength":1}}}}]},{"allOf":[{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}},{"not":{"required":["custom_cycle_type","custom_cycle"],"properties":{"custom_cycle_type":{"not":{"enum":[null]}},"custom_cycle":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["process_type","custom_cycle_type"],"properties":{"process_type":{"enum":[12]},"custom_cycle_type":{"enum":[1]}}},{"not":{"required":["custom_cycle"],"properties":{"custom_cycle":{"not":{"enum":[null]},"minimum":5}}}}]},{"allOf":[{"required":["custom_cycle_type"],"properties":{"custom_cycle_type":{"not":{"enum":[null]}}}},{"not":{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}}}]},{"allOf":[{"required":["custom_cycle"],"properties":{"custom_cycle":{"not":{"enum":[null]}}}},{"not":{"required":["process_type"],"properties":{"process_type":{"enum":[12]}}}}]}]},"uniqueKey":"schedule.oneOf.1","typeLabel":"null"}],"uniqueKey":"schedule","typeLabel":"object | null"},"surcharge_config":{"oneOf":[{"type":"array","description":"Supported top-level alternative; use `plan.surcharge_config` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nSurcharge options, preferably an array of strings. See the schema and examples for allowed options. Omission, null or an empty array disables all options; non-array values are also treated as all disabled. Unknown options do not enable charges. credit_card_surcharge selects the credit card surcharge group. Actual charges depend on merchant business rules and payment method restrictions. Applies in manual mode. Template mode uses the template's surcharge options, which this field cannot override. By agreement schedule mode does not support this setting. Card surcharges remain subject to the applicable charging policy; if it prohibits them, selecting card options does not enable charges.","items":{"type":"string","description":"Surcharge option.","enum":["direct_debit_surcharge","visa_domestic_surcharge","visa_international_surcharge","mastercard_domestic_surcharge","mastercard_international_surcharge","amex_domestic_surcharge","amex_international_surcharge","credit_card_surcharge"],"uniqueKey":"surcharge_config.oneOf.0.items.[INDEX]","typeLabel":"enum\u003cstring>"},"uniqueKey":"surcharge_config.oneOf.0","typeLabel":"enum\u003cstring>[]"},{"type":"null","description":"Supported top-level alternative; use `plan.surcharge_config` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nSurcharge options, preferably an array of strings. See the schema and examples for allowed options. Omission, null or an empty array disables all options; non-array values are also treated as all disabled. Unknown options do not enable charges. credit_card_surcharge selects the credit card surcharge group. Actual charges depend on merchant business rules and payment method restrictions. Applies in manual mode. Template mode uses the template's surcharge options, which this field cannot override. By agreement schedule mode does not support this setting. Card surcharges remain subject to the applicable charging policy; if it prohibits them, selecting card options does not enable charges.","items":{"type":"string","description":"Surcharge option.","enum":["direct_debit_surcharge","visa_domestic_surcharge","visa_international_surcharge","mastercard_domestic_surcharge","mastercard_international_surcharge","amex_domestic_surcharge","amex_international_surcharge","credit_card_surcharge"]},"uniqueKey":"surcharge_config.oneOf.1","typeLabel":"null"}],"uniqueKey":"surcharge_config","typeLabel":"enum\u003cstring>[] | null"},"dishonour_fee_switch":{"oneOf":[{"type":"boolean","description":"Supported top-level alternative; use `plan.dishonour_fee_switch` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nWhether to charge a customer dishonour fee. Omission or null defaults to off. Enabling it requires an applicable positive fee configuration; the signed terms determine the actual amount. Also accepts 0/1 and the strings \"0\"/\"1\". Applies only to manual recurring/one_off mode. Template mode and By agreement schedule mode do not support this setting through this field.","uniqueKey":"dishonour_fee_switch.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Supported top-level alternative; use `plan.dishonour_fee_switch` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nWhether to charge a customer dishonour fee. Omission or null defaults to off. Enabling it requires an applicable positive fee configuration; the signed terms determine the actual amount. Also accepts 0/1 and the strings \"0\"/\"1\". Applies only to manual recurring/one_off mode. Template mode and By agreement schedule mode do not support this setting through this field.","uniqueKey":"dishonour_fee_switch.oneOf.1","typeLabel":"null"},{"type":"integer","description":"Supported top-level alternative; use `plan.dishonour_fee_switch` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nWhether to charge a customer dishonour fee. Omission or null defaults to off. Enabling it requires an applicable positive fee configuration; the signed terms determine the actual amount. Also accepts 0/1 and the strings \"0\"/\"1\". Applies only to manual recurring/one_off mode. Template mode and By agreement schedule mode do not support this setting through this field.","enum":[0,1],"uniqueKey":"dishonour_fee_switch.oneOf.2","typeLabel":"enum\u003cinteger>"},{"type":"string","description":"Supported top-level alternative; use `plan.dishonour_fee_switch` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nWhether to charge a customer dishonour fee. Omission or null defaults to off. Enabling it requires an applicable positive fee configuration; the signed terms determine the actual amount. Also accepts 0/1 and the strings \"0\"/\"1\". Applies only to manual recurring/one_off mode. Template mode and By agreement schedule mode do not support this setting through this field.","enum":["0","1"],"uniqueKey":"dishonour_fee_switch.oneOf.3","typeLabel":"enum\u003cstring>"},{"type":"null","uniqueKey":"dishonour_fee_switch.oneOf.4","typeLabel":"null"}],"uniqueKey":"dishonour_fee_switch","typeLabel":"boolean · null · enum\u003cinteger> · enum\u003cstring> · null"},"template_id":{"oneOf":[{"type":"string","description":"Supported top-level alternative; use `plan.template_id` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nAvailable template ID from GET /api/v2/plan/list. Only enabled, ACTIVE, non-tiered templates other than By agreement are accepted.","maxLength":20,"uniqueKey":"template_id.oneOf.0","typeLabel":"string"},{"type":"null","description":"Supported top-level alternative; use `plan.template_id` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nAvailable template ID from GET /api/v2/plan/list. Only enabled, ACTIVE, non-tiered templates other than By agreement are accepted.","maxLength":20,"uniqueKey":"template_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"template_id","typeLabel":"string | null"},"start_date":{"oneOf":[{"type":"string","description":"Supported top-level alternative; use `plan.start_date` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nDate override for the template's recurring segment. Required when the template contains recurring. Must be no earlier than tomorrow in the service business timezone.","format":"date","uniqueKey":"start_date.oneOf.0","typeLabel":"string\u003cdate>"},{"type":"null","description":"Supported top-level alternative; use `plan.start_date` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nDate override for the template's recurring segment. Required when the template contains recurring. Must be no earlier than tomorrow in the service business timezone.","format":"date","uniqueKey":"start_date.oneOf.1","typeLabel":"null"}],"uniqueKey":"start_date","typeLabel":"string\u003cdate> | null"},"payment_date":{"oneOf":[{"type":"string","description":"Supported top-level alternative; use `plan.payment_date` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nDate override for the template's one_off segment. Required when the template contains one_off. Must be no earlier than tomorrow in the service business timezone.","format":"date","uniqueKey":"payment_date.oneOf.0","typeLabel":"string\u003cdate>"},{"type":"null","description":"Supported top-level alternative; use `plan.payment_date` for new integrations. If both forms supply this field, the nested value takes precedence.\n\nDate override for the template's one_off segment. Required when the template contains one_off. Must be no earlier than tomorrow in the service business timezone.","format":"date","uniqueKey":"payment_date.oneOf.1","typeLabel":"null"}],"uniqueKey":"payment_date","typeLabel":"string\u003cdate> | null"}},"required":["merchant_id"],"not":{"anyOf":[{"not":{"oneOf":[{"allOf":[{"anyOf":[{"type":"object","required":["customer"],"properties":{"customer":{"type":"object","required":["customer_id"],"properties":{"customer_id":{"type":"string","minLength":1,"pattern":"\\S"}}}}},{"allOf":[{"not":{"type":"object","required":["customer"],"properties":{"customer":{"type":"object","required":["customer_id"],"properties":{"customer_id":{}}}}}},{"type":"object","required":["customer_id"],"properties":{"customer_id":{"type":"string","minLength":1,"pattern":"\\S"}}}]}]},{"not":{"anyOf":[{"anyOf":[{"type":"object","required":["customer"],"properties":{"customer":{"type":"object","required":["firstName"],"properties":{"firstName":{"type":"string","minLength":1,"pattern":"\\S"}}}}},{"allOf":[{"not":{"type":"object","required":["customer"],"properties":{"customer":{"type":"object","required":["firstName"],"properties":{"firstName":{}}}}}},{"type":"object","required":["firstName"],"properties":{"firstName":{"type":"string","minLength":1,"pattern":"\\S"}}}]}]},{"anyOf":[{"type":"object","required":["customer"],"properties":{"customer":{"type":"object","required":["lastName"],"properties":{"lastName":{"type":"string","minLength":1,"pattern":"\\S"}}}}},{"allOf":[{"not":{"type":"object","required":["customer"],"properties":{"customer":{"type":"object","required":["lastName"],"properties":{"lastName":{}}}}}},{"type":"object","required":["lastName"],"properties":{"lastName":{"type":"string","minLength":1,"pattern":"\\S"}}}]}]},{"anyOf":[{"type":"object","required":["customer"],"properties":{"customer":{"type":"object","required":["emailAddress"],"properties":{"emailAddress":{"type":"string","minLength":1,"pattern":"\\S"}}}}},{"allOf":[{"not":{"type":"object","required":["customer"],"properties":{"customer":{"type":"object","required":["emailAddress"],"properties":{"emailAddress":{}}}}}},{"type":"object","required":["emailAddress"],"properties":{"emailAddress":{"type":"string","minLength":1,"pattern":"\\S"}}}]}]}]}}]},{"allOf":[{"not":{"anyOf":[{"type":"object","required":["customer"],"properties":{"customer":{"type":"object","required":["customer_id"],"properties":{"customer_id":{"type":"string","minLength":1,"pattern":"\\S"}}}}},{"allOf":[{"not":{"type":"object","required":["customer"],"properties":{"customer":{"type":"object","required":["customer_id"],"properties":{"customer_id":{}}}}}},{"type":"object","required":["customer_id"],"properties":{"customer_id":{"type":"string","minLength":1,"pattern":"\\S"}}}]}]}},{"anyOf":[{"type":"object","required":["customer"],"properties":{"customer":{"type":"object","required":["firstName"],"properties":{"firstName":{"type":"string","minLength":1,"pattern":"\\S"}}}}},{"allOf":[{"not":{"type":"object","required":["customer"],"properties":{"customer":{"type":"object","required":["firstName"],"properties":{"firstName":{}}}}}},{"type":"object","required":["firstName"],"properties":{"firstName":{"type":"string","minLength":1,"pattern":"\\S"}}}]}]},{"anyOf":[{"type":"object","required":["customer"],"properties":{"customer":{"type":"object","required":["lastName"],"properties":{"lastName":{"type":"string","minLength":1,"pattern":"\\S"}}}}},{"allOf":[{"not":{"type":"object","required":["customer"],"properties":{"customer":{"type":"object","required":["lastName"],"properties":{"lastName":{}}}}}},{"type":"object","required":["lastName"],"properties":{"lastName":{"type":"string","minLength":1,"pattern":"\\S"}}}]}]},{"anyOf":[{"type":"object","required":["customer"],"properties":{"customer":{"type":"object","required":["emailAddress"],"properties":{"emailAddress":{"type":"string","minLength":1,"pattern":"\\S"}}}}},{"allOf":[{"not":{"type":"object","required":["customer"],"properties":{"customer":{"type":"object","required":["emailAddress"],"properties":{"emailAddress":{}}}}}},{"type":"object","required":["emailAddress"],"properties":{"emailAddress":{"type":"string","minLength":1,"pattern":"\\S"}}}]}]}]}]}},{"not":{"oneOf":[{"allOf":[{"anyOf":[{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["template_id"],"properties":{"template_id":{"type":"string","minLength":1,"pattern":"\\S"}}}}},{"allOf":[{"not":{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["template_id"],"properties":{"template_id":{}}}}}},{"type":"object","required":["template_id"],"properties":{"template_id":{"type":"string","minLength":1,"pattern":"\\S"}}}]}]},{"not":{"anyOf":[{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["schedule"],"properties":{"schedule":{"type":"object","minProperties":1}}}}},{"allOf":[{"not":{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["schedule"],"properties":{"schedule":{}}}}}},{"type":"object","required":["schedule"],"properties":{"schedule":{"type":"object","minProperties":1}}}]}]}},{"not":{"anyOf":[{"anyOf":[{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["recurring"],"properties":{"recurring":{"type":"object","minProperties":1}}}}},{"allOf":[{"not":{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["recurring"],"properties":{"recurring":{}}}}}},{"type":"object","required":["recurring"],"properties":{"recurring":{"type":"object","minProperties":1}}}]}]},{"anyOf":[{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["one_off"],"properties":{"one_off":{"type":"object","minProperties":1}}}}},{"allOf":[{"not":{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["one_off"],"properties":{"one_off":{}}}}}},{"type":"object","required":["one_off"],"properties":{"one_off":{"type":"object","minProperties":1}}}]}]}]}}]},{"allOf":[{"anyOf":[{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["schedule"],"properties":{"schedule":{"type":"object","minProperties":1}}}}},{"allOf":[{"not":{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["schedule"],"properties":{"schedule":{}}}}}},{"type":"object","required":["schedule"],"properties":{"schedule":{"type":"object","minProperties":1}}}]}]},{"not":{"anyOf":[{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["template_id"],"properties":{"template_id":{"type":"string","minLength":1,"pattern":"\\S"}}}}},{"allOf":[{"not":{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["template_id"],"properties":{"template_id":{}}}}}},{"type":"object","required":["template_id"],"properties":{"template_id":{"type":"string","minLength":1,"pattern":"\\S"}}}]}]}},{"not":{"anyOf":[{"anyOf":[{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["recurring"],"properties":{"recurring":{"type":"object","minProperties":1}}}}},{"allOf":[{"not":{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["recurring"],"properties":{"recurring":{}}}}}},{"type":"object","required":["recurring"],"properties":{"recurring":{"type":"object","minProperties":1}}}]}]},{"anyOf":[{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["one_off"],"properties":{"one_off":{"type":"object","minProperties":1}}}}},{"allOf":[{"not":{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["one_off"],"properties":{"one_off":{}}}}}},{"type":"object","required":["one_off"],"properties":{"one_off":{"type":"object","minProperties":1}}}]}]}]}}]},{"allOf":[{"anyOf":[{"anyOf":[{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["recurring"],"properties":{"recurring":{"type":"object","minProperties":1}}}}},{"allOf":[{"not":{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["recurring"],"properties":{"recurring":{}}}}}},{"type":"object","required":["recurring"],"properties":{"recurring":{"type":"object","minProperties":1}}}]}]},{"anyOf":[{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["one_off"],"properties":{"one_off":{"type":"object","minProperties":1}}}}},{"allOf":[{"not":{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["one_off"],"properties":{"one_off":{}}}}}},{"type":"object","required":["one_off"],"properties":{"one_off":{"type":"object","minProperties":1}}}]}]}]},{"not":{"anyOf":[{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["template_id"],"properties":{"template_id":{"type":"string","minLength":1,"pattern":"\\S"}}}}},{"allOf":[{"not":{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["template_id"],"properties":{"template_id":{}}}}}},{"type":"object","required":["template_id"],"properties":{"template_id":{"type":"string","minLength":1,"pattern":"\\S"}}}]}]}},{"not":{"anyOf":[{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["schedule"],"properties":{"schedule":{"type":"object","minProperties":1}}}}},{"allOf":[{"not":{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["schedule"],"properties":{"schedule":{}}}}}},{"type":"object","required":["schedule"],"properties":{"schedule":{"type":"object","minProperties":1}}}]}]}},{"anyOf":[{"anyOf":[{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["recurring"],"properties":{"recurring":{"type":"object","required":["enabled"],"properties":{"enabled":{"enum":[true,1,"1"]}}}}}}},{"allOf":[{"not":{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["recurring"],"properties":{"recurring":{}}}}}},{"type":"object","required":["recurring"],"properties":{"recurring":{"type":"object","required":["enabled"],"properties":{"enabled":{"enum":[true,1,"1"]}}}}}]}]},{"anyOf":[{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["one_off"],"properties":{"one_off":{"type":"object","required":["enabled"],"properties":{"enabled":{"enum":[true,1,"1"]}}}}}}},{"allOf":[{"not":{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["one_off"],"properties":{"one_off":{}}}}}},{"type":"object","required":["one_off"],"properties":{"one_off":{"type":"object","required":["enabled"],"properties":{"enabled":{"enum":[true,1,"1"]}}}}}]}]}]}]}]}},{"allOf":[{"allOf":[{"not":{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["template_id"],"properties":{"template_id":{"type":"string","minLength":1,"pattern":"\\S"}}}}}},{"anyOf":[{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["template_id"],"properties":{"template_id":{}}}}},{"not":{"type":"object","required":["template_id"],"properties":{"template_id":{"type":"string","minLength":1,"pattern":"\\S"}}}}]}]},{"allOf":[{"not":{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["plan_name"],"properties":{"plan_name":{"type":"string","minLength":1,"pattern":"\\S"}}}}}},{"anyOf":[{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["plan_name"],"properties":{"plan_name":{}}}}},{"not":{"type":"object","required":["plan_name"],"properties":{"plan_name":{"type":"string","minLength":1,"pattern":"\\S"}}}}]}]}]},{"allOf":[{"anyOf":[{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["template_id"],"properties":{"template_id":{"type":"string","minLength":1,"pattern":"\\S"}}}}},{"allOf":[{"not":{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["template_id"],"properties":{"template_id":{}}}}}},{"type":"object","required":["template_id"],"properties":{"template_id":{"type":"string","minLength":1,"pattern":"\\S"}}}]}]},{"allOf":[{"not":{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["start_date"],"properties":{"start_date":{"type":"string","minLength":1,"pattern":"\\S"}}}}}},{"anyOf":[{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["start_date"],"properties":{"start_date":{}}}}},{"not":{"type":"object","required":["start_date"],"properties":{"start_date":{"type":"string","minLength":1,"pattern":"\\S"}}}}]}]},{"allOf":[{"not":{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["payment_date"],"properties":{"payment_date":{"type":"string","minLength":1,"pattern":"\\S"}}}}}},{"anyOf":[{"type":"object","required":["plan"],"properties":{"plan":{"type":"object","required":["payment_date"],"properties":{"payment_date":{}}}}},{"not":{"type":"object","required":["payment_date"],"properties":{"payment_date":{"type":"string","minLength":1,"pattern":"\\S"}}}}]}]}]}]},"uniqueKey":"","typeLabel":"object"},"examples":{"manual":{"title":"manual","value":{"merchant_id":"48290713","customer":{"customer_id":"CUS48290713"},"plan":{"plan_name":"Monthly membership","recurring":{"enabled":1,"schedule_name":"Monthly fee","recurring_type":3,"amount":"25.50","start_date":"2030-01-10","day_of_debit":"FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=15"},"surcharge_config":[]},"notify_email":false,"notify_sms":false}},"newCustomer":{"title":"newCustomer","value":{"merchant_id":"48290713","customer":{"firstName":"Emily","lastName":"Carter","emailAddress":"[email protected]","mobilePhoneNumber":491570006,"addressLine1":"18 Paperbark Avenue","addressSuburb":"Sydney","addressState":"NSW","addressPostCode":"2000"},"plan":{"plan_name":"One time fee","one_off":{"enabled":1,"schedule_name":"Initial fee","amount":"20.00","payment_date":"2030-01-15"}}}},"template":{"title":"template","value":{"merchant_id":"48290713","customer":{"customer_id":"CUS48290713"},"plan":{"template_id":"TPL62038591","start_date":"2030-01-10"}}},"agreement":{"title":"agreement","value":{"merchant_id":"48290713","customer":{"customer_id":"CUS48290713"},"plan":{"plan_name":"Usage based DDR","schedule":{"type":6,"schedule_name":"First usage charge","amount":"10.00","start_date":"2030-01-15"}}}},"custom":{"title":"custom","value":{"merchant_id":"48290713","customer":{"customer_id":"CUS48290713"},"plan":{"plan_name":"Every ten days","recurring":{"enabled":1,"schedule_name":"Ten-day membership fee","recurring_type":3,"amount":"25.50","start_date":"2030-01-10","day_of_debit":"FREQ=DAILY;INTERVAL=10","process_type":12,"custom_cycle_type":1,"custom_cycle":10}}}},"quarterly":{"title":"quarterly","value":{"merchant_id":"48290713","customer":{"customer_id":"CUS48290713"},"plan":{"plan_name":"Quarterly membership","recurring":{"enabled":1,"schedule_name":"Quarterly membership fee","recurring_type":3,"amount":"25.50","start_date":"2030-01-10","day_of_debit":"FREQ=MONTHLY;INTERVAL=3;BYMONTHDAY=15","day_of_debit_dtstart":"2030-02-15"}}}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"5dce7bcd-8d2f-430e-a9f9-06f6f307f036":{"description":"HTTP 200. Distinguish success, business errors, validation errors and business authentication errors using the response body code.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","description":"Success response.","required":["code","message","data"],"properties":{"code":{"type":"integer","description":"0 means the subscription was created and awaits customer activation.","enum":[0],"isRequired":true,"uniqueKey":"oneOf.0.code","typeLabel":"enum\u003cinteger>"},"message":{"type":"string","description":"Response message.","isRequired":true,"uniqueKey":"oneOf.0.message","typeLabel":"string"},"data":{"type":"object","description":"Created DDR awaiting activation.","properties":{"customer_id":{"type":"string","description":"BillBuddy customer identifier.","isRequired":true,"uniqueKey":"oneOf.0.data.customer_id","typeLabel":"string"},"plan_id":{"type":"string","description":"DDR subscription ID.","isRequired":true,"uniqueKey":"oneOf.0.data.plan_id","typeLabel":"string"},"status":{"type":"integer","description":"DDR status: 1 Active, 2 Inactive, 3 Processing, 4 Processed, 5 On Hold, 6 Completed, 7 Cancelled, 8 Paused, 9 Expired.","enum":[2],"isRequired":true,"uniqueKey":"oneOf.0.data.status","typeLabel":"enum\u003cinteger>"},"is_by_agreement":{"type":"boolean","description":"Returns true only in By agreement mode.","uniqueKey":"oneOf.0.data.is_by_agreement","typeLabel":"boolean"},"activation_url":{"type":"string","description":"Complete hosted activation page URL. Use it unchanged for a browser redirect or iframe src; do not construct the URL or parse its credentials. A success response may omit this field. If missing, contact BillBuddy to check the created subscription before proceeding. For recurring and By agreement subscriptions, use it before start_date. For one-off-only subscriptions, submit activation within 30 days of creation.","format":"uri","uniqueKey":"oneOf.0.data.activation_url","typeLabel":"string\u003curi>"},"activation_html":{"type":"string","description":"HTML suitable for iframe srcdoc that directs the customer to activation_url. A success response may omit this field; handle it as described for activation_url.","uniqueKey":"oneOf.0.data.activation_html","typeLabel":"string"}},"required":["customer_id","plan_id","status"],"isRequired":true,"uniqueKey":"oneOf.0.data","typeLabel":"object"}},"uniqueKey":"oneOf.0","typeLabel":"object"},{"type":"object","description":"Business error. HTTP status is usually still 200.","required":["code","message","data"],"properties":{"code":{"type":"integer","description":"Business and authentication errors use 1; request parameter and upload file property validation errors use 400.","enum":[1,400],"isRequired":true,"uniqueKey":"oneOf.1.code","typeLabel":"enum\u003cinteger>"},"message":{"type":"string","description":"Error reason. The exact message varies by cause.","isRequired":true,"uniqueKey":"oneOf.1.message","typeLabel":"string"},"data":{"oneOf":[{"type":"object","description":"Error data: may be [], {} or customer context containing customer_id.","properties":{"customer_id":{"type":"string","description":"If a later createDdr step fails, this may identify a customer that was created and retained. Reuse this ID when retrying.","uniqueKey":"oneOf.1.data.oneOf.0.customer_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.1.data.oneOf.0","typeLabel":"object"},{"type":"array","items":{"oneOf":[{}],"uniqueKey":"oneOf.1.data.oneOf.1.items.[INDEX]","typeLabel":"any"},"description":"Error data: may be [], {} or customer context containing customer_id.","isRequired":true,"uniqueKey":"oneOf.1.data.oneOf.1","typeLabel":"any[]"}],"isRequired":true,"uniqueKey":"oneOf.1.data","typeLabel":"object | any[]"}},"uniqueKey":"oneOf.1","typeLabel":"object"}],"uniqueKey":"","typeLabel":"object"},"examples":{"success":{"title":"success","value":{"code":0,"message":"ok","data":{"customer_id":"CUS48290713","plan_id":"DDR73019482","status":2,"activation_url":"https://staging-api.billbuddyhq.com/api/v2/subscription/activatePage/73a9c4f128d60b5e9a2746cd801fb352","activation_html":"\u003c!DOCTYPE html>\u003chtml>\u003chead>\u003cmeta charset=\"UTF-8\">\u003cmeta http-equiv=\"refresh\" content=\"0;url=https://staging-api.billbuddyhq.com/api/v2/subscription/activatePage/73a9c4f128d60b5e9a2746cd801fb352\">\u003cstyle>html,body{height:100%;margin:0}body{display:flex;align-items:center;justify-content:center;font-family:-apple-system,Segoe UI,Roboto,Arial,sans-serif;color:#444;background:#fff}.tip{text-align:center;font-size:16px}.spin{width:28px;height:28px;margin:0 auto 12px;border:3px solid #ddd;border-top-color:#888;border-radius:50%;animation:r .8s linear infinite}@keyframes r{to{transform:rotate(360deg)}}\u003c/style>\u003c/head>\u003cbody>\u003cdiv class=\"tip\">\u003cdiv class=\"spin\">\u003c/div>Redirecting...\u003c/div>\u003cform method=\"get\" action=\"https://staging-api.billbuddyhq.com/api/v2/subscription/activatePage/73a9c4f128d60b5e9a2746cd801fb352\" target=\"_self\" id=\"checkform\" name=\"checkform\">\u003c/form>\u003cscript>window.onload=function(){document.checkform.submit();};\u003c/script>\u003c/body>\u003c/html>"}}},"agreement":{"title":"agreement","value":{"code":0,"message":"ok","data":{"customer_id":"CUS48290713","plan_id":"DDR73019482","status":2,"activation_url":"https://staging-api.billbuddyhq.com/api/v2/subscription/activatePage/73a9c4f128d60b5e9a2746cd801fb352","activation_html":"\u003c!DOCTYPE html>\u003chtml>\u003chead>\u003cmeta charset=\"UTF-8\">\u003cmeta http-equiv=\"refresh\" content=\"0;url=https://staging-api.billbuddyhq.com/api/v2/subscription/activatePage/73a9c4f128d60b5e9a2746cd801fb352\">\u003cstyle>html,body{height:100%;margin:0}body{display:flex;align-items:center;justify-content:center;font-family:-apple-system,Segoe UI,Roboto,Arial,sans-serif;color:#444;background:#fff}.tip{text-align:center;font-size:16px}.spin{width:28px;height:28px;margin:0 auto 12px;border:3px solid #ddd;border-top-color:#888;border-radius:50%;animation:r .8s linear infinite}@keyframes r{to{transform:rotate(360deg)}}\u003c/style>\u003c/head>\u003cbody>\u003cdiv class=\"tip\">\u003cdiv class=\"spin\">\u003c/div>Redirecting...\u003c/div>\u003cform method=\"get\" action=\"https://staging-api.billbuddyhq.com/api/v2/subscription/activatePage/73a9c4f128d60b5e9a2746cd801fb352\" target=\"_self\" id=\"checkform\" name=\"checkform\">\u003c/form>\u003cscript>window.onload=function(){document.checkform.submit();};\u003c/script>\u003c/body>\u003c/html>","is_by_agreement":true}}},"withoutTicket":{"title":"withoutTicket","value":{"code":0,"message":"ok","data":{"customer_id":"CUS48290713","plan_id":"DDR73019482","status":2}}},"failure":{"title":"failure","value":{"code":1,"message":"Customer not found","data":[]}},"validation":{"title":"validation","value":{"code":400,"message":"Provide exactly one of: recurring/one_off, template_id, or schedule.","data":{}}}},"exampleType":"examples"}},"exampleType":"examples"},"c382ceb6-c67a-47ed-8fef-c0ae95557c0c":{"description":"Rate limit exceeded. API requests share a limit of 120 requests per minute, normally counted by source IP; this is not a separate allowance for each endpoint. Wait for the seconds specified by Retry-After.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","description":"Rate limit response.","properties":{"message":{"type":"string","description":"Rate limit message.","uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"example":{"message":"Too Many Attempts."},"examples":{"Example":{"title":"Example","value":{"message":"Too Many Attempts."}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"10c08da3-e05c-44ec-abc7-3b8d4a88a061":{"oauth2":{"type":"oauth2","description":"OAuth2 client_credentials authorization. Obtain a new access_token when it expires.","flows":{"clientCredentials":{"tokenUrl":"/oauth/token","scopes":{}}},"scopes":[],"schemeName":"oauth2"}}},"servers":{"ec796d37-3557-4815-8bd3-57ca5c337838":{"url":"https://staging-api.billbuddyhq.com","description":"Staging environment"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"oauth2","description":"OAuth2 client_credentials authorization. Obtain a new access_token when it expires.","flows":{"clientCredentials":{"tokenUrl":"/oauth/token","scopes":{}}},"scopes":[],"schemeName":"oauth2"},"schema":{"title":"OAuth2 Auth","type":"string","isRequired":true,"description":"OAuth2 client_credentials authorization. Obtain a new access_token when it expires.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"oauth2","name":"Authorization"}],"title":"oauth2"}]},"originalFileLocation":"openapi/billbuddy-v2-openapi.en.yaml"},"subdomain":"bill-buddy","siteName":"BillBuddy API","title":"Create a hosted subscription - BillBuddy API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/en/api-reference/subscriptions/create","matchLevel":0},"cn":{"href":"/cn/api-reference/subscriptions/create","matchLevel":1}}},"lastModified":"2026-10-30T09:01:30.130Z","originalFileLocation":"en/api-reference/subscriptions/create.mdx","locale":"en"},"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=\"### Choose a subscription mode Use the recommended nested customer and plan fields. Choose one customer format: customer.customer_id for an existing customer, or customer.firstName, customer.lastName and customer.emailAddress for a new customer. Do not combine existing customer identification with new customer details. | Mode | Fields to supply | Conditions | | --- | --- | --- | | Manual subscription | plan.plan_name and at least one enabled plan.recurring or plan.one_off segment | Set each enabled segment\u0026#x27;s enabled to 1; recurring and one-off segments can both be enabled | | Template subscription | plan.template_id and the applicable template dates | Supply plan.start_date for a recurring segment and plan.payment_date for a one-off segment; omit plan_name to inherit the template name | | By agreement | plan.plan_name and plan.schedule | Supply schedule_name, type, amount and start_date for the initial schedule; types 1, 2, 3, 4 and 6 are allowed | The three modes are mutually exclusive. An enabled manual recurring segment requires schedule_name, recurring_type, amount, start_date and day_of_debit. An enabled one-off segment requires schedule_name, amount and payment_date. Dates must be no earlier than tomorrow in the business timezone. | Recurring end condition | Additional required fields | | --- | --- | | recurring_type=1 / schedule.type=1, successful payment count | end_terms | | recurring_type=2 / schedule.type=2, total amount | total_amount, with amount no greater than total_amount | | recurring_type=3 / schedule.type=3, until cancelled | No additional end condition | | recurring_type=4 / schedule.type=4, end date | end_date, no earlier than the same segment\u0026#x27;s start_date | | schedule.type=6, one-off | day_of_debit is not required; this type is not available for recurring_type | Quarterly, half-yearly and yearly frequencies require day_of_debit_dtstart. Custom frequencies require process_type=12, custom_cycle_type and custom_cycle, consistent with the RRULE. See individual fields for ranges and date windows. Top-level alternative fields remain supported. New integrations should use the nested format consistently. If both formats contain the same field, the nested value takes precedence. A successful creation returns status=2 Inactive; the subscription is not yet activated. Give customers the complete activation_url unchanged, use it as an iframe src, or use activation_html as the iframe srcdoc. Customers enter payment details, authorize debits and activate on the BillBuddy-hosted page. Do not construct activation links or parse credentials. Keep the Client Secret and access_token on your server. Three definition modes are mutually exclusive: manual recurring/one_off, template_id, and By agreement schedule. Template mode requires dates for each enabled component: recurring start_date and one-off payment_date. New customer details and existing customer references are mutually exclusive. The nested customer/plan format is recommended; see field descriptions for alternatives. A successful response may omit the activation link. Contact BillBuddy to check the created subscription before proceeding in that case. No caller-supplied idempotency identifier is supported; do not blindly retry creation. Recurring and By agreement subscriptions must be activated before start_date; one-off-only subscriptions must be submitted for activation within 30 days of creation. An accessible page does not guarantee submission is still permitted; the activation response is authoritative. All examples illustrate request and response formats. Replace customers, orders, cards and accounts with approved test data. BASE_URL is the service root domain without /api/v2. ACCESS_TOKEN is the access_token returned by /oauth/token. Example dates are in 2030; replace them with actual dates that satisfy the current date restrictions.\">\u003cmeta data-mint-head name=\"application-name\" content=\"BillBuddy API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/bill-buddy/_generated/favicon/apple-touch-icon.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/bill-buddy/_generated/favicon/favicon-32x32.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/bill-buddy/_generated/favicon/favicon-16x16.png?v=3\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/bill-buddy/_generated/favicon/favicon.ico?v=3\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create a hosted subscription - BillBuddy API\">\u003cmeta data-mint-head property=\"og:description\" content=\"### Choose a subscription mode Use the recommended nested customer and plan fields. Choose one customer format: customer.customer_id for an existing customer, or customer.firstName, customer.lastName and customer.emailAddress for a new customer. Do not combine existing customer identification with new customer details. | Mode | Fields to supply | Conditions | | --- | --- | --- | | Manual subscription | plan.plan_name and at least one enabled plan.recurring or plan.one_off segment | Set each enabled segment\u0026#x27;s enabled to 1; recurring and one-off segments can both be enabled | | Template subscription | plan.template_id and the applicable template dates | Supply plan.start_date for a recurring segment and plan.payment_date for a one-off segment; omit plan_name to inherit the template name | | By agreement | plan.plan_name and plan.schedule | Supply schedule_name, type, amount and start_date for the initial schedule; types 1, 2, 3, 4 and 6 are allowed | The three modes are mutually exclusive. An enabled manual recurring segment requires schedule_name, recurring_type, amount, start_date and day_of_debit. An enabled one-off segment requires schedule_name, amount and payment_date. Dates must be no earlier than tomorrow in the business timezone. | Recurring end condition | Additional required fields | | --- | --- | | recurring_type=1 / schedule.type=1, successful payment count | end_terms | | recurring_type=2 / schedule.type=2, total amount | total_amount, with amount no greater than total_amount | | recurring_type=3 / schedule.type=3, until cancelled | No additional end condition | | recurring_type=4 / schedule.type=4, end date | end_date, no earlier than the same segment\u0026#x27;s start_date | | schedule.type=6, one-off | day_of_debit is not required; this type is not available for recurring_type | Quarterly, half-yearly and yearly frequencies require day_of_debit_dtstart. Custom frequencies require process_type=12, custom_cycle_type and custom_cycle, consistent with the RRULE. See individual fields for ranges and date windows. Top-level alternative fields remain supported. New integrations should use the nested format consistently. If both formats contain the same field, the nested value takes precedence. A successful creation returns status=2 Inactive; the subscription is not yet activated. Give customers the complete activation_url unchanged, use it as an iframe src, or use activation_html as the iframe srcdoc. Customers enter payment details, authorize debits and activate on the BillBuddy-hosted page. Do not construct activation links or parse credentials. Keep the Client Secret and access_token on your server. Three definition modes are mutually exclusive: manual recurring/one_off, template_id, and By agreement schedule. Template mode requires dates for each enabled component: recurring start_date and one-off payment_date. New customer details and existing customer references are mutually exclusive. The nested customer/plan format is recommended; see field descriptions for alternatives. A successful response may omit the activation link. Contact BillBuddy to check the created subscription before proceeding in that case. No caller-supplied idempotency identifier is supported; do not blindly retry creation. Recurring and By agreement subscriptions must be activated before start_date; one-off-only subscriptions must be submitted for activation within 30 days of creation. An accessible page does not guarantee submission is still permitted; the activation response is authoritative. All examples illustrate request and response formats. Replace customers, orders, cards and accounts with approved test data. BASE_URL is the service root domain without /api/v2. ACCESS_TOKEN is the access_token returned by /oauth/token. Example dates are in 2030; replace them with actual dates that satisfy the current date restrictions.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"BillBuddy API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/create\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://bill-buddy.mintlify.app/_mintlify/api/og/v2?division=Subscriptions\u0026amp;title=Create+a+hosted+subscription\u0026amp;description=%23%23%23+Choose+a+subscription+mode%0A%0AUse+the+recommended+nested+%60customer%60+and+%60plan%60+fields.+Choose+one+customer+format%3A+%60customer.customer_id%60+for+an+existing+cust\u0026amp;theme=64470f610240a2cb772d6400\u0026amp;signature=a8a121ea6de5b6908c1e02e467cf61eb0ceede71be6ad9092ee6835ccbba766b\">\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=\"Create a hosted subscription - BillBuddy API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"### Choose a subscription mode Use the recommended nested customer and plan fields. Choose one customer format: customer.customer_id for an existing customer, or customer.firstName, customer.lastName and customer.emailAddress for a new customer. Do not combine existing customer identification with new customer details. | Mode | Fields to supply | Conditions | | --- | --- | --- | | Manual subscription | plan.plan_name and at least one enabled plan.recurring or plan.one_off segment | Set each enabled segment\u0026#x27;s enabled to 1; recurring and one-off segments can both be enabled | | Template subscription | plan.template_id and the applicable template dates | Supply plan.start_date for a recurring segment and plan.payment_date for a one-off segment; omit plan_name to inherit the template name | | By agreement | plan.plan_name and plan.schedule | Supply schedule_name, type, amount and start_date for the initial schedule; types 1, 2, 3, 4 and 6 are allowed | The three modes are mutually exclusive. An enabled manual recurring segment requires schedule_name, recurring_type, amount, start_date and day_of_debit. An enabled one-off segment requires schedule_name, amount and payment_date. Dates must be no earlier than tomorrow in the business timezone. | Recurring end condition | Additional required fields | | --- | --- | | recurring_type=1 / schedule.type=1, successful payment count | end_terms | | recurring_type=2 / schedule.type=2, total amount | total_amount, with amount no greater than total_amount | | recurring_type=3 / schedule.type=3, until cancelled | No additional end condition | | recurring_type=4 / schedule.type=4, end date | end_date, no earlier than the same segment\u0026#x27;s start_date | | schedule.type=6, one-off | day_of_debit is not required; this type is not available for recurring_type | Quarterly, half-yearly and yearly frequencies require day_of_debit_dtstart. Custom frequencies require process_type=12, custom_cycle_type and custom_cycle, consistent with the RRULE. See individual fields for ranges and date windows. Top-level alternative fields remain supported. New integrations should use the nested format consistently. If both formats contain the same field, the nested value takes precedence. A successful creation returns status=2 Inactive; the subscription is not yet activated. Give customers the complete activation_url unchanged, use it as an iframe src, or use activation_html as the iframe srcdoc. Customers enter payment details, authorize debits and activate on the BillBuddy-hosted page. Do not construct activation links or parse credentials. Keep the Client Secret and access_token on your server. Three definition modes are mutually exclusive: manual recurring/one_off, template_id, and By agreement schedule. Template mode requires dates for each enabled component: recurring start_date and one-off payment_date. New customer details and existing customer references are mutually exclusive. The nested customer/plan format is recommended; see field descriptions for alternatives. A successful response may omit the activation link. Contact BillBuddy to check the created subscription before proceeding in that case. No caller-supplied idempotency identifier is supported; do not blindly retry creation. Recurring and By agreement subscriptions must be activated before start_date; one-off-only subscriptions must be submitted for activation within 30 days of creation. An accessible page does not guarantee submission is still permitted; the activation response is authoritative. All examples illustrate request and response formats. Replace customers, orders, cards and accounts with approved test data. BASE_URL is the service root domain without /api/v2. ACCESS_TOKEN is the access_token returned by /oauth/token. Example dates are in 2030; replace them with actual dates that satisfy the current date restrictions.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://bill-buddy.mintlify.app/_mintlify/api/og/v2?division=Subscriptions\u0026amp;title=Create+a+hosted+subscription\u0026amp;description=%23%23%23+Choose+a+subscription+mode%0A%0AUse+the+recommended+nested+%60customer%60+and+%60plan%60+fields.+Choose+one+customer+format%3A+%60customer.customer_id%60+for+an+existing+cust\u0026amp;theme=64470f610240a2cb772d6400\u0026amp;signature=a8a121ea6de5b6908c1e02e467cf61eb0ceede71be6ad9092ee6835ccbba766b\">\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=\"https://mintlify.s3.us-west-1.amazonaws.com/bill-buddy/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"BillBuddy API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2563EB\">\u003clink data-mint-head rel=\"canonical\" href=\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/create\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/en/api-reference/subscriptions/create.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/create\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh\" href=\"https://bill-buddy.mintlify.app/cn/api-reference/subscriptions/create\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/create\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://bill-buddy.mintlify.app/#organization\",\"name\":\"BillBuddy API\",\"url\":\"https://bill-buddy.mintlify.app\"},{\"@type\":\"WebSite\",\"@id\":\"https://bill-buddy.mintlify.app#website\",\"name\":\"BillBuddy API\",\"url\":\"https://bill-buddy.mintlify.app\",\"publisher\":{\"@id\":\"https://bill-buddy.mintlify.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/create#webpage\",\"url\":\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/create\",\"name\":\"Create a hosted subscription\",\"description\":\"### Choose a subscription mode Use the recommended nested customer and plan fields. Choose one customer format: customer.customer_id for an existing customer, or customer.firstName, customer.lastName and customer.emailAddress for a new customer. Do not combine existing customer identification with new customer details. | Mode | Fields to supply | Conditions | | --- | --- | --- | | Manual subscription | plan.plan_name and at least one enabled plan.recurring or plan.one_off segment | Set each enabled segment's enabled to 1; recurring and one-off segments can both be enabled | | Template subscription | plan.template_id and the applicable template dates | Supply plan.start_date for a recurring segment and plan.payment_date for a one-off segment; omit plan_name to inherit the template name | | By agreement | plan.plan_name and plan.schedule | Supply schedule_name, type, amount and start_date for the initial schedule; types 1, 2, 3, 4 and 6 are allowed | The three modes are mutually exclusive. An enabled manual recurring segment requires schedule_name, recurring_type, amount, start_date and day_of_debit. An enabled one-off segment requires schedule_name, amount and payment_date. Dates must be no earlier than tomorrow in the business timezone. | Recurring end condition | Additional required fields | | --- | --- | | recurring_type=1 / schedule.type=1, successful payment count | end_terms | | recurring_type=2 / schedule.type=2, total amount | total_amount, with amount no greater than total_amount | | recurring_type=3 / schedule.type=3, until cancelled | No additional end condition | | recurring_type=4 / schedule.type=4, end date | end_date, no earlier than the same segment's start_date | | schedule.type=6, one-off | day_of_debit is not required; this type is not available for recurring_type | Quarterly, half-yearly and yearly frequencies require day_of_debit_dtstart. Custom frequencies require process_type=12, custom_cycle_type and custom_cycle, consistent with the RRULE. See individual fields for ranges and date windows. Top-level alternative fields remain supported. New integrations should use the nested format consistently. If both formats contain the same field, the nested value takes precedence. A successful creation returns status=2 Inactive; the subscription is not yet activated. Give customers the complete activation_url unchanged, use it as an iframe src, or use activation_html as the iframe srcdoc. Customers enter payment details, authorize debits and activate on the BillBuddy-hosted page. Do not construct activation links or parse credentials. Keep the Client Secret and access_token on your server. Three definition modes are mutually exclusive: manual recurring/one_off, template_id, and By agreement schedule. Template mode requires dates for each enabled component: recurring start_date and one-off payment_date. New customer details and existing customer references are mutually exclusive. The nested customer/plan format is recommended; see field descriptions for alternatives. A successful response may omit the activation link. Contact BillBuddy to check the created subscription before proceeding in that case. No caller-supplied idempotency identifier is supported; do not blindly retry creation. Recurring and By agreement subscriptions must be activated before start_date; one-off-only subscriptions must be submitted for activation within 30 days of creation. An accessible page does not guarantee submission is still permitted; the activation response is authoritative. All examples illustrate request and response formats. Replace customers, orders, cards and accounts with approved test data. BASE_URL is the service root domain without /api/v2. ACCESS_TOKEN is the access_token returned by /oauth/token. Example dates are in 2030; replace them with actual dates that satisfy the current date restrictions.\",\"dateModified\":\"2026-10-30T09:01:30.130Z\",\"isPartOf\":{\"@id\":\"https://bill-buddy.mintlify.app#website\"},\"breadcrumb\":{\"@id\":\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/create#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/create#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Subscriptions\",\"item\":\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/templates\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a hosted subscription\",\"item\":\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/create\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/create#apireference\",\"headline\":\"Create a hosted subscription\",\"name\":\"Create a hosted subscription\",\"description\":\"### Choose a subscription mode Use the recommended nested customer and plan fields. Choose one customer format: customer.customer_id for an existing customer, or customer.firstName, customer.lastName and customer.emailAddress for a new customer. Do not combine existing customer identification with new customer details. | Mode | Fields to supply | Conditions | | --- | --- | --- | | Manual subscription | plan.plan_name and at least one enabled plan.recurring or plan.one_off segment | Set each enabled segment's enabled to 1; recurring and one-off segments can both be enabled | | Template subscription | plan.template_id and the applicable template dates | Supply plan.start_date for a recurring segment and plan.payment_date for a one-off segment; omit plan_name to inherit the template name | | By agreement | plan.plan_name and plan.schedule | Supply schedule_name, type, amount and start_date for the initial schedule; types 1, 2, 3, 4 and 6 are allowed | The three modes are mutually exclusive. An enabled manual recurring segment requires schedule_name, recurring_type, amount, start_date and day_of_debit. An enabled one-off segment requires schedule_name, amount and payment_date. Dates must be no earlier than tomorrow in the business timezone. | Recurring end condition | Additional required fields | | --- | --- | | recurring_type=1 / schedule.type=1, successful payment count | end_terms | | recurring_type=2 / schedule.type=2, total amount | total_amount, with amount no greater than total_amount | | recurring_type=3 / schedule.type=3, until cancelled | No additional end condition | | recurring_type=4 / schedule.type=4, end date | end_date, no earlier than the same segment's start_date | | schedule.type=6, one-off | day_of_debit is not required; this type is not available for recurring_type | Quarterly, half-yearly and yearly frequencies require day_of_debit_dtstart. Custom frequencies require process_type=12, custom_cycle_type and custom_cycle, consistent with the RRULE. See individual fields for ranges and date windows. Top-level alternative fields remain supported. New integrations should use the nested format consistently. If both formats contain the same field, the nested value takes precedence. A successful creation returns status=2 Inactive; the subscription is not yet activated. Give customers the complete activation_url unchanged, use it as an iframe src, or use activation_html as the iframe srcdoc. Customers enter payment details, authorize debits and activate on the BillBuddy-hosted page. Do not construct activation links or parse credentials. Keep the Client Secret and access_token on your server. Three definition modes are mutually exclusive: manual recurring/one_off, template_id, and By agreement schedule. Template mode requires dates for each enabled component: recurring start_date and one-off payment_date. New customer details and existing customer references are mutually exclusive. The nested customer/plan format is recommended; see field descriptions for alternatives. A successful response may omit the activation link. Contact BillBuddy to check the created subscription before proceeding in that case. No caller-supplied idempotency identifier is supported; do not blindly retry creation. Recurring and By agreement subscriptions must be activated before start_date; one-off-only subscriptions must be submitted for activation within 30 days of creation. An accessible page does not guarantee submission is still permitted; the activation response is authoritative. All examples illustrate request and response formats. Replace customers, orders, cards and accounts with approved test data. BASE_URL is the service root domain without /api/v2. ACCESS_TOKEN is the access_token returned by /oauth/token. Example dates are in 2030; replace them with actual dates that satisfy the current date restrictions.\",\"url\":\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/create\",\"mainEntityOfPage\":{\"@id\":\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/create#webpage\"},\"dateModified\":\"2026-10-30T09:01:30.130Z\",\"publisher\":{\"@id\":\"https://bill-buddy.mintlify.app/#organization\"},\"isPartOf\":{\"@id\":\"https://bill-buddy.mintlify.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"BillBuddy API\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"BillBuddy API","nav":{"global":null,"languages":[{"language":"en","default":true,"tabs":[{"tab":"Integration guide","pages":[{"title":"Integration guide","href":"/en/introduction"}]},{"tab":"API reference","groups":[{"group":"Transactions","pages":[{"title":"Create a direct payment","deprecated":null,"version":null,"sidebarTitle":"Create a direct payment","openapi":"/openapi/billbuddy-v2-openapi.en.yaml post /api/v2/trans/directPay","href":"/en/api-reference/transactions/direct-pay"},{"title":"Create batch direct payments","deprecated":null,"version":null,"sidebarTitle":"Create batch direct payments","openapi":"/openapi/billbuddy-v2-openapi.en.yaml post /api/v2/trans/batchDirectPay","href":"/en/api-reference/transactions/batch-direct-pay"},{"title":"Cancel scheduled payments","deprecated":null,"version":null,"sidebarTitle":"Cancel scheduled payments","openapi":"/openapi/billbuddy-v2-openapi.en.yaml post /api/v2/trans/cancelDirectPay","href":"/en/api-reference/transactions/cancel-direct-pay"},{"title":"Query a transaction","deprecated":null,"version":null,"sidebarTitle":"Query a transaction","openapi":"/openapi/billbuddy-v2-openapi.en.yaml get /api/v2/trans/queryTrans","href":"/en/api-reference/transactions/query-transaction"},{"title":"List transactions","deprecated":null,"version":null,"sidebarTitle":"List transactions","openapi":"/openapi/billbuddy-v2-openapi.en.yaml get /api/v2/trans/list","href":"/en/api-reference/transactions/list-transactions"},{"title":"Upload a TXT transaction file","deprecated":null,"version":null,"sidebarTitle":"Upload a TXT transaction file","openapi":"/openapi/billbuddy-v2-openapi.en.yaml post /api/v2/trans/bulk-upload","href":"/en/api-reference/transactions/bulk-upload"},{"title":"Query a TXT batch and its details","deprecated":null,"version":null,"sidebarTitle":"Query a TXT batch and its details","openapi":"/openapi/billbuddy-v2-openapi.en.yaml get /api/v2/trans/bulk-upload/result","href":"/en/api-reference/transactions/bulk-upload-result"}]},{"group":"Subscriptions","pages":[{"title":"List available subscription templates","description":"Lists subscription templates available to the authorized merchant and specified business. Only ACTIVE, enabled, non-tiered templates other than By agreement are returned, ordered by creation time descending. Price filters apply to the latest template price. Callers must ensure each range starts at or below its end.\n\nThe list provides candidate templates. Subscription creation still validates pricing, enabled charge segments and required dates, and returns a business error if the selected template cannot be used.\n\nAll examples illustrate request and response formats. Replace customers, orders, cards and accounts with approved test data. BASE_URL is the service root domain without /api/v2. ACCESS_TOKEN is the access_token returned by /oauth/token. Example dates are in 2030; replace them with actual dates that satisfy the current date restrictions.","deprecated":null,"version":null,"sidebarTitle":"List available subscription templates","openapi":"/openapi/billbuddy-v2-openapi.en.yaml get /api/v2/plan/list","href":"/en/api-reference/subscriptions/templates"},{"title":"Create a hosted subscription","deprecated":null,"version":null,"sidebarTitle":"Create a hosted subscription","openapi":"/openapi/billbuddy-v2-openapi.en.yaml post /api/v2/subscription/create","href":"/en/api-reference/subscriptions/create"},{"title":"Create and activate a DDR","description":"### Customer, subscription and payment method\n\nSupply `merchant_id`, `subscription_number`, `customer`, `plan` and `payment`. Choose either `customer.customer_id` for an existing customer or `firstName`, `lastName` and `emailAddress` for a new customer. Do not combine the two. `plan.plan_name` is required; templates are not supported.\n\nProvide at least one non-empty `plan.recurring` or `plan.one_off` segment. This endpoint has no `enabled` switch. Every recurring segment requires `recurring_type`, `start_date` and `schedule_name`; types 1–4 also require `amount` and `day_of_debit`.\n\n| recurring_type | End condition | Additional required fields |\n| --- | --- | --- |\n| 1 | Successful payment count | `end_terms` |\n| 2 | Total amount | `total_amount`, with `amount` no greater than `total_amount` |\n| 3 | Until cancelled | No additional end condition |\n| 4 | End date | `end_date`, no earlier than the segment's `start_date` |\n| 5 | By agreement authorization | No amount or frequency required; add payment schedules later through `createSchedule` |\n\nA non-empty one-off segment requires `schedule_name`, `amount` and `payment_date`. Start and payment dates must be no earlier than tomorrow in the business timezone. See individual fields for quarterly, half-yearly, yearly and custom frequency requirements.\n\n| payment.type | Payment details | Agreement timestamps |\n| --- | --- | --- |\n| 1, bank account | `payment.bank.bsb`, `payment.bank.account_no`, `payment.bank.account_name` | `accept_terms_of_service_at`, `accept_direct_debit_request_service_agreement_at` |\n| 2, credit card | `payment.card.card_number`, `payment.card.expiration_month`, `payment.card.expiration_year`, `payment.card.security_code`, `payment.card.name_on_card` | `accept_terms_of_service_at` |\n\nChoose the bank or card details matching `payment.type`. Submit only the selected object where possible. The other object is not used for this binding, but any supplied fields must still pass validation. All agreement timestamps are within `payment`. See request fields for accepted types and limits.\n\nThe merchant server submits a payment method and agreement acceptance timestamp on the customer's behalf. A successful creation returns status=1 Active. Supports recurring types 1/2/3/4, By agreement (5), one_off only, and recurring plus one-off combinations. Templates and 3DS are not supported, and no activation link is provided. By agreement creates a debit authorization only; call createSchedule to add a payment schedule. subscription_number must be unique within the same merchant and business. On failure, data.customer_id may identify a customer already created; reuse that identifier when retrying.\n\nIf a failure response includes data.customer_id, the customer has already been created. Retry with customer.customer_id to reuse that customer and avoid duplicates. The error message varies by cause.\n\nAll examples illustrate request and response formats. Replace customers, orders, cards and accounts with approved test data. BASE_URL is the service root domain without /api/v2. ACCESS_TOKEN is the access_token returned by /oauth/token. Example dates are in 2030; replace them with actual dates that satisfy the current date restrictions.","deprecated":null,"version":null,"sidebarTitle":"Create and activate a DDR","openapi":"/openapi/billbuddy-v2-openapi.en.yaml post /api/v2/subscription/createDdr","href":"/en/api-reference/subscriptions/create-ddr"},{"title":"Add a payment schedule to a By agreement DDR","deprecated":null,"version":null,"sidebarTitle":"Add a payment schedule to a By agreement DDR","openapi":"/openapi/billbuddy-v2-openapi.en.yaml post /api/v2/subscription/createSchedule","href":"/en/api-reference/subscriptions/create-schedule"}]},{"group":"Authentication","pages":[{"title":"Obtain an OAuth access token","deprecated":null,"version":null,"sidebarTitle":"Obtain an OAuth access token","openapi":"/openapi/billbuddy-v2-openapi.en.yaml post /oauth/token","href":"/en/api-reference/authentication/token"}]}]}]},{"language":"cn","pages":[{"title":"cn","href":"/cn/api-reference/subscriptions/create"}]}]},"title":"Create a hosted subscription - BillBuddy API","buildId":"dpl_EnxDqhjaNc9a8MVa833TGULPd9uJ","deploymentId":"dpl_EnxDqhjaNc9a8MVa833TGULPd9uJ","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-26-lDe7V.js","utils-CWQmgYtH.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-4-Aw3rSD.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-C2zjXYA5.js","snippetPresets-DFmpFA7C.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-FJpQavWq.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-D_GvPF7k.js","shallow-Bs2ZB0NO.js","getApiPlaygroundDisplay-DCcqJJk-.js","CodeSnippet-DzDxawVe.js","CodeSnippets-aUr7fU-7.js","Page-CT9uE8Ip.js","getPastedJson-Y1fKsj_I.js","icon-DI4zTsDr.js","MethodPill-C0nDlmSQ.js","DuplicateIcon-NUXbx2nQ.js","createIcon-BdTHrPAi.js","DynamicMarkdown-CtpgKJwj.js","SectionHeading-B3x35tOt.js","axios-vUo_bRtp.js","Markdown-3OmurJMP.js","clsx-DMKzROTp.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-1ms6tsT-.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-Ke9xIMFx.js"]}