// 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.list({
// Obtains orders that match the acknowledgement status. When set to true, obtains orders that have been acknowledged. When false, obtains orders that have not been acknowledged. We recommend using this filter set to `false`, in conjunction with the `acknowledge` call, such that only un-acknowledged orders are returned.
acknowledged: 'placeholder-value',
// The maximum number of orders to return in the response, used for paging. The default value is 25 orders per page, and the maximum allowed value is 250 orders per page.
maxResults: 'placeholder-value',
// The ID of the account that manages the order. This cannot be a multi-client account.
merchantId: 'placeholder-value',
// Order results by placement date in descending or ascending order. Acceptable values are: - placedDateAsc - placedDateDesc
orderBy: 'placeholder-value',
// The token returned by the previous request.
pageToken: 'placeholder-value',
// Obtains orders placed before this date (exclusively), in ISO 8601 format.
placedDateEnd: 'placeholder-value',
// Obtains orders placed after this date (inclusively), in ISO 8601 format.
placedDateStart: 'placeholder-value',
// Obtains orders that match any of the specified statuses. Please note that `active` is a shortcut for `pendingShipment` and `partiallyShipped`, and `completed` is a shortcut for `shipped`, `partiallyDelivered`, `delivered`, `partiallyReturned`, `returned`, and `canceled`.
statuses: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "kind": "my_kind",
// "nextPageToken": "my_nextPageToken",
// "resources": []
// }
}
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.acknowledge({
// 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
// {
// "operationId": "my_operationId"
// }
},
});
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.captureOrder({
// Required. The ID of the account that manages the order. This cannot be a multi-client account.
merchantId: 'placeholder-value',
// Required. The ID of the Order.
orderId: 'placeholder-value',
// Request body metadata
requestBody: {
// request body parameters
// {}
},
});
console.log(res.data);
// Example response
// {
// "executionStatus": "my_executionStatus"
// }
}
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.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.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;
});