# Customer

## Get Customer Information

> Retrieve customer information associated with the specified customer key.

```json
{"openapi":"3.0.1","info":{"title":"Recurring Payments API","version":"2.0"},"paths":{"/rest/v2/customers/{customerKey}":{"get":{"tags":["Customer"],"summary":"Get Customer Information","description":"Retrieve customer information associated with the specified customer key.","operationId":"get_2","parameters":[{"name":"customerKey","in":"path","description":"Unique identifier of the customer.","required":true,"schema":{"type":"string"}},{"name":"api-key","in":"header","description":"An access API key issued to you by Xplor Pay.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/payload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/payload"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}}}}}},"components":{"schemas":{"payload":{"type":"object","properties":{"customers":{"$ref":"#/components/schemas/customers"},"payloadType":{"type":"string","description":"Type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"Payload","xml":{"name":"payload"}},"customers":{"type":"object","properties":{"customer":{"type":"array","items":{"$ref":"#/components/schemas/customer"}}},"xml":{"name":"customers"}},"customer":{"required":["first-name","last-name"],"type":"object","properties":{"email":{"type":"string","description":"Email address associated with the customer."},"phone":{"type":"string","description":"Primary phone number of the customer."},"comments":{"type":"string","description":"Additional comments associated with the customer profile."},"metadata":{"type":"object","additionalProperties":{"type":"string","description":"Key-value pairs used to store additional information related to the customer."},"description":"Key-value pairs used to store additional information related to the customer."},"customer-key":{"type":"string","description":"A unique identifier defined to reference the customer in external systems."},"first-name":{"type":"string","description":"Customer's first name."},"last-name":{"type":"string","description":"Customer's last name."},"billing-address":{"$ref":"#/components/schemas/Address"},"shipping-address":{"$ref":"#/components/schemas/Address"},"links":{"$ref":"#/components/schemas/Links"}},"description":"Represents a recurring billing customer profile.","xml":{"name":"customer"}},"Address":{"type":"object","properties":{"company":{"type":"string","description":"Company name associated with the billing address."},"street":{"type":"string","description":"Primary street address for the billing."},"street2":{"type":"string","description":"Secondary street address information, if available."},"city":{"type":"string","description":"City associated with the billing address."},"state":{"type":"string","description":"State or province of the billing address."},"zip":{"type":"string","description":"ZIP or postal code of the billing address."},"country":{"type":"string","description":"Country of the billing address."},"phone":{"type":"string","description":"Phone number associated with the billing address."},"first-name":{"type":"string","description":"First name of the billing contact."},"last-name":{"type":"string","description":"Last name of the billing contact."}},"description":"Contains the customer's billing address details.","xml":{"name":"clearent-address"}},"Links":{"type":"object","properties":{"link":{"type":"array","items":{"$ref":"#/components/schemas/Link"}}},"description":"Contains related resource links associated with the customer. Each link includes an id, href, and rel (customer, customer-token, payment-plan, token, transaction).","xml":{"name":"links"}},"Link":{"type":"object","properties":{"rel":{"type":"string","description":"Relationship type describing the linked resource. Possible values: customer customer-token payment-plan token transaction.","enum":["transaction,token,customer,payment-plan,customer-token"]},"href":{"type":"string","description":"URI of the related resource."},"id":{"type":"string","description":"Identifier of the linked resource."}}},"ErrorPayloadResponsePayload":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorPayload"},"payloadType":{"type":"string","description":"Type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"Payload","xml":{"name":"payload"}},"ErrorPayload":{"type":"object","properties":{"error-message":{"type":"string","description":"Describes the reason for the error."},"result-code":{"type":"string","description":"Numeric code that identifies the type of error returned by the request."},"time-stamp":{"type":"string","description":"Date and time when the error occurred, ISO 8601 format (UTC)."}},"xml":{"name":"error"}}}}}
```

## Update Customer

> Update customer details in an existing customer record identified by the unique customer key.

