// 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.instorerefundlineitem({
// 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
// {
// "amountPretax": {},
// "amountTax": {},
// "lineItemId": "my_lineItemId",
// "operationId": "my_operationId",
// "productId": "my_productId",
// "quantity": 0,
// "reason": "my_reason",
// "reasonText": "my_reasonText"
// }
},
});
console.log(res.data);
// Example response
// {
// "executionStatus": "my_executionStatus",
// "kind": "my_kind"
// }
}
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.returnrefundlineitem({
// 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
// {
// "lineItemId": "my_lineItemId",
// "operationId": "my_operationId",
// "priceAmount": {},
// "productId": "my_productId",
// "quantity": 0,
// "reason": "my_reason",
// "reasonText": "my_reasonText",
// "taxAmount": {}
// }
},
});
console.log(res.data);
// Example response
// {
// "executionStatus": "my_executionStatus",
// "kind": "my_kind"
// }
}
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.setlineitemmetadata({
// 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
// {
// "annotations": [],
// "lineItemId": "my_lineItemId",
// "operationId": "my_operationId",
// "productId": "my_productId"
// }
},
});
console.log(res.data);
// Example response
// {
// "executionStatus": "my_executionStatus",
// "kind": "my_kind"
// }
}
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.cancellineitem({
// 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
// {
// "amount": {},
// "amountPretax": {},
// "amountTax": {},
// "lineItemId": "my_lineItemId",
// "operationId": "my_operationId",
// "productId": "my_productId",
// "quantity": 0,
// "reason": "my_reason",
// "reasonText": "my_reasonText"
// }
},
});
console.log(res.data);
// Example response
// {
// "executionStatus": "my_executionStatus",
// "kind": "my_kind"
// }
}
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.rejectreturnlineitem({
// 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
// {
// "lineItemId": "my_lineItemId",
// "operationId": "my_operationId",
// "productId": "my_productId",
// "quantity": 0,
// "reason": "my_reason",
// "reasonText": "my_reasonText"
// }
},
});
console.log(res.data);
// Example response
// {
// "executionStatus": "my_executionStatus",
// "kind": "my_kind"
// }
}
main().catch(e => {
console.error(e);
throw e;
});