Payment Schedules API

Subsbase allows you to customize your billing frequency for your customers through payment schedules. You can also create templates to be used later on when creating new payment schedules. To learn more about Payment Schedules, Payment Schedule Templates and how to create them, please check out Schedules.

The Payment Schedules API is an integral component of the core service. As a result, all requests should be directed to: https://api.subsbase.io/core/v2/graphql.

The core service expects 2 headers, the X-SITE-ID and Authorization so the request would be:

POST https://api.subsbase.io/core/v2/graphql
Authorization: Bearer {server token}
X-SITE-ID: {your site id}
Consuming the Payment Schedules API requires that a server token is used to authenticate the request. The server token is expected in the Authorization header.

Queries

Payment Schedules

query GetPaymentSchedules($siteId: String!, $pagination: PaginationGQLInputType, $sorting: [SortingGQLInputType], $filter: FilterGQLInputType) {
  paymentSchedules(
    siteId: $siteId
    pagination: $pagination
    sorting: $sorting
    filter: $filter
  ) {
    isSuccess
    message
    pagination {
      page
      perPage
      totalRecords
    }
    data {
      id
      name
      product
      createdOn
      currency {
        code
      }
      customer {
        id
        customerId
        fullName
      }
      paymentMethod {
        type
        displayText
      }
      scheduledPayments {
        name
        date
        amount
        status
      }
      data {
        status
      }
    }
  }
}
#All properties are found in the PaymentScheduleGQLType
// Variables Sample:
{
  "siteId": "test-site",
  "pagination": {
    "perPage": 20,
    "page": 1
  },
  "sorting": [
    {
      "field": "createdOn",
      "direction": "Descending"
    }
  ]
}

Payment Schedule

query GetPaymentSchedule(
  $siteId: String!
  $paymentScheduleId: String!
) {
  paymentSchedule(siteId: $siteId, paymentScheduleId: $paymentScheduleId) {
    id
    reference
    name
    product
    createdOn
    baseCurrency {
      code
      displayText
      symbol
    }
    billingCurrency {
      code
      displayText
      symbol
    }
    displayCurrency {
      code
      displayText
      symbol
    }
    data {
      invoicing
      comments
      allowPaymentMethodChange
      status
      currencySettings {
        billingCurrency {
          target
          useApiForConversion
          useSiteGlobalConversion
          currenciesConversion
        }
        displayCurrency {
          target
          useApiForConversion
          useSiteGlobalConversion
          currenciesConversion
        }
        billingCapRate
        billingFloorRate
      }
    }
    infoFields {
      label
      name
      value
    }
    customFields
    customer {
      customerId
      firstName
      lastName
      fullName
      emailAddress
    }
    scheduledPayments {
      id
      reference
      name
      date
      amount
      status
      statusDate
      data {
        billingRate
      }
      infoFields {
        label
        name
        value
      }
      customFields
      url
    }
    totalOutstandingAmount
    totalOverdueAmount
  }
}
// Variables Sample:
{
  "siteId": "test-site",
  "paymentScheduleId": "86105eb2-4ba2-40a3-a88f-7cefd1f58214"
}

Payment Schedules by Id

query GetPaymentSchedulesById($siteId: String!,$ids: [String]!,$pagination: PaginationGQLInputType,$sorting: [SortingGQLInputType]) { 
   paymentSchedulesById (siteId: $siteId,ids: $ids,pagination: $pagination,sorting: $sorting) {
    isSuccess
    data{
        id
        #All properties are found in the PaymentScheduleGQLType
    }
    message
   } 
}
// Variables Sample
{"siteId":"test-site",
"ids": [
    "d6c1d09b-c27b-4d2b-8ea1-1afed93038a3",
    "9476c7b3-faa1-4f0d-9194-d252f344cb4a"
  ]
}

Payment Schedule Templates

query GetPaymentScheduleTemplates($siteId: String!, $pagination: PaginationGQLInputType, $sorting: [SortingGQLInputType], $filter: FilterGQLInputType) {
  paymentScheduleTemplates(
    siteId: $siteId
    pagination: $pagination
    sorting: $sorting
    filter: $filter
  ) {
    isSuccess
    message
    pagination {
      page
      perPage
      totalRecords
    }
    data {
      id
      siteId
      name
      description
      payments {
        name
      }
    }
  }
}
// Variables Sample:
{
  "siteId": "test-site",
  "pagination": {
    "perPage": 20,
    "page": 1
  }
}

