// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/content.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const content = google.content('v2.1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/content'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await content.returnpolicyonline.patch({
// Required. The id of the merchant for which to retrieve the return policy online object.
merchantId: 'placeholder-value',
// Required. The id of the return policy to update.
returnPolicyId: 'placeholder-value',
// Request body metadata
requestBody: {
// request body parameters
// {
// "countries": [],
// "itemConditions": [],
// "label": "my_label",
// "name": "my_name",
// "policy": {},
// "restockingFee": {},
// "returnMethods": [],
// "returnPolicyId": "my_returnPolicyId",
// "returnPolicyUri": "my_returnPolicyUri",
// "returnReasonCategoryInfo": []
// }
},
});
console.log(res.data);
// Example response
// {
// "countries": [],
// "itemConditions": [],
// "label": "my_label",
// "name": "my_name",
// "policy": {},
// "restockingFee": {},
// "returnMethods": [],
// "returnPolicyId": "my_returnPolicyId",
// "returnPolicyUri": "my_returnPolicyUri",
// "returnReasonCategoryInfo": []
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/content.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const content = google.content('v2.1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/content'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await content.returnpolicyonline.delete({
// Required. The id of the merchant for which to retrieve the return policy online object.
merchantId: 'placeholder-value',
// Required. The id of the return policy to delete.
returnPolicyId: 'placeholder-value',
});
console.log(res.data);
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/content.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const content = google.content('v2.1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/content'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await content.returnpolicyonline.list({
// Required. The id of the merchant for which to retrieve the return policy online object.
merchantId: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "returnPolicies": []
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/content.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const content = google.content('v2.1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/content'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await content.returnpolicyonline.create({
// Required. The id of the merchant for which to retrieve the return policy online object.
merchantId: 'placeholder-value',
// Request body metadata
requestBody: {
// request body parameters
// {
// "countries": [],
// "itemConditions": [],
// "label": "my_label",
// "name": "my_name",
// "policy": {},
// "restockingFee": {},
// "returnMethods": [],
// "returnPolicyId": "my_returnPolicyId",
// "returnPolicyUri": "my_returnPolicyUri",
// "returnReasonCategoryInfo": []
// }
},
});
console.log(res.data);
// Example response
// {
// "countries": [],
// "itemConditions": [],
// "label": "my_label",
// "name": "my_name",
// "policy": {},
// "restockingFee": {},
// "returnMethods": [],
// "returnPolicyId": "my_returnPolicyId",
// "returnPolicyUri": "my_returnPolicyUri",
// "returnReasonCategoryInfo": []
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/content.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const content = google.content('v2.1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/content'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await content.returnaddress.get({
// The Merchant Center account to get a return address for.
merchantId: 'placeholder-value',
// Return address ID generated by Google.
returnAddressId: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "address": {},
// "country": "my_country",
// "kind": "my_kind",
// "label": "my_label",
// "phoneNumber": "my_phoneNumber",
// "returnAddressId": "my_returnAddressId"
// }
}
main().catch(e => {
console.error(e);
throw e;
});