Customer and Recurring API
Overview
The Cardknox Recurring API, designed in the RESTful architectural style, lets you process recurring transactions through the Cardknox gateway based on customized schedules. You can create recurring schedules along with customers and payment methods. Additionally, you can process single transactions for a customer and change a merchant's settings for recurring schedule reports.
Authorization
All requests require passing in an authorization header. The value of the authorization header should be your gateway API key. Contact Cardknox at support@cardknox.com, and we will provide you with an API key.
Versioning
Customer and Recurring API V2 is versioned to allow stability for integrators and flexibility for Cardknox to continue making improvements.
Major Version
The URL contains the major version number parameter. This version number would only be changed if there has been a major change that overhauls the entire API.
Example: https://api.cardknox.com/v2
Minor Version
This version number is incremented when a breaking change to the existing API is implemented (for example, a change to how requests are processed or how responses are sent back).
The minor version is passed in the X-Recurring-Api-Version header: X-Recurring-Api-Version = 2.1
Request Method
The Cardknox gateway requires the POST method to be used for enhanced security.
We do not support the GET method.
Base URL
The base URL for all requests is https://api.cardknox.com/v2
Customer Endpoints
/CreateCustomer
Add a new customer record, which can then be linked to payment methods and schedules.
Request Body (JSON)
Parameter | Required | Type | Description |
SoftwareName | Yes | string | The name of the software making the request. |
SoftwareVersion | Yes | string | The version of the software making the request. |
CustomerNumber | No | string | Merchant's internal customer identifier. |
CustomerNotes | No | string | Notes pertaining to the customer. |
No | string | Customer's email address. | |
Fax | No | string | Customer's fax number. |
BillFirstName | Yes* | string | Customer's first name for their billing profile. *Required if |
BillMiddleName | No | string | Customer's middle name or middle initial for their billing profile. |
BillLastName | Yes* | string | Customer's last name or family name for their billing profile. *Required if |
BillCompany | Yes* | string | Customer's company name for their billing profile. *Required if |
BillStreet | No | string | Customer's street address for their billing profile. |
BillStreet2 | No | string | Customer's street address second line for their billing profile. |
BillCity | No | string | Customer's city for their billing profile. |
BillState | No | string | Customer's state for their billing profile. |
BillZip | No | string | Customer's ZIP code or postal code for their billing profile. |
BillCountry | No | string | Customer's country for their billing profile. |
BillPhone | No | string | Customer's phone number for their billing profile. |
BillMobile | No | string | Customer's mobile number for their billing profile. |
ShipFirstName | No | string | Customer’s first name for their shipping profile. |
ShipMiddleName | No | string | Customer’s middle name or initial for their shipping profile. |
ShipLastName | No | string | Customer’s last/family name for their shipping profile. |
ShipCompany | No | string | Customer’s company name for their shipping profile. |
ShipStreet | No | string | Customer’s street address for their shipping profile. |
ShipStreet2 | No | string | Customer’s street address second line for their shipping profile. |
ShipCity | No | string | Customer’s city for their shipping profile. |
ShipState | No | string | Customer’s state for their shipping profile. |
ShipZip | No | string | Customer’s ZIP code for their shipping profile. |
ShipCountry | No | string | Customer’s country for their shipping profile. |
ShipPhone | No | string | Customer’s phone number for their shipping profile. |
ShipMobile | No | string | Customer’s mobile number for their shipping profile. |
ShipEmail | No | string | Customer’s shipping email address for their shipping profile. |
CustomerCustomXX | No | string | Custom fields (20 available) used for custom data such as customer comments and so forth. Use |
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the | |
CustomerId | integer | The created customer ID. |
Sample Response
/UpdateCustomer
Update existing customer information.
Note: All fields with values must be passed in (even fields that are not being updated). Any fields not passed in are treated as being set to blank.
Request Body (JSON)
Parameter | Required | Type | Description |
SoftwareName | Yes | string | The name of the software making the request. |
SoftwareVersion | Yes | string | The version of the software making the request. |
Revision | Yes | integer | The revision number of the record to update. If this does not match the current revision number of the record, the update will fail. |
CustomerId | Yes | string | The ID of the customer to update. |
CustomerNumber | No | string | Merchant's internal customer identifier. |
CustomerNotes | No | string | Notes pertaining to the customer. |
DefaultPaymentMethodId | Yes | string | The ID of the created payment method. |
No | string | Customer's email address. | |
Fax | No | string | Customer's fax number. |
BillFirstName | Yes* | string | Customer's first name for their billing profile. *Required if |
BillMiddleName | No | string | Customer's middle name or middle initial for their billing profile. |
BillLastName | Yes* | string | Customer's last/family name for their billing profile. *Required if |
BillCompany | Yes* | string | Customer's company name for their billing profile. *Required if |
BillStreet | No | string | Customer's street address for their billing profile. |
BillStreet2 | No | string | Customer's street address second line for their billing profile. |
BillCity | No | string | Customer's city for their billing profile. |
BillState | No | string | Customer's state for their billing profile. |
BillZip | No | string | Customer's ZIP code or postal code for their billing profile. |
BillCountry | No | string | Customer's country for their billing profile. |
BillPhone | No | string | Customer's phone number for their billing profile. |
BillMobile | No | string | Customer's mobile number for their billing profile. |
ShipFirstName | No | string | Customer’s first name for their shipping profile. |
ShipMiddleName | No | string | Customer’s middle name or initial for their shipping profile. |
ShipLastName | No | string | Customer’s last/family name for their shipping profile. |
ShipCompany | No | string | Customer’s company name for their shipping profile. |
ShipStreet | No | string | Customer’s street address for their shipping profile. |
ShipStreet2 | No | string | Customer’s street address second line for their shipping profile. |
ShipCity | No | string | Customer’s city for their shipping profile. |
ShipState | No | string | Customer’s state for their shipping profile. |
ShipZip | No | string | Customer’s ZIP code for their shipping profile. |
ShipCountry | No | string | Customer’s country for their shipping profile. |
ShipPhone | No | string | Customer’s phone number for their shipping profile. |
ShipMobile | No | string | Customer’s mobile number for their shipping profile. |
ShipEmail | No | string | Customer’s shipping email address for their shipping profile. |
CustomerCustomXX | No | string | Custom fields (20 available) used for custom data such as customer comments and so forth. Use |
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the |
Sample Response
/GetCustomer
Retrieves the details of a specific customer.
Request Body (JSON)
Parameter | Required | Type | Description |
SoftwareName | Yes | string | The name of the software making the request. |
SoftwareVersion | Yes | string | The version of the software making the request. |
CustomerId | Yes | string | The ID of the customer to retrieve. |
ShowDeleted | No | boolean | A flag that can be set to retrieve deleted items. If set to true, only deleted items can be retrieved (i.e. customers that are not deleted will not be returned). |
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the | |
Revision | integer | The revision number of the customer record. | |
CreatedDate | string | The date and time the customer was created, returned in ISO 8601 format (yyyy-MM-dd HH:mm:ss.fff). | |
CustomerId | string | The ID of the customer to update. | |
CustomerNumber | string | Merchant's internal customer identifier. | |
CustomerNotes | string | Notes pertaining to the customer. | |
string | Customer's email address. | ||
Fax | string | Customer's fax number. | |
BillFirstName | string | Customer's first name for their billing profile. | |
BillMiddleName | string | Customer's middle name or initial for their billing profile. | |
BillLastName | string | Customer's last/family name for their billing profile. | |
BillCompany | string | Customer's company name for their billing profile. | |
BillStreet | string | Customer's street address for their billing profile. | |
BillStreet2 | string | Customer's street address second line for their billing profile. | |
BillCity | string | Customer's city for their billing profile. | |
BillState | string | Customer's state for their billing profile. | |
BillZip | string | Customer's ZIP code or postal code for their billing profile. | |
BillCountry | string | Customer's country for their billing profile. | |
BillPhone | string | Customer's phone number for their billing profile. | |
BillMobile | string | Customer's mobile number for their billing profile. | |
ShipFirstName | string | Customer’s first name for their shipping profile. | |
ShipMiddleName | string | Customer’s middle name or initial for their shipping profile. | |
ShipLastName | string | Customer’s last/family name for their shipping profile. | |
ShipCompany | string | Customer’s company name for their shipping profile. | |
ShipStreet | string | Customer’s street address for their shipping profile. | |
ShipStreet2 | string | Customer’s street address second line for their shipping profile. | |
ShipCity | string | Customer’s city for their shipping profile. | |
ShipState | string | Customer’s state for their shipping profile. | |
ShipZip | string | Customer’s ZIP code for their shipping profile. | |
ShipCountry | string | Customer’s country for their shipping profile. | |
ShipPhone | string | Customer’s phone number for their shipping profile. | |
ShipMobile | string | Customer’s mobile number for their shipping profile. | |
ShipEmail | string | Customer’s shipping email address for their shipping profile. | |
CustomerCustomXX | string | Custom fields (20 available) used for custom data such as customer comments and so forth. Use |
Sample Response
/DeleteCustomer
Deletes a customer record. You cannot delete a customer who has an active recurring schedule.
Request Body (JSON)
Parameter | Required | Type | Description |
SoftwareName | Yes | string | The name of the software making the request. |
SoftwareVersion | Yes | string | The version of the software making the request. |
CustomerId | Yes | string | The ID of the customer to update. |
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the |
Sample Response
/ListCustomers
Lists customers created by a merchant.
Request Body (JSON)
Parameter | Required | Type | Default Value | Description | Valid Values |
SoftwareName | Yes | string | The name of the software making the request. | ||
SoftwareVersion | Yes | string | The version of the software making the request. | ||
PageSize | No | integer | 100 | The maximum number of items to retrieve for this request. | |
NextToken | No | string | A token that can be sent in to the following request to get the next set of customers. | ||
SortOrder | No | string | Ascending | The list order. Order is determined by customer creation date. | Ascending, Descending |
Filters | No | object | { "IsDeleted" : false } | Filters that can be applied to limit the result set. Filters will remove any items that do not contain the string for that filter value. If there are multiple filters applied, the item must match all of them. Available filters:
|
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the | |
Customers | object[] | An array of customer objects. Refer to the /GetCustomer endpoint for the values that are returned for each customer. | |
NextToken | string | A token to include in the next request to get the next set of results. |
Sample Response
Payment Method Endpoints
/CreatePaymentMethod
Adds a new payment method to a customer’s account profile.
Request Body (JSON)
Parameter | Required | Type | Description |
SoftwareName | Yes | string | The name of the software making the request. |
SoftwareVersion | Yes | string | The version of the software making the request. |
CustomerId | Yes | string | The ID of the customer to update with the new payment method. |
Token | Yes | string | Cardknox token that references a previously used payment method to use for the charge. |
TokenType | Yes | string | The |
TokenAlias | No | string | Custom name for the |
Exp | Yes* | string | Credit card expiration date. *Required if |
Routing | Yes* | string | ACH payment routing number. *Required if |
AccountType | No | string | The account type - checking / savings. *Allowed if the |
Name | No | string | Name on the customer's account. *Required for ACH (check) transactions. |
Street | No | string | Customer's street address for their billing profile. |
Zip | No | string | Customer's ZIP code or postal code for their billing profile. |
SetAsDefault | No | boolean | Sets this payment method as the default payment method. Note: If there are no other payment methods, this method is automatically set as the default. |
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the | |
PaymentMethodId | string | The ID of the created payment method. |
Sample Response
/UpdatePaymentMethod
Updates an existing payment method.
Note: All fields with values must be passed in (even fields that are not being updated). Any fields not passed in are treated as being set to blank.
Request Body (JSON)
Parameter | Required | Type | Description |
SoftwareName | Yes | string | The name of the software making the request. |
SoftwareVersion | Yes | string | The version of the software making the request. |
Revision | Yes | integer | The revision number of the record to update. If this does not match the current revision number of the record, the update will fail. |
PaymentMethodId | Yes | string | The ID of the payment method to update. |
TokenAlias | No | string | Custom name for the |
Exp | No | string | Credit card expiration date. |
AccountType | No | string | The account type - checking / savings *Allowed if |
Routing | Yes* | string | ACH payment routing number. *Required if |
Name | No* | string | Name on the customer's account. *Required for ACH (check) transactions. |
Street | No | string | Customer's street address for their billing profile. |
Zip | No | string | Customer's ZIP code or postal code for their billing profile. |
SetAsDefault | No | boolean | Sets this payment method as the default payment method. Note: If there are no other payment methods, this method is automatically set as the default. |
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents an error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the |
Sample Response
/GetPaymentMethod
Retrieves an existing payment method.
Request Body (JSON)
Parameter | Required | Type | Description |
SoftwareName | Yes | string | The name of the software making the request. |
SoftwareVersion | Yes | string | The version of the software making the request. |
PaymentMethodId | Yes | string | The ID of the payment method to retrieve. |
ShowDeleted | No | boolean | A flag that can be set to retrieve deleted items. If set to true, only deleted items can be retrieved (i.e., payment methods that are not deleted will not be returned). |
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the | |
PaymentMethodId | string | The ID of the payment method. | |
Revision | number | The revision number of the record to update. If this does not match the current revision number of the record the update will fail. | |
Token | string | Cardknox token that references a previously used payment method to use for the charge. | |
TokenType | string | The | CC, Check |
TokenAlias | string | Custom name for the | |
Exp | string | Credit card expiration date (in | |
AccountType | string | The account type - checking / savings Note: This field is only populated when | |
Issuer | string | The credit card issuer. Note: This field is only populated when | |
MaskedCardNumber | string | The masked credit card number. Note: This field is only populated when | |
Name | string | The name on the check. Note: This field is only populated when | |
Street | string | The building number and street name of the customer being billed. | |
Zip | string | The zip code of the customer being billed. | |
CreatedDate | string | The date and time the payment method was created, returned in ISO 8601 format (yyyy-MM-dd HH:mm:ss.fff). |
Sample Response
/DeletePaymentMethod
Removes a payment method from the customer’s record. This will fail if the payment method is the customer's only payment method and there are active schedules.
Request Body (JSON)
Parameter | Required | Type | Description |
SoftwareName | Yes | string | The name of the software making the request. |
SoftwareVersion | Yes | string | The version of the software making the request. |
PaymentMethodId | Yes | string | The ID of the payment method to retrieve. |
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the |
Sample Response
/ListPaymentMethods
Return payment methods based on specific search parameters.
Request Body (JSON)
Parameter | Required | Type | Default Value | Description | Valid Values |
SoftwareName | Yes | string | The name of the software making the request. | ||
SoftwareVersion | Yes | string | The version of the software making the request. | ||
PageSize | No | integer | 100 | The maximum number of items to retrieve for this request. | |
NextToken | No | string | A token that can be sent in to the following request to get the next set of payment methods. | ||
SortOrder | No | string | Ascending | The list order. Order is determined by payment method creation date. | Ascending, Descending |
Filters | No | object | { "IsDeleted" : false } | Filters that can be applied to limit the result set. Filters will remove any items that do not contain the string for that filter value. If there are multiple filters applied, the item must match all of them. Available filters:
|
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the | |
PaymentMethods | object[] | An array of payment method objects. Refer to the /GetPaymentMethod endpoint for the values that are returned for each payment method. | |
NextToken | string | A token to include in the next request to get the next set of results. |
Sample Response
Schedule Endpoints
/CreateSchedule
Create a recurring payment schedule. Schedules have two main parameters: IntervalType
and IntervalCount
. You can set IntervalType
to day, week, month, or year. The IntervalCount
parameter determines the number of times the IntervalType
should pass before the next payment schedule is triggered.
Example 1: To process a charge every two weeks, set IntervalType
to week and set IntervalCount
to 2. This specifies that two weeks should pass before initiating a new charge.
Example 2: To process a charge every 10 days, set IntervalType
to day and set IntervalCount
to 10. This specifies that 10 days should pass before initiating a new charge.
Unsuccessful Payments: If an attempted payment is unsuccessful (e.g., the card is declined), the system reschedules the charge for the following day. This can be done up to five times, provided that the rescheduled payment doesn’t overlap into the next payment cycle. After five unsuccessful attempts, or if rescheduling the payment as above will overlap into the next payment cycle, this individual payment will be canceled. The entire schedule remains in effect.
Request Body (JSON)
Parameter | Required | Type | Default Value | Description | Valid Values |
SoftwareName | Yes | string | The name of the software making the request. | ||
SoftwareVersion | Yes | string | The version of the software making the request. | ||
CustomerId | Yes* | string | Customer's unique ID number. *Required if linking the schedule to an existing customer. | ||
PaymentMethodId | No | string | The unique ID number of the payment method the schedule should use to process the transactions. If none is set, the default payment method on the customer will be used. *Allowed if linking the schedule to an existing customer | ||
NewCustomer | Yes* | object | The customer details. Refer to the /CreateCustomer endpoint for fields that can be set for this object. *Required if not linking the schedule to an existing customer. This cannot be set if linking to an existing customer. | ||
NewPaymentMethod | Yes* | object | The payment method details. Refer to the /CreatePaymentMethod endpoint for fields that can be set for this object. *Required if not linking the schedule to an existing customer. This cannot be set if linking to an existing customer. | ||
IntervalType | Yes | string | Type of time interval. | day, week, month, year | |
Amount | Yes | decimal | Total amount of each transaction. | Must be a number with up to 2 decimal places | |
Currency | No | string | Currency code to be used when processing transactions Note: If the currency code used is not supported for the merchant and it does not run a transaction on schedule creation, the schedule will not error until the first transaction is processed. | ||
TotalPayments | No | integer | infinite | Total count of scheduled payment occurrences, including the initial payment. Note: If left blank, the count is indefinite. This field cannot be set together with | |
Cvv | No | string | The CVV value for the first transaction that is run if a transaction is run immediately. This value will not be applied to a future transaction run by the created schedule. | ||
Description | No | string | Additional data sent with the transaction. | ||
Invoice | No | string | Customer's invoice number for the transaction. Use | ||
PONumber | No | string | Customer's purchase order number for the transaction. | ||
ScheduleName | No | string | Merchant's internal schedule identifier. | ||
IntervalCount | No | integer | 1 | Number of time periods to elapse before the payment schedule is re-triggered. Examples: For every 28 days, set For every other month, set | |
FailedTransactionRetryTimes | No | integer | 5 | Maximum number of times to retry before rescheduling to the next run time if the transaction fails. Retries are run on each subsequent day. If it’s set to 0, it will try one time total. | |
DaysBetweenRetriesnew | No | integer | 1 | Number of days between retries after a declined transaction. | Any natural number greater than 0. |
SkipSaturdayAndHolidays | No | boolean | false | Indicates whether to process payments on the Sabbath and Jewish holidays. | |
CustReceipt | No | boolean | false | A flag that can be set to send the receipts to the email set in | |
CalendarCulture | No | string | Gregorian | Type of calendar to use when executing month and year interval types. | Gregorian, Hebrew |
UseDefaultPaymentMethodOnly | No | boolean | false | Indicates that the system should not try another card if the default card fails. | |
ScheduleRule | No | object | The schedule rule used to determine the next run time after each processed payment. See Appendix A for more information on the | ||
StartDate | No | string | current date | Schedule start date in YYYY-MM-DD format. The start date must be within one year. Unless the | |
EndDate | No | string | Schedule expiration date in YYYY-MM-DD format. Note: This field cannot be set together with | ||
AfterMaxRetriesAction | No | string | ContinueNextInterval | The action to perform after a schedule hits the maximum number of failed attempts in a single interval.
| Disable, ContinueNextInterval |
AllowInitialTransactionToDecline | No | boolean | false | Create the schedule even if the initial payment fails. Note: Can be used only if the | |
CustomXX | No | string | Custom fields (19 available) used for custom data, such as customer comments and so forth.
| ||
InitialAmount | No | String or Integer | Overrides Amount on initial transaction | 5.99 |
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the | |
ScheduleId | string | The ID of the schedule that was created. | |
CustomerId | string | The ID of the customer that was created if the schedule was not linked to an existing customer. | |
PaymentMethodId | string | The ID of the payment method that was created if the schedule was not linked to an existing customer. |
Sample Response
/UpdateSchedule
This command allows you to update some details of a schedule. You can only update information that does not change the actual schedule. For example, the CustomerId
field cannot be updated (and it is not listed in the parameter table below). Also, you cannot update inactive schedules.
The following fields can be updated at any point:
AfterMaxRetriesAction
Amount
CustomXX
CustReceipt
DaysBetweenRetries
Description
Invoice
PaymentMethodId
PONumber
RetryAmount
ScheduleName
SkipSaturdayAndHolidays
UseDefaultPaymentMethodOnly
Any fields that are not set will use the default values (or if no default is indicated, they will be removed).
Request Body (JSON)
Parameter | Required | Type | Default Value | Description | Valid Values |
SoftwareName | Yes | string | The name of the software making the request. | ||
SoftwareVersion | Yes | string | The version of the software making the request. | ||
Revision | Yes | integer | The revision number of the record to update. If this does not match the current revision number of the record, the update will fail. | ||
ScheduleId | Yes | string | The ID of the schedule to update. | ||
Amount | No | decimal | Transaction amount | ||
Currency | No | string | Currency code to be used when processing transactions. Note: If the currency code used is not supported for the merchant and it does not run a transaction on schedule creation, the schedule will not error until the first transaction is processed. | ||
TotalPayments | No | integer | infinite | Total count of scheduled payment occurrences, including the initial payment. You can only change this field before a schedule has been completed. Additionally, you cannot set the value to be lower than the number of payments already processed. Note: This can be updated to at least the number of payments processed or higher. | |
Description | No | string | Additional data sent with the transaction. | ||
Invoice | No | string | Customer's invoice number for the transaction Use | ||
PONumber | No | string | Customer's purchase order number for the transaction. | ||
ScheduleName | No | string | Merchant's internal schedule identifier. | ||
FailedTransactionRetryTimes | No | integer | 5 | Maximum number of times to retry before rescheduling to the next run time if the transaction fails. Retries are run on each subsequent day. If it’s set to 0, it will try one time. You can only change this field before a schedule has been completed. | |
DaysBetweenRetries | No | integer | Number of days between retries after a declined transaction. | Any natural number greater than 0 | |
SkipSaturdayAndHolidays | No | boolean | false | Indicates whether to process payments on the Sabbath and Jewish holidays. | |
CustReceipt | No | boolean | false | A flag that can be set to send the receipts to the email set in | |
CalendarCulture | Yes | string | Gregorian | Type of calendar to use when executing month and year interval types. Note: You cannot change this once the schedule has begun. | Gregorian, Hebrew |
UseDefaultPaymentMethodOnly | No | boolean | false | Indicates that the system should not try another card if the default card fails. | |
PaymentMethodId | No | string | The unique ID of the payment method the schedule should use to process the transactions | ||
ScheduleRule | No | object | The schedule rule used to determine the next run time after each processed payment. See Appendix A for more information on the | ||
StartDate | Yes | string | Schedule start date in YYYY-MM-DD format. The start date must be within one year. Note: This cannot be changed once the schedule has begun. | ||
EndDate | No | string | Schedule expiration date in YYYY-MM-DD format. Note: This field cannot be set together with | ||
AfterMaxRetriesAction | No | string | ContinueNextInterval | The action to perform after a schedule hits the maximum number of failed attempts in a single interval.
| Disable, ContinueNextInterval |
CustomXX | No | string | Custom fields (19 available) used for custom data, such as customer comments and so forth.
|
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the |
Sample Response
/EnableSchedule
Restart a schedule that was previously disabled.
Request Body (JSON)
Parameter | Required | Type | Description |
SoftwareName | Yes | string | The name of the software making the request. |
SoftwareVersion | Yes | string | The version of the software making the request. |
ScheduleId | Yes | string | The ID of the schedule to enable. |
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the |
Sample Response
/DisableSchedule
Stop, pause, cancel, or inactivate an active schedule.
Request Body (JSON)
Parameter | Required | Type | Description |
SoftwareName | Yes | string | The name of the software making the request. |
SoftwareVersion | Yes | string | The version of the software making the request. |
ScheduleId | Yes | string | The ID of the schedule to disable. |
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the |
Sample Response
/DeleteSchedule
Removes a schedule. You can only delete a schedule that is not active.
Request Body (JSON)
Parameter | Required | Type | Description |
SoftwareName | Yes | string | The name of the software making the request. |
SoftwareVersion | Yes | string | The version of the software making the request. |
ScheduleId | Yes | string | The ID of the schedule to delete. |
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the |
Sample Response
/GetSchedule
Retrieves the details for a schedule.
Request Body (JSON)
Parameter | Required | Type | Description |
SoftwareName | Yes | string | The name of the software making the request. |
SoftwareVersion | Yes | string | The version of the software making the request. |
ScheduleId | Yes | string | The ID of the schedule to retrieve. |
ShowDeleted | No | boolean | A flag that can be set to retrieve deleted items. If set to true, only deleted items can be retrieved (i.e., schedules that are not deleted will not be returned). |
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the | |
Revision | integer | The revision number of the record to update. If this does not match the current revision number of the record, the update will fail. | |
ScheduleId | string | Schedule reference number. | |
ScheduleName | string | Schedule name. | |
CustomerId | string | Customer's unique ID number. | |
PaymentMethodId | string | The unique ID number of the payment method the schedule uses to process the transactions Note: Only populated when a specific PaymentMethodId was sent in on creating/updating schedule | |
IsDeleted | boolean | A flag indicating whether the record is deleted. | |
UseDefaultCardOnly | boolean | Indicates that the system should not try another card if the default card fails. | |
FailedTransactionRetryTimes | integer | Maximum number of times to retry before rescheduling to the next run time if the transaction fails. The tries are spaced apart into 1-day intervals. | |
FailedAttemptsInCurrentInterval | integer | The number of unsuccessful transactions that were processed for the current interval. This value will reset to 0 at the start of the next interval. | |
DaysBetweenRetries | integer | Number of days between retries after a declined transaction. | |
ScheduleRule | object | The schedule rule used to determine the next run time after each processed payment. See Appendix A for more information on the | |
StartDate | string | Schedule start date in YYYY-MM-DD format. | |
EndDate | string | Schedule end date in YYYY-MM-DD format. | |
AllowInitialTransactionToDecline | boolean | Indicates whether the schedule was set up to allow the first transaction to be declined. | |
Description | string | Additional data sent with the transaction (optional). | |
Amount | decimal | Transaction amount. | |
Currency | string | Currency code to be used when processing transactions. | |
TotalPayments | integer | Total count of scheduled payment occurrences, including the initial payment. | |
PaymentsProcessed | integer | The number of payments processed by the schedule. | |
SkipSaturdayAndHolidays | boolean | Indicates whether to process payments on the Sabbath and Jewish holidays. | |
IntervalType | string | Type of time interval. | |
IntervalCount | integer | Number of time periods to elapse before the payment schedule is re-triggered. Note: Refer to the /CreateSchedule endpoint for more details. | |
LastTransactionStatus | string | The status of the last transaction run by the schedule. | |
LastTransactionError | string | The error message of the last transaction if the status was Error. | |
LastProjectedPaymentDate | string | The projected payment date of the last transaction that the schedule will run. Note: This may not be 100% accurate if that last date falls on a Saturday or Holiday and | |
Invoice | string | Customer's invoice number for the transaction. | |
PONumber | string | Customer's purchase order number for the transaction. | |
CustReceipt | boolean | A flag indicating whether receipts will be sent to the email set in | |
NextScheduledRunTime | string | The date and time that the schedule will next run. | |
InitialRunTime | string | The date and time of the first transaction run by the schedule. | |
LastRunTime | string | The date and time of the last transaction run by the schedule. | |
IsActive | boolean | A flag indicating whether the schedule is currently enabled/active. | |
CalendarCulture | string | Type of calendar to use when executing month and year interval types. | |
CreatedDate | string | Date that the schedule was created. | |
CustomerNumber | string | Merchant's internal customer identifier. | |
string | Customer's email address. | ||
BillFirstName | string | Customer's first name for their billing profile. | |
BillMiddleName | string | Customer's middle name or initial for their billing profile. | |
BillLastName | string | Customer's last/family name for their billing profile. | |
BillCompany | string | Customer's company for their billing profile. | |
AfterMaxRetriesAction | string | The action to perform after a schedule hits the maximum number of failed attempts in a single interval.
| Disable, ContinueNextInterval |
CustomXX | string | Custom fields (19 available) used for custom data, such as customer comments and so forth.
|
Sample Response
/GetUpcomingPaymentDates
Returns a list of upcoming payment dates (up to 100) for a specific schedule.
Request Body (JSON)
Parameter | Required | Type | Default Value | Description | Valid Values |
SoftwareName | Yes | string | The name of the software making the request. | ||
SoftwareVersion | Yes | string | The version of the software making the request. | ||
ScheduleId | Yes | string | The ID of the schedule to retrieve. | ||
NumberOfPayments | Yes | integer | The number of payment dates to retrieve. | An integer between 1 and 100 (inclusive) | |
CalendarCulture | No | string | Gregorian | The culture the dates should be returned in. | Gregorian, Hebrew |
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents an error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the | |
UpcomingPaymentDates | string[] | The upcoming payment dates for the specified schedule in the format yyyy-mm-dd. |
Sample Response
/ListSchedules
Returns a list of schedules that are sorted by creation date (ascending or descending order). You can use search filters to narrow the search results that are returned.
Request Body (JSON)
Parameter | Required | Type | Default Value | Description | Valid Values |
SoftwareName | Yes | string | The name of the software making the request. | ||
SoftwareVersion | Yes | string | The version of the software making the request. | ||
PageSize | No | integer | 100 | The maximum number of items to retrieve for this request. | |
NextToken | No | string | A token that can be sent in to the following request to get the next set of schedules. | ||
SortOrder | No | string | Ascending | The list order. Order is determined by schedule creation date. | Ascending, Descending |
Filters | No | object | { "IsDeleted" : false } | Filters that can be applied to limit the result set. Filters will remove any items that don't contain the string for that filter value. If there are multiple filters applied the item must match all of them. Available filters:
|
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents an error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the | |
Schedules | object[] | An array of schedule objects. Refer to the /GetSchedule endpoint for the values that are returned for each schedule. Note: The | |
NextToken | string | A token to include in the next request to get the next set of results. |
Sample Response
Transaction Endpoints
/ProcessTransaction
Processes a single payment transaction for a customer. You can specify a backup payment method to use should the initial payment fail. If desired, you can have the system send an email receipt of the transaction to the customer.
Request Body (JSON)
Parameter | Required | Type | Default Value | Description |
SoftwareName | Yes | string | The name of the software making the request. | |
SoftwareVersion | Yes | string | The version of the software making the request. | |
CustomerId | Yes | string | Customer's unique ID number. | |
PaymentMethodId | Yes* | string | The ID of the payment method to use for the transaction. *Required if using an existing payment method. | |
Amount | Yes | decimal | The amount of the transaction. | |
Tax | No | decimal | The tax portion that is included in the total transaction amount. | |
PaymentDetails | No* | object | The details for a new method of payment. *Required if not using an existing payment method. Note: Refer to the /CreatePaymentMethod endpoint for available and required fields. | |
UseBackupPaymentMethods | No | boolean | false | Indicates that the system should try another card if the default card fails. |
Invoice | No | string | Customer's invoice number for the transaction. Use | |
PONumber | No | string | Customer's purchase order number for the transaction. | |
Description | No | string | Additional data sent with the transaction. | |
AllowDuplicates | No | boolean | false | A flag indicating whether to disable duplicate detection. Useful for testing, but it is not suggested that this be set to true in production. |
CustReceipt | No | boolean | A flag that can be set to send the receipts to the email address set in | |
Cvv | No | string | The CVV value for the transaction. | |
No | string | Customer's email address. | ||
Fax | No | string | Customer's fax number. | |
BillFirstName | Yes* | string | Customer's first name for their billing profile. *This field is required if | |
BillMiddleName | No | string | Customer's middle name or initial for their billing profile. | |
BillLastName | Yes* | string | Customer's last/family name for their billing profile. *This field is required if | |
BillCompany | Yes* | string | Customer's company for their billing profile. *This field is required if | |
BillStreet | No | string | Customer's street address for their billing profile. | |
BillStreet2 | No | string | Customer's street address second line for their billing profile. | |
BillCity | No | string | Customer's city for their billing profile. | |
BillState | No | string | Customer's state for their billing profile. | |
BillZip | No | string | Customer's ZIP code or postal code for their billing profile. | |
BillCountry | No | string | Customer's country for their billing profile. | |
BillPhone | No | string | Customer's phone number for their billing profile. | |
BillMobile | No | string | Customer's mobile number for their billing profile. | |
ShipFirstName | No | string | Customer’s first name for their shipping profile. | |
ShipMiddleName | No | string | Customer’s middle name or initial for their shipping profile. | |
ShipLastName | No | string | Customer’s last/family name for their shipping profile. | |
ShipCompany | No | string | Customer’s company name for their shipping profile. | |
ShipStreet | No | string | Customer’s street address for their shipping profile. | |
ShipStreet2 | No | string | Customer’s street address second line for their shipping profile. | |
ShipCity | No | string | Customer’s city for their shipping profile. | |
ShipState | No | string | Customer’s state for their shipping profile. | |
ShipZip | No | string | Customer’s ZIP or postal code for their shipping profile. | |
ShipCountry | No | string | Customer’s country for their shipping profile. | |
ShipPhone | No | string | Customer’s phone number for their shipping profile. | |
ShipMobile | No | string | Customer’s mobile number for their shipping profile. | |
ShipEmail | No | string | Customer’s shipping email address for their shipping profile. | |
CustomXX | No | string | Custom fields (19 available) used for custom data, such as customer comments and so forth.
| |
Currency | No | string | Currency code for the transaction. | |
TransactionType | No | string | sale | The type of transaction to run. |
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the | |
GatewayRefnum | string | The gateway reference number for the transaction. | |
GatewayStatus | string | The status of the transaction passed back by the gateway. | |
GatewayErrorMessage | string | The error message for the transaction passed back by the gateway if the status indicates an error. |
Sample Response
/GetTransaction
Returns the details of an existing transaction, such as transaction date and customer ID. Also returned are the transaction's processing status and any error messages from the gateway.
Request Body (JSON)
Parameter | Required | Type | Description |
SoftwareName | Yes | string | The name of the software making the request. |
SoftwareVersion | Yes | string | The version of the software making the request. |
TransactionId | Yes | string | The ID of the transaction to retrieve. |
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the | |
TransactionId | string | The ID of the retrieved transaction. | |
ScheduleId | string | The ID of the schedule that the transaction was run for. | |
CustomerId | string | The ID of the customer that the transaction was run for. | |
PaymentMethodId | string | The ID of the payment method used in the transaction. | |
TransactionDate | string | The date the transaction was run. | |
GatewayRefNum | string | The reference number generated by the gateway for the transaction. | |
GatewayStatus | string | The transaction processing status returned by the gateway. | |
GatewayError | string | The error message returned by the gateway if |
Sample Response
/ListTransactions
Returns a list of transactions, that are sorted by transaction date (in ascending or descending order). You can use specific search criteria to define which transactions to return.
Request Body (JSON)
Parameter | Required | Type | Default Value | Description | Valid Values |
SoftwareName | Yes | string | The name of the software making the request. | ||
SoftwareVersion | Yes | string | The version of the software making the request. | ||
PageSize | No | integer | 100 | The maximum number of items to retrieve for this request. | |
NextToken | No | string | A token that can be sent in to the following request to get the next set of transactions. | ||
SortOrder | No | string | Ascending | The list order. Order is determined by the date the transaction ran. | Ascending, Descending |
Filters | No | object | Filters that can be applied to limit the result set. Filters will remove any items that do not contain the string for that filter value. If there are multiple filters applied, the item must match all of them. Available filters:
|
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the | |
Transactions | object[] | An array of transaction objects. Refer to the /GetTransaction endpoint for the values that are returned for each transaction. | |
NextToken | string | A token to include in the next request to get the next set of results. |
Sample Response
Merchant Endpoints
/UpdateMerchant
Changes the recurring report settings for the merchant, which includes:
Email address
Enabled status
Show Details setting
Request Body (JSON)
Parameter | Required | Type | Description |
SoftwareName | Yes | string | The name of the software making the request. |
SoftwareVersion | Yes | string | The version of the software making the request. |
Revision | Yes | integer | The current revision number of the record. If his value is incorrect the update will fail. |
ScheduleReportSettings | Yes | object | The schedule report settings for the merchant:
|
MaxRetriesReachedNotification | No | object | Settings for an email notification when a schedule reaches the maximum number of retries in an interval.
Note: Values are only updated if they are not set to null. To clear the EmailAddresses, an empty array must be passed in. |
Sample Request
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the |
Sample Response
/DescribeMerchant
Returns the merchant's current configuration for recurring report settings (see /UpdateMerchant).
Request Body (JSON)
Parameter | Required | Type | Description |
SoftwareName | Yes | string | The name of the software making the request. |
SoftwareVersion | Yes | string | The version of the software making the request. |
Sample Request
{ "SoftwareName" : "ACME Inc.", "SoftwareVersion" : "1.0" }
Response Body (JSON)
Parameter | Type | Description | Valid Values |
Result | char | The result of the API call. S represents success, E represents error. | S, E |
RefNum | string | A unique request ID. | |
Error | string | If the | |
Revision | integer | The current revision number of the record. | |
ScheduleReportSettings | object | The schedule report settings for the merchant:
| |
MaxRetriesReachedNotification | object | The max retry reached notification settings for the merchant:
|
Sample Response
Appendix A - Schedule Rules
Fields
Name | Type | Description | Valid Values |
RuleType | string | The type of rule to create. | On, Nth |
DayOfWeek | integer | The day of the week to run the schedule on. | 1 - 7 |
DayOfMonth | integer | The day of the month to run the schedule on. | 1 - 31 for gregorian schedules 1 - 30 for hebrew schedules |
MonthOfYear | integer | The month of the year to run the schedule on. | 1 - 12 for gregorian schedules 1 - 13 for hebrew schedules |
N | integer | The nth value to run the schedule on. | Any positive or negative integer other than zero |
NthOfType | string | The type that the nth value should be applied to. | Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Day, Weekday, WeekendDay |
RuleType
There are two types of rules: On
and Nth
.
On
rules run on a specified day within the specified interval (Examples: every Sunday, the 3rd of each month, or February 17th each year).
Nth
rules run on nth (or nth from last) of the specified interval (Examples: the first weekday of each month, or the second to last Sunday of each month).
Restrictions
DayOfWeek
,DayOfMonth
, andMonthOfYear
can only be used whenRuleType
isOn
.DayOfWeek
can only be used for weekly schedules.DayOfMonth
can only be used for monthly and yearly schedules.MonthOfYear
can only be used for yearly schedules.N
andNthOfType
can only be used whenRuleType
isNth
.Weekly schedules can only have a
RuleType
ofOn
.Daily schedules cannot use rule types.
Additional Notes
Weekdays begin with Monday and continue through Friday.
Weekends are Saturday and Sunday.
The following are the values for the days of the week:
Sunday = 1
Monday = 2
Tuesday = 3
Wednesday = 4
Thursday = 5
Friday = 6
Saturday = 7
The following are the values for
MonthOfYear
for the Hebrew calendar:Tishrei = 1
Cheshvan = 2
Kislev = 3
Teves = 4
Shevat = 5
Adar = 6
(Adar Beis = 7 in a leap year)
Nisan = 7 (8 in a leap year)
Iyar = 8 (9 in a leap year)
Sivan = 9 (10 in a leap year)
Tamuz = 10 (11 in a leap year)
Av = 11 (12 in a leap year)
Elul = 12 (13 in a leap year)
Use a negative number as the value of
N
to run as the nth from last.An
N
value of1
indicates the firstAn
N
value of -1 indicates the last
A schedule with an
IntervalCount
greater than 1 will first run on the next matching date and will skip intervals from now on.Example: The current date is January 1st, 2023 (a Wednesday), and the schedule rule says it should run on the first Thursday of the month with an
IntervalCount
of 2. The first run time will be on January 2nd, 2023, and the second run time will be on March 5th, 2023.
Schedules will begin running on the first matching date on or after the scheduled start date. If the start date is past the first matching date in the current period, it will begin the next interval period.
Example: A yearly schedule that runs on January 1st with a start date of January 2nd, 2023, will first run on January 1st, 2024.
If no schedule rule is passed in when creating a schedule, a default rule will be created based on the interval type. The default
RuleType
isOn
with theDayOfWeek
,DayOfMonth
, andMonthOfYear
values set based on the start date.
Example 1
A monthly schedule that runs every 3 months on the first weekday of the month:
Example 2
A yearly schedule that runs every year on January 1st:
Example 3
A weekly schedule that runs every other Monday:
Appendix B - Timeouts
Timeouts
Transactions that take longer than 45 seconds to process will now be automatically voided by the gateway and marked as declined on recurring.
Last updated