---
title: "aid_customers_tokens_events_post"
method: POST
path: "/accounts/{aid}/customers/tokens/events"
tags: ["tokens"]
---

# aid_customers_tokens_events_post

`POST /accounts/{aid}/customers/tokens/events`

Find details about a token, inclusive details about
any customer the token belongs to and any token events recorded
Include event in the request to update the status of the token
scopes:
- admin:customers
- write:customers

## Path parameters

- `aid` string, ^[PT]{1}\d{8}$, required

## Request body

- object
  - `token` TokenTypeValue, required — Lookup by token type and value
    - `type` string, required
    - `value` string, required — identifies how or who is resposible for the token value
  - `event` TokenEvent — Record event data about a token An event can be created before the customer exist and before the token has been added to the customer
    - `expires_at` string, date-time
    - `created_at` string, date-time
    - `event` string, required — context about the event
    - `status` string — State to set on given token type and value
    - `metadata` object — Additional metadata about the event

## Response `200`

Token details

- TokenDetail
  - `id` string — Auto-generated ID identifying the token type/value. Will be random until the token type/value has been added to a customer or a token event has been registered.
  - `customer` CustomerResponse
    - `metadata` object — A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format. You can unset an individual key by setting its value to null and then saving. To clear all keys, set metadata to null
    - `id` string, uuid — An UUID that uniquely identifies the resource
    - `created_at` string, date-time — The date-time when the resource was created
    - `created_by` string — The ID of the user/client created the resource
    - `updated_at` string, date-time — The date-time when the resource was last updated
    - `deleted_by` string — The ID of the user/client created the resource
    - `deleted_at` string, date-time
    - `first_name` string, nullable
    - `last_name` string, nullable
    - `email` string, nullable — customer email, case insensitive duplication control prevents multiple user with same `type` to have equal email customer@example.com is equal to CUStOMer@EXAMPLE.com
    - `phone_number` string, ^\+?[1-9]\d{1,14}$, nullable — A phone number in E.164 number formatting.
    - `attributes` object — Custom attributes
    - `status` string, nullable — Status of the customer
    - `favorite_store` string, nullable — customer favorite store
    - `enrolled_by` object — The source that recruited the customer
      - `type` string — Enrollment type, e.g. `url`, `store`, `qr_code`, any string
      - `value` string, nullable, required
    - `marketing_consent` object — Customers consent for marketing in different channels
      - `sms` UserConsent
        - `consent` boolean
        - `updated_at` string, date-time — The date-time when the resource was last updated:
      - `email` UserConsent
        - `consent` boolean
        - `updated_at` string, date-time — The date-time when the resource was last updated:
    - `type` 'customer' | 'company' | 'contact' | 'employee' | 'other', required — Describe type of a user. - `company` property is required when using the type `company` - `company` property is only supported for users with type `other` or `company` - Creating or updating user with type `employee` or `other` requires `admin:customers` or `write:customers` scope. - User login is only available for users with type `customer` or `company`
    - `addresses` CustomerAddress[]
      - `address_line` string, required
      - `address_line_2` string
      - `postal_code` string
      - `postal_place` string, required
      - `country` string, iso-3166-1, required — ISO 3166-1 country code
      - `latitude` number
      - `longitude` number
      - `type` 'custom' | 'home' | 'other' | 'work' — The address type
      - `custom_type` string — If the address `type` is `custom`, this property contains the custom value
      - `comment` string — Comment about the address
    - `term` CustomerTerm
      - `id` string, uuid
      - `accepted_at` string, date-time
    - `company` object — Company details, supported when type is Company
      - `organization_number` string — Companys identification number
      - `bussiness_name` string, required
      - `department` string — companys department
      - `industry` string
      - `website` string
      - `number_of_employees` string
    - `gender` string, nullable
    - `date_of_birth` string, date, nullable
    - `contact_for` object[] — The users that it is a contact for, supported when type is `contact`
      - `customer_id` string, required — The customer id that it is a contact for
    - `customer_id` string, required — The customer id you have defined for the customer. (must not have trailing or leading spaces) An auto-generated customer_id will be created if no customer_id is provided.
  - `token` CustomerToken
    - `id` string, uuid — An UUID that uniquely identifies the resource
    - `created_at` string, date-time — The date-time when the resource was created
    - `created_by` string — The ID of the user/client created the resource
    - `updated_at` string, date-time — The date-time when the resource was last updated
    - `deleted_by` string — The ID of the user/client created the resource
    - `deleted_at` string, date-time
    - `token_id` string — The token id you have defined for the token. (must not have trailing or leading spaces)
    - `type` string, required — identifies how or who is resposible for the token value
    - `value` string, required
    - `metadata` object — Additional metadata about the token or the entity the token was created from
  - `status` string — Aggregated status from events registered or customer resolved. The status will be set to `customer.status` and fallback to the status of the latest event. The status will be set to `UNKNOWN` if no `customer.status` and event status is registered. The status will be set to the previous event status (or UNKNOWN) if the event has expired
  - `events` TokenEvent[] — Events recorded given token type and value
    - `expires_at` string, date-time
    - `created_at` string, date-time
    - `event` string, required — context about the event
    - `status` string — State to set on given token type and value
    - `metadata` object — Additional metadata about the event

## Other responses

- `default` — Unexpected error

---

[API](https://skmtc.net/dintero/apis/account-management-api.md) · [All operations](https://skmtc.net/dintero/apis/account-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/dintero/account-management-api/revisions/9b83a4199008/schema)
