Recurring Payments Service Customer

Customer Controller

Search Customers

get
Query parameters
customer-keyanyOptional

find customer by customer key

descendinganyOptional

if true (default), lists results in descending order. Otherwise it will list them in ascending order

emailanyOptional

email address of customer

exp-dateanyOptional

expiration date of card

first-nameanyOptional

first name of customer

last-fouranyOptional

last four digits of card number

last-nameanyOptional

last name of customer

order-byanyOptional

order list by

pageanyOptional

page number

page-sizeanyOptional

page-size

phone-numberanyOptional

phone number

plan-nameanyOptional

plan name

Header parameters
api-keyanyRequired

api-key-value

Responses
200
OK
get
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"
}

Create a Customer

post

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.

Header parameters
api-keyanyRequired

api-key-value

Body
commentsstringOptional

notes about the customer

Example: my fav customer
customer-keystringOptional

Customer Identifier

Example: custID-88839992-223838-023333
emailstringOptional

Email Address of customer

Example: [email protected]
first-namestringRequired

First Name of Customer

Example: John
last-namestringRequired

Last Name of the customer

Example: Doe
phonestringOptional

Customer phone number

Example: 444-444-4444
Responses
200
OK
post
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"
  }
}

Get a Customer's Info

get
Path parameters
customerKeyanyRequired

customerKey

Header parameters
api-keyanyRequired

api-key-value

Responses
200
OK
get
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"
}

Update a Customer

put

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

Path parameters
customerKeyanyRequired

customerKey

Header parameters
api-keyanyRequired

api-key-value

Body
commentsstringOptional

notes about the customer

Example: my fav customer
customer-keystringOptional

Customer Identifier

Example: custID-88839992-223838-023333
emailstringOptional

Email Address of customer

Example: [email protected]
first-namestringRequired

First Name of Customer

Example: John
last-namestringRequired

Last Name of the customer

Example: Doe
phonestringOptional

Customer phone number

Example: 444-444-4444
Responses
200
OK
put
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"
  }
}

Delete a Customer

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.

Path parameters
customerKeyanyRequired

customerKey

Header parameters
api-keyanyRequired

api-key-value

Responses
200
OK
delete
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?