```json
{"openapi":"3.0.1","info":{"title":"Recurring Payments API","version":"2.0"},"paths":{"/rest/v2/customers/{customerKey}":{"put":{"tags":["Customer"],"summary":"Update Customer","description":"Update customer details in an existing customer record identified by the unique customer key.","operationId":"put_2","parameters":[{"name":"customerKey","in":"path","description":"Unique identifier of the customer.","required":true,"schema":{"type":"string"}},{"name":"api-key","in":"header","description":"An access API key issued to you by Xplor Pay.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/customer"}},"application/xml":{"schema":{"$ref":"#/components/schemas/customer"}}},"required":true},"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/payload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/payload"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}}}}}},"components":{"schemas":{"customer":{"required":["first-name","last-name"],"type":"object","properties":{"email":{"type":"string","description":"Email address associated with the customer."},"phone":{"type":"string","description":"Primary phone number of the customer."},"comments":{"type":"string","description":"Additional comments associated with the customer profile."},"metadata":{"type":"object","additionalProperties":{"type":"string","description":"Key-value pairs used to store additional information related to the customer."},"description":"Key-value pairs used to store additional information related to the customer."},"customer-key":{"type":"string","description":"A unique identifier defined to reference the customer in external systems."},"first-name":{"type":"string","description":"Customer's first name."},"last-name":{"type":"string","description":"Customer's last name."},"billing-address":{"$ref":"#/components/schemas/Address"},"shipping-address":{"$ref":"#/components/schemas/Address"},"links":{"$ref":"#/components/schemas/Links"}},"description":"Represents a recurring billing customer profile.","xml":{"name":"customer"}},"Address":{"type":"object","properties":{"company":{"type":"string","description":"Company name associated with the billing address."},"street":{"type":"string","description":"Primary street address for the billing."},"street2":{"type":"string","description":"Secondary street address information, if available."},"city":{"type":"string","description":"City associated with the billing address."},"state":{"type":"string","description":"State or province of the billing address."},"zip":{"type":"string","description":"ZIP or postal code of the billing address."},"country":{"type":"string","description":"Country of the billing address."},"phone":{"type":"string","description":"Phone number associated with the billing address."},"first-name":{"type":"string","description":"First name of the billing contact."},"last-name":{"type":"string","description":"Last name of the billing contact."}},"description":"Contains the customer's billing address details.","xml":{"name":"clearent-address"}},"Links":{"type":"object","properties":{"link":{"type":"array","items":{"$ref":"#/components/schemas/Link"}}},"description":"Contains related resource links associated with the customer. Each link includes an id, href, and rel (customer, customer-token, payment-plan, token, transaction).","xml":{"name":"links"}},"Link":{"type":"object","properties":{"rel":{"type":"string","description":"Relationship type describing the linked resource. Possible values: customer customer-token payment-plan token transaction.","enum":["transaction,token,customer,payment-plan,customer-token"]},"href":{"type":"string","description":"URI of the related resource."},"id":{"type":"string","description":"Identifier of the linked resource."}}},"payload":{"type":"object","properties":{"customers":{"$ref":"#/components/schemas/customers"},"payloadType":{"type":"string","description":"Type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"Payload","xml":{"name":"payload"}},"customers":{"type":"object","properties":{"customer":{"type":"array","items":{"$ref":"#/components/schemas/customer"}}},"xml":{"name":"customers"}},"ErrorPayloadResponsePayload":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorPayload"},"payloadType":{"type":"string","description":"Type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"Payload","xml":{"name":"payload"}},"ErrorPayload":{"type":"object","properties":{"error-message":{"type":"string","description":"Describes the reason for the error."},"result-code":{"type":"string","description":"Numeric code that identifies the type of error returned by the request."},"time-stamp":{"type":"string","description":"Date and time when the error occurred, ISO 8601 format (UTC)."}},"xml":{"name":"error"}}}}}
```

## Delete Customer

> Delete the existing customer record identified by the unique customer key, only if no plans or payments are associated with the customer.

```json
{"openapi":"3.0.1","info":{"title":"Recurring Payments API","version":"2.0"},"paths":{"/rest/v2/customers/{customerKey}":{"delete":{"tags":["Customer"],"summary":"Delete Customer","description":"Delete the existing customer record identified by the unique customer key, only if no plans or payments are associated with the customer.","operationId":"delete","parameters":[{"name":"customerKey","in":"path","description":"Unique identifier of the customer.","required":true,"schema":{"type":"string"}},{"name":"api-key","in":"header","description":"An access API key issued to you by Xplor Pay.","required":true,"schema":{"type":"string"}}],"responses":{"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}}}}}},"components":{"schemas":{"ErrorPayloadResponsePayload":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorPayload"},"payloadType":{"type":"string","description":"Type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"Payload","xml":{"name":"payload"}},"ErrorPayload":{"type":"object","properties":{"error-message":{"type":"string","description":"Describes the reason for the error."},"result-code":{"type":"string","description":"Numeric code that identifies the type of error returned by the request."},"time-stamp":{"type":"string","description":"Date and time when the error occurred, ISO 8601 format (UTC)."}},"xml":{"name":"error"}}}}}
```

