# Customers

## Create a customer

> \*\*\*\
> \
> \*\*Overview\*\*\
> \
> Add new customers in the 2Checkout platform. By default, customer status is \<strong>Inactive\</strong> until you assign a specific subscription to the customer. Following that action, customer status reflects the status of the attached subscription(s).

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/customers/":{"post":{"tags":["Customers"],"summary":"Create a customer","description":"***\n\n**Overview**\n\nAdd new customers in the 2Checkout platform. By default, customer status is <strong>Inactive</strong> until you assign a specific subscription to the customer. Following that action, customer status reflects the status of the attached subscription(s).","parameters":[{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","enum":["application/json"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerInformation"}}}},"responses":{"200":{"description":"OK"}}}}},"components":{"schemas":{"CustomerInformation":{"type":"object","properties":{"ExternalCustomerReference":{"type":"string"},"FirstName":{"type":"string"},"LastName":{"type":"string"},"Company":{"type":"string"},"FiscalCode":{"type":"string"},"Address1":{"type":"string"},"Address2":{"type":"string"},"City":{"type":"string"},"State":{"type":"string"},"Zip":{"type":"string"},"CountryCode":{"type":"string"},"Phone":{"type":"string"},"Fax":{"type":"string"},"Email":{"type":"string"},"ExistingCards":{"type":"array","items":{"type":"string"}},"Enabled":{"type":"boolean"},"Trial":{"type":"boolean"},"Language":{"type":"string"},"CustomerReference":{"type":"string"},"Credit":{"type":"object","properties":{"Limit":{"type":"number","description":"The credit limit available for customer","format":"float"},"Remaining":{"type":"number","description":"The remaining credit available for customer","format":"float"},"Currency":{"type":"string","description":"The credit currency"}}}}}}}}
```

## Retrieve a customer

> \*\*\*\
> \*\*Overview\*\*\
> Retrieve customer information from the 2Checkout platform using either the 2Checkout Customer Reference or the External Customer Reference.

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/customers/{CReference}/":{"get":{"tags":["Customers"],"summary":"Retrieve a customer","description":"***\n**Overview**\nRetrieve customer information from the 2Checkout platform using either the 2Checkout Customer Reference or the External Customer Reference.","parameters":[{"name":"CReference","in":"path","description":"Internal 2Checkout customer reference or your customer identifier","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"includePaymentData","in":"path","description":"Flag used to indicate if customer payment information should be returned or not","required":true,"style":"simple","explode":false,"schema":{"type":"boolean"}},{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","default":"application/json","enum":["application/json"]}},{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerInformation"}}}}}}}},"components":{"schemas":{"CustomerInformation":{"type":"object","properties":{"ExternalCustomerReference":{"type":"string"},"FirstName":{"type":"string"},"LastName":{"type":"string"},"Company":{"type":"string"},"FiscalCode":{"type":"string"},"Address1":{"type":"string"},"Address2":{"type":"string"},"City":{"type":"string"},"State":{"type":"string"},"Zip":{"type":"string"},"CountryCode":{"type":"string"},"Phone":{"type":"string"},"Fax":{"type":"string"},"Email":{"type":"string"},"ExistingCards":{"type":"array","items":{"type":"string"}},"Enabled":{"type":"boolean"},"Trial":{"type":"boolean"},"Language":{"type":"string"},"CustomerReference":{"type":"string"},"Credit":{"type":"object","properties":{"Limit":{"type":"number","description":"The credit limit available for customer","format":"float"},"Remaining":{"type":"number","description":"The remaining credit available for customer","format":"float"},"Currency":{"type":"string","description":"The credit currency"}}}}}}}}
```

## Update a customer

> \*\*\*\
> \
> \*\*Overview\*\*\
> \
> Update customer information from the 2Checkout platform using the 2Checkout Customer Reference.\
> \
> \*\*\*\
> \
> \*\*Method and URL\*\*\
> \
> \*\*PUT\*\* \`<https://api.2checkout.com/rest/5.0/customers/CReference/\\`\\>
> \
> \*\*\*\
> \
> \*\*Example URL\*\*\
> \
> To update a customer in the 2Checkout system, use this URL:\
> \
> \- \`<https://api.2checkout.com/rest/5.0/customers/{CReference}/\\`\\>
> \
> \*\*\*\
> \
> \*\*Response\*\*\
> \
> 200 JSON

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/customers/{CReference}/":{"put":{"tags":["Customers"],"summary":"Update a customer","description":"***\n\n**Overview**\n\nUpdate customer information from the 2Checkout platform using the 2Checkout Customer Reference.\n\n***\n\n**Method and URL**\n\n**PUT** `https://api.2checkout.com/rest/5.0/customers/CReference/`\n\n***\n\n**Example URL**\n\nTo update a customer in the 2Checkout system, use this URL:\n\n- `https://api.2checkout.com/rest/5.0/customers/{CReference}/`\n\n***\n\n**Response**\n\n200 JSON","parameters":[{"name":"CReference","in":"path","description":"Internal 2Checkout customer reference","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"endUserUpdate","in":"query","description":"Set true to have the changes reflected on the end-user details for all subscriptions.","required":false,"style":"form","explode":true,"schema":{"type":"boolean"}},{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","enum":["application/json"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerInformation"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{}}}}}}},"components":{"schemas":{"CustomerInformation":{"type":"object","properties":{"ExternalCustomerReference":{"type":"string"},"FirstName":{"type":"string"},"LastName":{"type":"string"},"Company":{"type":"string"},"FiscalCode":{"type":"string"},"Address1":{"type":"string"},"Address2":{"type":"string"},"City":{"type":"string"},"State":{"type":"string"},"Zip":{"type":"string"},"CountryCode":{"type":"string"},"Phone":{"type":"string"},"Fax":{"type":"string"},"Email":{"type":"string"},"ExistingCards":{"type":"array","items":{"type":"string"}},"Enabled":{"type":"boolean"},"Trial":{"type":"boolean"},"Language":{"type":"string"},"CustomerReference":{"type":"string"},"Credit":{"type":"object","properties":{"Limit":{"type":"number","description":"The credit limit available for customer","format":"float"},"Remaining":{"type":"number","description":"The remaining credit available for customer","format":"float"},"Currency":{"type":"string","description":"The credit currency"}}}}}}}}
```

## Delete customer credit card

> Delete customer credit card

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/customers/{CReference}/credit-card/{TransientToken}":{"delete":{"tags":["Customers"],"summary":"Delete customer credit card","description":"Delete customer credit card","parameters":[{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"CReference","in":"path","description":"Internal 2Checkout customer reference or your customer identifier string","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"TransientToken","in":"path","description":"Transient Token for card, can be fount in getCustomerInfoBySSOToken string","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnlinkCustomerCreditCardResponse"}}}},"400":{"description":"Not deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnlinkCustomerCreditCard400Response"}}}}}}}},"components":{"schemas":{"UnlinkCustomerCreditCardResponse":{"type":"object","properties":{"Deleted":{"type":"boolean"}}},"UnlinkCustomerCreditCard400Response":{"type":"object","properties":{"Deleted":{"type":"boolean"},"Errors":{"type":"array","items":{"$ref":"#/components/schemas/UnlinkCustomerCreditCard400ErrorResponse"}}}},"UnlinkCustomerCreditCard400ErrorResponse":{"type":"object","properties":{"SubscriptionReference":{"type":"string"},"Message":{"type":"string"},"ErrorCode":{"type":"string"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.2checkout.com/api-reference/reference/customers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
