Supply 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.
Provide 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.
recurring_type
End condition
Additional required fields
1
Successful payment count
end_terms
2
Total amount
total_amount, with amount no greater than total_amount
3
Until cancelled
No additional end condition
4
End date
end_date, no earlier than the segment’s start_date
5
By agreement authorization
No amount or frequency required; add payment schedules later through createSchedule
A 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.
Choose 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.
The 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.
If 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.
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 and immediately activates a DDR from the merchant server. customer must contain either an existing customer reference or new customer details. At least one of plan.recurring and plan.one_off must be nonempty; templates are not supported. recurring_type=5 creates a By agreement debit authorization only; 1/2/3/4 create recurring payment schedules. one_off alone is a one-off payment; combined with recurring it is a deposit. payment is required; 3DS is not supported. Currency is fixed to AUD.
Merchant subscription number. Must be unique within the same merchant and business. A previously used number cannot be reused; duplicates fail instead of returning the existing subscription.
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".
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-ddr","slug":"/en/api-reference/subscriptions/create-ddr","pageMetadata":{"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","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: \"Customer, subscription and payment method\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Supply \", _jsx(_components.code, {\n children: \"merchant_id\"\n }), \", \", _jsx(_components.code, {\n children: \"subscription_number\"\n }), \", \", _jsx(_components.code, {\n children: \"customer\"\n }), \", \", _jsx(_components.code, {\n children: \"plan\"\n }), \" and \", _jsx(_components.code, {\n children: \"payment\"\n }), \". Choose either \", _jsx(_components.code, {\n children: \"customer.customer_id\"\n }), \" for an existing customer or \", _jsx(_components.code, {\n children: \"firstName\"\n }), \", \", _jsx(_components.code, {\n children: \"lastName\"\n }), \" and \", _jsx(_components.code, {\n children: \"emailAddress\"\n }), \" for a new customer. Do not combine the two. \", _jsx(_components.code, {\n children: \"plan.plan_name\"\n }), \" is required; templates are not supported.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Provide at least one non-empty \", _jsx(_components.code, {\n children: \"plan.recurring\"\n }), \" or \", _jsx(_components.code, {\n children: \"plan.one_off\"\n }), \" segment. This endpoint has no \", _jsx(_components.code, {\n children: \"enabled\"\n }), \" switch. Every recurring segment requires \", _jsx(_components.code, {\n children: \"recurring_type\"\n }), \", \", _jsx(_components.code, {\n children: \"start_date\"\n }), \" and \", _jsx(_components.code, {\n children: \"schedule_name\"\n }), \"; types 1–4 also require \", _jsx(_components.code, {\n children: \"amount\"\n }), \" and \", _jsx(_components.code, {\n children: \"day_of_debit\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.table, {\n children: [_jsx(_components.thead, {\n children: _jsxs(_components.tr, {\n children: [_jsx(_components.th, {\n children: \"recurring_type\"\n }), _jsx(_components.th, {\n children: \"End condition\"\n }), _jsx(_components.th, {\n children: \"Additional required fields\"\n })]\n })\n }), _jsxs(_components.tbody, {\n children: [_jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: \"1\"\n }), _jsx(_components.td, {\n children: \"Successful payment count\"\n }), _jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"end_terms\"\n })\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: \"2\"\n }), _jsx(_components.td, {\n children: \"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: [_jsx(_components.td, {\n children: \"3\"\n }), _jsx(_components.td, {\n children: \"Until cancelled\"\n }), _jsx(_components.td, {\n children: \"No additional end condition\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: \"4\"\n }), _jsx(_components.td, {\n children: \"End date\"\n }), _jsxs(_components.td, {\n children: [_jsx(_components.code, {\n children: \"end_date\"\n }), \", no earlier than the segment’s \", _jsx(_components.code, {\n children: \"start_date\"\n })]\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: \"5\"\n }), _jsx(_components.td, {\n children: \"By agreement authorization\"\n }), _jsxs(_components.td, {\n children: [\"No amount or frequency required; add payment schedules later through \", _jsx(_components.code, {\n children: \"createSchedule\"\n })]\n })]\n })]\n })]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"A non-empty 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 }), \". 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\", _jsxs(_components.table, {\n children: [_jsx(_components.thead, {\n children: _jsxs(_components.tr, {\n children: [_jsx(_components.th, {\n children: \"payment.type\"\n }), _jsx(_components.th, {\n children: \"Payment details\"\n }), _jsx(_components.th, {\n children: \"Agreement timestamps\"\n })]\n })\n }), _jsxs(_components.tbody, {\n children: [_jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: \"1, bank account\"\n }), _jsxs(_components.td, {\n children: [_jsx(_components.code, {\n children: \"payment.bank.bsb\"\n }), \", \", _jsx(_components.code, {\n children: \"payment.bank.account_no\"\n }), \", \", _jsx(_components.code, {\n children: \"payment.bank.account_name\"\n })]\n }), _jsxs(_components.td, {\n children: [_jsx(_components.code, {\n children: \"accept_terms_of_service_at\"\n }), \", \", _jsx(_components.code, {\n children: \"accept_direct_debit_request_service_agreement_at\"\n })]\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: \"2, credit card\"\n }), _jsxs(_components.td, {\n children: [_jsx(_components.code, {\n children: \"payment.card.card_number\"\n }), \", \", _jsx(_components.code, {\n children: \"payment.card.expiration_month\"\n }), \", \", _jsx(_components.code, {\n children: \"payment.card.expiration_year\"\n }), \", \", _jsx(_components.code, {\n children: \"payment.card.security_code\"\n }), \", \", _jsx(_components.code, {\n children: \"payment.card.name_on_card\"\n })]\n }), _jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"accept_terms_of_service_at\"\n })\n })]\n })]\n })]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Choose the bank or card details matching \", _jsx(_components.code, {\n children: \"payment.type\"\n }), \". 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 \", _jsx(_components.code, {\n children: \"payment\"\n }), \". See request fields for accepted types and limits.\"]\n }), \"\\n\", _jsx(_components.p, {\n children: \"The 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 }), \"\\n\", _jsx(_components.p, {\n children: \"If 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 }), \"\\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 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","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Subscriptions"],"operationId":"v2CreateDdr","summary":"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.","security":["973ef440-46cc-4bd5-ae9a-1c79f0fb10d7"],"responses":{"200":"3c46dae4-4248-4a26-99fa-9ed74ffcad1d","429":"0f73820a-63c3-4ef5-8c14-23b6860e040d"},"requestBody":"986bdfa9-bf46-45cd-b44b-d9f995c24e7b","x-codeSamples":[{"lang":"Shell","label":"Bank account By agreement authorization","source":"curl -X POST \"${BASE_URL}/api/v2/subscription/createDdr\" \\\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 \"subscription_number\": \"MEM-20300101-001\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"recurring\": {\n \"recurring_type\": 5,\n \"schedule_name\": \"Authorisation\",\n \"start_date\": \"2030-01-10\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\n }\n }\n}'"},{"lang":"Shell","label":"Recurring DDR with a credit card","source":"curl -X POST \"${BASE_URL}/api/v2/subscription/createDdr\" \\\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 \"subscription_number\": \"MEM-20300101-002\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\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 },\n \"payment\": {\n \"type\": 2,\n \"accept_terms_of_service_at\": 1893456000000,\n \"card\": {\n \"card_number\": \"4111111111111111\",\n \"expiration_month\": \"12\",\n \"expiration_year\": \"2030\",\n \"security_code\": \"123\",\n \"name_on_card\": \"Emily Carter\",\n \"email\": \"[email protected]\"\n }\n }\n}'"},{"lang":"Shell","label":"One-off-only DDR","source":"curl -X POST \"${BASE_URL}/api/v2/subscription/createDdr\" \\\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 \"subscription_number\": \"MEM-20300101-003\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\n }\n }\n}'"},{"lang":"Python","label":"Bank account By agreement authorization","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/createDdr\"\nheaders = {\"Accept\": \"application/json\"}\nheaders[\"Authorization\"] = \"Bearer \" + os.environ[\"ACCESS_TOKEN\"]\npayload = json.loads(r'''{\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-001\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"recurring\": {\n \"recurring_type\": 5,\n \"schedule_name\": \"Authorisation\",\n \"start_date\": \"2030-01-10\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\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":"Recurring DDR with a credit card","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/createDdr\"\nheaders = {\"Accept\": \"application/json\"}\nheaders[\"Authorization\"] = \"Bearer \" + os.environ[\"ACCESS_TOKEN\"]\npayload = json.loads(r'''{\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-002\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\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 },\n \"payment\": {\n \"type\": 2,\n \"accept_terms_of_service_at\": 1893456000000,\n \"card\": {\n \"card_number\": \"4111111111111111\",\n \"expiration_month\": \"12\",\n \"expiration_year\": \"2030\",\n \"security_code\": \"123\",\n \"name_on_card\": \"Emily Carter\",\n \"email\": \"[email protected]\"\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":"One-off-only DDR","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/createDdr\"\nheaders = {\"Accept\": \"application/json\"}\nheaders[\"Authorization\"] = \"Bearer \" + os.environ[\"ACCESS_TOKEN\"]\npayload = json.loads(r'''{\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-003\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\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":"Bank account By agreement authorization","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/createDdr\");\nconst headers = { Accept: \"application/json\" };\nheaders.Authorization = `Bearer ${env(\"ACCESS_TOKEN\")}`;\nconst payload = {\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-001\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"recurring\": {\n \"recurring_type\": 5,\n \"schedule_name\": \"Authorisation\",\n \"start_date\": \"2030-01-10\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\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":"Recurring DDR with a credit card","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/createDdr\");\nconst headers = { Accept: \"application/json\" };\nheaders.Authorization = `Bearer ${env(\"ACCESS_TOKEN\")}`;\nconst payload = {\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-002\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\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 },\n \"payment\": {\n \"type\": 2,\n \"accept_terms_of_service_at\": 1893456000000,\n \"card\": {\n \"card_number\": \"4111111111111111\",\n \"expiration_month\": \"12\",\n \"expiration_year\": \"2030\",\n \"security_code\": \"123\",\n \"name_on_card\": \"Emily Carter\",\n \"email\": \"[email protected]\"\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":"One-off-only DDR","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/createDdr\");\nconst headers = { Accept: \"application/json\" };\nheaders.Authorization = `Bearer ${env(\"ACCESS_TOKEN\")}`;\nconst payload = {\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-003\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\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":"Bank account By agreement authorization","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/createDdr\";\n$headers = ['Accept: application/json'];\n$headers[] = 'Authorization: Bearer ' . $env('ACCESS_TOKEN');\n$body = \u003c\u003c\u003c'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-001\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"recurring\": {\n \"recurring_type\": 5,\n \"schedule_name\": \"Authorisation\",\n \"start_date\": \"2030-01-10\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\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":"Recurring DDR with a credit card","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/createDdr\";\n$headers = ['Accept: application/json'];\n$headers[] = 'Authorization: Bearer ' . $env('ACCESS_TOKEN');\n$body = \u003c\u003c\u003c'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-002\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\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 },\n \"payment\": {\n \"type\": 2,\n \"accept_terms_of_service_at\": 1893456000000,\n \"card\": {\n \"card_number\": \"4111111111111111\",\n \"expiration_month\": \"12\",\n \"expiration_year\": \"2030\",\n \"security_code\": \"123\",\n \"name_on_card\": \"Emily Carter\",\n \"email\": \"[email protected]\"\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":"One-off-only DDR","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/createDdr\";\n$headers = ['Accept: application/json'];\n$headers[] = 'Authorization: Bearer ' . $env('ACCESS_TOKEN');\n$body = \u003c\u003c\u003c'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-003\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\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":"Bank account By agreement authorization","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/createDdr\"\n payload := `{\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-001\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"recurring\": {\n \"recurring_type\": 5,\n \"schedule_name\": \"Authorisation\",\n \"start_date\": \"2030-01-10\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\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":"Recurring DDR with a credit card","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/createDdr\"\n payload := `{\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-002\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\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 },\n \"payment\": {\n \"type\": 2,\n \"accept_terms_of_service_at\": 1893456000000,\n \"card\": {\n \"card_number\": \"4111111111111111\",\n \"expiration_month\": \"12\",\n \"expiration_year\": \"2030\",\n \"security_code\": \"123\",\n \"name_on_card\": \"Emily Carter\",\n \"email\": \"[email protected]\"\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":"One-off-only DDR","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/createDdr\"\n payload := `{\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-003\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\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":"Bank account By agreement authorization","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/createDdr\";\n String payload =\n \"{\\n\" +\n \" \\\"merchant_id\\\": \\\"48290713\\\",\\n\" +\n \" \\\"subscription_number\\\": \\\"MEM-20300101-001\\\",\\n\" +\n \" \\\"customer\\\": {\\n\" +\n \" \\\"customer_id\\\": \\\"CUS48290713\\\"\\n\" +\n \" },\\n\" +\n \" \\\"plan\\\": {\\n\" +\n \" \\\"plan_name\\\": \\\"Usage based DDR\\\",\\n\" +\n \" \\\"recurring\\\": {\\n\" +\n \" \\\"recurring_type\\\": 5,\\n\" +\n \" \\\"schedule_name\\\": \\\"Authorisation\\\",\\n\" +\n \" \\\"start_date\\\": \\\"2030-01-10\\\"\\n\" +\n \" }\\n\" +\n \" },\\n\" +\n \" \\\"payment\\\": {\\n\" +\n \" \\\"type\\\": 1,\\n\" +\n \" \\\"accept_terms_of_service_at\\\": 1893456000000,\\n\" +\n \" \\\"accept_direct_debit_request_service_agreement_at\\\": 1893456000000,\\n\" +\n \" \\\"bank\\\": {\\n\" +\n \" \\\"bsb\\\": \\\"062-000\\\",\\n\" +\n \" \\\"account_no\\\": \\\"618472950\\\",\\n\" +\n \" \\\"account_name\\\": \\\"Emily Carter\\\"\\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":"Recurring DDR with a credit card","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/createDdr\";\n String payload =\n \"{\\n\" +\n \" \\\"merchant_id\\\": \\\"48290713\\\",\\n\" +\n \" \\\"subscription_number\\\": \\\"MEM-20300101-002\\\",\\n\" +\n \" \\\"customer\\\": {\\n\" +\n \" \\\"customer_id\\\": \\\"CUS48290713\\\"\\n\" +\n \" },\\n\" +\n \" \\\"plan\\\": {\\n\" +\n \" \\\"plan_name\\\": \\\"Monthly membership\\\",\\n\" +\n \" \\\"recurring\\\": {\\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 \" },\\n\" +\n \" \\\"payment\\\": {\\n\" +\n \" \\\"type\\\": 2,\\n\" +\n \" \\\"accept_terms_of_service_at\\\": 1893456000000,\\n\" +\n \" \\\"card\\\": {\\n\" +\n \" \\\"card_number\\\": \\\"4111111111111111\\\",\\n\" +\n \" \\\"expiration_month\\\": \\\"12\\\",\\n\" +\n \" \\\"expiration_year\\\": \\\"2030\\\",\\n\" +\n \" \\\"security_code\\\": \\\"123\\\",\\n\" +\n \" \\\"name_on_card\\\": \\\"Emily Carter\\\",\\n\" +\n \" \\\"email\\\": \\\"[email protected]\\\"\\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":"One-off-only DDR","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/createDdr\";\n String payload =\n \"{\\n\" +\n \" \\\"merchant_id\\\": \\\"48290713\\\",\\n\" +\n \" \\\"subscription_number\\\": \\\"MEM-20300101-003\\\",\\n\" +\n \" \\\"customer\\\": {\\n\" +\n \" \\\"customer_id\\\": \\\"CUS48290713\\\"\\n\" +\n \" },\\n\" +\n \" \\\"plan\\\": {\\n\" +\n \" \\\"plan_name\\\": \\\"One time fee\\\",\\n\" +\n \" \\\"one_off\\\": {\\n\" +\n \" \\\"schedule_name\\\": \\\"Initial fee\\\",\\n\" +\n \" \\\"amount\\\": \\\"20.00\\\",\\n\" +\n \" \\\"payment_date\\\": \\\"2030-01-15\\\"\\n\" +\n \" }\\n\" +\n \" },\\n\" +\n \" \\\"payment\\\": {\\n\" +\n \" \\\"type\\\": 1,\\n\" +\n \" \\\"accept_terms_of_service_at\\\": 1893456000000,\\n\" +\n \" \\\"accept_direct_debit_request_service_agreement_at\\\": 1893456000000,\\n\" +\n \" \\\"bank\\\": {\\n\" +\n \" \\\"bsb\\\": \\\"062-000\\\",\\n\" +\n \" \\\"account_no\\\": \\\"618472950\\\",\\n\" +\n \" \\\"account_name\\\": \\\"Emily Carter\\\"\\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":"Bank account By agreement authorization","source":"require \"net/http\"\nrequire \"uri\"\n\nbase_url = ENV.fetch(\"BASE_URL\").sub(%r{/+$}, \"\")\nuri = URI(base_url + \"/api/v2/subscription/createDdr\")\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 \"subscription_number\": \"MEM-20300101-001\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"recurring\": {\n \"recurring_type\": 5,\n \"schedule_name\": \"Authorisation\",\n \"start_date\": \"2030-01-10\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\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":"Recurring DDR with a credit card","source":"require \"net/http\"\nrequire \"uri\"\n\nbase_url = ENV.fetch(\"BASE_URL\").sub(%r{/+$}, \"\")\nuri = URI(base_url + \"/api/v2/subscription/createDdr\")\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 \"subscription_number\": \"MEM-20300101-002\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\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 },\n \"payment\": {\n \"type\": 2,\n \"accept_terms_of_service_at\": 1893456000000,\n \"card\": {\n \"card_number\": \"4111111111111111\",\n \"expiration_month\": \"12\",\n \"expiration_year\": \"2030\",\n \"security_code\": \"123\",\n \"name_on_card\": \"Emily Carter\",\n \"email\": \"[email protected]\"\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":"One-off-only DDR","source":"require \"net/http\"\nrequire \"uri\"\n\nbase_url = ENV.fetch(\"BASE_URL\").sub(%r{/+$}, \"\")\nuri = URI(base_url + \"/api/v2/subscription/createDdr\")\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 \"subscription_number\": \"MEM-20300101-003\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\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-ddr","metadata":{"sidebarTitle":"Create and activate a DDR"}},"method":"post","type":"path","servers":["ec796d37-3557-4815-8bd3-57ca5c337838"],"path":"/api/v2/subscription/createDdr","baseUrlOptions":["https://staging-api.billbuddyhq.com"],"title":"Create and activate a DDR","codeSamples":[{"label":"Bank account By agreement authorization","lang":"Shell","source":"curl -X POST \"${BASE_URL}/api/v2/subscription/createDdr\" \\\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 \"subscription_number\": \"MEM-20300101-001\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"recurring\": {\n \"recurring_type\": 5,\n \"schedule_name\": \"Authorisation\",\n \"start_date\": \"2030-01-10\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\n }\n }\n}'"},{"label":"Recurring DDR with a credit card","lang":"Shell","source":"curl -X POST \"${BASE_URL}/api/v2/subscription/createDdr\" \\\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 \"subscription_number\": \"MEM-20300101-002\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\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 },\n \"payment\": {\n \"type\": 2,\n \"accept_terms_of_service_at\": 1893456000000,\n \"card\": {\n \"card_number\": \"4111111111111111\",\n \"expiration_month\": \"12\",\n \"expiration_year\": \"2030\",\n \"security_code\": \"123\",\n \"name_on_card\": \"Emily Carter\",\n \"email\": \"[email protected]\"\n }\n }\n}'"},{"label":"One-off-only DDR","lang":"Shell","source":"curl -X POST \"${BASE_URL}/api/v2/subscription/createDdr\" \\\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 \"subscription_number\": \"MEM-20300101-003\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\n }\n }\n}'"},{"label":"Bank account By agreement authorization","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/createDdr\"\nheaders = {\"Accept\": \"application/json\"}\nheaders[\"Authorization\"] = \"Bearer \" + os.environ[\"ACCESS_TOKEN\"]\npayload = json.loads(r'''{\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-001\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"recurring\": {\n \"recurring_type\": 5,\n \"schedule_name\": \"Authorisation\",\n \"start_date\": \"2030-01-10\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\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":"Recurring DDR with a credit card","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/createDdr\"\nheaders = {\"Accept\": \"application/json\"}\nheaders[\"Authorization\"] = \"Bearer \" + os.environ[\"ACCESS_TOKEN\"]\npayload = json.loads(r'''{\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-002\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\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 },\n \"payment\": {\n \"type\": 2,\n \"accept_terms_of_service_at\": 1893456000000,\n \"card\": {\n \"card_number\": \"4111111111111111\",\n \"expiration_month\": \"12\",\n \"expiration_year\": \"2030\",\n \"security_code\": \"123\",\n \"name_on_card\": \"Emily Carter\",\n \"email\": \"[email protected]\"\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":"One-off-only DDR","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/createDdr\"\nheaders = {\"Accept\": \"application/json\"}\nheaders[\"Authorization\"] = \"Bearer \" + os.environ[\"ACCESS_TOKEN\"]\npayload = json.loads(r'''{\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-003\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\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":"Bank account By agreement authorization","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/createDdr\");\nconst headers = { Accept: \"application/json\" };\nheaders.Authorization = `Bearer ${env(\"ACCESS_TOKEN\")}`;\nconst payload = {\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-001\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"recurring\": {\n \"recurring_type\": 5,\n \"schedule_name\": \"Authorisation\",\n \"start_date\": \"2030-01-10\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\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":"Recurring DDR with a credit card","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/createDdr\");\nconst headers = { Accept: \"application/json\" };\nheaders.Authorization = `Bearer ${env(\"ACCESS_TOKEN\")}`;\nconst payload = {\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-002\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\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 },\n \"payment\": {\n \"type\": 2,\n \"accept_terms_of_service_at\": 1893456000000,\n \"card\": {\n \"card_number\": \"4111111111111111\",\n \"expiration_month\": \"12\",\n \"expiration_year\": \"2030\",\n \"security_code\": \"123\",\n \"name_on_card\": \"Emily Carter\",\n \"email\": \"[email protected]\"\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":"One-off-only DDR","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/createDdr\");\nconst headers = { Accept: \"application/json\" };\nheaders.Authorization = `Bearer ${env(\"ACCESS_TOKEN\")}`;\nconst payload = {\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-003\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\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":"Bank account By agreement authorization","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/createDdr\";\n$headers = ['Accept: application/json'];\n$headers[] = 'Authorization: Bearer ' . $env('ACCESS_TOKEN');\n$body = \u003c\u003c\u003c'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-001\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"recurring\": {\n \"recurring_type\": 5,\n \"schedule_name\": \"Authorisation\",\n \"start_date\": \"2030-01-10\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\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":"Recurring DDR with a credit card","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/createDdr\";\n$headers = ['Accept: application/json'];\n$headers[] = 'Authorization: Bearer ' . $env('ACCESS_TOKEN');\n$body = \u003c\u003c\u003c'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-002\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\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 },\n \"payment\": {\n \"type\": 2,\n \"accept_terms_of_service_at\": 1893456000000,\n \"card\": {\n \"card_number\": \"4111111111111111\",\n \"expiration_month\": \"12\",\n \"expiration_year\": \"2030\",\n \"security_code\": \"123\",\n \"name_on_card\": \"Emily Carter\",\n \"email\": \"[email protected]\"\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":"One-off-only DDR","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/createDdr\";\n$headers = ['Accept: application/json'];\n$headers[] = 'Authorization: Bearer ' . $env('ACCESS_TOKEN');\n$body = \u003c\u003c\u003c'JSON'\n{\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-003\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\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":"Bank account By agreement authorization","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/createDdr\"\n payload := `{\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-001\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"recurring\": {\n \"recurring_type\": 5,\n \"schedule_name\": \"Authorisation\",\n \"start_date\": \"2030-01-10\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\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":"Recurring DDR with a credit card","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/createDdr\"\n payload := `{\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-002\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\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 },\n \"payment\": {\n \"type\": 2,\n \"accept_terms_of_service_at\": 1893456000000,\n \"card\": {\n \"card_number\": \"4111111111111111\",\n \"expiration_month\": \"12\",\n \"expiration_year\": \"2030\",\n \"security_code\": \"123\",\n \"name_on_card\": \"Emily Carter\",\n \"email\": \"[email protected]\"\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":"One-off-only DDR","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/createDdr\"\n payload := `{\n \"merchant_id\": \"48290713\",\n \"subscription_number\": \"MEM-20300101-003\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\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":"Bank account By agreement authorization","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/createDdr\";\n String payload =\n \"{\\n\" +\n \" \\\"merchant_id\\\": \\\"48290713\\\",\\n\" +\n \" \\\"subscription_number\\\": \\\"MEM-20300101-001\\\",\\n\" +\n \" \\\"customer\\\": {\\n\" +\n \" \\\"customer_id\\\": \\\"CUS48290713\\\"\\n\" +\n \" },\\n\" +\n \" \\\"plan\\\": {\\n\" +\n \" \\\"plan_name\\\": \\\"Usage based DDR\\\",\\n\" +\n \" \\\"recurring\\\": {\\n\" +\n \" \\\"recurring_type\\\": 5,\\n\" +\n \" \\\"schedule_name\\\": \\\"Authorisation\\\",\\n\" +\n \" \\\"start_date\\\": \\\"2030-01-10\\\"\\n\" +\n \" }\\n\" +\n \" },\\n\" +\n \" \\\"payment\\\": {\\n\" +\n \" \\\"type\\\": 1,\\n\" +\n \" \\\"accept_terms_of_service_at\\\": 1893456000000,\\n\" +\n \" \\\"accept_direct_debit_request_service_agreement_at\\\": 1893456000000,\\n\" +\n \" \\\"bank\\\": {\\n\" +\n \" \\\"bsb\\\": \\\"062-000\\\",\\n\" +\n \" \\\"account_no\\\": \\\"618472950\\\",\\n\" +\n \" \\\"account_name\\\": \\\"Emily Carter\\\"\\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":"Recurring DDR with a credit card","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/createDdr\";\n String payload =\n \"{\\n\" +\n \" \\\"merchant_id\\\": \\\"48290713\\\",\\n\" +\n \" \\\"subscription_number\\\": \\\"MEM-20300101-002\\\",\\n\" +\n \" \\\"customer\\\": {\\n\" +\n \" \\\"customer_id\\\": \\\"CUS48290713\\\"\\n\" +\n \" },\\n\" +\n \" \\\"plan\\\": {\\n\" +\n \" \\\"plan_name\\\": \\\"Monthly membership\\\",\\n\" +\n \" \\\"recurring\\\": {\\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 \" },\\n\" +\n \" \\\"payment\\\": {\\n\" +\n \" \\\"type\\\": 2,\\n\" +\n \" \\\"accept_terms_of_service_at\\\": 1893456000000,\\n\" +\n \" \\\"card\\\": {\\n\" +\n \" \\\"card_number\\\": \\\"4111111111111111\\\",\\n\" +\n \" \\\"expiration_month\\\": \\\"12\\\",\\n\" +\n \" \\\"expiration_year\\\": \\\"2030\\\",\\n\" +\n \" \\\"security_code\\\": \\\"123\\\",\\n\" +\n \" \\\"name_on_card\\\": \\\"Emily Carter\\\",\\n\" +\n \" \\\"email\\\": \\\"[email protected]\\\"\\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":"One-off-only DDR","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/createDdr\";\n String payload =\n \"{\\n\" +\n \" \\\"merchant_id\\\": \\\"48290713\\\",\\n\" +\n \" \\\"subscription_number\\\": \\\"MEM-20300101-003\\\",\\n\" +\n \" \\\"customer\\\": {\\n\" +\n \" \\\"customer_id\\\": \\\"CUS48290713\\\"\\n\" +\n \" },\\n\" +\n \" \\\"plan\\\": {\\n\" +\n \" \\\"plan_name\\\": \\\"One time fee\\\",\\n\" +\n \" \\\"one_off\\\": {\\n\" +\n \" \\\"schedule_name\\\": \\\"Initial fee\\\",\\n\" +\n \" \\\"amount\\\": \\\"20.00\\\",\\n\" +\n \" \\\"payment_date\\\": \\\"2030-01-15\\\"\\n\" +\n \" }\\n\" +\n \" },\\n\" +\n \" \\\"payment\\\": {\\n\" +\n \" \\\"type\\\": 1,\\n\" +\n \" \\\"accept_terms_of_service_at\\\": 1893456000000,\\n\" +\n \" \\\"accept_direct_debit_request_service_agreement_at\\\": 1893456000000,\\n\" +\n \" \\\"bank\\\": {\\n\" +\n \" \\\"bsb\\\": \\\"062-000\\\",\\n\" +\n \" \\\"account_no\\\": \\\"618472950\\\",\\n\" +\n \" \\\"account_name\\\": \\\"Emily Carter\\\"\\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":"Bank account By agreement authorization","lang":"Ruby","source":"require \"net/http\"\nrequire \"uri\"\n\nbase_url = ENV.fetch(\"BASE_URL\").sub(%r{/+$}, \"\")\nuri = URI(base_url + \"/api/v2/subscription/createDdr\")\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 \"subscription_number\": \"MEM-20300101-001\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Usage based DDR\",\n \"recurring\": {\n \"recurring_type\": 5,\n \"schedule_name\": \"Authorisation\",\n \"start_date\": \"2030-01-10\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\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":"Recurring DDR with a credit card","lang":"Ruby","source":"require \"net/http\"\nrequire \"uri\"\n\nbase_url = ENV.fetch(\"BASE_URL\").sub(%r{/+$}, \"\")\nuri = URI(base_url + \"/api/v2/subscription/createDdr\")\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 \"subscription_number\": \"MEM-20300101-002\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"Monthly membership\",\n \"recurring\": {\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 },\n \"payment\": {\n \"type\": 2,\n \"accept_terms_of_service_at\": 1893456000000,\n \"card\": {\n \"card_number\": \"4111111111111111\",\n \"expiration_month\": \"12\",\n \"expiration_year\": \"2030\",\n \"security_code\": \"123\",\n \"name_on_card\": \"Emily Carter\",\n \"email\": \"[email protected]\"\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":"One-off-only DDR","lang":"Ruby","source":"require \"net/http\"\nrequire \"uri\"\n\nbase_url = ENV.fetch(\"BASE_URL\").sub(%r{/+$}, \"\")\nuri = URI(base_url + \"/api/v2/subscription/createDdr\")\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 \"subscription_number\": \"MEM-20300101-003\",\n \"customer\": {\n \"customer_id\": \"CUS48290713\"\n },\n \"plan\": {\n \"plan_name\": \"One time fee\",\n \"one_off\": {\n \"schedule_name\": \"Initial fee\",\n \"amount\": \"20.00\",\n \"payment_date\": \"2030-01-15\"\n }\n },\n \"payment\": {\n \"type\": 1,\n \"accept_terms_of_service_at\": 1893456000000,\n \"accept_direct_debit_request_service_agreement_at\": 1893456000000,\n \"bank\": {\n \"bsb\": \"062-000\",\n \"account_no\": \"618472950\",\n \"account_name\": \"Emily Carter\"\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 and immediately activates a DDR from the merchant server. customer must contain either an existing customer reference or new customer details. At least one of plan.recurring and plan.one_off must be nonempty; templates are not supported. recurring_type=5 creates a By agreement debit authorization only; 1/2/3/4 create recurring payment schedules. one_off alone is a one-off payment; combined with recurring it is a deposit. payment is required; 3DS is not supported. Currency is fixed to AUD.","properties":{"merchant_id":{"type":"string","description":"Business identifier assigned by BillBuddy.","maxLength":20,"minLength":1,"isRequired":true,"uniqueKey":"merchant_id","typeLabel":"string"},"subscription_number":{"type":"string","description":"Merchant subscription number. Must be unique within the same merchant and business. A previously used number cannot be reused; duplicates fail instead of returning the existing subscription.","maxLength":64,"minLength":1,"isRequired":true,"uniqueKey":"subscription_number","typeLabel":"string"},"customer":{"type":"object","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"}},"description":"Customer information. Supply either an existing customer identifier or new customer details.","not":{"anyOf":[{"not":{"oneOf":[{"allOf":[{"type":"object","required":["customer_id"],"properties":{"customer_id":{"type":"string","minLength":1,"pattern":"\\S"}}},{"not":{"anyOf":[{"type":"object","required":["firstName"],"properties":{"firstName":{"type":"string","minLength":1,"pattern":"\\S"}}},{"type":"object","required":["lastName"],"properties":{"lastName":{"type":"string","minLength":1,"pattern":"\\S"}}},{"type":"object","required":["emailAddress"],"properties":{"emailAddress":{"type":"string","minLength":1,"pattern":"\\S"}}}]}}]},{"allOf":[{"not":{"type":"object","required":["customer_id"],"properties":{"customer_id":{"type":"string","minLength":1,"pattern":"\\S"}}}},{"type":"object","required":["firstName"],"properties":{"firstName":{"type":"string","minLength":1,"pattern":"\\S"}}},{"type":"object","required":["lastName"],"properties":{"lastName":{"type":"string","minLength":1,"pattern":"\\S"}}},{"type":"object","required":["emailAddress"],"properties":{"emailAddress":{"type":"string","minLength":1,"pattern":"\\S"}}}]}]}}]},"isRequired":true,"uniqueKey":"customer","typeLabel":"object"},"plan":{"type":"object","properties":{"plan_name":{"type":"string","description":"Subscription name. Required; at most 255 characters.","maxLength":255,"minLength":1,"isRequired":true,"uniqueKey":"plan.plan_name","typeLabel":"string"},"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"},"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. Card surcharges remain subject to the applicable charging policy; if that policy 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. Card surcharges remain subject to the applicable charging policy; if that policy 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\".","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\".","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\".","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\".","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":{"description":"This endpoint prohibits this field. Omit it.","not":{},"uniqueKey":"plan.template_id","typeLabel":"any"},"recurring":{"oneOf":[{"type":"object","properties":{"recurring_type":{"oneOf":[{"type":"integer","description":"Subscription end condition: 1 after a number of successful payments; 2 at a cumulative amount; 3 until cancelled; 4 on an end date; 5 By agreement, which creates a debit authorization for later payment schedules. Required when plan.recurring is nonempty; this endpoint has no enabled flag.","enum":[1,2,3,4,5,null],"uniqueKey":"plan.recurring.oneOf.0.recurring_type.oneOf.0","typeLabel":"enum\u003cinteger>"},{"type":"null","description":"Subscription end condition: 1 after a number of successful payments; 2 at a cumulative amount; 3 until cancelled; 4 on an end date; 5 By agreement, which creates a debit authorization for later payment schedules. Required when plan.recurring is nonempty; this endpoint has no enabled flag.","enum":[1,2,3,4,5,null],"uniqueKey":"plan.recurring.oneOf.0.recurring_type.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.recurring.oneOf.0.recurring_type","typeLabel":"enum\u003cinteger> | null"},"start_date":{"oneOf":[{"type":"string","description":"Start date, preferably YYYY-MM-DD. Must be no earlier than tomorrow in the service business timezone. Required when plan.recurring is nonempty; this endpoint has no enabled flag. The earliest date is 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, preferably YYYY-MM-DD. Must be no earlier than tomorrow in the service business timezone. Required when plan.recurring is nonempty; this endpoint has no enabled flag. The earliest date is 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"},"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 for recurring_type=1/2/3/4. By agreement (5) creates a debit authorization only and does not require this field. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","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 for recurring_type=1/2/3/4. By agreement (5) creates a debit authorization only and does not require this field. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","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 for recurring_type=1/2/3/4. By agreement (5) creates a debit authorization only and does not require this field. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","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"},"day_of_debit":{"oneOf":[{"type":"string","description":"RFC 5545 RRULE debit rule. Required and non-null for recurring_type=1/2/3/4. Omit it for recurring_type=5, which creates a debit authorization; submit subsequent payment schedules through createSchedule. Nonstandard frequencies require process_type=12, custom_cycle_type and custom_cycle consistent with the RRULE.","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 for recurring_type=1/2/3/4. Omit it for recurring_type=5, which creates a debit authorization; submit subsequent payment schedules through createSchedule. Nonstandard frequencies require process_type=12, custom_cycle_type and custom_cycle consistent with the RRULE.","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"},"end_date":{"oneOf":[{"type":"string","description":"End date, preferably YYYY-MM-DD. Required and non-null when recurring_type=4. When supplied, cannot precede start_date in the same segment. Omit for recurring_type=5 because it does not define a payment schedule.","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 recurring_type=4. When supplied, cannot precede start_date in the same segment. Omit for recurring_type=5 because it does not define a payment schedule.","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 recurring_type=1. Omit for recurring_type=5 because it does not define a payment schedule.","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 recurring_type=1. Omit for recurring_type=5 because it does not define a payment schedule.","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 recurring_type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount. Omit for recurring_type=5 because it does not define a payment schedule.","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 recurring_type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount. Omit for recurring_type=5 because it does not define a payment schedule.","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 recurring_type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount. Omit for recurring_type=5 because it does not define a payment schedule.","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"},"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. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","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. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","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 plan.recurring.process_type=12. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","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 plan.recurring.process_type=12. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","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 plan.recurring.process_type=12. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","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 plan.recurring.process_type=12. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","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. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","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. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","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"},"schedule_name":{"oneOf":[{"type":"string","description":"Payment schedule name. Required when plan.recurring is nonempty; this endpoint has no enabled flag.","maxLength":255,"uniqueKey":"plan.recurring.oneOf.0.schedule_name.oneOf.0","typeLabel":"string"},{"type":"null","description":"Payment schedule name. Required when plan.recurring is nonempty; this endpoint has no enabled flag.","maxLength":255,"uniqueKey":"plan.recurring.oneOf.0.schedule_name.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.recurring.oneOf.0.schedule_name","typeLabel":"string | null"}},"description":"Enabled by its presence; no enabled parameter is supported. Supports recurring_type=1/2/3/4/5. At least one nonempty definition must be supplied between this field and one_off.","not":{"anyOf":[{"allOf":[{"required":["recurring_type"],"properties":{"recurring_type":{"enum":[1]}}},{"not":{"required":["end_terms"],"properties":{"end_terms":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["recurring_type"],"properties":{"recurring_type":{"enum":[2]}}},{"not":{"required":["total_amount"],"properties":{"total_amount":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["recurring_type"],"properties":{"recurring_type":{"enum":[4]}}},{"not":{"required":["end_date"],"properties":{"end_date":{"not":{"enum":[null]},"minLength":1}}}}]},{"allOf":[{"required":["recurring_type"],"properties":{"recurring_type":{"enum":[1,2,3,4]}}},{"not":{"required":["amount","day_of_debit"],"properties":{"amount":{"not":{"enum":[null]}},"day_of_debit":{"not":{"enum":[null]},"minLength":1}}}}]},{"allOf":[{"required":["recurring_type"],"properties":{"recurring_type":{"enum":[1]}}},{"not":{"required":["end_terms"],"properties":{"end_terms":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["recurring_type"],"properties":{"recurring_type":{"enum":[2]}}},{"not":{"required":["total_amount"],"properties":{"total_amount":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["recurring_type"],"properties":{"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]}}}}]},{"allOf":[{"not":{"maxProperties":0}},{"not":{"required":["recurring_type","start_date","schedule_name"],"properties":{"recurring_type":{"not":{"enum":[null]}},"start_date":{"not":{"enum":[null]},"minLength":1},"schedule_name":{"not":{"enum":[null]},"minLength":1}}}}]}]},"uniqueKey":"plan.recurring.oneOf.0","typeLabel":"object"},{"type":"null","properties":{"recurring_type":{"oneOf":[{"type":"integer","description":"Subscription end condition: 1 after a number of successful payments; 2 at a cumulative amount; 3 until cancelled; 4 on an end date; 5 By agreement, which creates a debit authorization for later payment schedules. Required when plan.recurring is nonempty; this endpoint has no enabled flag.","enum":[1,2,3,4,5,null]},{"type":"null","description":"Subscription end condition: 1 after a number of successful payments; 2 at a cumulative amount; 3 until cancelled; 4 on an end date; 5 By agreement, which creates a debit authorization for later payment schedules. Required when plan.recurring is nonempty; this endpoint has no enabled flag.","enum":[1,2,3,4,5,null]}]},"start_date":{"oneOf":[{"type":"string","description":"Start date, preferably YYYY-MM-DD. Must be no earlier than tomorrow in the service business timezone. Required when plan.recurring is nonempty; this endpoint has no enabled flag. The earliest date is tomorrow in the service business timezone.","format":"date"},{"type":"null","description":"Start date, preferably YYYY-MM-DD. Must be no earlier than tomorrow in the service business timezone. Required when plan.recurring is nonempty; this endpoint has no enabled flag. The earliest date is tomorrow in the service business timezone.","format":"date"}]},"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 for recurring_type=1/2/3/4. By agreement (5) creates a debit authorization only and does not require this field. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","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 for recurring_type=1/2/3/4. By agreement (5) creates a debit authorization only and does not require this field. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","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 for recurring_type=1/2/3/4. By agreement (5) creates a debit authorization only and does not require this field. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","pattern":"^\\d+(\\.\\d{1,2})?$"},{"type":"null"}]},"day_of_debit":{"oneOf":[{"type":"string","description":"RFC 5545 RRULE debit rule. Required and non-null for recurring_type=1/2/3/4. Omit it for recurring_type=5, which creates a debit authorization; submit subsequent payment schedules through createSchedule. Nonstandard frequencies require process_type=12, custom_cycle_type and custom_cycle consistent with the RRULE.","maxLength":255},{"type":"null","description":"RFC 5545 RRULE debit rule. Required and non-null for recurring_type=1/2/3/4. Omit it for recurring_type=5, which creates a debit authorization; submit subsequent payment schedules through createSchedule. Nonstandard frequencies require process_type=12, custom_cycle_type and custom_cycle consistent with the RRULE.","maxLength":255}]},"end_date":{"oneOf":[{"type":"string","description":"End date, preferably YYYY-MM-DD. Required and non-null when recurring_type=4. When supplied, cannot precede start_date in the same segment. Omit for recurring_type=5 because it does not define a payment schedule.","format":"date"},{"type":"null","description":"End date, preferably YYYY-MM-DD. Required and non-null when recurring_type=4. When supplied, cannot precede start_date in the same segment. Omit for recurring_type=5 because it does not define a payment schedule.","format":"date"}]},"end_terms":{"oneOf":[{"type":"integer","description":"Number of successful payments, an integer of at least 1. Required and non-null when recurring_type=1. Omit for recurring_type=5 because it does not define a payment schedule.","minimum":1},{"type":"null","description":"Number of successful payments, an integer of at least 1. Required and non-null when recurring_type=1. Omit for recurring_type=5 because it does not define a payment schedule.","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 recurring_type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount. Omit for recurring_type=5 because it does not define a payment schedule.","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 recurring_type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount. Omit for recurring_type=5 because it does not define a payment schedule.","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 recurring_type=2. When amount and total_amount are both supplied in the same segment, amount must not exceed total_amount. Omit for recurring_type=5 because it does not define a payment schedule.","pattern":"^\\d+(\\.\\d{1,2})?$"},{"type":"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. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","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. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","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 plan.recurring.process_type=12. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","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 plan.recurring.process_type=12. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","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 plan.recurring.process_type=12. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","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 plan.recurring.process_type=12. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","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. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","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. For recurring_type=5, this field does not define a payment schedule and should be omitted; submit actual debit rules through createSchedule after authorization.","pattern":"^(\\d{4}-)?\\d{2}-\\d{2}$"}]},"schedule_name":{"oneOf":[{"type":"string","description":"Payment schedule name. Required when plan.recurring is nonempty; this endpoint has no enabled flag.","maxLength":255},{"type":"null","description":"Payment schedule name. Required when plan.recurring is nonempty; this endpoint has no enabled flag.","maxLength":255}]}},"description":"Enabled by its presence; no enabled parameter is supported. Supports recurring_type=1/2/3/4/5. At least one nonempty definition must be supplied between this field and one_off.","not":{"anyOf":[{"allOf":[{"required":["recurring_type"],"properties":{"recurring_type":{"enum":[1]}}},{"not":{"required":["end_terms"],"properties":{"end_terms":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["recurring_type"],"properties":{"recurring_type":{"enum":[2]}}},{"not":{"required":["total_amount"],"properties":{"total_amount":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["recurring_type"],"properties":{"recurring_type":{"enum":[4]}}},{"not":{"required":["end_date"],"properties":{"end_date":{"not":{"enum":[null]},"minLength":1}}}}]},{"allOf":[{"required":["recurring_type"],"properties":{"recurring_type":{"enum":[1,2,3,4]}}},{"not":{"required":["amount","day_of_debit"],"properties":{"amount":{"not":{"enum":[null]}},"day_of_debit":{"not":{"enum":[null]},"minLength":1}}}}]},{"allOf":[{"required":["recurring_type"],"properties":{"recurring_type":{"enum":[1]}}},{"not":{"required":["end_terms"],"properties":{"end_terms":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["recurring_type"],"properties":{"recurring_type":{"enum":[2]}}},{"not":{"required":["total_amount"],"properties":{"total_amount":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["recurring_type"],"properties":{"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]}}}}]},{"allOf":[{"not":{"maxProperties":0}},{"not":{"required":["recurring_type","start_date","schedule_name"],"properties":{"recurring_type":{"not":{"enum":[null]}},"start_date":{"not":{"enum":[null]},"minLength":1},"schedule_name":{"not":{"enum":[null]},"minLength":1}}}}]}]},"uniqueKey":"plan.recurring.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.recurring","typeLabel":"object | null"},"one_off":{"oneOf":[{"type":"object","properties":{"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 plan.one_off is nonempty.","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 plan.one_off is nonempty.","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 plan.one_off is nonempty.","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"},"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 plan.one_off is nonempty. 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 plan.one_off is nonempty. 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":{"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"},"schedule_name":{"oneOf":[{"type":"string","description":"Payment schedule name. Required and non-null when plan.one_off is nonempty.","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 plan.one_off is nonempty.","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"}},"description":"One-off payment definition. Acts as a Deposit when enabled with recurring, or as a One-off when used alone.","not":{"anyOf":[{"allOf":[{"not":{"maxProperties":0}},{"not":{"required":["amount","payment_date","schedule_name"],"properties":{"amount":{"not":{"enum":[null]}},"payment_date":{"not":{"enum":[null]},"minLength":1},"schedule_name":{"not":{"enum":[null]},"minLength":1}}}}]}]},"uniqueKey":"plan.one_off.oneOf.0","typeLabel":"object"},{"type":"null","properties":{"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 plan.one_off is nonempty.","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 plan.one_off 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 plan.one_off is nonempty.","pattern":"^\\d+(\\.\\d{1,2})?$"},{"type":"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 plan.one_off is nonempty. 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 plan.one_off is nonempty. YYYY-MM-DD is recommended. Cannot precede tomorrow in the service business timezone.","format":"date"}]},"description":{"oneOf":[{"type":"string","description":"Description.","maxLength":500},{"type":"null","description":"Description.","maxLength":500}]},"schedule_name":{"oneOf":[{"type":"string","description":"Payment schedule name. Required and non-null when plan.one_off is nonempty.","maxLength":255},{"type":"null","description":"Payment schedule name. Required and non-null when plan.one_off is nonempty.","maxLength":255}]}},"description":"One-off payment definition. Acts as a Deposit when enabled with recurring, or as a One-off when used alone.","not":{"anyOf":[{"allOf":[{"not":{"maxProperties":0}},{"not":{"required":["amount","payment_date","schedule_name"],"properties":{"amount":{"not":{"enum":[null]}},"payment_date":{"not":{"enum":[null]},"minLength":1},"schedule_name":{"not":{"enum":[null]},"minLength":1}}}}]}]},"uniqueKey":"plan.one_off.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan.one_off","typeLabel":"object | null"}},"description":"DDR subscription definition, including the subscription name, debit rules and fee options.","required":["plan_name"],"not":{"not":{"anyOf":[{"type":"object","properties":{"recurring":{"type":"object","not":{"enum":[null]},"minProperties":1}},"required":["recurring"]},{"type":"object","properties":{"one_off":{"type":"object","not":{"enum":[null]},"minProperties":1}},"required":["one_off"]}]}},"isRequired":true,"uniqueKey":"plan","typeLabel":"object"},"payment":{"type":"object","properties":{"type":{"type":"integer","description":"Payment method: 1 bank account, 2 credit card.","enum":[1,2],"isRequired":true,"uniqueKey":"payment.type","typeLabel":"enum\u003cinteger>"},"accept_terms_of_service_at":{"oneOf":[{"type":"number","description":"Timestamp when the customer accepted the terms of service. Required. Accepts Unix milliseconds or seconds, or a date-time string in YYYY-MM-DD HH:mm:ss format in the business timezone (Australia/Sydney). Milliseconds are recommended to avoid timezone ambiguity. When required, cannot be null, empty or whitespace-only.","isRequired":true,"uniqueKey":"payment.accept_terms_of_service_at.oneOf.0","typeLabel":"number"},{"type":"string","description":"Timestamp when the customer accepted the terms of service. Required. Accepts Unix milliseconds or seconds, or a date-time string in YYYY-MM-DD HH:mm:ss format in the business timezone (Australia/Sydney). Milliseconds are recommended to avoid timezone ambiguity. When required, cannot be null, empty or whitespace-only.","minLength":1,"isRequired":true,"uniqueKey":"payment.accept_terms_of_service_at.oneOf.1","typeLabel":"string"}],"isRequired":true,"uniqueKey":"payment.accept_terms_of_service_at","typeLabel":"number | string"},"accept_direct_debit_request_service_agreement_at":{"oneOf":[{"type":"number","description":"Timestamp when the customer accepted the DDRSA. Required for bank account payments. Accepts Unix milliseconds or seconds, or a date-time string in YYYY-MM-DD HH:mm:ss format in the business timezone (Australia/Sydney). Milliseconds are recommended to avoid timezone ambiguity. When required, cannot be null, empty or whitespace-only.","uniqueKey":"payment.accept_direct_debit_request_service_agreement_at.oneOf.0","typeLabel":"number"},{"type":"null","description":"Timestamp when the customer accepted the DDRSA. Required for bank account payments. Accepts Unix milliseconds or seconds, or a date-time string in YYYY-MM-DD HH:mm:ss format in the business timezone (Australia/Sydney). Milliseconds are recommended to avoid timezone ambiguity. When required, cannot be null, empty or whitespace-only.","uniqueKey":"payment.accept_direct_debit_request_service_agreement_at.oneOf.1","typeLabel":"null"},{"type":"string","description":"Timestamp when the customer accepted the DDRSA. Required for bank account payments. Accepts Unix milliseconds or seconds, or a date-time string in YYYY-MM-DD HH:mm:ss format in the business timezone (Australia/Sydney). Milliseconds are recommended to avoid timezone ambiguity. When required, cannot be null, empty or whitespace-only.","minLength":1,"uniqueKey":"payment.accept_direct_debit_request_service_agreement_at.oneOf.2","typeLabel":"string"},{"type":"null","uniqueKey":"payment.accept_direct_debit_request_service_agreement_at.oneOf.3","typeLabel":"null"}],"uniqueKey":"payment.accept_direct_debit_request_service_agreement_at","typeLabel":"number · null · string · null"},"card":{"type":"object","properties":{"card_number":{"type":"string","description":"Visa, Mastercard or American Express card number. Acceptance depends on card brand recognition and channel configuration.","pattern":"^\\d{13,19}$","minLength":1,"isRequired":true,"uniqueKey":"payment.card.card_number","typeLabel":"string"},"expiration_month":{"type":"string","description":"Card expiry month, preferably two digits, such as 12.","pattern":"^\\d{1,2}$","minLength":1,"isRequired":true,"uniqueKey":"payment.card.expiration_month","typeLabel":"string"},"expiration_year":{"type":"string","description":"Card expiry year, preferably four digits, such as 2030.","pattern":"^\\d{2,4}$","minLength":1,"isRequired":true,"uniqueKey":"payment.card.expiration_year","typeLabel":"string"},"security_code":{"type":"string","description":"Card security code (CVV). Use a string to preserve leading zeros.","pattern":"^\\d{3,4}$","minLength":1,"isRequired":true,"uniqueKey":"payment.card.security_code","typeLabel":"string"},"name_on_card":{"type":"string","description":"Name on the card.","maxLength":100,"minLength":1,"isRequired":true,"uniqueKey":"payment.card.name_on_card","typeLabel":"string"},"email":{"oneOf":[{"type":"string","description":"Email address.","format":"email","maxLength":500,"uniqueKey":"payment.card.email.oneOf.0","typeLabel":"string\u003cemail>"},{"type":"null","description":"Email address.","format":"email","maxLength":500,"uniqueKey":"payment.card.email.oneOf.1","typeLabel":"null"}],"uniqueKey":"payment.card.email","typeLabel":"string\u003cemail> | null"}},"description":"Credit card information. Required with its mandatory child fields when payment.type=2.","required":["card_number","expiration_month","expiration_year","security_code","name_on_card"],"uniqueKey":"payment.card","typeLabel":"object"},"bank":{"type":"object","properties":{"bsb":{"type":"string","description":"Australian BSB.","pattern":"^\\d{3}-?\\d{3}$","minLength":1,"isRequired":true,"uniqueKey":"payment.bank.bsb","typeLabel":"string"},"account_no":{"type":"string","description":"Bank account number. Use a string to preserve leading zeros.","pattern":"^\\d{6,9}$","minLength":1,"isRequired":true,"uniqueKey":"payment.bank.account_no","typeLabel":"string"},"account_name":{"type":"string","description":"Bank account holder name.","maxLength":255,"minLength":1,"isRequired":true,"uniqueKey":"payment.bank.account_name","typeLabel":"string"},"email":{"oneOf":[{"type":"string","description":"Email address.","format":"email","maxLength":500,"uniqueKey":"payment.bank.email.oneOf.0","typeLabel":"string\u003cemail>"},{"type":"null","description":"Email address.","format":"email","maxLength":500,"uniqueKey":"payment.bank.email.oneOf.1","typeLabel":"null"}],"uniqueKey":"payment.bank.email","typeLabel":"string\u003cemail> | null"}},"description":"Bank account information. Required with its mandatory child fields when payment.type=1.","required":["bsb","account_no","account_name"],"uniqueKey":"payment.bank","typeLabel":"object"}},"description":"Payment method and agreement acceptance timestamps for creation and activation. Each card/bank schema defines its accepted fields.","required":["type","accept_terms_of_service_at"],"not":{"anyOf":[{"allOf":[{"required":["type"],"properties":{"type":{"enum":[2]}}},{"not":{"required":["card"],"properties":{"card":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["type"],"properties":{"type":{"enum":[1]}}},{"not":{"required":["bank"],"properties":{"bank":{"not":{"enum":[null]}}}}}]},{"allOf":[{"required":["type"],"properties":{"type":{"enum":[1]}}},{"not":{"required":["accept_direct_debit_request_service_agreement_at"],"properties":{"accept_direct_debit_request_service_agreement_at":{"not":{"enum":[null]}}}}}]}]},"isRequired":true,"uniqueKey":"payment","typeLabel":"object"},"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"}},"required":["merchant_id","subscription_number","customer","plan","payment"],"uniqueKey":"","typeLabel":"object"},"examples":{"baBank":{"title":"baBank","value":{"merchant_id":"48290713","subscription_number":"MEM-20300101-001","customer":{"customer_id":"CUS48290713"},"plan":{"plan_name":"Usage based DDR","recurring":{"recurring_type":5,"schedule_name":"Authorisation","start_date":"2030-01-10"}},"payment":{"type":1,"accept_terms_of_service_at":1893456000000,"accept_direct_debit_request_service_agreement_at":1893456000000,"bank":{"bsb":"062-000","account_no":"618472950","account_name":"Emily Carter"}}}},"recurringCard":{"title":"recurringCard","value":{"merchant_id":"48290713","subscription_number":"MEM-20300101-002","customer":{"customer_id":"CUS48290713"},"plan":{"plan_name":"Monthly membership","recurring":{"schedule_name":"Monthly fee","recurring_type":3,"amount":"25.50","start_date":"2030-01-10","day_of_debit":"FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=15"}},"payment":{"type":2,"accept_terms_of_service_at":1893456000000,"card":{"card_number":"4111111111111111","expiration_month":"12","expiration_year":"2030","security_code":"123","name_on_card":"Emily Carter","email":"[email protected]"}}}},"oneOff":{"title":"oneOff","value":{"merchant_id":"48290713","subscription_number":"MEM-20300101-003","customer":{"customer_id":"CUS48290713"},"plan":{"plan_name":"One time fee","one_off":{"schedule_name":"Initial fee","amount":"20.00","payment_date":"2030-01-15"}},"payment":{"type":1,"accept_terms_of_service_at":1893456000000,"accept_direct_debit_request_service_agreement_at":1893456000000,"bank":{"bsb":"062-000","account_no":"618472950","account_name":"Emily Carter"}}}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"3c46dae4-4248-4a26-99fa-9ed74ffcad1d":{"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 DDR was created and activated. Does not indicate a completed charge.","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":"Activated DDR without a hosted activation link.","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":[1],"isRequired":true,"uniqueKey":"oneOf.0.data.status","typeLabel":"enum\u003cinteger>"},"subscription_number":{"type":"string","description":"Echoes the merchant subscription number.","isRequired":true,"uniqueKey":"oneOf.0.data.subscription_number","typeLabel":"string"}},"required":["customer_id","plan_id","status","subscription_number"],"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","subscription_number":"MEM-20300101-001","status":1}}},"duplicate":{"title":"duplicate","value":{"code":1,"message":"The subscription number already exists","data":[]}},"validation":{"title":"validation","value":{"code":400,"message":"The payment field is required.","data":{}}},"customerCreatedButDdrFailed":{"title":"customerCreatedButDdrFailed","value":{"code":1,"message":"DDR create failed due to internal error","data":{"customer_id":"CUS48290714"}}}},"exampleType":"examples"}},"exampleType":"examples"},"0f73820a-63c3-4ef5-8c14-23b6860e040d":{"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":{"973ef440-46cc-4bd5-ae9a-1c79f0fb10d7":{"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 and activate a DDR - BillBuddy API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/en/api-reference/subscriptions/create-ddr","matchLevel":0},"cn":{"href":"/cn/api-reference/subscriptions/create-ddr","matchLevel":1}}},"lastModified":"2026-10-30T09:01:30.147Z","originalFileLocation":"en/api-reference/subscriptions/create-ddr.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=\"### Customer, subscription and payment method Supply 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. Provide 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. | recurring_type | End condition | Additional required fields | | --- | --- | --- | | 1 | Successful payment count | end_terms | | 2 | Total amount | total_amount, with amount no greater than total_amount | | 3 | Until cancelled | No additional end condition | | 4 | End date | end_date, no earlier than the segment\u0026#x27;s start_date | | 5 | By agreement authorization | No amount or frequency required; add payment schedules later through createSchedule | A 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. | payment.type | Payment details | Agreement timestamps | | --- | --- | --- | | 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 | | 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 | Choose 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. The merchant server submits a payment method and agreement acceptance timestamp on the customer\u0026#x27;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. If 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. 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 and activate a DDR - BillBuddy API\">\u003cmeta data-mint-head property=\"og:description\" content=\"### Customer, subscription and payment method Supply 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. Provide 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. | recurring_type | End condition | Additional required fields | | --- | --- | --- | | 1 | Successful payment count | end_terms | | 2 | Total amount | total_amount, with amount no greater than total_amount | | 3 | Until cancelled | No additional end condition | | 4 | End date | end_date, no earlier than the segment\u0026#x27;s start_date | | 5 | By agreement authorization | No amount or frequency required; add payment schedules later through createSchedule | A 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. | payment.type | Payment details | Agreement timestamps | | --- | --- | --- | | 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 | | 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 | Choose 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. The merchant server submits a payment method and agreement acceptance timestamp on the customer\u0026#x27;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. If 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. 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-ddr\">\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+and+activate+a+DDR\u0026amp;description=%23%23%23+Customer%2C+subscription+and+payment+method%0A%0ASupply+%60merchant_id%60%2C+%60subscription_number%60%2C+%60customer%60%2C+%60plan%60+and+%60payment%60.+Choose+either+%60customer.customer_i\u0026amp;theme=64470f610240a2cb772d6400\u0026amp;signature=bfbb2ec4ffed07f5bcfbab411806aad35ef4da8e74e386f18d6dcc71d6d71f4f\">\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 and activate a DDR - BillBuddy API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"### Customer, subscription and payment method Supply 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. Provide 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. | recurring_type | End condition | Additional required fields | | --- | --- | --- | | 1 | Successful payment count | end_terms | | 2 | Total amount | total_amount, with amount no greater than total_amount | | 3 | Until cancelled | No additional end condition | | 4 | End date | end_date, no earlier than the segment\u0026#x27;s start_date | | 5 | By agreement authorization | No amount or frequency required; add payment schedules later through createSchedule | A 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. | payment.type | Payment details | Agreement timestamps | | --- | --- | --- | | 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 | | 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 | Choose 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. The merchant server submits a payment method and agreement acceptance timestamp on the customer\u0026#x27;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. If 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. 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+and+activate+a+DDR\u0026amp;description=%23%23%23+Customer%2C+subscription+and+payment+method%0A%0ASupply+%60merchant_id%60%2C+%60subscription_number%60%2C+%60customer%60%2C+%60plan%60+and+%60payment%60.+Choose+either+%60customer.customer_i\u0026amp;theme=64470f610240a2cb772d6400\u0026amp;signature=bfbb2ec4ffed07f5bcfbab411806aad35ef4da8e74e386f18d6dcc71d6d71f4f\">\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-ddr\">\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-ddr.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/create-ddr\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh\" href=\"https://bill-buddy.mintlify.app/cn/api-reference/subscriptions/create-ddr\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/create-ddr\">\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-ddr#webpage\",\"url\":\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/create-ddr\",\"name\":\"Create and activate a DDR\",\"description\":\"### Customer, subscription and payment method Supply 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. Provide 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. | recurring_type | End condition | Additional required fields | | --- | --- | --- | | 1 | Successful payment count | end_terms | | 2 | Total amount | total_amount, with amount no greater than total_amount | | 3 | Until cancelled | No additional end condition | | 4 | End date | end_date, no earlier than the segment's start_date | | 5 | By agreement authorization | No amount or frequency required; add payment schedules later through createSchedule | A 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. | payment.type | Payment details | Agreement timestamps | | --- | --- | --- | | 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 | | 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 | Choose 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. The 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. If 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. 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.147Z\",\"isPartOf\":{\"@id\":\"https://bill-buddy.mintlify.app#website\"},\"breadcrumb\":{\"@id\":\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/create-ddr#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/create-ddr#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 and activate a DDR\",\"item\":\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/create-ddr\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/create-ddr#apireference\",\"headline\":\"Create and activate a DDR\",\"name\":\"Create and activate a DDR\",\"description\":\"### Customer, subscription and payment method Supply 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. Provide 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. | recurring_type | End condition | Additional required fields | | --- | --- | --- | | 1 | Successful payment count | end_terms | | 2 | Total amount | total_amount, with amount no greater than total_amount | | 3 | Until cancelled | No additional end condition | | 4 | End date | end_date, no earlier than the segment's start_date | | 5 | By agreement authorization | No amount or frequency required; add payment schedules later through createSchedule | A 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. | payment.type | Payment details | Agreement timestamps | | --- | --- | --- | | 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 | | 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 | Choose 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. The 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. If 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. 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-ddr\",\"mainEntityOfPage\":{\"@id\":\"https://bill-buddy.mintlify.app/en/api-reference/subscriptions/create-ddr#webpage\"},\"dateModified\":\"2026-10-30T09:01:30.147Z\",\"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","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","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"},{"title":"Create and activate a DDR","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","description":"### Parameters by schedule type\n\nSupply `merchant_id`, `plan_id`, `type`, `amount` and `start_date`. The target DDR must be active, have a bound payment method and allow a new schedule.\n\n| type | Schedule type | Additional required fields |\n| --- | --- | --- |\n| 1 | Successful payment count | `day_of_debit`, `end_terms` |\n| 2 | Total amount | `day_of_debit`, `total_amount` |\n| 3 | Until cancelled | `day_of_debit` |\n| 4 | End date | `day_of_debit`, `end_date`, with the end date no earlier than `start_date` |\n| 6 | One-off | `day_of_debit` is not required |\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 each field for start dates, first debit dates and full value limits.\n\nAdds a payment schedule only to an activated By agreement DDR with a payment method already attached. The schedule uses that DDR's payment method. If any schedule is Paused, including a Deposit, resume or cancel it first. If an Active non-Deposit schedule exists, wait until it ends or is cancelled before adding another. Nonstandard RRULE expressions require process_type=12, custom_cycle_type and custom_cycle. start_date cannot precede the DDR start date. The first actual debit must be no earlier than tomorrow in the service business timezone and must comply with the DDR start date and frequency rules. Retain both plan_id and schedule_no from the response.\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":"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-ddr"}]}]},"title":"Create and activate a DDR - 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"]}