## Search Customers

> Retrieve the list of customers using search criteria.

```json
{"openapi":"3.0.1","info":{"title":"Recurring Payments API","version":"2.0"},"paths":{"/rest/v2/customers":{"get":{"tags":["Customer"],"summary":"Search Customers","description":"Retrieve the list of customers using search criteria.","operationId":"search","parameters":[{"name":"api-key","in":"header","description":"An access API key issued to you by Xplor Pay.","required":true,"schema":{"type":"string"}},{"name":"customer-key","in":"query","description":"Unique identifier assigned to the customer.","schema":{"type":"string"}},{"name":"first-name","in":"query","description":"First name of the customer.","schema":{"type":"string"}},{"name":"last-name","in":"query","description":"Last name of the customer.","schema":{"type":"string"}},{"name":"last-four","in":"query","description":"Last four digits of the customer's card number.","schema":{"type":"string"}},{"name":"exp-date","in":"query","description":"Expiration date of the customer's card. Format: MMYY.","schema":{"type":"string"}},{"name":"email","in":"query","description":"Email address associated with the customer.","schema":{"type":"string"}},{"name":"phone-number","in":"query","description":"Phone number associated with the customer.","schema":{"type":"string"}},{"name":"plan-name","in":"query","description":"Name of the recurring payment plan associated with the customer.","schema":{"type":"string"}},{"name":"page","in":"query","description":"Specifies the page number of results to return when pagination is applied.","schema":{"type":"integer"}},{"name":"page-size","in":"query","description":"Specifies the number of results to return per page.","schema":{"type":"integer"}},{"name":"descending","in":"query","description":"Determines the sort order of the results. Set to true for descending order. Default is true.","schema":{"type":"boolean","enum":["true","false"]}},{"name":"order-by","in":"query","description":"Used to sort the results.","schema":{"type":"string","enum":["first-name","last-name","customer-key","phone","email"]}}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/payload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/payload"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}}}}}},"components":{"schemas":{"payload":{"type":"object","properties":{"customers":{"$ref":"#/components/schemas/customers"},"payloadType":{"type":"string","description":"Type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"Payload","xml":{"name":"payload"}},"customers":{"type":"object","properties":{"customer":{"type":"array","items":{"$ref":"#/components/schemas/customer"}}},"xml":{"name":"customers"}},"customer":{"required":["first-name","last-name"],"type":"object","properties":{"email":{"type":"string","description":"Email address associated with the customer."},"phone":{"type":"string","description":"Primary phone number of the customer."},"comments":{"type":"string","description":"Additional comments associated with the customer profile."},"metadata":{"type":"object","additionalProperties":{"type":"string","description":"Key-value pairs used to store additional information related to the customer."},"description":"Key-value pairs used to store additional information related to the customer."},"customer-key":{"type":"string","description":"A unique identifier defined to reference the customer in external systems."},"first-name":{"type":"string","description":"Customer's first name."},"last-name":{"type":"string","description":"Customer's last name."},"billing-address":{"$ref":"#/components/schemas/Address"},"shipping-address":{"$ref":"#/components/schemas/Address"},"links":{"$ref":"#/components/schemas/Links"}},"description":"Represents a recurring billing customer profile.","xml":{"name":"customer"}},"Address":{"type":"object","properties":{"company":{"type":"string","description":"Company name associated with the billing address."},"street":{"type":"string","description":"Primary street address for the billing."},"street2":{"type":"string","description":"Secondary street address information, if available."},"city":{"type":"string","description":"City associated with the billing address."},"state":{"type":"string","description":"State or province of the billing address."},"zip":{"type":"string","description":"ZIP or postal code of the billing address."},"country":{"type":"string","description":"Country of the billing address."},"phone":{"type":"string","description":"Phone number associated with the billing address."},"first-name":{"type":"string","description":"First name of the billing contact."},"last-name":{"type":"string","description":"Last name of the billing contact."}},"description":"Contains the customer's billing address details.","xml":{"name":"clearent-address"}},"Links":{"type":"object","properties":{"link":{"type":"array","items":{"$ref":"#/components/schemas/Link"}}},"description":"Contains related resource links associated with the customer. Each link includes an id, href, and rel (customer, customer-token, payment-plan, token, transaction).","xml":{"name":"links"}},"Link":{"type":"object","properties":{"rel":{"type":"string","description":"Relationship type describing the linked resource. Possible values: customer customer-token payment-plan token transaction.","enum":["transaction,token,customer,payment-plan,customer-token"]},"href":{"type":"string","description":"URI of the related resource."},"id":{"type":"string","description":"Identifier of the linked resource."}}},"ErrorPayloadResponsePayload":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorPayload"},"payloadType":{"type":"string","description":"Type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"Payload","xml":{"name":"payload"}},"ErrorPayload":{"type":"object","properties":{"error-message":{"type":"string","description":"Describes the reason for the error."},"result-code":{"type":"string","description":"Numeric code that identifies the type of error returned by the request."},"time-stamp":{"type":"string","description":"Date and time when the error occurred, ISO 8601 format (UTC)."}},"xml":{"name":"error"}}}}}
```

