PayNow

Media

List media

GEThttps://api.paynow.gg/v1/stores/{storeId}/media

Lists the store's uploaded images and videos, newest first.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store to list media for.
Query parameters
typeenumOptional
Only return media of this type.
limitintegerOptional
The maximum number of items to return in a single request.
afterFlakeIdOptional
Returns items after the specified ID. Used for forward pagination through results.
beforeFlakeIdOptional
Returns items before the specified ID. Used for backward pagination through results.
ascbooleanOptional
Determines the sort order of returned items. When true, items are returned in ascending order. When false, items are returned in descending order.
Response
200OKMediaAssetDto[]
Represents an image or video uploaded to a store's media.
Show fields
idFlakeIdRequired
content_typestringRequired
The MIME type of the media, for example 'image/png'.
created_atstringRequired
The date and time the media asset was created.
size_bytesintegerRequired
The size of the media in bytes.
store_idFlakeIdRequired
typeenumRequired
Specifies the kind of media an asset holds.
Possible enum values
  • unknown

    The type is unknown.

  • image

    An image (PNG, JPEG, WEBP or GIF).

  • video

    A video (MP4).

urlstringRequired
The public URL the media is served from.

Failed requests return a PayNowError body. See the error response guide.

curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/media" \
  -H "Authorization: APIKey TOKEN"
Response200
[
  {
    "id": "411486491630370816",
    "content_type": "string",
    "created_at": "2024-01-01T00:00:00Z",
    "size_bytes": 0,
    "store_id": "411486491630370816",
    "type": "unknown",
    "url": "string"
  }
]

Get media asset

GEThttps://api.paynow.gg/v1/stores/{storeId}/media/{mediaAssetId}

Retrieves a single uploaded image or video.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the media asset belongs to.
mediaAssetIdFlakeIdRequired
The ID of the media asset.
Response
200OKMediaAssetDto
Represents an image or video uploaded to a store's media.
Show fields
idFlakeIdRequired
content_typestringRequired
The MIME type of the media, for example 'image/png'.
created_atstringRequired
The date and time the media asset was created.
size_bytesintegerRequired
The size of the media in bytes.
store_idFlakeIdRequired
typeenumRequired
Specifies the kind of media an asset holds.
Possible enum values
  • unknown

    The type is unknown.

  • image

    An image (PNG, JPEG, WEBP or GIF).

  • video

    A video (MP4).

urlstringRequired
The public URL the media is served from.

Failed requests return a PayNowError body. See the error response guide.

curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/media/{mediaAssetId}" \
  -H "Authorization: APIKey TOKEN"
Response200
{
  "id": "411486491630370816",
  "content_type": "string",
  "created_at": "2024-01-01T00:00:00Z",
  "size_bytes": 0,
  "store_id": "411486491630370816",
  "type": "unknown",
  "url": "string"
}

Delete media asset

DELETEhttps://api.paynow.gg/v1/stores/{storeId}/media/{mediaAssetId}

Removes the media asset from the store's media so it can no longer be attached. Products, tags and logos already using it keep showing it.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the media asset belongs to.
mediaAssetIdFlakeIdRequired
The ID of the media asset.
Response
204No Content

Failed requests return a PayNowError body. See the error response guide.

curl -X DELETE "https://api.paynow.gg/v1/stores/{storeId}/media/{mediaAssetId}" \
  -H "Authorization: APIKey TOKEN"

Start media upload

POSThttps://api.paynow.gg/v1/stores/{storeId}/media/uploads

Starts uploading an image or video of at most 20 MB. Upload the file to the returned 'upload_url' with a PUT request whose Content-Type and Content-Length headers match the request, then call the finish route.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store to upload media to.
Request body
content_typestringRequired
The MIME type of the file. One of 'image/png', 'image/jpeg', 'image/webp', 'image/gif' or 'video/mp4'.
size_bytesintegerRequired
The size of the file in bytes, at most 20 MB (20971520 bytes).
Response
200OKCreateMediaUploadResponseDto
Represents a started media upload.
Show fields
expires_atstringRequired
The date and time after which 'upload_url' stops accepting the upload.
media_asset_idFlakeIdRequired
upload_urlstringRequired
The URL to upload the file to with a PUT request, sending the file as the raw request body.

Failed requests return a PayNowError body. See the error response guide.

curl -X POST "https://api.paynow.gg/v1/stores/{storeId}/media/uploads" \
  -H "Authorization: APIKey TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "content_type": "image/png",
  "size_bytes": 524288
}'
Response200
{
  "expires_at": "2024-01-01T00:00:00Z",
  "media_asset_id": "411486491630370816",
  "upload_url": "string"
}

Finish media upload

POSThttps://api.paynow.gg/v1/stores/{storeId}/media/{mediaAssetId}/finish

Checks the uploaded file and makes the media asset ready to be used on products, tags and store logos.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the media asset belongs to.
mediaAssetIdFlakeIdRequired
The ID of the media asset returned when the upload was started.
Response
200OKMediaAssetDto
Represents an image or video uploaded to a store's media.
Show fields
idFlakeIdRequired
content_typestringRequired
The MIME type of the media, for example 'image/png'.
created_atstringRequired
The date and time the media asset was created.
size_bytesintegerRequired
The size of the media in bytes.
store_idFlakeIdRequired
typeenumRequired
Specifies the kind of media an asset holds.
Possible enum values
  • unknown

    The type is unknown.

  • image

    An image (PNG, JPEG, WEBP or GIF).

  • video

    A video (MP4).

urlstringRequired
The public URL the media is served from.

Failed requests return a PayNowError body. See the error response guide.

curl -X POST "https://api.paynow.gg/v1/stores/{storeId}/media/{mediaAssetId}/finish" \
  -H "Authorization: APIKey TOKEN"
Response200
{
  "id": "411486491630370816",
  "content_type": "string",
  "created_at": "2024-01-01T00:00:00Z",
  "size_bytes": 0,
  "store_id": "411486491630370816",
  "type": "unknown",
  "url": "string"
}