---
updatedAt: 2026-08-11T08:29:13.000Z
agentTools:
  projectIndex: https://docs.payadvantage.com.au/llms.txt
---

# Create a new Direct Debit from Template

Creates a direct debit from a subscription template. All amounts, frequency, fees and end conditions are taken from the template's current version; only scheduling and authorisation options may be supplied.

# OpenAPI definition

```json
{
  "openapi": "3.0.4",
  "info": {
    "title": "PayAdvantage Web API",
    "termsOfService": "https://www.payadvantage.com.au/terms-of-service",
    "contact": {
      "name": "Support",
      "url": "https://help.payadvantage.com.au/hc/en-us/categories/360000110195",
      "email": "support@payadvantage.com.au"
    },
    "version": "v3"
  },
  "servers": [
    {
      "url": "https://api.test.payadvantage.com.au/v3/"
    }
  ],
  "paths": {
    "/direct_debit_from_template": {
      "post": {
        "tags": [
          "Direct Debit"
        ],
        "summary": "Create a new Direct Debit from Template",
        "description": "Creates a direct debit from a subscription template. All amounts, frequency, fees and end conditions are taken from the template's current version; only scheduling and authorisation options may be supplied.",
        "operationId": "direct_debit_from_template_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DirectDebitFromTemplateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created Direct Debit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DirectDebitResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "User is not authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource, or may need an account of some sort",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource could not be found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request was well-formed but was unable to be followed due to semantic errors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiErrorResponse": {
        "type": "object",
        "properties": {
          "ErrorCode": {
            "type": "string",
            "nullable": true,
            "example": "abc"
          },
          "Messages": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AuthLink": {
        "required": [
          "Expiry"
        ],
        "type": "object",
        "properties": {
          "Link": {
            "type": "string",
            "description": "Link URL",
            "nullable": true,
            "readOnly": true,
            "example": "abc"
          },
          "Expiry": {
            "pattern": "\\d\\d\\d\\d\\-\\d\\d\\-\\d\\dT\\d\\d:\\d\\d(:\\d\\d(\\.\\d{1,7})?(Z|([+\\-]\\d\\d:\\d\\d))?)?",
            "type": "string",
            "description": "Date and time of when the direct debit request link expires.",
            "format": "date",
            "readOnly": true,
            "example": "2022-12-31"
          }
        },
        "additionalProperties": false,
        "description": "A direct debit request link that can be sent to, or shared with a customer digitally. The customer follows the link to the hosted page portal where they can complete signing the DDR. Once signed the DDR status will be pending."
      },
      "CodeOnly": {
        "type": "object",
        "properties": {
          "Code": {
            "pattern": "^[0-9A-Z]{6}$",
            "type": "string",
            "description": "The entities code.",
            "nullable": true,
            "example": "ABC123"
          }
        },
        "additionalProperties": false,
        "example": {
          "Code": "ABC123"
        }
      },
      "CustomerSummary": {
        "type": "object",
        "properties": {
          "Code": {
            "pattern": "^[0-9A-Z]{6}$",
            "type": "string",
            "description": "The entities code.",
            "nullable": true,
            "example": "abc"
          },
          "Name": {
            "type": "string",
            "description": "Name of customer or business",
            "nullable": true,
            "example": "abc"
          },
          "CustomRef": {
            "type": "string",
            "description": "Custom reference number for a customer.",
            "nullable": true,
            "example": "abc"
          },
          "ExternalID": {
            "type": "string",
            "description": "The entities ID from the external system that created it.",
            "nullable": true,
            "example": "abc"
          }
        },
        "additionalProperties": false
      },
      "DirectDebitFromTemplateRequest": {
        "required": [
          "Customer",
          "Template"
        ],
        "type": "object",
        "properties": {
          "Customer": {
            "$ref": "#/components/schemas/CodeOnly"
          },
          "Template": {
            "$ref": "#/components/schemas/CodeOnly"
          },
          "CustomerPaymentAccount": {
            "$ref": "#/components/schemas/CodeOnly"
          },
          "CustomerAuthorisationNotRequired": {
            "type": "boolean",
            "description": "Submits the direct debit for authorisation and approval immediately without customer intervention. To use this option a Customer Payment Account is required.",
            "nullable": true
          },
          "ReminderDays": {
            "maximum": 3,
            "minimum": 0,
            "type": "integer",
            "description": "Overrides the template's reminder days (0-3). Does not detach the direct debit from the template. Inherits the template value when omitted.",
            "format": "byte",
            "nullable": true,
            "example": 1
          },
          "StartDate": {
            "pattern": "^\\d\\d\\d\\d\\-\\d\\d\\-\\d\\d$",
            "type": "string",
            "description": "Overrides the recurring start date. On this endpoint a StartDate supplied without StartDateCondition is treated as 'on_date'. Does not detach from the template.",
            "format": "date",
            "nullable": true,
            "example": "2022-12-31"
          },
          "StartDateCondition": {
            "enum": [
              "today",
              "on_date"
            ],
            "type": "string",
            "description": "Overrides the template's recurring start condition. Does not detach from the template."
          },
          "UpfrontDate": {
            "pattern": "^\\d\\d\\d\\d\\-\\d\\d\\-\\d\\d$",
            "type": "string",
            "description": "Overrides the upfront date. On this endpoint an UpfrontDate supplied without UpfrontDateCondition (and without UpfrontDateDays) is treated as 'on_date'. The upfront amount always comes from the template. Does not detach from the template.",
            "format": "date",
            "nullable": true,
            "example": "2022-12-31"
          },
          "UpfrontDateDays": {
            "type": "integer",
            "description": "Overrides the upfront day offset. Required when UpfrontDateCondition is 'days_before_first_instalment' or 'days_after_first_instalment'. If UpfrontDateDays is supplied without a condition the request is rejected (ambiguous). Does not detach from the template.",
            "format": "int32",
            "nullable": true,
            "example": 1
          },
          "UpfrontDateCondition": {
            "enum": [
              "today",
              "on_date",
              "days_before_first_instalment",
              "days_after_first_instalment"
            ],
            "type": "string",
            "description": "Overrides the template's upfront date condition. Does not detach from the template."
          }
        },
        "additionalProperties": false
      },
      "DirectDebitInstallmentResponse": {
        "required": [
          "Amount",
          "DateScheduled",
          "EstimatedFee",
          "IsCatchUp",
          "ReminderSent"
        ],
        "type": "object",
        "properties": {
          "Code": {
            "type": "string",
            "description": "Unique identifier for the installment.",
            "format": "uuid"
          },
          "DateScheduled": {
            "pattern": "^\\d\\d\\d\\d\\-\\d\\d\\-\\d\\d$",
            "type": "string",
            "description": "The date that the installment is scheduled to be processed.",
            "format": "date",
            "example": "2022-12-31"
          },
          "DateProcessed": {
            "pattern": "\\d\\d\\d\\d\\-\\d\\d\\-\\d\\dT\\d\\d:\\d\\d(:\\d\\d(\\.\\d{1,7})?(Z|([+\\-]\\d\\d:\\d\\d))?)?",
            "type": "string",
            "description": "The date and time that the installment was processed, otherwise null.",
            "format": "date",
            "nullable": true,
            "example": "2022-12-31"
          },
          "Amount": {
            "type": "number",
            "description": "The installment amount excluding any fees.",
            "format": "double",
            "example": 1.23
          },
          "EstimatedFee": {
            "type": "number",
            "description": "The estimated fee amount for the installment. This amount does not include unpaid installment fees.",
            "format": "double",
            "example": 1.23
          },
          "ReminderSent": {
            "type": "boolean",
            "description": "Indicates whether an upcoming installment reminder has been sent to the customer.",
            "example": true
          },
          "IsCatchUp": {
            "type": "boolean",
            "description": "Indicates if the installment is a catch-up installment for a previously missed installment.",
            "example": true
          },
          "Payment": {
            "$ref": "#/components/schemas/DirectDebitPaymentResponse"
          }
        },
        "additionalProperties": false,
        "description": "A direct debit installment."
      },
      "DirectDebitPaymentResponse": {
        "required": [
          "IsFailed"
        ],
        "type": "object",
        "properties": {
          "Code": {
            "type": "string",
            "description": "Unique code identifier for the payment.",
            "nullable": true,
            "example": "abc"
          },
          "Status": {
            "$ref": "#/components/schemas/PaymentStatusIDs"
          },
          "IsFailed": {
            "type": "boolean",
            "description": "Whether this payment has failed.",
            "example": true
          }
        },
        "additionalProperties": false,
        "description": "The payment associated with an installment."
      },
      "DirectDebitResponse": {
        "required": [
          "AuthorisationLink",
          "Code",
          "DateCreated",
          "InvoiceOnSettlement",
          "IsPaymentPlan",
          "RecurringAmount",
          "RecurringDateStart",
          "SendInvoiceNotification"
        ],
        "type": "object",
        "properties": {
          "Code": {
            "type": "string",
            "description": "Unique internal identifier assigned to the direct debit by Pay Advantage. This cannot be changed.",
            "nullable": true,
            "example": "abc"
          },
          "AuthorisationLink": {
            "$ref": "#/components/schemas/AuthLink"
          },
          "DateCreated": {
            "pattern": "\\d\\d\\d\\d\\-\\d\\d\\-\\d\\dT\\d\\d:\\d\\d(:\\d\\d(\\.\\d{1,7})?(Z|([+\\-]\\d\\d:\\d\\d))?)?",
            "type": "string",
            "description": "Date and time direct debit was created e.g. `datecreated=ddMMyyyy`",
            "format": "date",
            "example": "2022-12-31"
          },
          "Status": {
            "enum": [
              "Draft",
              "CustomerDraft",
              "Pending",
              "Rejected",
              "Active",
              "Paused",
              "Cancelled",
              "Complete"
            ],
            "type": "string",
            "description": "The status of the direct debit.",
            "nullable": true,
            "example": "abc"
          },
          "IsPaymentPlan": {
            "type": "boolean",
            "description": "The direct debit is a payment plan.",
            "example": true
          },
          "InvoiceOnSettlement": {
            "type": "boolean",
            "description": "When true, an invoice is generated for the customer each time an instalment settles.",
            "example": true
          },
          "SendInvoiceNotification": {
            "type": "boolean",
            "description": "When invoicing on settlement is enabled, indicates whether the generated invoice is automatically emailed to the customer.",
            "example": true
          },
          "Customer": {
            "$ref": "#/components/schemas/CustomerSummary"
          },
          "Description": {
            "type": "string",
            "description": "The direct debit description. e.g. \"Membership Fees\".",
            "nullable": true,
            "example": "abc"
          },
          "ExternalID": {
            "type": "string",
            "description": "An external identifier for your application. Setting this value will allow you to query payments using the same external ID reference. This is useful will allow you to marry up the payments that were deducted based on a DDR external ID reference",
            "nullable": true,
            "example": "abc"
          },
          "UpfrontAmount": {
            "type": "number",
            "description": "The total amount that will be charged for a one-off upfront payment e.g. `UpfrontAmount=25.50`. Use this if you want the first amount to have a discount, or bundle any setup costs into the first payment. No value is returned if the direct debit has no upfront amount.",
            "format": "double",
            "nullable": true,
            "readOnly": true
          },
          "UpfrontDate": {
            "pattern": "^\\d\\d\\d\\d\\-\\d\\d\\-\\d\\d$",
            "type": "string",
            "description": "The date on which the upfront amount is to be charged. If the request hasn't been signed or approved before the declared date, instalments will not be processed and the request link will become invalid.",
            "format": "date",
            "nullable": true,
            "readOnly": true,
            "example": "2022-12-31"
          },
          "RecurringDateStart": {
            "pattern": "^\\d\\d\\d\\d\\-\\d\\d\\-\\d\\d$",
            "type": "string",
            "description": "The date on which recurring payments will begin. If the request hasn't been signed or approved before the declared date, instalments will not be processed and the request link will become invalid.",
            "format": "date",
            "readOnly": true,
            "example": "2022-12-31"
          },
          "RecurringAmount": {
            "type": "number",
            "description": "This is the recurring amount that will be charged every instalment. Upfront amounts are always charged separately to the recurring amount. Enter value as a currency amount in AUD e.g. `15.50`",
            "format": "double",
            "readOnly": true,
            "example": 1.23
          },
          "Frequency": {
            "enum": [
              "weekly",
              "fortnightly",
              "monthly",
              "quarterly",
              "yearly"
            ],
            "type": "string",
            "description": "Specifies the frequency instalments will occur from the recurring start date.",
            "nullable": true,
            "example": "abc"
          },
          "EndConditionAmount": {
            "type": "number",
            "description": "Lets you set a total amount to be paid at which point the direct debit will complete e.g. 1200.00 would process instalments until $1,200 is paid. This value can be set to null. If set to null the direct debit will only end when it is manually cancelled by you.",
            "format": "double",
            "nullable": true,
            "readOnly": true
          },
          "FailureOption": {
            "enum": [
              "pause",
              "next",
              "1week",
              "2weeks",
              "3days",
              "addtoend"
            ],
            "type": "string",
            "description": "The action automatically taken when a direct debit instalment fails. If no value is set these will default based on your failures and fees defaults that can be set through the PayAdvantage portal. <br>[Information about these options](https://help.payadvantage.com.au/hc/en-us/articles/360001567935-Dishonours-Fee-Settings)",
            "nullable": true,
            "readOnly": true,
            "example": "abc"
          },
          "OnchargedFees": {
            "enum": [
              "dishonor",
              "perdebit"
            ],
            "type": "string",
            "items": {
              "type": "string"
            },
            "description": "The fees that are on-charged for this direct debit. <br>Valid strings include: `dishonor` - charge the fees for payment failures back to the customer, `perdebit` - charge the per debit fee and msf to the customer",
            "nullable": true
          },
          "NextInstallmentDate": {
            "pattern": "^\\d\\d\\d\\d\\-\\d\\d\\-\\d\\d$",
            "type": "string",
            "description": "The date of the next installment.",
            "format": "date",
            "nullable": true,
            "example": "2022-12-31"
          },
          "NextInstallmentAmount": {
            "type": "number",
            "description": "The amount inclusive of fees for the next intallment.",
            "format": "double",
            "nullable": true
          },
          "Installments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DirectDebitInstallmentResponse"
            },
            "description": "The direct debit installments.",
            "nullable": true
          },
          "PaymentReminderDays": {
            "type": "integer",
            "description": "The number of days prior to a payment that a payment reminder will be sent. A value of null means no payment reminders will be sent.",
            "format": "int32",
            "nullable": true,
            "example": 1
          },
          "SubscriptionTemplate": {
            "$ref": "#/components/schemas/SubscriptionTemplateSummary"
          }
        },
        "additionalProperties": false,
        "example": {
          "Code": "ABC123",
          "AuthorisationLink": {
            "Link": "https://payadvantage.com.au/Authorise/DDAuthorise.aspx?code=1234abcd",
            "Expiry": "2026-11-05T17:25:28.3290000+11:00"
          },
          "AuthorisationLinks": [
            {
              "Link": "https://payadvantage.com.au/Authorise/DDAuthorise.aspx?code=1234abcd",
              "Expiry": "2026-11-05T17:25:28.3290000+11:00"
            }
          ],
          "DateCreated": "2026-10-03",
          "Status": "Draft",
          "IsPaymentPlan": false,
          "InvoiceOnSettlement": false,
          "SendInvoiceNotification": false,
          "Customer": {
            "Code": "ABC123",
            "Name": "Bob Smith",
            "CustomRef": "Your Customer Ref",
            "ExternalID": "Your Customer External ID"
          },
          "Description": "Weekly Membership",
          "ExternalID": "Your External ID",
          "UpfrontAmount": 0,
          "UpfrontDate": "2026-10-13",
          "RecurringDateStart": "2026-10-13",
          "RecurringAmount": 100,
          "Frequency": "weekly",
          "EndConditionAmount": 5000,
          "FailureOption": "3days",
          "OnchargedFees": [
            "dishonour"
          ],
          "NextInstallmentDate": null,
          "NextInstallmentAmount": null,
          "Installments": null,
          "PaymentReminderDays": null,
          "SubscriptionTemplate": null
        }
      },
      "PaymentStatusIDs": {
        "enum": [
          "Unknown",
          "pending",
          "processing",
          "succeeded",
          "failed",
          "undetermined",
          "agreement_created",
          "agreement_accepted",
          "settled"
        ],
        "type": "string"
      },
      "SubscriptionTemplateSummary": {
        "type": "object",
        "properties": {
          "Code": {
            "type": "string",
            "description": "The subscription template code.",
            "nullable": true,
            "example": "abc"
          },
          "Version": {
            "type": "integer",
            "description": "The subscription template version number.",
            "format": "int32",
            "nullable": true,
            "example": 1
          }
        },
        "additionalProperties": false
      }
    }
  }
}
```