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

# Open a support ticket

> Opens a ticket with its first message, which the store is told of. One open ticket a buyer at a time (`ticket_open`), 250 open at a store (`store_full`), and 100 messages a day a buyer (`daily_limit`). Refused with `tickets_off` where the store takes none. Pictures are sent from the customer panel. Answers the ticket as Get a support ticket does, and the list in `meta`.

Needs the buyer's token: `Authorization: Bearer shoply_ct_...`, from Sign in with the code.

It is counted for the buyer's token: 30 changes in ten minutes.



## OpenAPI

````yaml /api-reference/openapi.json post /stores/{storeId}/customer/tickets
openapi: 3.1.0
info:
  title: Shoply API
  version: '1'
  description: >-
    Everything a store's own server can do with a secret API key: its catalogue,
    orders, customers, marketing, finance and the rest of what the dashboard
    does. And the Customer API, which a buyer's own device asks with a token of
    theirs.
servers:
  - url: https://api.shoply.gg/v1
security:
  - apiKey: []
tags:
  - name: API key
  - name: Store
  - name: Domain
  - name: Payment methods
  - name: Analytics
  - name: Storefronts
  - name: Storefront code
  - name: Payment Routing
  - name: Custom payment methods
  - name: Products
  - name: Product pictures
  - name: Stock
  - name: Categories
  - name: Upsells
  - name: Subscriptions
  - name: Orders
  - name: Invoices
  - name: Reviews
  - name: Coupons
  - name: Coupon categories
  - name: Coupon pop-up
  - name: Sales
  - name: Blog
  - name: Search settings
  - name: Redirects
  - name: Sitemap
  - name: Cart Recovery
  - name: Email Marketing
  - name: Email Templates
  - name: Customers
  - name: Affiliates
  - name: Support Tickets
  - name: Blacklist
  - name: Fraud protection
  - name: Disputes
  - name: Finance
  - name: Tax
  - name: Expenses
  - name: Expense setup
  - name: API requests
  - name: Webhook endpoints
  - name: Webhook deliveries
  - name: Customer API
