> For the complete documentation index, see [llms.txt](https://docs.coda.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coda.co/codapay/archived-tokenization-api-2.0/integration-guide/shopper.md).

# Shopper

## <mark style="color:purple;">Shopper Object</mark>

<table><thead><tr><th width="212.33333333333331">Parameter name</th><th width="110">Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>String</td><td>Shopper ID generated by Coda</td></tr><tr><td>partner_shopper_id</td><td>String</td><td>ID the partner will use to identify their customer and link the token ID</td></tr><tr><td>phone_number</td><td>String</td><td>Shopper phone number</td></tr><tr><td>email</td><td>String</td><td>Shopper email address</td></tr><tr><td>status_code</td><td>String</td><td>Shopper status can be “active” or “inactive”</td></tr></tbody></table>

## <mark style="color:purple;">Base URL</mark>

<table><thead><tr><th width="107">Version</th><th>Base URL</th></tr></thead><tbody><tr><td>Sandbox</td><td>https://api-tc.codapayments-staging.com</td></tr><tr><td>Production</td><td>https://api-tc.codapayments.com</td></tr></tbody></table>

## <mark style="color:purple;">Endpoints</mark>

{% tabs %}
{% tab title="Unset" %}

```json
POST {Base URL}/v1/shoppers
GET {Base URL}/v1/shoppers/{shopper.id}
```

{% endtab %}
{% endtabs %}

## <mark style="color:purple;">Create Shopper</mark>

### <mark style="color:purple;">POST /shoppers</mark>

{% tabs %}
{% tab title="Unset" %}

```json
curl --location '{baseUrl}/v1/shoppers' \
--header 'X-Partner-Id: par_sg1882402279a0000' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: sdirugnvsiguhsirghsekjhgh' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXJ0bmVyX2lkIjoicGFyX3NnMTg4MjQwMjI3OWEwMDAwIiwiaWF0IjoxNzAxMjMzNTM0fQ.o_tcEJUEwEms49J0MXwvRuCGbsBx3rHugfgKsXVgj9I' \
--data-raw '{
  "partner_shopper_id": "partner-shopper-287",
  "phone_number": "+62846500522696",
  "email": "abc@abc.com"
}'
```

{% endtab %}
{% endtabs %}

### <mark style="color:purple;">Response</mark> [<mark style="color:purple;">Shopper Object</mark>](#shopper-object)

{% tabs %}
{% tab title="Unset" %}

```json
{
    "id": "shp_sg18bfb6894ea0000",
    "partner_shopper_id": "partner-shopper-345",
    "phone_number": "+62123456789",
    "email": "e@e.com",
    "status_code": "active"
}
```

{% endtab %}
{% endtabs %}

## <mark style="color:purple;">Retrieve Shopper</mark>

{% hint style="info" %} <mark style="color:blue;">**Retrieve a shopper by shopper id**</mark>
{% endhint %}

### <mark style="color:purple;">GET /shoppers/{shopper.id}</mark>

{% tabs %}
{% tab title="Unset" %}

```json
curl --location '{baseUrl}/v1/shoppers/shp_sg18c196c9bd50006' \
--header 'X-Partner-Id: par_sg1882402279a0000' \
--header 'X-Api-Key: sdirugnvsiguhsirghsekjhgh' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXJ0bmVyX2lkIjoicGFyX3NnMTg4MjQwMjI3OWEwMDAwIiwiaWF0IjoxNzAxMjMzNTM0fQ.o_tcEJUEwEms49J0MXwvRuCGbsBx3rHugfgKsXVgj9I' \
--data ''
```

{% endtab %}
{% endtabs %}

### <mark style="color:purple;">Response</mark> [<mark style="color:purple;">Shopper Object</mark>](#shopper-object)

{% tabs %}
{% tab title="Unset" %}

```json
{
    "id": "shp_sg18bfb6894ea0000",
    "partner_shopper_id": "partner-shopper-345",
    "phone_number": "+62878269555000",
    "email": "e@e.com",
    "status_code": "active"
}
```

{% endtab %}
{% endtabs %}

## <mark style="color:purple;">Request Parameters</mark>

<table data-full-width="false"><thead><tr><th width="186">Parameter name</th><th width="83">Type</th><th width="109">Required?</th><th width="233">Description</th><th width="264">Validation</th></tr></thead><tbody><tr><td>partner_shopper_id</td><td>String</td><td>Yes</td><td><p>ID the partner will use to identify their customer and link the token ID</p><p><br></p></td><td><p>Size must be between 4 and 32</p><p><br></p><p>Must match "^[a-zA-Z0-9-_]+$"</p></td></tr><tr><td>phone_number</td><td>String</td><td>No</td><td><p>Customer phone number</p><p><br></p></td><td><p>Size must be between 12 and 16</p><p><br></p><p>Must match "\+[0-9]+"</p></td></tr><tr><td>email</td><td>String</td><td>No</td><td>Customer email address</td><td>Size must be between 4 and 128<br><br>Must match "^[^\\\"!#$%&#x26;'*+\\-/=?^_`{|]+[^\\\"]*[^\\\"!#$%&#x26;'*+\\-/=?^_`{|]+@[a-zA-Z0-9-]+([\\.][a-zA-Z0-9-]+){1,2}$"</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.coda.co/codapay/archived-tokenization-api-2.0/integration-guide/shopper.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
