# Create a new workflow Endpoint: PUT /workflows Version: 1.0.0 Security: Biller Access Token (Staging), Biller Access Token (Production) ## Request fields (application/json): - `id` (string) The internal identifier of the schedule. Required only for updates. - `templateId` (string) The internal id of the template to be used for defining the schedule. Can be used in place of defining individual events for a schedule; in this case, the events will be automatically copied from the template. This streamlines the process and ensures consistency across schedules. - `customerDetails` (object) Contains the unique identifier for the customer. Example: {"id":"80349480-490b-4234-92e7-fad697e3d446"} - `customerDetails.id` (string, required) The Adfin ID of the customer. Example: "80349480-490b-4234-92e7-fad697e3d446" - `invoiceDetails` (object) Invoice details response object. - `invoiceDetails.id` (string) The internal id of the invoice - `invoiceDetails.invoiceNo` (string) The number of the invoice. Unique value that can be used as idempotency key - `invoiceDetails.description` (string) Short description of the invoice - `invoiceDetails.totalAmount` (string) The invoice total amount. Includes tax amount, amount paid or reduced with credit notes) - `invoiceDetails.taxAmount` (string) The invoice tax amount. - `invoiceDetails.dueAmount` (string) The invoice amount due (remaining to be paid). - `invoiceDetails.creditNotesAmount` (string) The total amount that is credited. - `invoiceDetails.dueDate` (string) The due date of the invoice - `invoiceDetails.issueDate` (string) The issue date date of the invoice - `invoiceDetails.creationTime` (string) The date the invoice was created - `invoiceDetails.lastUpdatedTime` (string) The date the invoice was last updated - `invoiceDetails.paidTime` (string) The date the invoice was paid - `invoiceDetails.status` (string) The status of the invoice. * DRAFT: The invoice is created, but not yet activated (sent) * UNPAID: The invoice is not yet paid. * SCHEDULED: The invoice is scheduled to collect the payment via Direct Debit. * SUBMITTED: The remaining due amount on the invoice is covered by submitted (but not yet confirmed) Direct Debit payments. * OVERDUE: The invoice is not yet paid and it is passed the due date. * PAID: The invoice payment has been captured. * SETTLED: The invoice is paid out. * VOID: The invoice was voided.. Possible values (non-exclusive): DRAFT, UNPAID, OVERDUE, SCHEDULED, SUBMITTED, PAID, VOID, SETTLED - `invoiceDetails.statusReasonCode` (string) The reason why the invoice is in a certain status. * MISSING_PAYER_CONTACT_DETAILS - The invoice is missing the contact details of payer. * PENDING_ACTIVATION - The invoice is not yet distributed by Adfin.. Possible values (non-exclusive): MISSING_PAYER_CONTACT_DETAILS, PENDING_ACTIVATION, PENDING_DD_MANDATE, PENDING_DD_CAPABILITY, MARKED_AS_PAID, WORKFLOW_COMPLETED, NOTIFICATION_DELIVERY_FAILED, BULK_PRUNE, OTHER - `invoiceDetails.statusReason` (string) Custom details on why the invoice is in a certain status - `invoiceDetails.itemsTaxType` (string) Specifies how tax is applied to line items in an invoice. * EXCLUSIVE: Line items are exclusive of tax. * INCLUSIVE: Line items are inclusive tax. * NONE: Line items have no tax.. Possible values (non-exclusive): EXCLUSIVE, INCLUSIVE, NONE - `invoiceDetails.items` (array) The list of items from the invoice - `invoiceDetails.items.id` (string) The ID of the line item to update. - `invoiceDetails.items.description` (string) The description of the item. - `invoiceDetails.items.quantity` (number) The quantity of items. - `invoiceDetails.items.unitAmount` (number) The price per unit of the item. - `invoiceDetails.items.taxRate` (number) The tax rate percentage applied on the line item amount (quantity * unit amount). - `invoiceDetails.items.taxAmount` (number) The tax amount added on top of the line item amount. - `invoiceDetails.items.totalAmount` (number) The total price of the item. - `invoiceDetails.items.taxDetails` (object) The tax details response. - `invoiceDetails.items.taxDetails.id` (string) The ID of the tax rate. - `invoiceDetails.items.taxDetails.rate` (number) The actual rate value. - `invoiceDetails.items.accountDetails` (object) The account details response. - `invoiceDetails.items.accountDetails.id` (string) The ID of the account code. - `invoiceDetails.items.accountDetails.code` (string) The account code value. - `invoiceDetails.items.productDetails` (object) The product details response. - `invoiceDetails.items.productDetails.id` (string) The ID of the product. - `invoiceDetails.items.productDetails.code` (string) The product code value. - `invoiceDetails.items.trackingGroupIds` (array) Tracking groups attached to this line item. - `invoiceDetails.items.trackingGroupIds.groupId` (string) Tracking group id. - `invoiceDetails.items.trackingGroupIds.itemId` (string) Tracking group selection option id. - `invoiceDetails.items.externalData` (array) Information about this line item captured from external systems - `invoiceDetails.items.externalData.id` (string) The ID from the external platform - `invoiceDetails.items.externalData.connectorType` (string) The connector type. Possible values (non-exclusive): XERO, QUICKBOOKS, BRIDGE, STRIPE, PLATFORM - `invoiceDetails.items.externalData.templateId` (string) The template ID from external platform from which this line item is created. Cannot use both the template ID and the account code. - `invoiceDetails.items.externalData.accountCode` (string) The account code from external platform from which this line item is created. Cannot use both the template ID and the account code. - `invoiceDetails.creditNotes` (array) The list of credit notes from the invoice - `invoiceDetails.creditNotes.id` (string) Credit note id. - `invoiceDetails.creditNotes.number` (string) Credit note number. - `invoiceDetails.creditNotes.amount` (number) Credit note amount. - `invoiceDetails.creditNotes.valueDate` (string) Date when credit note was applied. - `invoiceDetails.creditNotes.externalData` (array) References about this credit note from external platforms Adfin integrates with. Such as ID etc - `invoiceDetails.creditNotes.externalData.id` (string) ID of the Credit Note in the external platform - `invoiceDetails.fileSource` (string) The source of the file currently being served. Possible values (non-exclusive): NONE, FILE_UPLOAD, EXTERNAL, ADFIN, PENDING_ADFIN - `invoiceDetails.invoiceSource` (string) The source of the invoice. Possible values (non-exclusive): FILE_UPLOAD, MANUAL, PR, EXTERNAL, SCHEDULE, PLATFORM - `invoiceDetails.externalData` (array) References about this invoice from external platforms Adfin integrates with. Such as ID etc - `invoiceDetails.externalData.id` (string) ID of the Invoice in the external platform - `name` (string) The name of the schedule to be created for the customer. It must contain only alphanumeric characters, and be limited to a maximum of 50 characters. - `type` (string, required) The type of the schedule to be created for the customer. Possible values (non-exclusive): ONE_TIME_PAYMENT, DD_MANDATE_AUTHORISATION, DD_PAYMENT, CUSTOMER_STATEMENT - `customMessage` (string) The (optional) custom message to be added to notification - `events` (array) A list of events that will occur as part of the schedule, applicable exclusively to a single customer - `events.frequency` (object) The event frequency - `events.frequency.timeUnit` (string) Time unit measurements used to define the frequency of events. Possible values (non-exclusive): SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR, MONTH, WEEK, DAY - `events.frequency.frequency` (integer) The frequency of the time units - `events.frequency.dayOfMonth` (integer) The specific day of the month designated for executing the event. Please note that short month handling is applicable; if the value is set to 29, 30, or 31, the execution will occur on the last day of the month when applicable - `events.duration` (object) The event duration - `events.duration.startDate` (string) The date when the event execution will begin - `events.duration.endDate` (string) The date on which the execution of the event will conclude - `events.duration.maxNoOfExecutions` (integer) The maximum allowable executions of an event - `events.trigger` (object) Triggers the event based on a relative date. Mutually exclusive with ordinalWeekdayTrigger - `events.trigger.days` (integer) The number of days before/after sent date - `events.trigger.operator` (string) The operator used for determining the send date. Possible values (non-exclusive): ON, AFTER, BEFORE - `events.trigger.referenceDate` (string) The reference date used for computing the date when to execute the workflow step. Possible values (non-exclusive): DUE_DATE, SENT_DATE, PAYMENT_DATE - `events.relativeDateTrigger` (object) Triggers the event based on a relative date. Mutually exclusive with ordinalWeekdayTrigger - `events.ordinalWeekdayTrigger` (object) Triggers the event based on an ordinal weekday. Mutually exclusive with relativeDateTrigger - `events.ordinalWeekdayTrigger.ordinal` (integer, required) The ordinal position of the weekday in the month (e.g., 1 for first, 2 for second, -1 for last) - `events.ordinalWeekdayTrigger.dayOfWeek` (string, required) The day of the week (MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY) - `events.type` (string) Attribute that specifies the type of event. Possible values (non-exclusive): NO_ACTION, SEND_NOTIFICATION, MAKE_PAYMENT, UPDATE_DIRECT_DEBIT_PAYMENTS, SEND_DD_INVOICE_NOTICE, SEND_DD_COLLECTION_NOTICE, SEND_DD_SUCCESS_COLLECTION_NOTICE, SEND_DD_FAILED_COLLECTION_NOTICE, START_FALLBACK_WORKFLOW, SEND_MANDATE_AUTHORISATION_NOTIFICATION, CREATE_DD_MANDATE, PREVIEW_CHARGE_DATE, PREVIEW_PAYOUT_DATE, SEND_CUSTOMER_STATEMENT_NOTIFICATION - `events.details` (object) Attribute used for defining details related to an event. Can be utilized to create a new invoice request. This flexibility allows to tailor schedules effectively, ensuring that the appropriate information and formats are used for each scenario - `settings` (object) Optional workflow specific settings. - `settings.customerStatementSettings` (object) Customer statement workflow settings - `settings.customerStatementSettings.isEnabled` (boolean, required) Indicates whether customer statement workflow is enabled ## Response 200 fields (application/json): - `id` (string, required) The internal id of the workflow created - `templateId` (string) The internal id of the template used to define the workflow. This template id has been utilized to automatically copy events into the instance, streamlining the process and ensuring consistency throughout - `customerDetails` (object) Contains the unique identifier for the customer. Example: {"id":"80349480-490b-4234-92e7-fad697e3d446"} - `customerDetails.id` (string, required) The Adfin ID of the customer. Example: "80349480-490b-4234-92e7-fad697e3d446" - `invoiceDetails` (object) Invoice details response object. - `invoiceDetails.id` (string) The internal id of the invoice - `invoiceDetails.invoiceNo` (string) The number of the invoice. Unique value that can be used as idempotency key - `invoiceDetails.description` (string) Short description of the invoice - `invoiceDetails.totalAmount` (string) The invoice total amount. Includes tax amount, amount paid or reduced with credit notes) - `invoiceDetails.taxAmount` (string) The invoice tax amount. - `invoiceDetails.dueAmount` (string) The invoice amount due (remaining to be paid). - `invoiceDetails.creditNotesAmount` (string) The total amount that is credited. - `invoiceDetails.dueDate` (string) The due date of the invoice - `invoiceDetails.issueDate` (string) The issue date date of the invoice - `invoiceDetails.creationTime` (string) The date the invoice was created - `invoiceDetails.lastUpdatedTime` (string) The date the invoice was last updated - `invoiceDetails.paidTime` (string) The date the invoice was paid - `invoiceDetails.status` (string) The status of the invoice. * DRAFT: The invoice is created, but not yet activated (sent) * UNPAID: The invoice is not yet paid. * SCHEDULED: The invoice is scheduled to collect the payment via Direct Debit. * SUBMITTED: The remaining due amount on the invoice is covered by submitted (but not yet confirmed) Direct Debit payments. * OVERDUE: The invoice is not yet paid and it is passed the due date. * PAID: The invoice payment has been captured. * SETTLED: The invoice is paid out. * VOID: The invoice was voided.. Possible values (non-exclusive): DRAFT, UNPAID, OVERDUE, SCHEDULED, SUBMITTED, PAID, VOID, SETTLED - `invoiceDetails.statusReasonCode` (string) The reason why the invoice is in a certain status. * MISSING_PAYER_CONTACT_DETAILS - The invoice is missing the contact details of payer. * PENDING_ACTIVATION - The invoice is not yet distributed by Adfin.. Possible values (non-exclusive): MISSING_PAYER_CONTACT_DETAILS, PENDING_ACTIVATION, PENDING_DD_MANDATE, PENDING_DD_CAPABILITY, MARKED_AS_PAID, WORKFLOW_COMPLETED, NOTIFICATION_DELIVERY_FAILED, BULK_PRUNE, OTHER - `invoiceDetails.statusReason` (string) Custom details on why the invoice is in a certain status - `invoiceDetails.itemsTaxType` (string) Specifies how tax is applied to line items in an invoice. * EXCLUSIVE: Line items are exclusive of tax. * INCLUSIVE: Line items are inclusive tax. * NONE: Line items have no tax.. Possible values (non-exclusive): EXCLUSIVE, INCLUSIVE, NONE - `invoiceDetails.items` (array) The list of items from the invoice - `invoiceDetails.items.id` (string) The ID of the line item to update. - `invoiceDetails.items.description` (string) The description of the item. - `invoiceDetails.items.quantity` (number) The quantity of items. - `invoiceDetails.items.unitAmount` (number) The price per unit of the item. - `invoiceDetails.items.taxRate` (number) The tax rate percentage applied on the line item amount (quantity * unit amount). - `invoiceDetails.items.taxAmount` (number) The tax amount added on top of the line item amount. - `invoiceDetails.items.totalAmount` (number) The total price of the item. - `invoiceDetails.items.taxDetails` (object) The tax details response. - `invoiceDetails.items.taxDetails.id` (string) The ID of the tax rate. - `invoiceDetails.items.taxDetails.rate` (number) The actual rate value. - `invoiceDetails.items.accountDetails` (object) The account details response. - `invoiceDetails.items.accountDetails.id` (string) The ID of the account code. - `invoiceDetails.items.accountDetails.code` (string) The account code value. - `invoiceDetails.items.productDetails` (object) The product details response. - `invoiceDetails.items.productDetails.id` (string) The ID of the product. - `invoiceDetails.items.productDetails.code` (string) The product code value. - `invoiceDetails.items.trackingGroupIds` (array) Tracking groups attached to this line item. - `invoiceDetails.items.trackingGroupIds.groupId` (string) Tracking group id. - `invoiceDetails.items.trackingGroupIds.itemId` (string) Tracking group selection option id. - `invoiceDetails.items.externalData` (array) Information about this line item captured from external systems - `invoiceDetails.items.externalData.id` (string) The ID from the external platform - `invoiceDetails.items.externalData.connectorType` (string) The connector type. Possible values (non-exclusive): XERO, QUICKBOOKS, BRIDGE, STRIPE, PLATFORM - `invoiceDetails.items.externalData.templateId` (string) The template ID from external platform from which this line item is created. Cannot use both the template ID and the account code. - `invoiceDetails.items.externalData.accountCode` (string) The account code from external platform from which this line item is created. Cannot use both the template ID and the account code. - `invoiceDetails.creditNotes` (array) The list of credit notes from the invoice - `invoiceDetails.creditNotes.id` (string) Credit note id. - `invoiceDetails.creditNotes.number` (string) Credit note number. - `invoiceDetails.creditNotes.amount` (number) Credit note amount. - `invoiceDetails.creditNotes.valueDate` (string) Date when credit note was applied. - `invoiceDetails.creditNotes.externalData` (array) References about this credit note from external platforms Adfin integrates with. Such as ID etc - `invoiceDetails.creditNotes.externalData.id` (string) ID of the Credit Note in the external platform - `invoiceDetails.fileSource` (string) The source of the file currently being served. Possible values (non-exclusive): NONE, FILE_UPLOAD, EXTERNAL, ADFIN, PENDING_ADFIN - `invoiceDetails.invoiceSource` (string) The source of the invoice. Possible values (non-exclusive): FILE_UPLOAD, MANUAL, PR, EXTERNAL, SCHEDULE, PLATFORM - `invoiceDetails.externalData` (array) References about this invoice from external platforms Adfin integrates with. Such as ID etc - `invoiceDetails.externalData.id` (string) ID of the Invoice in the external platform - `name` (string) The name of the workflow created for the customer - `type` (string, required) Attribute that specifies the type of workflow. Possible values (non-exclusive): ONE_TIME_PAYMENT, DD_MANDATE_AUTHORISATION, DD_PAYMENT, CUSTOMER_STATEMENT - `state` (string, required) The current state of the workflow. Possible values (non-exclusive): PENDING, ACTIVE, PAUSED, COMPLETED, TERMINATED - `paymentInitiationDate` (string) The payment initiation date of Auto Collect workflows - `creationTime` (string, required) The creation time of the workflow - `lastUpdatedTime` (string) Last time the workflow was updated - `events` (array) The list of events that will occur as part of the workflow, applicable exclusively to a single customer - `events.id` (string) The internal id of the created event - `events.frequency` (object) The event frequency - `events.frequency.timeUnit` (string) Time unit measurements used to define the frequency of events. Possible values (non-exclusive): SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR, MONTH, WEEK, DAY - `events.frequency.frequency` (integer) The frequency of the time units - `events.frequency.dayOfMonth` (integer) The specific day of the month designated for executing the event. Please note that short month handling is applicable; if the value is set to 29, 30, or 31, the execution will occur on the last day of the month when applicable - `events.duration` (object) The event duration - `events.duration.startDate` (string) The date when the event execution will begin - `events.duration.endDate` (string) The date on which the execution of the event will conclude - `events.duration.maxNoOfExecutions` (integer) The maximum allowable executions of an event - `events.trigger` (object) Triggers the event based on a relative date. Mutually exclusive with ordinalWeekdayTrigger - `events.trigger.days` (integer) The number of days before/after sent date - `events.trigger.operator` (string) The operator used for determining the send date. Possible values (non-exclusive): ON, AFTER, BEFORE - `events.trigger.referenceDate` (string) The reference date used for computing the date when to execute the workflow step. Possible values (non-exclusive): DUE_DATE, SENT_DATE, PAYMENT_DATE - `events.relativeDateTrigger` (object) Triggers the event based on a relative date. Mutually exclusive with ordinalWeekdayTrigger - `events.ordinalWeekdayTrigger` (object) Triggers the event based on an ordinal weekday. Mutually exclusive with relativeDateTrigger - `events.ordinalWeekdayTrigger.ordinal` (integer, required) The ordinal position of the weekday in the month (e.g., 1 for first, 2 for second, -1 for last) - `events.ordinalWeekdayTrigger.dayOfWeek` (string, required) The day of the week (MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY) - `events.triggerDate` (string) The event trigger date computed based on event execution configurations - `events.type` (string) The type of event. Possible values (non-exclusive): NO_ACTION, SEND_NOTIFICATION, MAKE_PAYMENT, UPDATE_DIRECT_DEBIT_PAYMENTS, SEND_DD_INVOICE_NOTICE, SEND_DD_COLLECTION_NOTICE, SEND_DD_SUCCESS_COLLECTION_NOTICE, SEND_DD_FAILED_COLLECTION_NOTICE, START_FALLBACK_WORKFLOW, SEND_MANDATE_AUTHORISATION_NOTIFICATION, CREATE_DD_MANDATE, PREVIEW_CHARGE_DATE, PREVIEW_PAYOUT_DATE, SEND_CUSTOMER_STATEMENT_NOTIFICATION - `events.state` (string) The current state of the event. Possible values (non-exclusive): SCHEDULED, ACTIVE, PAUSED, SKIPPED, FAILED, FINISHED, INACTIVE, DELETED - `events.details` (object) Attribute used for defining details related to an event. Can be utilized to create a new invoice request. This flexibility allows to tailor instances effectively, ensuring that the appropriate information and formats are used for each scenario - `settings` (array) The settings for reminders - `settings.id` (string) The internal id of the schedule setting - `settings.entityId` (string) The internal id of the entity for whom this schedule setting was created. - `settings.entityType` (string) Attribute that specifies the type of entity. Possible values (non-exclusive): INVOICE, CUSTOMER - `settings.creationTime` (string) The creation time of the schedule setting - `settings.lastUpdatedTime` (string) Last time the schedule setting was updated - `settings.startTime` (string) The time when the schedule setting activates - `settings.endTime` (string) The time when the schedule setting expires - `workflowSettings` (object) Configuration settings related to schedule. - `workflowSettings.reminderSettings` (array) Scheduled reminder configurations for invoices or customers, defining when automated reminders should be sent based on start and end times - `workflowSettings.customerStatementSettings` (object) Customer statement workflow settings - `workflowSettings.customerStatementSettings.isEnabled` (boolean, required) Indicates whether customer statement workflow is enabled ## Response 400 fields ## Response 401 fields ## Response 422 fields ## Response 500 fields