Updates information about an existing product. Heads up! Not all providers may support updating all fields. Please be mindful of the `result`.
npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');
// You can manage tokens here: https://superface.ai/insights
const sdk = new SuperfaceClient({ sdkAuthToken: '<< Login to get your token >>' });
async function run() {
// Load the profile
const profile = await sdk.getProfile('payments/update-product@1.0.0');
// Use the profile
const result = await profile
.getUseCase('UpdateProduct')
.perform({
productId: '',
name: '',
description: ''
}, {
provider: 'mock'
});
// Handle the result
try {
const data = result.unwrap();
console.log(data);
} catch (error) {
console.error(error);
}
}
run();
{
"productId": "",
"name": "",
"description": ""
}
{
"name": "",
"description": ""
}