paths:
  /stores/{storeId}/customer/tickets:
    post:
      tags:
        - Customer API
      summary: Open a support ticket
      description: >-
        Opens a ticket with its first message, which the store is told of. One
        open ticket a buyer at a time (`ticket_open`), 250 open at a store
        (`store_full`), and 100 messages a day a buyer (`daily_limit`). Refused
        with `tickets_off` where the store takes none. Pictures are sent from
        the customer panel. Answers the ticket as Get a support ticket does, and
        the list in `meta`.


        Needs the buyer's token: `Authorization: Bearer shoply_ct_...`, from
        Sign in with the code.


        It is counted for the buyer's token: 30 changes in ten minutes.
      operationId: customer.tickets.create
      parameters:
        - name: storeId
          in: path
          required: true
          description: >-
            The store's ID, from Settings, General in its dashboard. It is not a
            secret: a page may show it.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                subject:
                  type: string
                  description: What it is about, up to 100 characters.
                  example: Key not working
                message:
                  type: string
                  description: The first message, up to 500 characters.
                order:
                  type: string
                  description: >-
                    The order it is about, one of `meta.orders` on List support
                    tickets. Left out, something else.
              required:
                - subject
                - message
      responses:
        '201':
          description: It worked.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    nullable: true
                  code:
                    nullable: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      orderId:
                        type: string
                      subject:
                        type: string
                      status:
                        type: string
                      messages:
                        type: integer
                      pictures:
                        type: integer
                      lastMessageAt:
                        type: string
                      lastFrom:
                        type: string
                      lastLine:
                        type: string
                      firstReplyAt:
                        nullable: true
                      answeredAt:
                        nullable: true
                      resolvedAt:
                        nullable: true
                      resolvedBy:
                        nullable: true
                      createdAt:
                        type: string
                      updatedAt:
                        type: string
                      conversation:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            from:
                              type: string
                            body:
                              type: string
                            html:
                              type: string
                            pictures:
                              type:
                                - array
                                - object
                            createdAt:
                              type: string
                      canReopenUntil:
                        nullable: true
                      limits:
                        type: object
                        properties:
                          body:
                            type: integer
                          subject:
                            type: integer
                          picturesPerMessage:
                            type: integer
                          picturesPerTicket:
                            type: integer
                          pictureBytes:
                            type: integer
                      orderLabel:
                        type: string
                      orderProducts:
                        type: array
                        items:
                          type: string
                      orderMore:
                        type: integer
                  meta:
                    type: object
                    properties:
                      'on':
                        type: boolean
                      tickets:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            orderId:
                              type: string
                            subject:
                              type: string
                            status:
                              type: string
                            messages:
                              type: integer
                            pictures:
                              type: integer
                            lastMessageAt:
                              type: string
                            lastFrom:
                              type: string
                            lastLine:
                              type: string
                            firstReplyAt:
                              nullable: true
                            answeredAt:
                              nullable: true
                            resolvedAt:
                              nullable: true
                            resolvedBy:
                              nullable: true
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                      orders:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            label:
                              type: string
                            products:
                              type: array
                              items:
                                type: string
                            more:
                              type: integer
                      canOpen:
                        type: boolean
                      limits:
                        type: object
                        properties:
                          body:
                            type: integer
                          subject:
                            type: integer
                          picturesPerMessage:
                            type: integer
                          picturesPerTicket:
                            type: integer
                          pictureBytes:
                            type: integer
              example:
                success: true
                message: null
                code: null
                data:
                  id: 8e243e4e-58e7-4d63-a9c3-ef057672a8fd
                  orderId: bc44febe-0f25-4076-92eb-03a5045a57e7
                  subject: Key says it is already in use
                  status: open
                  messages: 1
                  pictures: 0
                  lastMessageAt: '2026-10-22T16:20:19Z'
                  lastFrom: buyer
                  lastLine: >-
                    I bought Northwind Pro this morning and the key says it is
                    already in use.
                  firstReplyAt: null
                  answeredAt: null
                  resolvedAt: null
                  resolvedBy: null
                  createdAt: '2026-10-22T16:20:19Z'
                  updatedAt: '2026-10-22T16:20:19Z'
                  conversation:
                    - id: cc08e8db-7064-4c32-9883-fe156fbe07f1
                      from: buyer
                      body: >-
                        I bought Northwind Pro this morning and the key says it
                        is already in use.
                      html: >-
                        <p>I bought Northwind Pro this morning and the key says
                        it is already in use.</p>
                      pictures: []
                      createdAt: '2026-10-22T16:20:19Z'
                  canReopenUntil: null
                  limits:
                    body: 500
                    subject: 100
                    picturesPerMessage: 3
                    picturesPerTicket: 25
                    pictureBytes: 5242880
                  orderLabel: Northwind Pro · Order bc44febe-0f25-4076-92eb-03a5045a57e7
                  orderProducts:
                    - Northwind Pro
                  orderMore: 0
                meta:
                  'on': true
                  tickets:
                    - id: 8e243e4e-58e7-4d63-a9c3-ef057672a8fd
                      orderId: bc44febe-0f25-4076-92eb-03a5045a57e7
                      subject: Key says it is already in use
                      status: open
                      messages: 1
                      pictures: 0
                      lastMessageAt: '2026-10-22T16:20:19Z'
                      lastFrom: buyer
                      lastLine: >-
                        I bought Northwind Pro this morning and the key says it
                        is already in use.
                      firstReplyAt: null
                      answeredAt: null
                      resolvedAt: null
                      resolvedBy: null
                      createdAt: '2026-10-22T16:20:19Z'
                      updatedAt: '2026-10-22T16:20:19Z'
                  orders:
                    - id: e9ae5h0p1ye-cd7fded3be6-1006662
                      label: Northwind Pro · Order e9ae5h0p1ye-cd7fded3be6-1006662
                      products:
                        - Northwind Pro
                      more: 0
                    - id: bc44febe-0f25-4076-92eb-03a5045a57e7
                      label: >-
                        Northwind Pro · Order
                        bc44febe-0f25-4076-92eb-03a5045a57e7
                      products:
                        - Northwind Pro
                      more: 0
                  canOpen: false
                  limits:
                    body: 500
                    subject: 100
                    picturesPerMessage: 3
                    picturesPerTicket: 25
                    pictureBytes: 5242880
        '401':
          $ref: '#/components/responses/NoToken'
        '403':
          $ref: '#/components/responses/StoreSaysNo'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/Refused'
        '429':
          $ref: '#/components/responses/CustomerTooMany'
      security:
        - customerToken: []
      x-codeSamples:
        - lang: javascript
          label: Node.js
          source: >
            import { ShoplyCustomer } from "@shoplygg/node";


            const buyer = new ShoplyCustomer({ storeId: "YOUR_STORE_ID", token
            });


            const result = await buyer.tickets.create({
              subject: "Key not working",
              message: "...",
            });
        - lang: php
          label: PHP
          source: >
            <?php


            require 'vendor/autoload.php';


            $buyer = new Shoply\Customer(['storeId' => 'YOUR_STORE_ID', 'token'
            => $token]);


            $result = $buyer->tickets->create([
                'subject' => 'Key not working',
                'message' => '...',
            ]);
        - lang: python
          label: Python
          source: >
            import shoply


            buyer = shoply.Customer("YOUR_STORE_ID", token=token)


            result = buyer.tickets.create(subject="Key not working",
            message="...")
components:
  responses:
    NoToken:
      description: >-
        No buyer's token was sent, or it was an API key
        (`customer_token_required`), or the token has ended or is another
        store's (`invalid_customer_token`). Sign the buyer in again.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Refusal'
    StoreSaysNo:
      description: >-
        The store does not let a buyer do this itself: `cancel_off`, `undo_off`,
        `pause_off`, `affiliates_closed`. Its customer panel says the same.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Refusal'
    NotFound:
      description: >-
        There is no such thing in this store: `not_found`. A store that is not
        the key's own is answered the same way.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Refusal'
    Refused:
      description: >-
        The request was understood and not carried out. `validation_failed` says
        what is wrong with each field under `errors`; other codes are the
        route's own.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Refusal'
    CustomerTooMany:
      description: >-
        Too many requests for now: `rate_limited`, or the route's own
        (`code_cooldown`, `code_paused`, `store_busy`). `Retry-After` says how
        many seconds to wait.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Refusal'
  schemas:
    Refusal:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          description: What is wrong, in words for a person.
        code:
          type: string
          description: What is wrong, as a word that does not change.
        data:
          nullable: true
        errors:
          type: object
          description: >-
            For `validation_failed`: what is wrong with each field, by the
            field's name.
          additionalProperties:
            type: string
      required:
        - success
        - message
        - code
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        A secret API key, made under Developers in the dashboard:
        `Authorization: Bearer shoply_sk_...`
    customerToken:
      type: http
      scheme: bearer
      description: >-
        A buyer's token, from Sign in with the code: `Authorization: Bearer
        shoply_ct_...`. It reaches that buyer's own orders at one store, and no
        route that takes a key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.