Skip to main content

Payment Plans

Payment plans represent recurring or scheduled billing arrangements. Templates are reusable plan definitions; plans are customer-specific instances created from a template or directly.


Payment Plan Templates

merchantApiPaymentPlanTemplateCreate

Create a reusable billing template tied to a transaction provider.

mutation CreateTemplate(
$providerId: String!
$data: MerchantPaymentPlanTemplateCreateSchema!
) {
merchantApiPaymentPlanTemplateCreate(
merchantTransactionProviderId: $providerId
data: $data
) {
id
name
amount
currency
renewalIntervalMonths
endsAfterMonths
trialPeriodDays
providerStatus
providerCode
createdAt
updatedAt
}
}

Top-level arguments

ArgumentTypeRequiredDescription
merchantTransactionProviderIdStringYesID of the merchant transaction provider
dataMerchantPaymentPlanTemplateCreateSchemaYesTemplate definition

MerchantPaymentPlanTemplateCreateSchema fields

FieldTypeRequiredDescription
nameStringYesHuman-readable template name
amountBigIntYesRecurring charge amount in smallest currency unit (e.g. cents)
initialAmountBigIntNoFirst-payment amount when different from amount
currencyCURRENCYYesISO 4217 currency enum (e.g. USD)
providerStatusPAYMENT_PLAN_TEMPLATE_STATUSYesInitial status: ENABLED or DISABLED
renewalIntervalMonthsIntYesMonths between renewals
endsAfterMonthsIntNoPlan duration in months; omit for indefinite
trialPeriodDaysIntNoTrial days before first charge; 0 for no trial

Return shape

FieldTypeDescription
idStringAccruPay template UUID
nameStringTemplate name
amountBigIntRecurring amount
currencyCURRENCYCurrency
renewalIntervalMonthsIntRenewal interval
endsAfterMonthsIntDuration; null if indefinite
trialPeriodDaysIntTrial period
providerStatusPAYMENT_PLAN_TEMPLATE_STATUSProvider-side status
providerCodeStringProvider's own template reference
createdAtDateTimeCreation timestamp
updatedAtDateTimeLast update timestamp

merchantApiPaymentPlanTemplateUpdate

Update a template's mutable fields. Changes apply to future plan renewals only; existing active plans are not retroactively modified.

mutation UpdateTemplate(
$providerId: String!
$templateId: String!
$data: MerchantPaymentPlanTemplateUpdateSchema!
) {
merchantApiPaymentPlanTemplateUpdate(
merchantTransactionProviderId: $providerId
merchantPaymentPlanTemplateId: $templateId
data: $data
) {
id
name
providerStatus
updatedAt
}
}

Top-level arguments

ArgumentTypeRequiredDescription
merchantTransactionProviderIdStringYesProvider ID
merchantPaymentPlanTemplateIdStringYesAccruPay template UUID to update
dataMerchantPaymentPlanTemplateUpdateSchemaYesFields to update

MerchantPaymentPlanTemplateUpdateSchema fields

FieldTypeRequiredDescription
nameStringNoNew template name
providerStatusPAYMENT_PLAN_TEMPLATE_STATUSNoENABLED or DISABLED

merchantApiPaymentPlanTemplateSyncOne

Pull the latest state for a template from the provider and update AccruPay's records.

mutation SyncTemplate($providerId: String!, $providerCode: String!) {
merchantApiPaymentPlanTemplateSyncOne(
merchantTransactionProviderId: $providerId
providerCode: $providerCode
) {
id
name
providerStatus
updatedAt
}
}

Arguments

ArgumentTypeRequiredDescription
merchantTransactionProviderIdStringYesProvider ID
providerCodeStringYesProvider's own template reference code

Payment Plans

merchantApiPaymentPlanCreate

Create a customer-specific payment plan, optionally from a template.

mutation CreatePlan(
$providerId: String!
$data: MerchantPaymentPlanCreateSchema!
) {
merchantApiPaymentPlanCreate(
merchantTransactionProviderId: $providerId
data: $data
) {
id
status
amount
currency
providerCode
renewalIntervalMonths
endsAfterMonths
trialPeriodDays
nextChargeAt
createdAt
updatedAt
}
}

Top-level arguments

ArgumentTypeRequiredDescription
merchantTransactionProviderIdStringYesProvider ID
dataMerchantPaymentPlanCreateSchemaYesPlan definition

MerchantPaymentPlanCreateSchema fields

FieldTypeRequiredDescription
merchantInternalPaymentPlanCodeStringYesYour unique identifier for this plan
templateIdStringNoAccruPay template UUID; inherits billing schedule when provided
paymentMethodIdStringYesStored payment method ID to charge on each renewal
amountBigIntYesRecurring charge amount in smallest currency unit
initialAmountBigIntNoFirst-charge amount when different from amount
currencyCURRENCYYesCurrency enum (e.g. USD)
renewalIntervalMonthsIntYesMonths between charges
endsAfterMonthsIntNoPlan duration in months; omit for indefinite
trialPeriodDaysIntNoTrial period before first charge
customer.merchantInternalCustomerCodeStringYesYour customer identifier

Return shape

FieldTypeDescription
idStringAccruPay plan UUID
statusPAYMENT_PLAN_STATUSACTIVE, INACTIVE, CANCELED, ENDED, or ERROR
amountBigIntRecurring charge amount
currencyCURRENCYCurrency
providerCodeStringProvider's plan reference
renewalIntervalMonthsIntRenewal interval
endsAfterMonthsIntDuration; null if indefinite
trialPeriodDaysIntTrial period
nextChargeAtDateTimeScheduled next charge date
createdAtDateTimeCreation timestamp
updatedAtDateTimeLast update timestamp

merchantApiPaymentPlanCancel

Cancel an active plan. No further renewals will be charged after cancellation.

mutation CancelPlan($planId: String!, $providerId: String!) {
merchantApiPaymentPlanCancel(
merchantPaymentPlanId: $planId
merchantTransactionProviderId: $providerId
) {
id
status
updatedAt
}
}

Arguments

ArgumentTypeRequiredDescription
merchantPaymentPlanIdStringYesAccruPay plan UUID to cancel
merchantTransactionProviderIdStringYesProvider the plan belongs to

merchantApiPaymentPlanSyncOne

Pull the latest plan state from the provider by the provider's own reference code.

mutation SyncPlan($providerId: String!, $providerCode: String!) {
merchantApiPaymentPlanSyncOne(
merchantTransactionProviderId: $providerId
providerCode: $providerCode
) {
id
status
nextChargeAt
updatedAt
}
}

Arguments

ArgumentTypeRequiredDescription
merchantTransactionProviderIdStringYesProvider ID
providerCodeStringYesProvider's plan reference code