Payment Schedule Template

query GetPaymentScheduleTemplate($siteId: String!, $paymentScheduleTemplateId: String!) {
  paymentScheduleTemplate(
    siteId: $siteId
    paymentScheduleTemplateId: $paymentScheduleTemplateId
  ) {
    id
    siteId
    name
    description
    rule {
      name
      operation
    }
    payments {
      order
      name
      intervalUnit
      intervalDuration
      percentageAmount
    }
  }
}
#All properties are found in the PaymentScheduleTemplateGQLType
// Variables Sample:
{
  "paymentScheduleTemplateId": "0ca585a2-0a6c-41e2-a345-57e6cc4ba436",
  "siteId": "test-site"
}

Site Payment Methods

These are the saved payment methods for recurring payments on your site, like wallets and cards, which are automatically collected.

query GetSitePaymentMethods($siteId: String!) {
  getSitePaymentMethods(siteId: $siteId) {
    id
    siteId
    paymentProviderCode
    #All properties are found in the SitePaymentMethodGQLType
  }
}
// Variables Sample:
{ "siteId": "test-site" }

Site Manual Payment Methods

  • These are the unsaved payment methods on your site, like cash, direct debit and cheques, which are not automatically collected and need to be manually marked as paid on your site.
query GetSiteManualPaymentMethods($siteId: String!) {
  getSiteManualPaymentMethods(siteId: $siteId) {
    id
    siteId
    paymentProviderCode
    displayText
    displayImage
  }
}
#All properties are found in the SitePaymentMethodGQLType
// Variables Sample
{"siteId":"test-site"
}

Dunning Profiles

query GetDunningProfiles($siteId: String!, $filter: FilterGQLInputType, $pagination: PaginationGQLInputType, $sorting: [SortingGQLInputType]) {
  dunningProfiles(
    siteId: $siteId
    filter: $filter
    pagination: $pagination
    sorting: $sorting
  ) {
    isSuccess
    message
    pagination {
      page
      perPage
      totalRecords
    }
    data {
      id
      siteId
      name
      dunningFailAction
      trials {
        index
        trialDelayInDays
        trialPercentage
        template
      }
    }
  }
}
#All properties are found in the DunningProfileGQLType
// Variables Sample:
{
  "siteId": "test-site",
  "pagination": {
    "perPage": 10,
    "page": 1
  },
  "sorting": [
    {
      "field": "name",
      "direction": "Ascending"
    }
  ],
  "filter": null
}

Dunning Profile

query GetDunningProfile($siteId: String!, $dunningProfileId: String!) {
  dunningProfile(siteId: $siteId, dunningProfileId: $dunningProfileId) {
    id
    siteId
    name
    dunningFailAction
    trials {
      index
      trialDelayInDays
      trialPercentage
      template
    }
  }
}
// Variables Sample:
{
  "siteId": "test-site",
  "dunningProfileId": "619951bd-74ce-46d6-827d-853e982fab99"
}

Mutations

Payment Schedule

Create Payment Schedule

  • To create a payment schedule, you need to use the following Mutation. It is advisable to use variables in this case since the input types are more complex than just strings:
