// 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.orders.createtestreturn({
// The ID of the account that manages the order. This cannot be a multi-client account.
merchantId: 'placeholder-value',
// The ID of the order.
orderId: 'placeholder-value',
// Request body metadata
requestBody: {
// request body parameters
// {
// "items": []
// }
},
});
console.log(res.data);
// Example response
// {
// "kind": "my_kind",
// "returnId": "my_returnId"
// }
}
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.orderreturns.get({
// The ID of the account that manages the order. This cannot be a multi-client account.
merchantId: 'placeholder-value',
// Merchant order return ID generated by Google.
returnId: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "creationDate": "my_creationDate",
// "merchantOrderId": "my_merchantOrderId",
// "orderId": "my_orderId",
// "orderReturnId": "my_orderReturnId",
// "returnItems": [],
// "returnPricingInfo": {},
// "returnShipments": []
// }
}
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');
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.orderreturns.get({
// The ID of the account that manages the order. This cannot be a multi-client account.
merchantId: 'placeholder-value',
// Merchant order return ID generated by Google.
returnId: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "creationDate": "my_creationDate",
// "merchantOrderId": "my_merchantOrderId",
// "orderId": "my_orderId",
// "orderReturnId": "my_orderReturnId",
// "returnItems": [],
// "returnShipments": []
// }
}
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');
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.orders.createtestorder({
// The ID of the account that should manage the order. This cannot be a multi-client account.
merchantId: 'placeholder-value',
// Request body metadata
requestBody: {
// request body parameters
// {
// "country": "my_country",
// "templateName": "my_templateName",
// "testOrder": {}
// }
},
});
console.log(res.data);
// Example response
// {
// "kind": "my_kind",
// "orderId": "my_orderId"
// }
}
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.orders.createtestorder({
// The ID of the account that should manage the order. This cannot be a multi-client account.
merchantId: 'placeholder-value',
// Request body metadata
requestBody: {
// request body parameters
// {
// "country": "my_country",
// "templateName": "my_templateName",
// "testOrder": {}
// }
},
});
console.log(res.data);
// Example response
// {
// "kind": "my_kind",
// "orderId": "my_orderId"
// }
}
main().catch(e => {
console.error(e);
throw e;
});