Recurring Payments

Customer

All fields are in alphanumeric format.

Field Name Required Notes
email Optional Email address for the customer
phone Optional Contact number for the customer
comments Optional Comments on the customer. Note: Once updated, these comments will override previous comments.
customer-key Response Field Only Unique key for the customer that has been created
first-name Required First name of the customer
last-name Required Last name of the customer
billing-address Optional Billing address of the customer
shipping-address Optional Shipping address of the customer

Create a Customer

Customer must be created in order to set up a plan. You can POST application/xml or application/json to the service. Make sure you include a valid api-key in the header.

XML Request XML Response
 
 

JSON Request JSON Response
 

 

Update a Customer

You can do an HTTP PUT on any field in the customer object, and it will update that row in the object. Keep in mind that updates to customers are first in and first out. First, you will need to add the customer-key that was returned on the creation of the customer to the end of the URL:
https://gateway-sb.clearent.net/rest/v2/customers/CUSTOMER-KEY-HERE

XML Request XML Response
 
 
JSON Request JSON Response
 
 

Delete

You can only Delete customers that do not have plans or payments associated to them. If your customer has payments and plans, you will receive an error. You can update the status of the customer to inactive if they have plans or payments and they will be archived after 24 months. For customers that do NOT have plans or payments you can use the delete method with the URL and customer-key: https://gateway-sb.clearent.net/rest/v2/customers/CUSTOMER-KEY-HERE. You will get a 200 ok, with the object that was deleted returned to you.

XML Request XML Response
Execute the delete function on the URL with the customer-key. In the header you will need to set the api-key and the content-type to application/xml.  
JSON Request JSON Response
Execute the delete function on the URL with the customer-key. In the header you will need to set the api-key and the content-type to application/json.  

Create a Token and associate with a customer

All fields are in alpha-numeric format

Field Name Required Notes
card Required Card number to create the card token with
card-type Required Type of card
exp-date Required expiration date of the card
customer-key Optional customer to associate to the token. This is required if you want to use this token with plans/customers
csc Required CSC of the card
description Required description of the card (i.e. – business card)
avs-address Optional Optional depending on your AVS settings
avs-required Optional defaults to true. If set to false, it will not validate avs address
avs-zip optional billing zip code of the card number

Create a token

Plan must have a customer-key from a previously related customer. Use url https://gateway-sb.clearent.net/rest/v2/tokens You can POST application/xml or application/json to the service. Make sure you include a valid api-key in the header.

XML Request XML Response
 
 
JSON Request JSON Response
 
 

Update a Token

You can do an HTTP PUT on the field you want to modify. There are only 3 modifiable fields on a token; customer-key, status (ACTIVE, INACTIVE, DELETED), description. Anything else you want to modify with a token, you will need to delete and re-add. First, you will need to add the token-id, that was returned on the creation of the token, to the end of the URL:
https://gateway-sb.clearent.net/rest/v2/tokens/1100000000214291111

XML Request XML Response
 
 
JSON Request JSON Response
 
 

Delete

To delete a token, you can use the delete method with URL. https://gateway-sb.clearent.net/rest/v2/tokens/1100000000214291111 You will get a 200 ok, with the object that was deleted returned to you.

XML Request XML Response
Method: DELETE URL: https://gateway-sb.clearent.net/rest/v2/tokens/1100000013339891111 REQUEST DELETE /rest/v2/tokens/1100000013339891111 Host: gateway-sb.clearent.net accept: application/xml api-key: YOURAPIKEYHERE content-type: application/xml  
JSON Request JSON Response
Method: DELETE URL: https://gateway-sb.clearent.net/rest/v2/tokens/1100000013339891111 REQUEST DELETE /rest/v2/tokens/1100000013339891111 Host: gateway-sb.clearent.net accept: application/json api-key: YOURAPIKEYHERE content-type: application/json  

Payment Plan

All fields are in alpha-numeric format.

Field Name Required Notes
plan-key Response Only Unique Identifier for the plan
plan-name Required Name of the plan
type Required Currently can only be SUBSCRIPTION
customer-key Optional customer to associate to the token. This is required if you want to use this token with plans/customers
customer-key Required Unique key for the customer that will be associated to the plan
token-id Required Card token that will be used to make payments on the plan
frequency Required Frequency to make the payment. Only option is MONTHLY
frequency-day Required Day of month to execute the payment
payment-amount Required Amount to pay with the frequency specified
start-date Required Day to start payment.
end-date Required Day to end payment. Cannot be longer than 12 months
status Required Status of the payment plan. ACTIVE – payments will fire. SUSPENDED – no payments will fire, CANCELLED – no payments will fire and cannot be restarted

Create a Plan

Plan must have a customer-key from a previously related customer. You can POST application/xml or application/json to the service. Make sure you include a valid api-key in the header.

XML Request XML Response
 
 
JSON Request JSON Response
 
 

Update a Payment Plan

You can do an HTTP PUT on any field in the payment plan object, and it will update that row in the object. Keep in mind that updates to payment plans are first in and first out. First, you will need to add the plan-key, that was returned on the creation of the customer, to the end of the URL:
https://gateway-sb.clearent.net/rest/v2/payment-plans/plan_tz1CRPmjbuXB

XML Request XML Response
 
 

JSON Request JSON Response
 

 

Delete

You can only Delete Plans that are not active and do not have payments associated to them. If your plan has payments, you will receive an error. You can update the status of the plan to Canceled if it has payments and the plan will be archived after 24 months. For plans that do NOT have payments you can use the delete method with the URL. https://gateway-sb.clearent.net/rest/v2/payment-plans/plan_tz1CRPmjbuXB You will get a 200 ok, with object that was deleted returned to you.

XML Request XML Response
Execute the delete function on the URL with the customer-key https://gateway-sb.clearent.net/rest/v2/payment-plans/plan_tz1CRPmjbuXB In the header you will need to set the api-key and the content-type to application/xml  
JSON Request JSON Response
Execute the delete function on the URL with the customer-key https://gateway-sb.clearent.net/rest/v2/payment-plans/plan_n30dbi2SFiGS In the header you will need to set the api-key and the content-type to application/json