mutation CreatePaymentSchedule(
  $siteId: String!
  $customerId: String!
  $paymentSchedule: PaymentScheduleGQLInputType!
  $requestNewPaymentMethod: Boolean
) {
  customer(siteId: $siteId, customerId: $customerId) {
    paymentSchedules {
      create(
        paymentSchedule: $paymentSchedule
        requestNewPaymentMethod: $requestNewPaymentMethod
      ) {
        isSuccess
        message
        value {
          id
          reference
          scheduledPayments {
            id
            reference
            #All properties are found in the PaymentScheduleGQLType 
          }
        }
      }
    }
  }
}
// Variables Sample:
{
  "siteId": "test-site",
  "customerId": "test-site_4491eb8d16534e7dae1a88636f232a3f",
  "requestNewPaymentMethod": false,
  "paymentSchedule": {
    "reference": "PS0001",
    "name": "Payment Schedule 1",
    "product": "Product...",
    "baseCurrencyCode": "usd",
    "billingCurrencyCode": "egp",
    "displayCurrencyCode": "egp",
    "paymentMethod": null,
    "narrativeTemplateId": null,
    "dunningProfileId": null,
    "invoiceId": null,
    "data": {
      "invoicing": "NoInvoice",
      "comments": "Test Payment Schedule",
      "allowPaymentMethodChange": true,
      "status": "Accepted",
      "currencySettings": {
        "billingCapRate": 60,
        "billingFloorRate": null,
        "billingCurrency": {
          "target": "egp",
          "useApiForConversion": true,
          "useSiteGlobalConversion": false,
          "currenciesConversion": { "usd": 50.1 }
        },
        "displayCurrency": {
          "target": "egp",
          "useApiForConversion": true,
          "useSiteGlobalConversion": false,
          "currenciesConversion": { "usd": 50.1 }
        }
      }
    },
    "infoFields": [
      {
        "label": "Contact Number",
        "name": "contact-number",
        "value": "01010101010"
      }
    ],
    "customFields": {
      "customFieldvv": "customValuevv"
    },
    "scheduledPayments": [
      {
        "reference": "SP0001",
        "name": "Scheduled Payment 1",
        "date": "2026-06-15T09:00:00Z",
        "amount": 100,
        "status": "NotPaid",
        "infoFields": {
          "label": "Contact Number",
          "name": "contact-number",
          "value": "01010101010"
        },
        "customFields": {
          "customFieldzz": "customValuezz"
        }
      },
      {
        "reference": "SP0002",
        "name": "Scheduled Payment 2",
        "date": "2026-07-15T09:00:00Z",
        "amount": 100,
        "status": "NotPaid",
        "infoFields": [
          {
            "label": "Contact Number",
            "name": "contact-number",
            "value": "01010101010"
          }
        ],
        "customFields": {
          "customFieldkk": "customValuekk"
        }
      }
    ]
  }
}
// Response Sample:
{
  "data": {
    "customer": {
      "paymentSchedules": {
        "create": {
          "isSuccess": true,
          "message": "",
          "value": {
            "id": "86105eb2-4ba2-40a3-a88f-7cefd1f58214",
            "reference": "PS0001",
            "scheduledPayments": [
              {
                "id": "4e4c203c-9921-4462-9c36-eb1434475176",
                "reference": "SP0001"
              },
              {
                "id": "533ea290-e6eb-4570-9805-2f23e912dfcb",
                "reference": "SP0002"
              }
            ]
          }
        }
      }
    }
  }
}

Update Payment Schedule

mutation UpdatePaymentSchedule(
    $siteId: String!
    $paymentScheduleId: String!
    $paymentSchedule: PaymentScheduleGQLInputType!
) {
    paymentSchedule(siteId: $siteId, paymentScheduleId: $paymentScheduleId) {
        update(paymentSchedule: $paymentSchedule) {
            isSuccess
            message
            value {
                id
                #All properties are found in the PaymentScheduleGQLType
            }
        }
    }
}
// Variables Sample:
{
  "siteId": "site Id",
  "paymentScheduleId": "42d2032e-9946-4fa0-9e4b-7d0e536cde0c",
  "paymentSchedule": {
    "siteId": "site Id",
    "id": "42d2032e-9946-4fa0-9e4b-7d0e536cde0c",
    "name": "three-month-schedule",
    "product": "test",
    "currencyCode": "egp",
    "paymentMethod": {
      "id": "d6c67f77-be9f-43a8-b775-979d88e5083b",
      "type": "card",
      "metaData": "",
      "isDefault": true,
      "identifier": "",
      "billingInfo": null,
      "displayText": "4242",
      "providerReference": "site Id_fad0c134205747a4839396a0654ffef0",
      "sitePaymentMethodId": "40103eb9-af57-484e-a0b3-c62b7f6dbd66"
    },
    "customerId": "ca6256f7-5683-4d28-ba52-b0b17be8b1a5",
    "data": {
      "invoicing": "NoInvoice",
      "extraDetails": "test",
      "allowPaymentMethodChange": false,
      "status": "NotAccepted"
    },
    "scheduledPayments": [
      {
        "id": "cbc7322f-c895-4cb4-a2ee-93506660c31f",
        "siteId": "site Id",
        "name": "Payment #1",
        "reference": null,
        "date": "2023-06-30T21:00:00",
        "amount": 0.834,
        "status": "NotPaid"
      },
      {
        "id": "9fc8b01d-c4bc-4e3e-9ef6-a6659247049a",
        "siteId": "site Id",
        "name": "Payment #2",
        "reference": null,
        "date": "2023-07-31T21:00:00",
        "amount": 0.833,
        "status": "NotPaid"
      },
      {
        "id": "13e1f17e-87db-481e-b3c9-3bef782129a0",
        "siteId": "site Id",
        "name": "Payment #3",
        "reference": null,
        "date": "2023-08-31T21:00:00",
        "amount": 0.833,
        "status": "NotPaid"
      }, 
    ],
    "dunningProfileId": null
  }
}

