# Upload Image

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/products/{product_id}/images/:
    post:
      summary: Upload Image
      deprecated: false
      description: |-
        Use this endpoint to add a single image to a product.

        <Accordion title="🔑Scopes" defaultOpen>
            
          `products.read_write` - Products Read & Write
         
        </Accordion>
      operationId: post-product-image
      tags:
        - Default module/Apps/Merchant APIs/Products/Product Images
        - Product Images
      parameters:
        - name: product_id
          in: path
          description: >-
            A unique identifier assigned to each product, used to reference and
            retrieve specific product details.
          required: true
          example: 96d0f5c3-1958-4a31-8b03-7014c2070630
          schema:
            type: string
            examples:
              - 107c2ff5-5c70-4749-b9bd-56dc1793013b
        - name: Access-Token
          in: header
          description: >-
            This token is used to authenticate and access information related to
            the store. It is obtained through an OAuth mechanism and is required
            to perform operations on the store's data. The `X-Manager-Token`
            should be included in the header of API requests that require
            store-related information.
          required: true
          example: '{{Access-Token}}'
          schema:
            type: number
            examples:
              - 37213
        - name: Store-Id
          in: header
          description: Unique identifier of the store.
          required: true
          example: '{{StoreId}}'
          schema:
            type: number
        - name: Accept-Language
          in: header
          description: >-
            Preferred language for the response. Defaults to `en` if not
            specified.
          required: false
          example: en
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                image:
                  type: string
                  format: binary
                  description: The URL or path of the product image.
                  example: cmMtdXBsb2FkLTE3NzExNjEzNzY5MTQtMg==/test1.jpg
                alt_text:
                  type: string
                  description: >-
                    A descriptive text for the image, used for accessibility and
                    SEO purposes, describing the content of the image.
                  example: test alt text
              required:
                - image
                - alt_text
            examples: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductImage'
              example:
                id: 59b5fff2-2281-44a4-8bf1-56d9fd1165bb
                image:
                  full_size: >-
                    https://media.zid.store/d297fb8b-c322-412e-a2f4-ffa96dc57022/59b5fff2-2281-44a4-8bf1-56d9fd1165bb.jpg
                  medium: >-
                    https://media.zid.store/thumbs/d297fb8b-c322-412e-a2f4-ffa96dc57022/59b5fff2-2281-44a4-8bf1-56d9fd1165bb-thumbnail-770x770-70.jpg
                  large: >-
                    https://media.zid.store/thumbs/d297fb8b-c322-412e-a2f4-ffa96dc57022/59b5fff2-2281-44a4-8bf1-56d9fd1165bb-thumbnail-1000x1000-70.jpg
                  small: >-
                    https://media.zid.store/thumbs/d297fb8b-c322-412e-a2f4-ffa96dc57022/59b5fff2-2281-44a4-8bf1-56d9fd1165bb-thumbnail-500x500-70.jpg
                  thumbnail: >-
                    https://media.zid.store/thumbs/d297fb8b-c322-412e-a2f4-ffa96dc57022/59b5fff2-2281-44a4-8bf1-56d9fd1165bb-thumbnail-370x370-70.jpg
                alt_text: test alt text
                display_order: 2
          headers: {}
          x-apidog-name: OK
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Response returned when the request cannot be authenticated
                  because the required credentials are missing, invalid, or
                  expired.
                properties:
                  status:
                    type: string
                    description: Indicates the overall status of the API response.
                    examples:
                      - error
                  message:
                    type: object
                    description: >-
                      Contains structured details explaining why the request
                      could not be authenticated.
                    properties:
                      type:
                        type: string
                        description: Indicates the category of the response message.
                        examples:
                          - error
                      code:
                        type: string
                        description: >-
                          A machine-readable code identifying the authentication
                          error. Returns null when no specific code is
                          available.
                        examples:
                          - UNAUTHORIZED
                        nullable: true
                      name:
                        type: string
                        description: >-
                          A short, human-readable title describing the
                          authentication error. Returns null when no title is
                          available.
                        examples:
                          - Unauthorized
                        nullable: true
                      description:
                        type: string
                        description: >-
                          A human-readable explanation of why the request could
                          not be authenticated. Returns null when no detailed
                          explanation is available.
                        examples:
                          - >-
                            Authentication credentials are missing, invalid, or
                            expired.
                        nullable: true
                    required:
                      - type
                      - code
                      - name
                      - description
                    x-apidog-orders:
                      - type
                      - code
                      - name
                      - description
                    x-apidog-ignore-properties: []
                required:
                  - status
                  - message
                x-apidog-orders:
                  - status
                  - message
                examples:
                  - status: error
                    message:
                      type: error
                      code: UNAUTHORIZED
                      name: Unauthorized
                      description: >-
                        Authentication credentials are missing, invalid, or
                        expired.
                x-apidog-ignore-properties: []
              examples:
                '2':
                  summary: Example 1
                  value:
                    status: error
                    message:
                      type: error
                      code: ERROR_SESSION_MISSING
                      name: Sorry
                      description: Please login first.
                '3':
                  summary: Example 2
                  value:
                    status: error
                    message:
                      type: error
                      code: ERROR_SESSION_INVALID
                      name: Sorry
                      description: Login session expired. Please login again.
                '4':
                  summary: Example 3
                  value:
                    status: error
                    message:
                      type: error
                      code: ERROR_SESSION_INVALID
                      name: Sorry
                      description: Invalid authentication
          headers: {}
          x-apidog-name: Unauthorized
        '500':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Status of the error.
                  message:
                    $ref: '#/components/schemas/ResponseEnvelopMessage'
                required:
                  - status
                  - message
                x-apidog-orders:
                  - status
                  - message
                x-apidog-ignore-properties: []
              example:
                status: error
                message:
                  type: error
                  code: MSG_HIDDEN
                  name: Error
                  description: Internal Server Error
          headers: {}
          x-apidog-name: Internal Server error
      security: []
      x-apidog-folder: Default module/Apps/Merchant APIs/Products/Product Images
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/613905/apis/api-9148571-run
components:
  schemas:
    ProductImage:
      type: object
      description: Information about a product image.
      properties:
        id:
          type: string
          description: Unique identifier for the image.
          examples:
            - 61ae9270-cf8f-11ea-87d0-0242ac130004
        image:
          $ref: '#/components/schemas/ProductImageSizes'
        alt_text:
          type: string
          description: Alternative text for the image.
          examples:
            - Black Sneaker
          nullable: true
        display_order:
          type: integer
          description: Determines the display order of images. Lower values have priority.
          examples:
            - 1
      x-stoplight:
        id: wmtssbojn4k3b
      x-apidog-orders:
        - id
        - image
        - alt_text
        - display_order
      required:
        - id
        - image
        - alt_text
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    ProductImageSizes:
      type: object
      description: Different sizes of a product image.
      properties:
        thumbnail:
          type: string
          description: URL of the thumbnail version of the image.
          examples:
            - https://example.com/images/thumbnail.jpg
        full_size:
          type: string
          description: URL of the full-size version of the image.
          examples:
            - https://example.com/images/full.jpg
        medium:
          type: string
          description: URL of the medium-sized version of the image.
          examples:
            - https://example.com/images/medium.jpg
        small:
          type: string
          description: URL of the small-sized version of the image.
          examples:
            - https://example.com/images/small.jpg
        large:
          type: string
          description: URL of the large-sized version of the image.
          examples:
            - https://example.com/images/large.jpg
      x-stoplight:
        id: 0vr4xx4vr48vy
      x-apidog-orders:
        - thumbnail
        - full_size
        - medium
        - small
        - large
      required:
        - thumbnail
        - full_size
        - medium
        - small
        - large
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    ResponseEnvelopMessage:
      type: object
      properties:
        type:
          type: string
          description: Type of response message returned by the API.
          examples:
            - success
        code:
          type: string
          description: Response code returned by the API, if available.
          examples:
            - MSG_POPUP_OK
          nullable: true
        name:
          type: string
          description: Name or title of the response message, if available.
          examples:
            - Coupons
          nullable: true
        description:
          type: string
          description: Detailed description of the response message, if available.
          examples:
            - Coupons created successfully
          nullable: true
      required:
        - type
        - code
        - name
        - description
      description: Additional response metadata.
      x-apidog-orders:
        - type
        - code
        - name
        - description
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes: {}
servers:
  - url: https://api.zid.sa/
    description: Prod Env
security: []

```
