Products
Actualizar la imagen del producto
Obtén una URL de S3 prefirmada para cargar una imagen de un producto. Carga la imagen en la URL devuelta en un plazo de 60 segundos.
PUT
/
products
/
{id}
/
images
JavaScript
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
const image = await client.products.images.update('pdt_R8AWMPiV8RyJElcCKvAID');
console.log(image.image_id);import os
from dodopayments import DodoPayments
client = DodoPayments(
bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted
)
image = client.products.images.update(
id="pdt_R8AWMPiV8RyJElcCKvAID",
)
print(image.image_id)package main
import (
"context"
"fmt"
"github.com/dodopayments/dodopayments-go"
"github.com/dodopayments/dodopayments-go/option"
)
func main() {
client := dodopayments.NewClient(
option.WithBearerToken("My Bearer Token"),
)
image, err := client.Products.Images.Update(
context.TODO(),
"pdt_R8AWMPiV8RyJElcCKvAID",
dodopayments.ProductImageUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", image.ImageID)
}
package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.products.images.ImageUpdateParams;
import com.dodopayments.api.models.products.images.ImageUpdateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
ImageUpdateResponse image = client.products().images().update("pdt_R8AWMPiV8RyJElcCKvAID");
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.products.images.ImageUpdateParams
import com.dodopayments.api.models.products.images.ImageUpdateResponse
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val image: ImageUpdateResponse = client.products().images().update("pdt_R8AWMPiV8RyJElcCKvAID")
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
image = dodo_payments.products.images.update("pdt_R8AWMPiV8RyJElcCKvAID")
puts(image)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Dodopayments\Client;
use Dodopayments\Core\Exceptions\APIException;
$client = new Client(
bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
environment: 'test_mode',
);
try {
$image = $client->products->images->update(
'pdt_R8AWMPiV8RyJElcCKvAID', forceUpdate: true
);
var_dump($image);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.Products.Images;
DodoPaymentsClient client = new();
ImageUpdateParams parameters = new() { ID = "pdt_R8AWMPiV8RyJElcCKvAID" };
var image = await client.Products.Images.Update(parameters);
Console.WriteLine(image);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let id = "id";
let result = client
.products()
.images()
.update()
.id(id)
.query(serde_json::json!({}))
.await?;
println!("{result:?}");
Ok(())
}curl --request PUT \
--url https://test.dodopayments.com/products/{id}/images \
--header 'Authorization: Bearer <token>'{
"url": "<string>",
"image_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Autorizaciones
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Parámetros de ruta
Product Id
Parámetros de consulta
Última modificación el 6 de agosto de 2026
¿Esta página le ayudó?
⌘I
JavaScript
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
const image = await client.products.images.update('pdt_R8AWMPiV8RyJElcCKvAID');
console.log(image.image_id);import os
from dodopayments import DodoPayments
client = DodoPayments(
bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted
)
image = client.products.images.update(
id="pdt_R8AWMPiV8RyJElcCKvAID",
)
print(image.image_id)package main
import (
"context"
"fmt"
"github.com/dodopayments/dodopayments-go"
"github.com/dodopayments/dodopayments-go/option"
)
func main() {
client := dodopayments.NewClient(
option.WithBearerToken("My Bearer Token"),
)
image, err := client.Products.Images.Update(
context.TODO(),
"pdt_R8AWMPiV8RyJElcCKvAID",
dodopayments.ProductImageUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", image.ImageID)
}
package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.products.images.ImageUpdateParams;
import com.dodopayments.api.models.products.images.ImageUpdateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
ImageUpdateResponse image = client.products().images().update("pdt_R8AWMPiV8RyJElcCKvAID");
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.products.images.ImageUpdateParams
import com.dodopayments.api.models.products.images.ImageUpdateResponse
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val image: ImageUpdateResponse = client.products().images().update("pdt_R8AWMPiV8RyJElcCKvAID")
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
image = dodo_payments.products.images.update("pdt_R8AWMPiV8RyJElcCKvAID")
puts(image)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Dodopayments\Client;
use Dodopayments\Core\Exceptions\APIException;
$client = new Client(
bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
environment: 'test_mode',
);
try {
$image = $client->products->images->update(
'pdt_R8AWMPiV8RyJElcCKvAID', forceUpdate: true
);
var_dump($image);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.Products.Images;
DodoPaymentsClient client = new();
ImageUpdateParams parameters = new() { ID = "pdt_R8AWMPiV8RyJElcCKvAID" };
var image = await client.Products.Images.Update(parameters);
Console.WriteLine(image);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let id = "id";
let result = client
.products()
.images()
.update()
.id(id)
.query(serde_json::json!({}))
.await?;
println!("{result:?}");
Ok(())
}curl --request PUT \
--url https://test.dodopayments.com/products/{id}/images \
--header 'Authorization: Bearer <token>'{
"url": "<string>",
"image_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}