Media
List media
Lists the store's uploaded images and videos, newest first.
Authorization: APIKey TOKEN.Show fieldsHide fields
unknownThe type is unknown.
imageAn image (PNG, JPEG, WEBP or GIF).
videoA video (MP4).
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"import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.media.listMediaAssets();import requests
headers = {"Authorization": "APIKey TOKEN"}
response = requests.get("https://api.paynow.gg/v1/stores/{storeId}/media", headers=headers)[
{
"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
Retrieves a single uploaded image or video.
Authorization: APIKey TOKEN.Show fieldsHide fields
unknownThe type is unknown.
imageAn image (PNG, JPEG, WEBP or GIF).
videoA video (MP4).
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"import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.media.getMediaAsset("411486491630370816");import requests
headers = {"Authorization": "APIKey TOKEN"}
response = requests.get("https://api.paynow.gg/v1/stores/{storeId}/media/{mediaAssetId}", headers=headers){
"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
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.
Authorization: APIKey TOKEN.curl -X DELETE "https://api.paynow.gg/v1/stores/{storeId}/media/{mediaAssetId}" \
-H "Authorization: APIKey TOKEN"import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
await paynow.media.deleteMediaAsset("411486491630370816");import requests
headers = {"Authorization": "APIKey TOKEN"}
response = requests.delete("https://api.paynow.gg/v1/stores/{storeId}/media/{mediaAssetId}", headers=headers)Start media upload
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.
Authorization: APIKey TOKEN.Show fieldsHide fields
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
}'import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.media.createMediaUpload({
content_type: "image/png",
size_bytes: 524288,
});import requests
headers = {"Authorization": "APIKey TOKEN"}
payload = {
"content_type": "image/png",
"size_bytes": 524288,
}
response = requests.post("https://api.paynow.gg/v1/stores/{storeId}/media/uploads", headers=headers, json=payload){
"expires_at": "2024-01-01T00:00:00Z",
"media_asset_id": "411486491630370816",
"upload_url": "string"
}Finish media upload
Checks the uploaded file and makes the media asset ready to be used on products, tags and store logos.
Authorization: APIKey TOKEN.Show fieldsHide fields
unknownThe type is unknown.
imageAn image (PNG, JPEG, WEBP or GIF).
videoA video (MP4).
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"import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.media.finishMediaUpload("411486491630370816");import requests
headers = {"Authorization": "APIKey TOKEN"}
response = requests.post("https://api.paynow.gg/v1/stores/{storeId}/media/{mediaAssetId}/finish", headers=headers){
"id": "411486491630370816",
"content_type": "string",
"created_at": "2024-01-01T00:00:00Z",
"size_bytes": 0,
"store_id": "411486491630370816",
"type": "unknown",
"url": "string"
}