Create Payment Schedule From Template

  • Instead of creating scheduled payments from scratch, you can use one of the previously made templates.
  • For more details about templates, please check out below the Payment Schedule Templates section.
  • To create a payment schedule from an already existing template, you need to use the following Mutation. It is advisable to use variables in this case since the input types are more complex than just strings:
mutation CreateCustomerPaymentSchedulesFromTemplate(
  $siteId: String!
  $customerId: String!
  $paymentScheduleFromTemplate: PaymentScheduleFromTemplateGQLInputType!
) {
  customer(siteId: $siteId, customerId: $customerId) {
    paymentSchedules {
      createFromTemplate(
        paymentScheduleFromTemplate: $paymentScheduleFromTemplate
      ) {
        isSuccess
        message
            value {
                id
                #All properties are found in the PaymentSchedulesTemplateGQLType
      }
    }
  }
}
// Variables Sample:
{
  "siteId": "site Id",
  "customerId": "site Id_341f7f56d2304428a19c85b6d6274322",
  "paymentScheduleFromTemplate": {
    "paymentScheduleTemplateId": "b54b9110-2627-45fd-a6d8-fa9374cb4578",
    "customerId": "site Id_341f7f56d2304428a19c85b6d6274322",
    "baseDate": "2023-02-28T22:00:00.000Z",
    "baseAmount": 20,
    "currencyCode": "egp",
    "product": "test-schedule-payment2",
    "selectedPaymentMethodId": "9392e570-f006-41c0-bbba-8705ce0030b8"
  }
}

Payment Schedule Template

Create Payment Schedule Template

  • To create a payment schedule template, you need to use the following Mutation. It is advisable to use variables in this case since the input types are more complex than just strings:
mutation CreatePaymentScheduleTemplate(
  $siteId: String!
  $paymentScheduleTemplate: PaymentScheduleTemplateGQLInputType!
) {
  paymentScheduleTemplates(siteId: $siteId) {
    create(paymentScheduleTemplate: $paymentScheduleTemplate) {
      isSuccess
      message
            value {
                id
                #All properties are found in the PaymentScheduleTemplateGQLType
    }
  }
}
// Variables Sample:
{
  "siteId": "site Id",
  "paymentScheduleTemplate": {
    "siteId": "site Id",
    "name": "birthday gift",
    "payments": [
      {
        "order": 1,
        "name": "birthday #1",
        "intervalDuration": 1,
        "intervalUnit": "Day",
        "percentageAmount": 0.5
      },
      {
        "order": 2,
        "name": "birthday #1",
        "intervalDuration": 1,
        "intervalUnit": "Day",
        "percentageAmount": 0.5
      }
    ]
  }
}

Update Payment Schedule Template

  • This operation updates the infofields of an existing payment schedule template.
  • To update an existing payment schedule template, you need to use the following Mutation. It is advisable to use variables in this case since the input types are more complex than just strings:
mutation UpdatePaymentScheduleTemplate(
  $siteId: String!
  $PaymentScheduleTemplateId: String!
  $paymentScheduleTemplate: PaymentScheduleTemplateGQLInputType!
) {
  paymentScheduleTemplate(
    siteId: $siteId
    paymentScheduleTemplateId: $PaymentScheduleTemplateId
  ) {
    update(paymentScheduleTemplate: $paymentScheduleTemplate) {
      isSuccess
      message
            value {
                id
                #All properties are found in the PaymentScheduleTemplateGQLType
            }
    }
  }
}
// Variables Sample:
{
  "siteId": "site Id",
  "PaymentScheduleTemplateId": "ec33559c-fd36-410b-ae63-b7b47b02e216",
  "paymentScheduleTemplate": {
    "siteId": "site Id",
    "id": "ec33559c-fd36-410b-ae63-b7b47b02e216",
    "name": "birthday gift",
    "description": "birthday gift",
    "payments": [
      {
        "order": 1,
        "name": "birthday #1",
        "intervalUnit": "Day",
        "intervalDuration": 1,
        "percentageAmount": 0.5
      },
      {
        "order": 2,
        "name": "birthday #1",
        "intervalUnit": "Day",
        "intervalDuration": 1,
        "percentageAmount": 0.5
      }
    ]
  }
}

Scheduled Payments

Create Scheduled Payment

  • Creates a scheduled payment under a specific payment schedule.
mutation CreateScheduledPayment(
    $siteId: String!
    $paymentScheduleId: String!
    $scheduledPayment: ScheduledPaymentGQLInputType!
) {
    paymentSchedule(siteId: $siteId, paymentScheduleId: $paymentScheduleId) {
        scheduledPayments {
            create(scheduledPayment: $scheduledPayment) {
                isSuccess
                message
            }
        }
    }
}
// Variables Sample:
{
    "siteId": "site Id",
    "paymentScheduleId": "42d2032e-9946-4fa0-9e4b-7d0e536cde0c",
    "scheduledPayment":  {
        "name": "test2",
        "date": "2023-06-06T21:00:00.000Z",
        "amount": 12,
        "siteId": "site Id",
        "status": "NotPaid"
    }
}

Update Scheduled Payment

  • To update a scheduled payment, you need to use the following:
mutation UpdateScheduledPayment(
  $siteId: String!
  $paymentScheduleId: String!
  $scheduledPaymentId: String!
  $scheduledPayment: ScheduledPaymentGQLInputType!
) {
  paymentSchedule(siteId: $siteId, paymentScheduleId: $paymentScheduleId) {
    scheduledPayment(scheduledPaymentId: $scheduledPaymentId) {
      update(scheduledPayment: $scheduledPayment) {
        isSuccess
        message
      }
    }
  }
}
// Variables Sample:
{
  "siteId": "test-site",
  "paymentScheduleId": "86105eb2-4ba2-40a3-a88f-7cefd1f58214",
  "scheduledPaymentId": "533ea290-e6eb-4570-9805-2f23e912dfcb",
  "scheduledPayment": {
    "reference": "SP0002_Modified",
    "name": "Scheduled Payment 2",
    "date": "2026-07-15T09:00:00Z",
    "amount": 100
  }
}

Cancel Scheduled Payments

Cancel Batch

  • To cancel a batch of scheduled payments, you need to use the following:
mutation CancelScheduledPayments($siteId: String!, $paymentScheduleId: String!, $ids: [String!]!) {
  paymentSchedule(siteId: $siteId, paymentScheduleId: $paymentScheduleId) {
    scheduledPaymentList(ids: $ids) {
      cancel {
        isSuccess
        message
      }
    }
  }
}
// Variables Sample:
{
  "siteId": "test-site",
  "paymentScheduleId": "adsbd-dlskfj-23-sdfklj204fj"
  "ids": ["1123-2343-2343-2334-23423", "1324-1324-1324-2343"]
}

Cancel Single

  • To cancel a single scheduled payment, you need to use the following:
mutation CancelScheduledPayment(
  $siteId: String!
  $scheduledPaymentId: String!
  $paymentScheduleId: String!
) {
  paymentSchedule(siteId: $siteId, paymentScheduleId: $paymentScheduleId) {
    scheduledPayment(scheduledPaymentId: $scheduledPaymentId) {
      cancel {
        isSuccess
        message
      }
    }
  }
}
// Variables Sample:
{
"siteId": "test-site",
"paymentScheduleId": "adsbd-dlskfj-23-sdfklj204fj",
"scheduledPaymentId": "adsbd-dlskfj-23-sdfklj204kk"
}
  • To send a scheduled payment link, you need to use the following:
mutation SendScheduledPaymentLink(
    $siteId: String!, $scheduledPaymentId: String!, $paymentScheduleId: String!) {
  paymentSchedule(siteId: $siteId, paymentScheduleId: $paymentScheduleId) {
    scheduledPayment(scheduledPaymentId: $scheduledPaymentId) {
      sendPaymentLink {
        isSuccess
        message
      }
    }
  }
}
// Variables Sample:
{
  "siteId": "test-site",
  "paymentScheduleId": "adsbd-dlskfj-23-sdfklj204fj"
  "scheduledPaymentId": "1123-2343-2343"
}

Mark as Paid

  • You can choose to mark a specific payment as paid or a batch/list of payments.

Single Payment Mark as Paid

mutation MarkScheduledPaymentAsPaid(
  $siteId: String!
  $paymentScheduleId: String!
  $scheduledPaymentId: String!
  $sitePaymentMethodId: String
  $amount: Decimal!
  $currencyCode: String!
  $conversionRate: Decimal!
  $date: DateTime!
  $comment: String
) {
  paymentSchedule(siteId: $siteId, paymentScheduleId: $paymentScheduleId) {
    scheduledPayment(scheduledPaymentId: $scheduledPaymentId) {
      markAsPaid(
        sitePaymentMethodId: $sitePaymentMethodId
        amount: $amount
        currencyCode: $currencyCode
        conversionRate: $conversionRate
        date: $date
        comment: $comment
      ) {
        isSuccess
        message
      }
    }
  }
}
// Variables Sample:
{
  "siteId": "test-site",
  "paymentScheduleId": "86105eb2-4ba2-40a3-a88f-7cefd1f58214",
  "scheduledPaymentId": "4e4c203c-9921-4462-9c36-eb1434475176",
  "sitePaymentMethodId": "9235ba08-0a41-11ec-9a03-0242ac130003",
  "amount": 100,
  "currencyCode": "egp",
  "conversionRate": 1,
  "date": "2026-06-17T01:03:23Z",
  "comment": "Test Payment..."
}

Batch Payments Mark as Paid

mutation MarkScheduledPaymentsAsPaid(
  $siteId: String!
  $ids: [String!]!
  $paymentScheduledId: String!
) {
  paymentSchedule(siteId: $siteId, paymentScheduleId: $paymentScheduleId) {
    scheduledPaymentList(ids: $ids) {
      markAsPaid {
        isSuccess
        message
      }
    }
  }
}
// Variables Sample:
{
  "siteId": "site Id",
  "paymentScheduleId": "adsbd-dlskfj-23-sdfklj204fj"
  "ids": ["1123-2343-2343-2334-23423", "1324-1324-1324-2343"]
}

Payment Methods

Change Payment Method

  • This operation changes/updates the infofields of an existing payment method.
  • For more details about payment methods, please check out Payment Method.
  • To change/update an existing payment method, you need to use the following Mutation. It is advisable to use variables in this case since the input types are more complex than just strings:
mutation ChangePaymentMethod(
  $siteId: String!
  $paymentScheduleId: String!
  $paymentMethod: PaymentMethodGQLInputType!
) {
  paymentSchedule(siteId: $siteId, paymentScheduleId: $paymentScheduleId) {
    changePaymentMethod(paymentMethod: $paymentMethod) {
      isSuccess
      message
    }
  }
}
// Variables Sample:
{
  "siteId": "site Id",
  "paymentScheduleId": "d6c1d09b-c27b-4d2b-8ea1-1afed93038a3",
  "paymentMethod": {
    "id": "240500c1-aa93-418a-9963-19dcd4aea238",
    "displayText": "8769",
    "isDefault": true,
    "type": "Visa Card",
    "sitePaymentMethodId": "182687d0-7ce2-4312-b589-ec911cb10cdc"
  }
}

Custom Fields

Add Custom Field

mutation AddPaymentScheduleCustomField(
  $siteId: String!
  $paymentScheduleId: String!
  $customField: KeyValuePairGQLInputType!
) {
  paymentSchedule(siteId: $siteId, paymentScheduleId: $paymentScheduleId) {
    customFields {
      add(customField: $customField) {
        isSuccess
        message
      }
    }
  }
}
// Variables Sample:
{
  "siteId": "site Id",
  "paymentScheduleId": "",
  "customField": {
    "key": "custom field key",
    "value": "custom field value"
  }
}

Update Custom Field

mutation UpdatePaymentScheduleCustomField(
  $siteId: String!
  $paymentScheduleId: String!
  $name: String!
  $customField: KeyValuePairGQLInputType!
) {
  paymentSchedule(siteId: $siteId, paymentScheduleId: $paymentScheduleId) {
    customField(name: $name) {
      update(customField: $customField) {
        isSuccess
        message
      }
    }
  }
}
// Variables Sample:
{
  "siteId": "site Id",
  "paymentScheduleId": "",
  "name": "custom field name",
  "customField": {
    "key": "custom field key",
    "value": "custom field new value"
  }
}

Delete Custom Field

mutation DeleteCustomField($siteId: String!, $paymentScheduleId: String!, $name: String!) {
  paymentSchedule(siteId: $siteId, paymentScheduleId: $paymentScheduleId) {
    customField(name: $name) {
      delete {
        isSuccess
        message
      }
    }
  }
}
// Variables Sample:
{
  "siteId": "site Id",
  "paymentScheduleId": "",
  "name": "custom field name"
}

Dunning Profiles

Create Dunning Profile

  • To create a new dunning profile, you need to use the following Mutation:
mutation CreateDunningProfile(
    $siteId: String!
    $dunningProfile: DunningProfileGQLInputType!
) {
    dunningProfiles(siteId: $siteId) {
        create(dunningProfile: $dunningProfile) {
            isSuccess
            message
          value{
                id
            #All properties are found in the DunningProfileGQLType
        }
    }
}
// Variables Sample:
{
  "siteId": "site Id",
  "dunningProfile": {
    "name": "dunning_profile_reminder",
    "dunningFailAction": "Cancel",
    "trials": [
      {
        "trialDelayInDays": 1,
        "trialPercentage": 0.5,
        "template": "reminder",
        "index": 0
      }
    ],
    "siteId": "site Id"
  }
}

Update Dunning Profile

  • This operation updates the infofields of an existing dunning profile.
  • To update an existing dunning profile, you need to use the following Mutation. It is advisable to use variables in this case since the input types are more complex than just strings:
mutation UpdateDunningProfile(
    $siteId: String!
    $dunningProfileId: String!
    $dunningProfile: DunningProfileGQLInputType!
) {
    dunningProfile(siteId: $siteId, dunningProfileId: $dunningProfileId) {
        update(dunningProfile: $dunningProfile) {
            isSuccess
            message
            value{
                id
            #All properties are found in the DunningProfileGQLType
        }
    }
}
// Variables Sample:
{
  "siteId": "site Id",
  "dunningProfile": {
    "name": "dunning_profile_reminder",
    "dunningFailAction": "Cancel",
    "trials": [
      {
        "index": 0,
        "trialDelayInDays": 1,
        "trialPercentage": 0.8,
        "template": "reminder"
      }
    ],
    "id": "aa187339-246c-4896-a685-55fb7f483168",
    "siteId": "site Id"
  },
  "dunningProfileId": "aa187339-246c-4896-a685-55fb7f483168"
}

Remove Dunning Profile

mutation RemoveDunningProfile(
    $siteId: String!
    $paymentScheduleId: String!
    $dunningProfileId: String
) {
    paymentSchedule(siteId: $siteId, paymentScheduleId: $paymentScheduleId) {
        dunningProfile(dunningProfileId: $dunningProfileId) {
            remove {
                isSuccess
            }
        }
    }
}
// Variables Sample:
{
    "siteId": "site Id",
    "paymentScheduleId": "d6c1d09b-c27b-4d2b-8ea1-1afed93038a3",
    "dunningProfileId": "b6288d74-f84c-4413-8431-6c097ffeab5e"
}