> ## Documentation Index
> Fetch the complete documentation index at: https://developers.bspk.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Creates or updates a Shopper in BSPK

> Creates or updates a Shopper in BSPK



## OpenAPI

````yaml /api-reference/platform_v1.json post /api/platform/v1/shoppers
openapi: 3.0.3
info:
  title: PLATFORM API V1
  version: 1.0.0
  contact:
    name: BSPK API Support
    email: bspk-support@bspk.com
  description: >-

    # Introduction


    The BSPK RESTful JSON API gives you access to your company's BSPK data.

    For all BSPK API related questions please email: *bspk-support@bspk.com*



    ### Authentication


    BSPK uses Token-Based API Authentication. API keys can be managed from the
    API Keys section in your admin interface. All unauthenticated requests will
    return an HTTP 401 response.


    **Important:**  Developers with BSPK API keys will be granted full access to
    the data in each endpoint. Access to this data is binary: everything or
    nothing.


    **Authorization header**

    Your  `Authorization`  header should be in the following format:

    ```

    Authorization: Bearer [API_KEY]

    ```


    ### Throttling


    API requests are limited to the amount specified in the returned
    `X-RateLimit-Limit` header (per 10 seconds). Exceeding that limit will cause
    BSPK to return an `HTTP 429` response. Check the `X-RateLimit-Limit` and
    `X-RateLimit-Remaining` headers to see how many more requests you are
    allowed until throttling kicks in.



    ### Error Codes


    - 400 - Bad Request.

    - 401 - Unauthorized – Invalid BSPK API key.

    - 404 - Not Found – Resource not found.

    - 422 - Unprocessable entity.

    - 429 - Throttle Limit reached.

    - 500 - BSPK Internal Server Error


    ### Validation


    Methods that take input will validate all parameters. Any parameter that
    fails validation will trigger an error response with status HTTP 422. The
    response body will be a JSON object like the example below which includes a
    list of fields that failed validation.


    `{'errors':[{'title': 'No clients found with IDs: [NON_EXISTING_ID,
    OTHER_NON_EXISTING_ID]','code':'not_found'}]}`



    ### Additional Information


    - Fields without a value will return null

    - Timestamps are rendered in ISO-8601 format (e.g. 2018-07-21T17:32:28Z)

    - BSPK reserves the right to add more properties to objects, but will never
    change or remove them. Any breaking changes will result in a major API
    version update.
         
servers:
  - url: https://api.bspk.com
    description: Production
security:
  - BearerAuth: []
paths:
  /api/platform/v1/shoppers:
    post:
      tags:
        - Shoppers
      summary: Creates or updates a Shopper in BSPK
      description: Creates or updates a Shopper in BSPK
      operationId: shopperCreate
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                shopper:
                  type: object
                  properties:
                    shopper_ref:
                      type: string
                      description: >-
                        Shopper's unique identifier provided by your backend
                        system.
                      example: CLI-789
                    first_name:
                      type: string
                      description: Shopper's first name.
                      example: John
                    last_name:
                      type: string
                      description: Shopper's last name.
                      example: Meyer
                    alternate_first_name:
                      type: string
                      description: Shopper's alternate first name.
                      example: Johnny
                    alternate_last_name:
                      type: string
                      description: Shopper's alternate last name.
                      example: Meyers
                    gender:
                      type: string
                      description: 'Gender of the shopper, being: M = Male or F = Female'
                      example: M
                    email:
                      type: string
                      description: Shopper's email
                      example: shopper1@email.com
                    mobile_phone:
                      type: string
                      description: Shopper's mobile phone (with country code)
                      example: '+5511987669944'
                    other_phone:
                      type: string
                      description: Shopper's other phone (with country code)
                      example: '+551154772457'
                    address:
                      type: string
                      description: Shopper's address
                      example: Av. Paulista, 1000
                    address_2:
                      type: string
                      description: Shopper's address 2nd line
                      example: 10th floor
                    address_3:
                      type: string
                      description: Shopper's address 3rd line
                      example: Suite 100
                    address_4:
                      type: string
                      description: Shopper's address 4th line
                      example: Building 1
                    city:
                      type: string
                      description: Shopper's city
                      example: New York
                    state:
                      type: string
                      description: Shopper's state
                      example: NY
                    zip_code:
                      type: string
                      description: Shopper's zip code
                      example: '10001'
                    country_code:
                      type: string
                      description: Shopper's country code
                      example: US
                    segment:
                      type: string
                      description: Shopper's segment
                      example: VIP
                    preferred_contact_channel:
                      type: string
                      description: >-
                        Valid entries are chat, email, line, whatsapp, wechat,
                        call
                      example: whatsapp
                    nationality:
                      type: string
                      description: Shopper's Nationality
                      example: US
                    passport_number:
                      type: string
                      description: Shopper's Passport Number
                      example: AA0199929992
                    languages:
                      type: string
                      description: Shopper's languages
                      example: en;fr
                    email_contact:
                      type: string
                      description: >-
                        Define if shopper gave their agreement to be contacted
                        by email
                      example: 'true'
                    phone_call_contact:
                      type: string
                      description: >-
                        Define if shopper gave their agreement to be contacted
                        by phone call
                      example: 'false'
                    chat_contact:
                      type: string
                      description: >-
                        Define if shopper gave their agreement to be contacted
                        by chat
                      example: 'false'
                    do_not_contact:
                      type: string
                      description: >-
                        Define if shopper should not be contacted, regardless of
                        the other contact preferences
                      example: 'false'
                    interested_in_new_products:
                      type: string
                      description: >-
                        Define if shopper is interested in receiving messages
                        about new products
                      example: 'true'
                    birthday:
                      type: string
                      description: >-
                        Shopper's birth day, full or partial (YYYY-MM-DD or
                        MM-DD)
                      example: '1982-02-22'
                    creation_date:
                      type: string
                      description: Shopper's creation date
                      example: 01/05/2022
                    store_ref:
                      type: string
                      description: Shopper's record was created at this store
                      example: '22'
                    sales_associate_ref:
                      type: string
                      description: Shopper's current associate
                      example: '1101'
                    preferences:
                      type: string
                      description: >-
                        Shopper's preferred product categories. Must belong to
                        the company "shopper preferences". Supports two formats:
                        (1) Flat values separated by semicolons, e.g. "Young
                        Professional; Lawyer". (2) Key:value pairs where key is
                        the preference group id and values are comma-separated,
                        e.g. "Right Thumb Ring Size:40,41;Necklace
                        Length:Classic". The key:value format allows assigning
                        the same value to different preference groups.
                      example: Young Professional; Lawyer
                    ignore_columns:
                      type: string
                      description: >-
                        Attributes to be ignored while saving the record (BSPK
                        will not override values for the specified attributes).
                      example: first_name;last_name
                    barcode:
                      type: string
                      description: Shopper's barcode
                      example: '1234567890123'
                    profile_type:
                      type: string
                      description: 'Shopper''s profile type (default: person)'
                      enum:
                        - person
                        - organization
                      example: person
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                  - external_id
                  - warnings
                  - updated_at
                  - created_at
                properties:
                  id:
                    type: integer
                  external_id:
                    type: string
                    nullable: true
                  warnings:
                    type: array
                    items:
                      type: string
                  updated_at:
                    type: string
                  created_at:
                    type: string
        '422':
          description: Unprocessable entity
          content:
            application/json:
              schema: {}
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````