Manage Auto payment for an schedule invoice
POST/invoices/schedule/:scheduleId/auto-payment
API to manage auto payment for a schedule
Request
Version stringrequired
API Version
Available options
v3scheduleId stringrequired
Schedule Id
- application/json
- Body
- Example (auto)
Bodyrequired
altIdstringrequired
location Id / company Id based on altType
altTypestringrequired
Alt Type
Available options
locationidstringrequired
autoPaymentobjectrequired
auto-payment configuration
{
"altId": "6578278e879ad2646715ba9c",
"altType": "location",
"id": "string",
"autoPayment": {
"enable": true,
"type": "string",
"paymentMethodId": "string",
"customerId": "string",
"card": {
"brand": "string",
"last4": "string"
},
"usBankAccount": {
"bank_name": "string",
"last4": "string"
},
"sepaDirectDebit": {
"bank_code": "string",
"last4": "string",
"branch_code": "string"
},
"bacsDirectDebit": {
"sort_code": "string",
"last4": "string"
},
"becsDirectDebit": {
"bsb_number": "string",
"last4": "string"
},
"cardId": "string",
"provider": {}
}
}
Successful response
- application/json
- Schema
- Example (auto)
Schema
_idstringrequired
Schedule Id
statusobjectrequired
Schedule Status
liveModebooleanrequired
Live Mode
altIdstringrequired
Location Id or Agency Id
altTypestringrequired
Available options
locationnamestringrequired
Name of the invoice
scheduleobject
invoicesobject[]required
List of invoices
businessDetailsobjectrequired
Business Details
currencystringrequired
Currency
contactDetailsobjectrequired
Contact Details
discountobject
Discount
itemsstring[]required
Invoice Items
totalnumberrequired
Total Amount
titlestringrequired
Title
termsNotesstringrequired
Terms notes
compiledTermsNotesstringrequired
Compiled terms notes
createdAtstringrequired
created at
updatedAtstringrequired
updated at
{
"_id": "6578278e879ad2646715ba9c",
"status": "draft",
"liveMode": false,
"altId": "6578278e879ad2646715ba9c",
"altType": "location",
"name": "New Invoice",
"schedule": {
"executeAt": "string",
"rrule": {
"intervalType": "monthly",
"interval": 2,
"startDate": "2023-01-01",
"startTime": "20:45:00",
"endDate": "2029-11-01",
"endTime": "18:45:00",
"dayOfMonth": 15,
"dayOfWeek": "mo",
"numOfWeek": -1,
"monthOfYear": "jan",
"count": 10,
"daysBefore": 5,
"useStartAsPrimaryUserAccepted": true,
"endType": "by"
}
},
"invoices": [
{
"_id": "6578278e879ad2646715ba9c",
"status": "draft",
"liveMode": false,
"amountPaid": 0,
"altId": "6578278e879ad2646715ba9c",
"altType": "location",
"name": "New Invoice",
"businessDetails": {
"name": "Alex",
"address": {
"addressLine1": "9931 Beechwood",
"city": "St. Houston",
"state": "TX",
"countryCode": "USA",
"postalCode": "559-6993"
},
"phoneNo": "+1-214-559-6993",
"website": "www.example.com"
},
"invoiceNumber": "19",
"currency": "USD",
"contactDetails": {
"id": "c6tZZU0rJBf30ZXx9Gli",
"phoneNo": "+1-214-559-6993",
"customFields": [],
"name": "Alex",
"address": {
"countryCode": "US"
}
},
"issueDate": "2023-01-01",
"dueDate": "2023-01-01",
"discount": {
"type": "percentage",
"value": 0
},
"invoiceItems": [
{
"taxes": [],
"_id": "c6tZZU0rJBf30ZXx9Gli",
"productId": "c6tZZU0rJBf30ZXx9Gli",
"priceId": "c6tZZU0rJBf30ZXx9Gli",
"currency": "USD",
"name": "Macbook Pro",
"qty": 1,
"amount": 999
}
],
"total": 999,
"title": "INVOICE",
"amountDue": 999,
"createdAt": "2023-12-12T09:27:42.355Z",
"updatedAt": "2023-12-12T09:27:42.355Z",
"automaticTaxesEnabled": true,
"automaticTaxesCalculated": true,
"paymentSchedule": {}
}
],
"businessDetails": {
"name": "Alex",
"address": {
"addressLine1": "9931 Beechwood",
"city": "St. Houston",
"state": "TX",
"countryCode": "USA",
"postalCode": "559-6993"
},
"phoneNo": "+1-214-559-6993",
"website": "www.example.com"
},
"currency": "USD",
"contactDetails": {
"id": "c6tZZU0rJBf30ZXx9Gli",
"phoneNo": "+1-214-559-6993",
"customFields": [],
"name": "Alex",
"address": {
"countryCode": "US"
}
},
"discount": {
"type": "percentage",
"value": 0
},
"items": [
{
"taxes": [],
"_id": "c6tZZU0rJBf30ZXx9Gli",
"productId": "c6tZZU0rJBf30ZXx9Gli",
"priceId": "c6tZZU0rJBf30ZXx9Gli",
"currency": "USD",
"name": "Macbook Pro",
"qty": 1,
"amount": 999
}
],
"total": 999,
"title": "INVOICE",
"termsNotes": "Confidential",
"compiledTermsNotes": "Confidential",
"createdAt": "2023-12-12T09:27:42.355Z",
"updatedAt": "2023-12-12T09:27:42.355Z"
}