Subscription

Create subscription.

SecurityBearer or Bearer or Bearer or Bearer
Request
Request Body schema: application/json

Request parameters

paymentProcessorId
string <uuid>
transactionType
integer <int32> (SubscriptionsService.Contracts.Enums.TransactionType)

Transaction type

Possible values:

  • 1 - Authorization:
  • 2 - Sale:
  • 11 - AchDebit:
Enum: 1 2 11
amount
number <double>

The total amount due of the transaction.

percentageOffRate
number or null <double>

The percent of Amount. To be discounted.

surchargeRate
number or null <double>

The percent of transaction amount to be added to Amount after PercentageOffRate is applied.

useCardPrice
boolean or null

Parameter is mandatory when merchant has ZeroCostProcessingOption == Dual Pricing. Parameter must be null when merchant has other ZeroCostProcessingOption. For Dual Pricing, amount should be the card price and useCardPrice should be "true", or amount should be the cash price and useCardPrice should be "false".

currencyId
integer <int32>

Currency ID (1 for USD)

paymentFrequencyUnit
integer <int32> (SubscriptionsService.Contracts.Enums.PaymentFrequencyUnit)

Payment frequency unit

Possible values:

  • 1 - Day:
  • 2 - Week:
  • 3 - Month:
Enum: 1 2 3
paymentFrequency
integer <int32>

Payment frequency value

paymentStartDateTime
string or null <date-time>

Date of the first payment. Null indicates immediate payment(PayNow)

numberOfPayments
integer <int32>

Number of payments for the subscription.

customerId
string <uuid>

Id of the customer the subscription is created for.

paymentMethodId
string <uuid>

Payment method Id. Must be added and active before subscription creation.

isFasterProcessing
boolean

Required for ACH. Must be empty for card subscriptions.

Responses
200

Success

400

Bad Request

404

Not Found

500

Server Error

post/sub-api/v1/subscriptions
Request samples
application/json
{
  • "paymentProcessorId": "a7699db0-1e16-4616-b2cf-4e8d4a5320cb",
  • "transactionType": 1,
  • "amount": 0,
  • "percentageOffRate": 0,
  • "surchargeRate": 0,
  • "useCardPrice": true,
  • "currencyId": 0,
  • "paymentFrequencyUnit": 1,
  • "paymentFrequency": 0,
  • "paymentStartDateTime": "2019-08-24T14:15:22Z",
  • "numberOfPayments": 0,
  • "customerId": "87d8e330-2878-4742-a86f-dbbb3bf522ac",
  • "paymentMethodId": "b6df8625-cd25-4123-b345-638aa7b5d011",
  • "isFasterProcessing": true
}
Response samples
application/json
{
  • "id": "629626a9-2ecc-48c0-b45a-cc1d4d71074e",
  • "payNowSuccess": true,
  • "transactionId": "2d915fbc-47a6-4bd2-98b3-735ccc1f8b9d",
  • "payNowResponse": null
}

Get subscriptions list.

SecurityBearer or Bearer or Bearer or Bearer
Request
query Parameters
page
integer <int32>
pageSize
integer <int32>
orderBy
string
asc
boolean
customerIds
Array of strings <uuid>
Responses
200

Success

400

Bad Request

404

Not Found

500

Server Error

get/sub-api/v1/subscriptions
Request samples
Response samples
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "merchantId": "c3073b9d-edd0-49f2-a28d-b7ded8ff9a8b",
  • "paymentProcessorId": "a7699db0-1e16-4616-b2cf-4e8d4a5320cb",
  • "statusId": 0,
  • "status": "string",
  • "transactionTypeId": 0,
  • "transactionType": "string",
  • "customerId": "87d8e330-2878-4742-a86f-dbbb3bf522ac",
  • "paymentMethodId": "b6df8625-cd25-4123-b345-638aa7b5d011",
  • "paymentAmount": {
    },
  • "alreadyPaidAmount": 0,
  • "allPaymentsAmount": 0,
  • "currencyId": 0,
  • "paymentFrequencyUnitId": 0,
  • "paymentFrequencyUnit": "string",
  • "paymentFrequency": 0,
  • "creationDate": "2019-08-24T14:15:22Z",
  • "subscriptionStartDate": "2019-08-24T14:15:22Z",
  • "subscriptionEndDate": "2019-08-24T14:15:22Z",
  • "lastPaymentDate": "2019-08-24T14:15:22Z",
  • "nextPaymentDate": "2019-08-24T14:15:22Z",
  • "successfulPaymentsCount": 0,
  • "numberOfPayments": 0,
  • "customer": {
    },
  • "source": {
    }
}

Retrieve subscription by id.

SecurityBearer or Bearer or Bearer or Bearer
Request
path Parameters
subscriptionId
required
string <uuid>

Subscription id

Responses
200

Success

400

Bad Request

404

Not Found

500

Server Error

get/sub-api/v1/subscriptions/{subscriptionId}
Request samples
Response samples
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "merchantId": "c3073b9d-edd0-49f2-a28d-b7ded8ff9a8b",
  • "paymentProcessorId": "a7699db0-1e16-4616-b2cf-4e8d4a5320cb",
  • "statusId": 0,
  • "status": "string",
  • "transactionTypeId": 0,
  • "transactionType": "string",
  • "customerId": "87d8e330-2878-4742-a86f-dbbb3bf522ac",
  • "paymentMethodId": "b6df8625-cd25-4123-b345-638aa7b5d011",
  • "paymentAmount": {
    },
  • "alreadyPaidAmount": 0,
  • "allPaymentsAmount": 0,
  • "currencyId": 0,
  • "paymentFrequencyUnitId": 0,
  • "paymentFrequencyUnit": "string",
  • "paymentFrequency": 0,
  • "creationDate": "2019-08-24T14:15:22Z",
  • "subscriptionStartDate": "2019-08-24T14:15:22Z",
  • "subscriptionEndDate": "2019-08-24T14:15:22Z",
  • "lastPaymentDate": "2019-08-24T14:15:22Z",
  • "nextPaymentDate": "2019-08-24T14:15:22Z",
  • "successfulPaymentsCount": 0,
  • "numberOfPayments": 0,
  • "customer": {
    },
  • "source": {
    }
}

Retrieve subscription by id.

SecurityBearer or Bearer or Bearer or Bearer
Request
path Parameters
subscriptionId
required
string <uuid>

Subscription id

query Parameters
page
integer <int32>
pageSize
integer <int32>
hideCompletedAndPlanned
boolean
Responses
200

Success

400

Bad Request

404

Not Found

500

Server Error

get/sub-api/v1/subscriptions/{subscriptionId}/payments
Request samples
Response samples
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "initialExecutionDateTime": "2019-08-24T14:15:22Z",
  • "statusId": 0,
  • "status": "string",
  • "amount": 0,
  • "paymentOrder": 0,
  • "attempts": [
    ]
}

Terminate subscription.

SecurityBearer or Bearer or Bearer or Bearer
Request
path Parameters
subscriptionId
required
string <uuid>

Subscription id

Responses
200

Success

400

Bad Request

404

Not Found

500

Server Error

put/sub-api/v1/subscriptions/{subscriptionId}/terminate
Request samples
Response samples
application/json
{
  • "id": "62181497-6c5d-4cb7-8fef-259e5b77f839",
  • "statusId": 5,
  • "status": "Terminated",
  • "message": "Subscription is terminated. Future payments will no longer be processed. This action is permanent."
}