## Create Customer

> Create a customer to set up a recurring payment plan.

```json
{"openapi":"3.0.1","info":{"title":"Recurring Payments API","version":"2.0"},"paths":{"/rest/v2/customers":{"post":{"tags":["Customer"],"summary":"Create Customer","description":"Create a customer to set up a recurring payment plan.","operationId":"post_1","parameters":[{"name":"api-key","in":"header","description":"An access API key issued to you by Xplor Pay.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/customer"}},"application/xml":{"schema":{"$ref":"#/components/schemas/customer"}}},"required":true},"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/payload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/payload"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}}}}}},"components":{"schemas":{"customer":{"required":["first-name","last-name"],"type":"object","properties":{"email":{"type":"string","description":"Email address associated with the customer."},"phone":{"type":"string","description":"Primary phone number of the customer."},"comments":{"type":"string","description":"Additional comments associated with the customer profile."},"metadata":{"type":"object","additionalProperties":{"type":"string","description":"Key-value pairs used to store additional information related to the customer."},"description":"Key-value pairs used to store additional information related to the customer."},"customer-key":{"type":"string","description":"A unique identifier defined to reference the customer in external systems."},"first-name":{"type":"string","description":"Customer's first name."},"last-name":{"type":"string","description":"Customer's last name."},"billing-address":{"$ref":"#/components/schemas/Address"},"shipping-address":{"$ref":"#/components/schemas/Address"},"links":{"$ref":"#/components/schemas/Links"}},"description":"Represents a recurring billing customer profile.","xml":{"name":"customer"}},"Address":{"type":"object","properties":{"company":{"type":"string","description":"Company name associated with the billing address."},"street":{"type":"string","description":"Primary street address for the billing."},"street2":{"type":"string","description":"Secondary street address information, if available."},"city":{"type":"string","description":"City associated with the billing address."},"state":{"type":"string","description":"State or province of the billing address."},"zip":{"type":"string","description":"ZIP or postal code of the billing address."},"country":{"type":"string","description":"Country of the billing address."},"phone":{"type":"string","description":"Phone number associated with the billing address."},"first-name":{"type":"string","description":"First name of the billing contact."},"last-name":{"type":"string","description":"Last name of the billing contact."}},"description":"Contains the customer's billing address details.","xml":{"name":"clearent-address"}},"Links":{"type":"object","properties":{"link":{"type":"array","items":{"$ref":"#/components/schemas/Link"}}},"description":"Contains related resource links associated with the customer. Each link includes an id, href, and rel (customer, customer-token, payment-plan, token, transaction).","xml":{"name":"links"}},"Link":{"type":"object","properties":{"rel":{"type":"string","description":"Relationship type describing the linked resource. Possible values: customer customer-token payment-plan token transaction.","enum":["transaction,token,customer,payment-plan,customer-token"]},"href":{"type":"string","description":"URI of the related resource."},"id":{"type":"string","description":"Identifier of the linked resource."}}},"payload":{"type":"object","properties":{"customers":{"$ref":"#/components/schemas/customers"},"payloadType":{"type":"string","description":"Type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"Payload","xml":{"name":"payload"}},"customers":{"type":"object","properties":{"customer":{"type":"array","items":{"$ref":"#/components/schemas/customer"}}},"xml":{"name":"customers"}},"ErrorPayloadResponsePayload":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorPayload"},"payloadType":{"type":"string","description":"Type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"Payload","xml":{"name":"payload"}},"ErrorPayload":{"type":"object","properties":{"error-message":{"type":"string","description":"Describes the reason for the error."},"result-code":{"type":"string","description":"Numeric code that identifies the type of error returned by the request."},"time-stamp":{"type":"string","description":"Date and time when the error occurred, ISO 8601 format (UTC)."}},"xml":{"name":"error"}}}}}
```
