Recurring Payments Service Customer
Customer Controller
find customer by customer key
if true (default), lists results in descending order. Otherwise it will list them in ascending order
email address of customer
expiration date of card
first name of customer
last four digits of card number
last name of customer
order list by
page number
page-size
phone number
plan name
api-key-value
GET //rest/v2/customers HTTP/1.1
Host: gateway-sb.clearent.net
Accept: */*
{
"code": 200,
"emvUrl": "text",
"exchange-id": "ID_38839393-3938383-484848484",
"gatewayUrl": "text",
"links": [
{
"href": "/rest/v2/transactions?id=846512",
"id": 846512,
"rel": "transaction"
}
],
"page": {
"first": false,
"last": false,
"number": 4,
"number-of-elements": 102,
"size": 4,
"sort": {
"field": {
"ANY_ADDITIONAL_PROPERTY": "text"
}
},
"total-elements": 102,
"total-pages": 4
},
"payload": {
"payloadType": "text"
},
"signature": "text",
"status": "SUCCESS",
"urls": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"vaultUrl": "text"
}
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.
api-key-value
notes about the customer
my fav customer
Customer Identifier
custID-88839992-223838-023333
First Name of Customer
John
Last Name of the customer
Doe
Customer phone number
444-444-4444
POST //rest/v2/customers HTTP/1.1
Host: gateway-sb.clearent.net
Content-Type: application/json
Accept: */*
Content-Length: 749
{
"billing-address": {
"city": "St Louis",
"company": "Test Company",
"country": "United States",
"first-name": "John",
"last-name": "Doe",
"phone": 3148889999,
"state": "MO",
"street": "123 Example Street",
"street2": "Suite 700",
"zip": 85284
},
"comments": "my fav customer",
"customer-key": "custID-88839992-223838-023333",
"email": "[email protected]",
"first-name": "John",
"last-name": "Doe",
"links": {
"link": [
{
"href": "/rest/v2/transactions?id=846512",
"id": 846512,
"rel": "transaction"
}
]
},
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"phone": "444-444-4444",
"shipping-address": {
"city": "St Louis",
"company": "Test Company",
"country": "United States",
"first-name": "John",
"last-name": "Doe",
"phone": 3148889999,
"state": "MO",
"street": "123 Example Street",
"street2": "Suite 700",
"zip": 85284
}
}
{
"payloadType": "text",
"payment": {
"amount": 9,
"completed-time": "09/19/2016 04:11:3333",
"customer-key": "cust_e333-93994-33838388938933",
"fired-time": "09/19/2016 04:11:3333",
"last-four": 3345,
"links": {
"link": [
{
"href": "/rest/v2/transactions?id=846512",
"id": 846512,
"rel": "transaction"
}
]
},
"original-exchange-id": "exchange-93994-33838388938933",
"payment-result": "APPROVED",
"payment-status": "APPROVED",
"payment-type": "Card",
"plan-key": "plan_8383-38833-3333",
"plan-name": "My Plan",
"transaction-id": "id",
"transaction-key": "id",
"transaction-type": "SALE"
}
}
customerKey
api-key-value
GET //rest/v2/customers/{customerKey} HTTP/1.1
Host: gateway-sb.clearent.net
Accept: */*
{
"code": 200,
"emvUrl": "text",
"exchange-id": "ID_38839393-3938383-484848484",
"gatewayUrl": "text",
"links": [
{
"href": "/rest/v2/transactions?id=846512",
"id": 846512,
"rel": "transaction"
}
],
"page": {
"first": false,
"last": false,
"number": 4,
"number-of-elements": 102,
"size": 4,
"sort": {
"field": {
"ANY_ADDITIONAL_PROPERTY": "text"
}
},
"total-elements": 102,
"total-pages": 4
},
"payload": {
"payloadType": "text"
},
"signature": "text",
"status": "SUCCESS",
"urls": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"vaultUrl": "text"
}
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
customerKey
api-key-value
notes about the customer
my fav customer
Customer Identifier
custID-88839992-223838-023333
First Name of Customer
John
Last Name of the customer
Doe
Customer phone number
444-444-4444
PUT //rest/v2/customers/{customerKey} HTTP/1.1
Host: gateway-sb.clearent.net
Content-Type: application/json
Accept: */*
Content-Length: 749
{
"billing-address": {
"city": "St Louis",
"company": "Test Company",
"country": "United States",
"first-name": "John",
"last-name": "Doe",
"phone": 3148889999,
"state": "MO",
"street": "123 Example Street",
"street2": "Suite 700",
"zip": 85284
},
"comments": "my fav customer",
"customer-key": "custID-88839992-223838-023333",
"email": "[email protected]",
"first-name": "John",
"last-name": "Doe",
"links": {
"link": [
{
"href": "/rest/v2/transactions?id=846512",
"id": 846512,
"rel": "transaction"
}
]
},
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"phone": "444-444-4444",
"shipping-address": {
"city": "St Louis",
"company": "Test Company",
"country": "United States",
"first-name": "John",
"last-name": "Doe",
"phone": 3148889999,
"state": "MO",
"street": "123 Example Street",
"street2": "Suite 700",
"zip": 85284
}
}
{
"payloadType": "text",
"payment": {
"amount": 9,
"completed-time": "09/19/2016 04:11:3333",
"customer-key": "cust_e333-93994-33838388938933",
"fired-time": "09/19/2016 04:11:3333",
"last-four": 3345,
"links": {
"link": [
{
"href": "/rest/v2/transactions?id=846512",
"id": 846512,
"rel": "transaction"
}
]
},
"original-exchange-id": "exchange-93994-33838388938933",
"payment-result": "APPROVED",
"payment-status": "APPROVED",
"payment-type": "Card",
"plan-key": "plan_8383-38833-3333",
"plan-name": "My Plan",
"transaction-id": "id",
"transaction-key": "id",
"transaction-type": "SALE"
}
}
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.
customerKey
api-key-value
DELETE //rest/v2/customers/{customerKey} HTTP/1.1
Host: gateway-sb.clearent.net
Accept: */*
{
"code": 200,
"emvUrl": "text",
"exchange-id": "ID_38839393-3938383-484848484",
"gatewayUrl": "text",
"links": [
{
"href": "/rest/v2/transactions?id=846512",
"id": 846512,
"rel": "transaction"
}
],
"page": {
"first": false,
"last": false,
"number": 4,
"number-of-elements": 102,
"size": 4,
"sort": {
"field": {
"ANY_ADDITIONAL_PROPERTY": "text"
}
},
"total-elements": 102,
"total-pages": 4
},
"payload": {
"payloadType": "text"
},
"signature": "text",
"status": "SUCCESS",
"urls": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"vaultUrl": "text"
}
Was this helpful?